linux-libc-headers: patch SDK gpio.h file with Digi debounce IOCTL

Digi customized linux kernel gpio.h file to allow debounce functionality by the
user space through the character device.
This commit patches the default gpio.h file that is used to generate the SDK
(which comes from kernel 4.18) with Digi debounce additions.

https://jira.digi.com/browse/DEL-7027

Signed-off-by: Hector Bujanda <hector.bujanda@digi.com>
This commit is contained in:
Hector Bujanda 2020-04-15 01:52:54 +02:00
parent 87f4f96944
commit f3bf3c7504
2 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,48 @@
From: Hector Bujanda <hector.bujanda@digi.com>
Date: Tue, 14 Apr 2020 15:51:52 -0700
Subject: [PATCH] gpio: uapi: add userspace support for setting debounce on
GPIO line
Added GPIO_SET_DEBOUNCE_IOCTL define and gpioline_debounce struct.
This allows calling gpiod_set_debounce() function through char device ioctl to
gpiolib.
https://jira.digi.com/browse/DEL-6425
Signed-off-by: Hector Bujanda <hector.bujanda@digi.com>
---
include/uapi/linux/gpio.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/uapi/linux/gpio.h b/include/uapi/linux/gpio.h
index 1bf6e6df084b..4b092990d4c8 100644
--- a/include/uapi/linux/gpio.h
+++ b/include/uapi/linux/gpio.h
@@ -53,6 +53,17 @@ struct gpioline_info {
char consumer[32];
};
+/**
+ * struct gpioline_debounce - GPIO line debounce
+ * @line_offset: the local offset on this GPIO device, fill this in when
+ * requesting the line information from the kernel
+ * @debounce_usec: debounce in uSeconds to set for this line
+ */
+struct gpioline_debounce {
+ __u32 line_offset;
+ __u32 debounce_usec;
+};
+
/* Maximum number of requested handles */
#define GPIOHANDLES_MAX 64
@@ -154,5 +165,6 @@ struct gpioevent_data {
#define GPIO_GET_LINEINFO_IOCTL _IOWR(0xB4, 0x02, struct gpioline_info)
#define GPIO_GET_LINEHANDLE_IOCTL _IOWR(0xB4, 0x03, struct gpiohandle_request)
#define GPIO_GET_LINEEVENT_IOCTL _IOWR(0xB4, 0x04, struct gpioevent_request)
+#define GPIO_SET_DEBOUNCE_IOCTL _IOW(0xB4, 0x05, struct gpioline_debounce)
#endif /* _UAPI_GPIO_H_ */
--
2.17.1

View File

@ -0,0 +1,8 @@
# Copyright (C) 2020 Digi International, Inc.
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
SRC_URI_append = " \
file://0001-gpio-uapi-add-userspace-support-for-setting-debounce.patch \
"