Lines Matching refs:counter
85 struct counter_device counter; member
90 static struct ti_eqep_cnt *ti_eqep_count_from_counter(struct counter_device *counter) in ti_eqep_count_from_counter() argument
92 return counter_priv(counter); in ti_eqep_count_from_counter()
95 static int ti_eqep_count_read(struct counter_device *counter, in ti_eqep_count_read() argument
98 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_count_read()
107 static int ti_eqep_count_write(struct counter_device *counter, in ti_eqep_count_write() argument
110 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_count_write()
120 static int ti_eqep_function_read(struct counter_device *counter, in ti_eqep_function_read() argument
124 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_function_read()
147 static int ti_eqep_function_write(struct counter_device *counter, in ti_eqep_function_write() argument
151 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_function_write()
176 static int ti_eqep_action_read(struct counter_device *counter, in ti_eqep_action_read() argument
181 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_action_read()
186 err = ti_eqep_function_read(counter, count, &function); in ti_eqep_action_read()
249 static int ti_eqep_position_ceiling_read(struct counter_device *counter, in ti_eqep_position_ceiling_read() argument
253 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_position_ceiling_read()
263 static int ti_eqep_position_ceiling_write(struct counter_device *counter, in ti_eqep_position_ceiling_write() argument
267 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_position_ceiling_write()
277 static int ti_eqep_position_enable_read(struct counter_device *counter, in ti_eqep_position_enable_read() argument
280 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_position_enable_read()
290 static int ti_eqep_position_enable_write(struct counter_device *counter, in ti_eqep_position_enable_write() argument
293 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_position_enable_write()
376 struct counter_device *counter; in ti_eqep_probe() local
381 counter = devm_counter_alloc(dev, sizeof(*priv)); in ti_eqep_probe()
382 if (!counter) in ti_eqep_probe()
384 priv = counter_priv(counter); in ti_eqep_probe()
400 counter->name = dev_name(dev); in ti_eqep_probe()
401 counter->parent = dev; in ti_eqep_probe()
402 counter->ops = &ti_eqep_counter_ops; in ti_eqep_probe()
403 counter->counts = ti_eqep_counts; in ti_eqep_probe()
404 counter->num_counts = ARRAY_SIZE(ti_eqep_counts); in ti_eqep_probe()
405 counter->signals = ti_eqep_signals; in ti_eqep_probe()
406 counter->num_signals = ARRAY_SIZE(ti_eqep_signals); in ti_eqep_probe()
408 platform_set_drvdata(pdev, counter); in ti_eqep_probe()
418 err = counter_add(counter); in ti_eqep_probe()
430 struct counter_device *counter = platform_get_drvdata(pdev); in ti_eqep_remove() local
433 counter_unregister(counter); in ti_eqep_remove()