History

Merge tag 'gpio-updates-for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio updates from Bartosz Golaszewski: "We have a single new driver, new features in others and some cleanups all over the place. Nothing really stands out and it is all relatively small. - new driver: gpio-modepin (plus relevant change in zynqmp firmware) - add interrupt support to gpio-virtio - enable the 'gpio-line-names' property in the DT bindings for gpio-rockchip - use the subsystem helpers where applicable in gpio-uniphier instead of accessing IRQ structures directly - code shrink in gpio-xilinx - add interrupt to gpio-mlxbf2 (and include the removal of custom interrupt code from the mellanox ethernet driver) - support multiple interrupts per bank in gpio-tegra186 (and force one interrupt per bank in older models) - fix GPIO line IRQ offset calculation in gpio-realtek-otto - drop unneeded MODULE_ALIAS expansions in multiple drivers - code cleanup in gpio-aggregator - minor improvements in gpio-max730x and gpio-mc33880 - Kconfig cleanups" * tag 'gpio-updates-for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: virtio_gpio: drop packed attribute gpio: virtio: Add IRQ support gpio: realtek-otto: fix GPIO line IRQ offset gpio: clean up Kconfig file net: mellanox: mlxbf_gige: Replace non-standard interrupt handling gpio: mlxbf2: Introduce IRQ support gpio: mc33880: Drop if with an always false condition gpio: max730x: Make __max730x_remove() return void gpio: aggregator: Wrap access to gpiochip_fwd.tmp[] gpio: modepin: Add driver support for modepin GPIO controller dt-bindings: gpio: zynqmp: Add binding documentation for modepin firmware: zynqmp: Add MMIO read and write support for PS_MODE pin gpio: tps65218: drop unneeded MODULE_ALIAS gpio: max77620: drop unneeded MODULE_ALIAS gpio: xilinx: simplify getting .driver_data gpio: tegra186: Support multiple interrupts per bank gpio: tegra186: Force one interrupt per bank gpio: uniphier: Use helper functions to get private data from IRQ data gpio: uniphier: Use helper function to get IRQ hardware number dt-bindings: gpio: add gpio-line-names to rockchip,gpio-bank.yaml

Linus Torvalds committed 5 years ago

Commit d20f7a02 parents dd72945 7d0003d26 files · +943 −351Browse files

Showing the changes to include/uapi/linux (1 of 26 files). Show all

Unified · Split

include/uapi/linux/virtio_gpio.h+26−1
@@ -5,12 +5,16 @@ · 4 unmodified lines
55
66 #include <linux/types.h>
77
8+/* Virtio GPIO Feature bits */
9+#define VIRTIO_GPIO_F_IRQ 0
10+
811 /* Virtio GPIO request types */
912 #define VIRTIO_GPIO_MSG_GET_NAMES 0x0001
1013 #define VIRTIO_GPIO_MSG_GET_DIRECTION 0x0002
1114 #define VIRTIO_GPIO_MSG_SET_DIRECTION 0x0003
1215 #define VIRTIO_GPIO_MSG_GET_VALUE 0x0004
1316 #define VIRTIO_GPIO_MSG_SET_VALUE 0x0005
17+#define VIRTIO_GPIO_MSG_IRQ_TYPE 0x0006
1418
1519 /* Possible values of the status field */
1620 #define VIRTIO_GPIO_STATUS_OK 0x0
@@ -21,11 +25,19 @@ · 4 unmodified lines
2125 #define VIRTIO_GPIO_DIRECTION_OUT 0x01
2226 #define VIRTIO_GPIO_DIRECTION_IN 0x02
2327
28+/* Virtio GPIO IRQ types */
29+#define VIRTIO_GPIO_IRQ_TYPE_NONE 0x00
30+#define VIRTIO_GPIO_IRQ_TYPE_EDGE_RISING 0x01
31+#define VIRTIO_GPIO_IRQ_TYPE_EDGE_FALLING 0x02
32+#define VIRTIO_GPIO_IRQ_TYPE_EDGE_BOTH 0x03
33+#define VIRTIO_GPIO_IRQ_TYPE_LEVEL_HIGH 0x04
34+#define VIRTIO_GPIO_IRQ_TYPE_LEVEL_LOW 0x08
35+
2436 struct virtio_gpio_config {
2537 __le16 ngpio;
2638 __u8 padding[2];
2739 __le32 gpio_names_size;
28−} __packed;
40+};
2941
3042 /* Virtio GPIO Request / Response */
3143 struct virtio_gpio_request {
@@ -44,4 +56,17 @@ struct virtio_gpio_response_get_names { · 12 unmodified lines
4456 __u8 value[];
4557 };
4658
59+/* Virtio GPIO IRQ Request / Response */
60+struct virtio_gpio_irq_request {
61+ __le16 gpio;
62+};
63+
64+struct virtio_gpio_irq_response {
65+ __u8 status;
66+};
67+
68+/* Possible values of the interrupt status field */
69+#define VIRTIO_GPIO_IRQ_STATUS_INVALID 0x0
70+#define VIRTIO_GPIO_IRQ_STATUS_VALID 0x1
71+
4772 #endif /* _LINUX_VIRTIO_GPIO_H */