video: Add a helper for enabling a panel via GPIO from dt
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.
Signed-off-by Fabio Estevam <[email protected]>
---
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
@@ -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
@@ -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
@@ -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
Dear Fabio Estevam,
Quoted 8 lines
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.
Signed-off-by Fabio Estevam <[email protected]>
Looks ok,
Reviewed-by Marek Vasut <[email protected]>
Best regards,
Marek Vasut