Lines Matching refs:counter
86 struct counter_device counter; member
91 static struct ti_eqep_cnt *ti_eqep_count_from_counter(struct counter_device *counter) in ti_eqep_count_from_counter() argument
93 return counter_priv(counter); in ti_eqep_count_from_counter()
96 static int ti_eqep_count_read(struct counter_device *counter, in ti_eqep_count_read() argument
99 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_count_read()
108 static int ti_eqep_count_write(struct counter_device *counter, in ti_eqep_count_write() argument
111 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_count_write()
121 static int ti_eqep_function_read(struct counter_device *counter, in ti_eqep_function_read() argument
125 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_function_read()
148 static int ti_eqep_function_write(struct counter_device *counter, in ti_eqep_function_write() argument
152 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_function_write()
177 static int ti_eqep_action_read(struct counter_device *counter, in ti_eqep_action_read() argument
182 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_action_read()
187 err = ti_eqep_function_read(counter, count, &function); in ti_eqep_action_read()
250 static int ti_eqep_position_ceiling_read(struct counter_device *counter, in ti_eqep_position_ceiling_read() argument
254 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_position_ceiling_read()
264 static int ti_eqep_position_ceiling_write(struct counter_device *counter, in ti_eqep_position_ceiling_write() argument
268 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_position_ceiling_write()
278 static int ti_eqep_position_enable_read(struct counter_device *counter, in ti_eqep_position_enable_read() argument
281 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_position_enable_read()
291 static int ti_eqep_position_enable_write(struct counter_device *counter, in ti_eqep_position_enable_write() argument
294 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_position_enable_write()
377 struct counter_device *counter; in ti_eqep_probe() local
383 counter = devm_counter_alloc(dev, sizeof(*priv)); in ti_eqep_probe()
384 if (!counter) in ti_eqep_probe()
386 priv = counter_priv(counter); in ti_eqep_probe()
402 counter->name = dev_name(dev); in ti_eqep_probe()
403 counter->parent = dev; in ti_eqep_probe()
404 counter->ops = &ti_eqep_counter_ops; in ti_eqep_probe()
405 counter->counts = ti_eqep_counts; in ti_eqep_probe()
406 counter->num_counts = ARRAY_SIZE(ti_eqep_counts); in ti_eqep_probe()
407 counter->signals = ti_eqep_signals; in ti_eqep_probe()
408 counter->num_signals = ARRAY_SIZE(ti_eqep_signals); in ti_eqep_probe()
410 platform_set_drvdata(pdev, counter); in ti_eqep_probe()
424 err = counter_add(counter); in ti_eqep_probe()
436 struct counter_device *counter = platform_get_drvdata(pdev); in ti_eqep_remove() local
439 counter_unregister(counter); in ti_eqep_remove()