Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] linux-tools: add gpio
@ 2016-09-14 12:09 Marcin Niestroj
  2016-09-23 21:27 ` Yann E. MORIN
  0 siblings, 1 reply; 2+ messages in thread
From: Marcin Niestroj @ 2016-09-14 12:09 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
---
 linux/Config.tools.in    |  9 +++++++++
 linux/linux-tool-gpio.mk | 28 ++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)
 create mode 100644 linux/linux-tool-gpio.mk

diff --git a/linux/Config.tools.in b/linux/Config.tools.in
index 5ada98d..303c967 100644
--- a/linux/Config.tools.in
+++ b/linux/Config.tools.in
@@ -14,6 +14,15 @@ comment "cpupower needs a toolchain w/ wchar"
 	depends on !BR2_bfin
 	depends on !BR2_USE_WCHAR && BR2_NEEDS_GETTEXT
 
+config BR2_LINUX_KERNEL_TOOL_GPIO
+	bool "gpio"
+	help
+	  gpio is a collection of tools to get information about,
+	  control and monitor gpios present on system.
+
+	  These tools use new gpio ABI which will deprecate sysfs gpio
+	  interface in the future.
+
 config BR2_LINUX_KERNEL_TOOL_PERF
 	bool "perf"
 	help
diff --git a/linux/linux-tool-gpio.mk b/linux/linux-tool-gpio.mk
new file mode 100644
index 0000000..bd38e67
--- /dev/null
+++ b/linux/linux-tool-gpio.mk
@@ -0,0 +1,28 @@
+################################################################################
+#
+# gpio
+#
+################################################################################
+
+LINUX_TOOLS += gpio
+
+GPIO_MAKE_OPTS = CROSS_COMPILE=$(TARGET_CROSS)
+
+define GPIO_BUILD_CMDS
+	$(Q)if ! grep install $(@D)/tools/gpio/Makefile >/dev/null 2>&1 ; then \
+		echo "Your kernel version is too old and does not have the gpio tools." ; \
+		echo "At least kernel 4.8 must be used." ; \
+		exit 1 ; \
+	fi
+
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/tools \
+		$(GPIO_MAKE_OPTS) \
+		gpio
+endef
+
+define GPIO_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/tools \
+		$(GPIO_MAKE_OPTS) \
+		DESTDIR=$(TARGET_DIR) \
+		gpio_install
+endef
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-23 21:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-14 12:09 [Buildroot] [PATCH] linux-tools: add gpio Marcin Niestroj
2016-09-23 21:27 ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox