Lines Matching refs:comp

39 	struct counter_comp comp;  member
115 err = a->comp.device_u8_read(counter, &data); in counter_comp_u8_show()
118 err = a->comp.signal_u8_read(counter, a->parent, &data); in counter_comp_u8_show()
121 err = a->comp.count_u8_read(counter, a->parent, &data); in counter_comp_u8_show()
129 if (a->comp.type == COUNTER_COMP_BOOL) in counter_comp_u8_show()
146 if (a->comp.type == COUNTER_COMP_BOOL) { in counter_comp_u8_store()
156 err = a->comp.device_u8_write(counter, data); in counter_comp_u8_store()
159 err = a->comp.signal_u8_write(counter, a->parent, data); in counter_comp_u8_store()
162 err = a->comp.count_u8_write(counter, a->parent, data); in counter_comp_u8_store()
178 const struct counter_available *const avail = a->comp.priv; in counter_comp_u32_show()
184 err = a->comp.device_u32_read(counter, &data); in counter_comp_u32_show()
187 err = a->comp.signal_u32_read(counter, a->parent, &data); in counter_comp_u32_show()
190 if (a->comp.type == COUNTER_COMP_SYNAPSE_ACTION) in counter_comp_u32_show()
191 err = a->comp.action_read(counter, a->parent, in counter_comp_u32_show()
192 a->comp.priv, &data); in counter_comp_u32_show()
194 err = a->comp.count_u32_read(counter, a->parent, &data); in counter_comp_u32_show()
202 switch (a->comp.type) { in counter_comp_u32_show()
244 struct counter_synapse *const synapse = a->comp.priv; in counter_comp_u32_store()
245 const struct counter_available *const avail = a->comp.priv; in counter_comp_u32_store()
249 switch (a->comp.type) { in counter_comp_u32_store()
281 err = a->comp.device_u32_write(counter, data); in counter_comp_u32_store()
284 err = a->comp.signal_u32_write(counter, a->parent, data); in counter_comp_u32_store()
287 if (a->comp.type == COUNTER_COMP_SYNAPSE_ACTION) in counter_comp_u32_store()
288 err = a->comp.action_write(counter, count, synapse, in counter_comp_u32_store()
291 err = a->comp.count_u32_write(counter, count, data); in counter_comp_u32_store()
312 err = a->comp.device_u64_read(counter, &data); in counter_comp_u64_show()
315 err = a->comp.signal_u64_read(counter, a->parent, &data); in counter_comp_u64_show()
318 err = a->comp.count_u64_read(counter, a->parent, &data); in counter_comp_u64_show()
344 err = a->comp.device_u64_write(counter, data); in counter_comp_u64_store()
347 err = a->comp.signal_u64_write(counter, a->parent, data); in counter_comp_u64_store()
350 err = a->comp.count_u64_write(counter, a->parent, data); in counter_comp_u64_store()
367 const struct counter_array *const element = a->comp.priv; in counter_comp_array_u32_show()
375 err = a->comp.signal_array_u32_read(counter, a->parent, element->idx, in counter_comp_array_u32_show()
389 const struct counter_array *const element = a->comp.priv; in counter_comp_array_u32_store()
403 err = a->comp.signal_array_u32_write(counter, a->parent, element->idx, in counter_comp_array_u32_store()
417 const struct counter_array *const element = a->comp.priv; in counter_comp_array_u64_show()
423 err = a->comp.device_array_u64_read(counter, element->idx, in counter_comp_array_u64_show()
427 err = a->comp.signal_array_u64_read(counter, a->parent, in counter_comp_array_u64_show()
431 err = a->comp.count_array_u64_read(counter, a->parent, in counter_comp_array_u64_show()
449 const struct counter_array *const element = a->comp.priv; in counter_comp_array_u64_store()
459 err = a->comp.device_array_u64_write(counter, element->idx, in counter_comp_array_u64_store()
463 err = a->comp.signal_array_u64_write(counter, a->parent, in counter_comp_array_u64_store()
467 err = a->comp.count_array_u64_write(counter, a->parent, in counter_comp_array_u64_store()
510 const struct counter_synapse *const synapse = a->comp.priv; in counter_comp_available_show()
511 const struct counter_available *const avail = a->comp.priv; in counter_comp_available_show()
513 switch (a->comp.type) { in counter_comp_available_show()
534 const struct counter_comp *const comp, void *const parent) in counter_avail_attr_create() argument
544 counter_attr->comp.type = comp->type; in counter_avail_attr_create()
545 counter_attr->comp.priv = comp->priv; in counter_avail_attr_create()
554 comp->name); in counter_avail_attr_create()
569 const struct counter_comp *const comp, in counter_attr_create() argument
573 const struct counter_array *const array = comp->priv; in counter_attr_create()
582 counter_attr->comp = *comp; in counter_attr_create()
589 dev_attr->attr.name = comp->name; in counter_attr_create()
590 switch (comp->type) { in counter_attr_create()
593 if (comp->device_u8_read) { in counter_attr_create()
597 if (comp->device_u8_write) { in counter_attr_create()
609 if (comp->device_u32_read) { in counter_attr_create()
613 if (comp->device_u32_write) { in counter_attr_create()
619 if (comp->device_u64_read) { in counter_attr_create()
623 if (comp->device_u64_write) { in counter_attr_create()
631 if (comp->signal_array_u32_read) { in counter_attr_create()
635 if (comp->signal_array_u32_write) { in counter_attr_create()
641 if (comp->device_array_u64_read) { in counter_attr_create()
645 if (comp->device_array_u64_write) { in counter_attr_create()
663 switch (comp->type) { in counter_attr_create()
668 return counter_avail_attr_create(dev, group, comp, parent); in counter_attr_create()
677 return sysfs_emit(buf, "%s\n", to_counter_attribute(attr)->comp.name); in counter_comp_name_show()
691 counter_attr->comp.name = name; in counter_name_attr_create()
709 const size_t id = (size_t)to_counter_attribute(attr)->comp.priv; in counter_comp_id_show()
731 counter_attr->comp.priv = (void *)id; in counter_comp_id_attr_create()
765 const struct counter_comp *const comp, in counter_array_attrs_create() argument
769 const struct counter_array *const array = comp->priv; in counter_array_attrs_create()
770 struct counter_comp ext = *comp; in counter_array_attrs_create()
778 ext.name = devm_kasprintf(dev, GFP_KERNEL, "%s%zu", comp->name, in counter_array_attrs_create()
847 struct counter_comp comp; in counter_signal_attrs_create() local
850 comp = counter_signal_comp; in counter_signal_attrs_create()
851 comp.signal_u32_read = counter->ops->signal_read; in counter_signal_attrs_create()
852 err = counter_attr_create(dev, cattr_group, &comp, scope, signal); in counter_signal_attrs_create()
901 struct counter_comp comp; in counter_sysfs_synapses_add() local
908 comp.name = devm_kasprintf(dev, GFP_KERNEL, "signal%zu_action", in counter_sysfs_synapses_add()
910 if (!comp.name) in counter_sysfs_synapses_add()
914 comp.type = COUNTER_COMP_SYNAPSE_ACTION; in counter_sysfs_synapses_add()
915 comp.action_read = counter->ops->action_read; in counter_sysfs_synapses_add()
916 comp.action_write = counter->ops->action_write; in counter_sysfs_synapses_add()
917 comp.priv = synapse; in counter_sysfs_synapses_add()
918 err = counter_attr_create(dev, group, &comp, in counter_sysfs_synapses_add()
924 err = counter_comp_id_attr_create(dev, group, comp.name, i); in counter_sysfs_synapses_add()
947 struct counter_comp comp; in counter_count_attrs_create() local
950 comp = counter_count_comp; in counter_count_attrs_create()
951 comp.count_u64_read = counter->ops->count_read; in counter_count_attrs_create()
952 comp.count_u64_write = counter->ops->count_write; in counter_count_attrs_create()
953 err = counter_attr_create(dev, cattr_group, &comp, scope, count); in counter_count_attrs_create()
963 comp = counter_function_comp; in counter_count_attrs_create()
964 comp.count_u32_read = counter->ops->function_read; in counter_count_attrs_create()
965 comp.count_u32_write = counter->ops->function_write; in counter_count_attrs_create()
966 err = counter_attr_create(dev, cattr_group, &comp, scope, count); in counter_count_attrs_create()