Lines Matching refs:counter

37 ssize_t counter_signal_enum_read(struct counter_device *counter,  in counter_signal_enum_read()  argument
48 err = e->get(counter, signal, &index); in counter_signal_enum_read()
59 ssize_t counter_signal_enum_write(struct counter_device *counter, in counter_signal_enum_write() argument
74 err = e->set(counter, signal, index); in counter_signal_enum_write()
82 ssize_t counter_signal_enum_available_read(struct counter_device *counter, in counter_signal_enum_available_read() argument
100 ssize_t counter_count_enum_read(struct counter_device *counter, in counter_count_enum_read() argument
111 err = e->get(counter, count, &index); in counter_count_enum_read()
122 ssize_t counter_count_enum_write(struct counter_device *counter, in counter_count_enum_write() argument
137 err = e->set(counter, count, index); in counter_count_enum_write()
145 ssize_t counter_count_enum_available_read(struct counter_device *counter, in counter_count_enum_available_read() argument
163 ssize_t counter_device_enum_read(struct counter_device *counter, void *priv, in counter_device_enum_read() argument
173 err = e->get(counter, &index); in counter_device_enum_read()
184 ssize_t counter_device_enum_write(struct counter_device *counter, void *priv, in counter_device_enum_write() argument
198 err = e->set(counter, index); in counter_device_enum_write()
206 ssize_t counter_device_enum_available_read(struct counter_device *counter, in counter_device_enum_available_read() argument
300 struct counter_device *const counter = dev_get_drvdata(dev); in counter_signal_show() local
307 err = counter->ops->signal_read(counter, signal, &val); in counter_signal_show()
450 const struct counter_device *const counter, in counter_signal_attributes_create() argument
467 parm.show = (counter->ops->signal_read) ? counter_signal_show : NULL; in counter_signal_attributes_create()
495 const struct counter_device *const counter) in counter_signals_register() argument
497 const size_t num_signals = counter->num_signals; in counter_signals_register()
505 signal = counter->signals + i; in counter_signals_register()
516 err = counter_signal_attributes_create(groups_list + i, counter, in counter_signals_register()
549 struct counter_device *const counter = dev_get_drvdata(dev); in counter_action_show() local
556 err = counter->ops->action_get(counter, count, synapse, &action_index); in counter_action_show()
577 struct counter_device *const counter = dev_get_drvdata(dev); in counter_action_store() local
590 err = counter->ops->action_set(counter, count, synapse, action_index); in counter_action_store()
624 const struct counter_device *const counter, in counter_synapses_register() argument
660 parm.show = (counter->ops->action_get) ? counter_action_show : NULL; in counter_synapses_register()
661 parm.store = (counter->ops->action_set) ? counter_action_store : NULL; in counter_synapses_register()
711 struct counter_device *const counter = dev_get_drvdata(dev); in counter_count_show() local
718 err = counter->ops->count_read(counter, count, &val); in counter_count_show()
729 struct counter_device *const counter = dev_get_drvdata(dev); in counter_count_store() local
740 err = counter->ops->count_write(counter, count, val); in counter_count_store()
762 struct counter_device *const counter = dev_get_drvdata(dev); in counter_function_show() local
769 err = counter->ops->function_get(counter, count, &func_index); in counter_function_show()
790 struct counter_device *const counter = dev_get_drvdata(dev); in counter_function_store() local
802 err = counter->ops->function_set(counter, count, func_index); in counter_function_store()
909 const struct counter_device *const counter, in counter_count_attributes_create() argument
928 parm.show = (counter->ops->count_read) ? counter_count_show : NULL; in counter_count_attributes_create()
929 parm.store = (counter->ops->count_write) ? counter_count_store : NULL; in counter_count_attributes_create()
949 parm.show = (counter->ops->function_get) ? counter_function_show : NULL; in counter_count_attributes_create()
950 parm.store = (counter->ops->function_set) ? counter_function_store : NULL; in counter_count_attributes_create()
999 const struct counter_device *const counter) in counter_counts_register() argument
1007 for (i = 0; i < counter->num_counts; i++) { in counter_counts_register()
1008 count = counter->counts + i; in counter_counts_register()
1019 err = counter_synapses_register(groups_list + i, counter, count, in counter_counts_register()
1025 err = counter_count_attributes_create(groups_list + i, counter, in counter_counts_register()
1112 struct counter_device *const counter) in counter_device_ext_register() argument
1120 for (i = 0 ; i < counter->num_ext; i++) { in counter_device_ext_register()
1128 ext_comp->ext = counter->ext + i; in counter_device_ext_register()
1133 parm.name = counter->ext[i].name; in counter_device_ext_register()
1134 parm.show = (counter->ext[i].read) ? counter_device_ext_show : NULL; in counter_device_ext_register()
1135 parm.store = (counter->ext[i].write) ? counter_device_ext_store : NULL; in counter_device_ext_register()
1153 struct counter_device *const counter) in counter_global_attr_register() argument
1158 err = counter_name_attribute_create(group, counter->name); in counter_global_attr_register()
1163 err = counter_size_attribute_create(group, counter->num_counts, in counter_global_attr_register()
1169 err = counter_size_attribute_create(group, counter->num_signals, in counter_global_attr_register()
1175 err = counter_device_ext_register(group, counter); in counter_global_attr_register()
1207 struct counter_device *const counter) in counter_device_groups_list_prepare() argument
1210 counter->num_signals + counter->num_counts + 1; in counter_device_groups_list_prepare()
1227 err = counter_signals_register(groups_list, counter); in counter_device_groups_list_prepare()
1230 num_groups += counter->num_signals; in counter_device_groups_list_prepare()
1233 err = counter_counts_register(groups_list + num_groups, counter); in counter_device_groups_list_prepare()
1236 num_groups += counter->num_counts; in counter_device_groups_list_prepare()
1239 err = counter_global_attr_register(groups_list + num_groups, counter); in counter_device_groups_list_prepare()
1245 counter->device_state->groups_list = groups_list; in counter_device_groups_list_prepare()
1246 counter->device_state->num_groups = num_groups; in counter_device_groups_list_prepare()
1310 struct counter_device *const counter = dev_get_drvdata(dev); in counter_device_release() local
1311 struct counter_device_state *const device_state = counter->device_state; in counter_device_release()
1337 int counter_register(struct counter_device *const counter) in counter_register() argument
1346 counter->device_state = device_state; in counter_register()
1358 if (counter->parent) { in counter_register()
1359 device_state->dev.parent = counter->parent; in counter_register()
1360 device_state->dev.of_node = counter->parent->of_node; in counter_register()
1364 dev_set_drvdata(&device_state->dev, counter); in counter_register()
1367 err = counter_device_groups_list_prepare(counter); in counter_register()
1402 void counter_unregister(struct counter_device *const counter) in counter_unregister() argument
1404 if (counter) in counter_unregister()
1405 device_del(&counter->device_state->dev); in counter_unregister()
1430 struct counter_device *const counter) in devm_counter_register() argument
1439 ret = counter_register(counter); in devm_counter_register()
1441 *ptr = counter; in devm_counter_register()
1471 struct counter_device *const counter) in devm_counter_unregister() argument
1476 counter); in devm_counter_unregister()