The gpio_chip label is useful for userspace to understand what kind of GPIO chip it is dealing with. Let's store a copy of this label in the gpio_device, add it to the struct passed to userspace for GPIO_GET_CHIPINFO_IOCTL and modify lsgpio to show it.
Showing the changes to include/uapi/linux/gpio.h (1 of 5 files). Show all
Unified · Split
| @@ -16,10 +16,12 @@ · 15 unmodified lines | ||
| 16 | 16 | /** |
| 17 | 17 | * struct gpiochip_info - Information about a certain GPIO chip |
| 18 | 18 | * @name: the name of this GPIO chip |
| 19 | + * @label: a functional name for this GPIO chip | |
| 19 | 20 | * @lines: number of GPIO lines on this chip |
| 20 | 21 | */ |
| 21 | 22 | struct gpiochip_info { |
| 22 | 23 | char name[32]; |
| 24 | + char label[32]; | |
| 23 | 25 | __u32 lines; |
| 24 | 26 | }; |
| 25 | 27 | |