Lines Matching refs:line
65 /* Custom name for the virtual line */
67 /* GPIO chip label or line name */
69 /* Can be negative to indicate lookup by line name */
158 struct gpio_aggregator_line *line;
160 line = kzalloc(sizeof(*line), GFP_KERNEL);
161 if (!line)
165 line->key = kstrdup(key, GFP_KERNEL);
166 if (!line->key) {
167 kfree(line);
172 line->flags = GPIO_LOOKUP_FLAGS_DEFAULT;
173 line->parent = parent;
174 line->idx = idx;
175 line->offset = offset;
176 INIT_LIST_HEAD(&line->entry);
178 return line;
182 struct gpio_aggregator_line *line)
189 if (tmp->idx > line->idx) {
190 list_add_tail(&line->entry, &tmp->entry);
194 list_add_tail(&line->entry, &aggr->list_head);
198 struct gpio_aggregator_line *line)
202 list_del(&line->entry);
207 struct gpio_aggregator_line *line, *tmp;
209 list_for_each_entry_safe(line, tmp, &aggr->list_head, entry) {
210 configfs_unregister_group(&line->group);
222 gpio_aggregator_line_del(aggr, line);
223 kfree(line->key);
224 kfree(line->name);
225 kfree(line);
440 u32 line;
445 line = gpiospec->args[0];
446 if (line >= chip->ngpio)
449 timings = &fwd->delay_timings[line];
453 return line;
586 struct gpio_aggregator_line *line;
602 list_for_each_entry(line, &aggr->list_head, entry)
603 line_names[n++] = line->name ?: "";
606 "gpio-line-names",
615 struct gpio_aggregator_line *line;
640 list_for_each_entry(line, &aggr->list_head, entry) {
642 * - Either GPIO chip label or line name must be configured
643 * (i.e. line->key must be non-NULL)
647 if (!line->key || line->idx != n) {
652 if (line->offset < 0)
653 ret = gpio_aggregator_add_gpio(aggr, line->key,
656 ret = gpio_aggregator_add_gpio(aggr, line->key,
657 line->offset, &n);
699 struct gpio_aggregator_line *line;
706 list_for_each_entry(line, &aggr->list_head, entry) {
709 subsys, &line->group.cg_item);
712 &line->group.cg_item);
719 struct gpio_aggregator_line *line = to_gpio_aggregator_line(item);
720 struct gpio_aggregator *aggr = line->parent;
724 return sysfs_emit(page, "%s\n", line->key ?: "");
731 struct gpio_aggregator_line *line = to_gpio_aggregator_line(item);
732 struct gpio_aggregator *aggr = line->parent;
747 kfree(line->key);
748 line->key = no_free_ptr(key);
757 struct gpio_aggregator_line *line = to_gpio_aggregator_line(item);
758 struct gpio_aggregator *aggr = line->parent;
762 return sysfs_emit(page, "%s\n", line->name ?: "");
769 struct gpio_aggregator_line *line = to_gpio_aggregator_line(item);
770 struct gpio_aggregator *aggr = line->parent;
785 kfree(line->name);
786 line->name = no_free_ptr(name);
795 struct gpio_aggregator_line *line = to_gpio_aggregator_line(item);
796 struct gpio_aggregator *aggr = line->parent;
800 return sysfs_emit(page, "%d\n", line->offset);
807 struct gpio_aggregator_line *line = to_gpio_aggregator_line(item);
808 struct gpio_aggregator *aggr = line->parent;
816 * When offset == -1, 'key' represents a line name to lookup.
818 * the 'offset' value representing the line within that chip.
820 * GPIOLIB uses the U16_MAX value to indicate lookup by line name so
832 line->offset = offset;
922 struct gpio_aggregator_line *line = to_gpio_aggregator_line(item);
923 struct gpio_aggregator *aggr = line->parent;
927 gpio_aggregator_line_del(aggr, line);
928 kfree(line->key);
929 kfree(line->name);
930 kfree(line);
962 struct gpio_aggregator_line *line;
966 ret = sscanf(name, "line%u%n", &idx, &nchar);
984 list_for_each_entry(line, &aggr->list_head, entry)
985 if (line->idx == idx)
988 line = gpio_aggregator_line_alloc(aggr, idx, NULL, -1);
989 if (IS_ERR(line))
990 return ERR_CAST(line);
992 config_group_init_type_name(&line->group, name, &gpio_aggregator_line_type);
994 gpio_aggregator_line_add(aggr, line);
996 return &line->group;
1059 struct gpio_aggregator_line *line;
1076 /* Named GPIO line */
1077 scnprintf(name, sizeof(name), "line%u", n);
1078 line = gpio_aggregator_line_alloc(aggr, n, key, -1);
1079 if (IS_ERR(line)) {
1080 error = PTR_ERR(line);
1083 config_group_init_type_name(&line->group, name,
1086 &line->group);
1090 gpio_aggregator_line_add(aggr, line);
1108 scnprintf(name, sizeof(name), "line%u", n);
1109 line = gpio_aggregator_line_alloc(aggr, n, key, i);
1110 if (IS_ERR(line)) {
1111 error = PTR_ERR(line);
1114 config_group_init_type_name(&line->group, name,
1117 &line->group);
1121 gpio_aggregator_line_add(aggr, line);