Lines Matching refs:counter

9 #include <linux/counter.h>
85 struct counter_device counter;
90 static struct ti_eqep_cnt *ti_eqep_count_from_counter(struct counter_device *counter)
92 return counter_priv(counter);
95 static int ti_eqep_count_read(struct counter_device *counter,
98 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter);
107 static int ti_eqep_count_write(struct counter_device *counter,
110 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter);
120 static int ti_eqep_function_read(struct counter_device *counter,
124 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter);
147 static int ti_eqep_function_write(struct counter_device *counter,
151 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter);
176 static int ti_eqep_action_read(struct counter_device *counter,
181 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter);
186 err = ti_eqep_function_read(counter, count, &function);
249 static int ti_eqep_position_ceiling_read(struct counter_device *counter,
253 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter);
263 static int ti_eqep_position_ceiling_write(struct counter_device *counter,
267 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter);
277 static int ti_eqep_position_enable_read(struct counter_device *counter,
280 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter);
290 static int ti_eqep_position_enable_write(struct counter_device *counter,
293 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter);
376 struct counter_device *counter;
381 counter = devm_counter_alloc(dev, sizeof(*priv));
382 if (!counter)
384 priv = counter_priv(counter);
400 counter->name = dev_name(dev);
401 counter->parent = dev;
402 counter->ops = &ti_eqep_counter_ops;
403 counter->counts = ti_eqep_counts;
404 counter->num_counts = ARRAY_SIZE(ti_eqep_counts);
405 counter->signals = ti_eqep_signals;
406 counter->num_signals = ARRAY_SIZE(ti_eqep_signals);
408 platform_set_drvdata(pdev, counter);
418 err = counter_add(counter);
430 struct counter_device *counter = platform_get_drvdata(pdev);
433 counter_unregister(counter);
455 MODULE_DESCRIPTION("TI eQEP counter driver");