Skip to contentSkip to conversation

video: Add a helper for enabling a panel via GPIO from dt

PATCH In review Fabio Estevam 2 participants 2 messages Apr 3, 2013 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 video: Add a helper for enabling a panel via GPIO from dt

From: Fabio Estevam <[email protected]>

Introduce a helper that can be used to retrieve the GPIO via devicetree that is used to turn on a display.

Tested on a mx28evk board.

---
Changes since v1:
- Fix return value

 drivers/video/Kconfig                  |    6 +++++
 drivers/video/Makefile                 |    1 +
 drivers/video/of_display_enable_gpio.c |   43 ++++++++++++++++++++++++++++++++
 include/video/of_display_gpio.h        |   17 +++++++++++++
 4 files changed, 67 insertions(+)
 create mode 100644 drivers/video/of_display_enable_gpio.c
 create mode 100644 include/video/of_display_gpio.h
drivers/video/Kconfig +6 -0
index 0181a87..7607f42 100644
@@ -52,6 +52,12 @@ config OF_VIDEOMODE
 	help
 	  helper to get videomodes from the devicetree
 
+config OF_DISPLAY_ENABLE_GPIO
+	bool "Support for enabling a panel via GPIO from the devicetree"
+	depends on OF
+	help
+	  helper to turning on a panel via gpio from the devicetree
+
 config HDMI
 	bool
 
drivers/video/Makefile +1 -0
index 97f7b6d..4d3ec70 100644
@@ -176,3 +176,4 @@ obj-$(CONFIG_DISPLAY_TIMING) += display_timing.o
 obj-$(CONFIG_OF_DISPLAY_TIMING) += of_display_timing.o
 obj-$(CONFIG_VIDEOMODE) += videomode.o
 obj-$(CONFIG_OF_VIDEOMODE) += of_videomode.o
+obj-$(CONFIG_OF_DISPLAY_ENABLE_GPIO) += of_display_enable_gpio.o
drivers/video/of_display_enable_gpio.c new file +43 -0

43 lines not on this page · raw message

include/video/of_display_gpio.h new file +17 -0
new file mode 100644
index 0000000..a56b6a1
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#ifndef __LINUX_OF_DISPLAY_GPIO_H
+#define __LINUX_OF_DISPLAY_GPIO_H
+
+int of_get_display_gpio_enable(struct platform_device *pdev);
+
+#endif
Signature · 1 line
1.7.9.5