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
375 struct counter_device *const counter = dev_get_drvdata(dev); in counter_signal_show() local
382 err = counter->ops->signal_read(counter, signal, &val); in counter_signal_show()
525 const struct counter_device *const counter, in counter_signal_attributes_create() argument
542 parm.show = (counter->ops->signal_read) ? counter_signal_show : NULL; in counter_signal_attributes_create()
570 const struct counter_device *const counter) in counter_signals_register() argument
572 const size_t num_signals = counter->num_signals; in counter_signals_register()
580 signal = counter->signals + i; in counter_signals_register()
591 err = counter_signal_attributes_create(groups_list + i, counter, in counter_signals_register()
624 struct counter_device *const counter = dev_get_drvdata(dev); in counter_action_show() local
631 err = counter->ops->action_get(counter, count, synapse, &action_index); in counter_action_show()
652 struct counter_device *const counter = dev_get_drvdata(dev); in counter_action_store() local
665 err = counter->ops->action_set(counter, count, synapse, action_index); in counter_action_store()
699 const struct counter_device *const counter, in counter_synapses_register() argument
735 parm.show = (counter->ops->action_get) ? counter_action_show : NULL; in counter_synapses_register()
736 parm.store = (counter->ops->action_set) ? counter_action_store : NULL; in counter_synapses_register()
786 struct counter_device *const counter = dev_get_drvdata(dev); in counter_count_show() local
793 err = counter->ops->count_read(counter, count, &val); in counter_count_show()
804 struct counter_device *const counter = dev_get_drvdata(dev); in counter_count_store() local
811 err = counter->ops->count_write(counter, count, &val); in counter_count_store()
833 struct counter_device *const counter = dev_get_drvdata(dev); in counter_function_show() local
840 err = counter->ops->function_get(counter, count, &func_index); in counter_function_show()
861 struct counter_device *const counter = dev_get_drvdata(dev); in counter_function_store() local
873 err = counter->ops->function_set(counter, count, func_index); in counter_function_store()
980 const struct counter_device *const counter, in counter_count_attributes_create() argument
999 parm.show = (counter->ops->count_read) ? counter_count_show : NULL; in counter_count_attributes_create()
1000 parm.store = (counter->ops->count_write) ? counter_count_store : NULL; in counter_count_attributes_create()
1020 parm.show = (counter->ops->function_get) ? counter_function_show : NULL; in counter_count_attributes_create()
1021 parm.store = (counter->ops->function_set) ? counter_function_store : NULL; in counter_count_attributes_create()
1070 const struct counter_device *const counter) in counter_counts_register() argument
1078 for (i = 0; i < counter->num_counts; i++) { in counter_counts_register()
1079 count = counter->counts + i; in counter_counts_register()
1090 err = counter_synapses_register(groups_list + i, counter, count, in counter_counts_register()
1096 err = counter_count_attributes_create(groups_list + i, counter, in counter_counts_register()
1183 struct counter_device *const counter) in counter_device_ext_register() argument
1191 for (i = 0 ; i < counter->num_ext; i++) { in counter_device_ext_register()
1199 ext_comp->ext = counter->ext + i; in counter_device_ext_register()
1204 parm.name = counter->ext[i].name; in counter_device_ext_register()
1205 parm.show = (counter->ext[i].read) ? counter_device_ext_show : NULL; in counter_device_ext_register()
1206 parm.store = (counter->ext[i].write) ? counter_device_ext_store : NULL; in counter_device_ext_register()
1224 struct counter_device *const counter) in counter_global_attr_register() argument
1229 err = counter_name_attribute_create(group, counter->name); in counter_global_attr_register()
1234 err = counter_size_attribute_create(group, counter->num_counts, in counter_global_attr_register()
1240 err = counter_size_attribute_create(group, counter->num_signals, in counter_global_attr_register()
1246 err = counter_device_ext_register(group, counter); in counter_global_attr_register()
1278 struct counter_device *const counter) in counter_device_groups_list_prepare() argument
1281 counter->num_signals + counter->num_counts + 1; in counter_device_groups_list_prepare()
1298 err = counter_signals_register(groups_list, counter); in counter_device_groups_list_prepare()
1301 num_groups += counter->num_signals; in counter_device_groups_list_prepare()
1304 err = counter_counts_register(groups_list + num_groups, counter); in counter_device_groups_list_prepare()
1307 num_groups += counter->num_counts; in counter_device_groups_list_prepare()
1310 err = counter_global_attr_register(groups_list + num_groups, counter); in counter_device_groups_list_prepare()
1316 counter->device_state->groups_list = groups_list; in counter_device_groups_list_prepare()
1317 counter->device_state->num_groups = num_groups; in counter_device_groups_list_prepare()
1381 struct counter_device *const counter = dev_get_drvdata(dev); in counter_device_release() local
1382 struct counter_device_state *const device_state = counter->device_state; in counter_device_release()
1408 int counter_register(struct counter_device *const counter) in counter_register() argument
1417 counter->device_state = device_state; in counter_register()
1429 if (counter->parent) { in counter_register()
1430 device_state->dev.parent = counter->parent; in counter_register()
1431 device_state->dev.of_node = counter->parent->of_node; in counter_register()
1435 dev_set_drvdata(&device_state->dev, counter); in counter_register()
1438 err = counter_device_groups_list_prepare(counter); in counter_register()
1473 void counter_unregister(struct counter_device *const counter) in counter_unregister() argument
1475 if (counter) in counter_unregister()
1476 device_del(&counter->device_state->dev); in counter_unregister()
1501 struct counter_device *const counter) in devm_counter_register() argument
1510 ret = counter_register(counter); in devm_counter_register()
1512 *ptr = counter; in devm_counter_register()
1542 struct counter_device *const counter) in devm_counter_unregister() argument
1547 counter); in devm_counter_unregister()