All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] mx6sabresd: Allow LVDS backlight to be functional after a kernel reboot
@ 2016-06-08 18:05 Marco Franchi
  2016-06-08 20:31 ` Stefano Babic
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Marco Franchi @ 2016-06-08 18:05 UTC (permalink / raw)
  To: u-boot

Currently the LVDS backlight does not work in U-Boot after a ?reboot? comand
in the kernel.

This problem occurs because the kernel uses this pin in PWM mode and U-Boot
does not configure the backlight pin as GPIO functionality.

So fix the problem by explicitly configuring the backlight pin as GPIO in
U-Boot.

Signed-off-by: Marco Franchi <marco.franchi@nxp.com>
---
 board/freescale/mx6sabresd/mx6sabresd.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c
index 54ba36b..28c969d 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -177,13 +177,27 @@ static iomux_v3_cfg_t const rgb_pads[] = {
 	MX6_PAD_DISP0_DAT21__IPU1_DISP0_DATA21 | MUX_PAD_CTRL(NO_PAD_CTRL),
 	MX6_PAD_DISP0_DAT22__IPU1_DISP0_DATA22 | MUX_PAD_CTRL(NO_PAD_CTRL),
 	MX6_PAD_DISP0_DAT23__IPU1_DISP0_DATA23 | MUX_PAD_CTRL(NO_PAD_CTRL),
+};
+
+static iomux_v3_cfg_t const bl_pads[] = {
 	MX6_PAD_SD1_DAT3__GPIO1_IO21 | MUX_PAD_CTRL(NO_PAD_CTRL),
 };
 
+static void enable_backlight(void)
+{
+	imx_iomux_v3_setup_multiple_pads(bl_pads, ARRAY_SIZE(bl_pads));
+	gpio_direction_output(DISP0_PWR_EN, 1);
+}
+
 static void enable_rgb(struct display_info_t const *dev)
 {
 	imx_iomux_v3_setup_multiple_pads(rgb_pads, ARRAY_SIZE(rgb_pads));
-	gpio_direction_output(DISP0_PWR_EN, 1);
+	enable_backlight();
+}
+
+static void enable_lvds(struct display_info_t const *dev)
+{
+	enable_backlight();
 }
 
 static struct i2c_pads_info i2c_pad_info1 = {
@@ -370,7 +384,7 @@ struct display_info_t const displays[] = {{
 	.addr	= 0,
 	.pixfmt	= IPU_PIX_FMT_RGB666,
 	.detect	= NULL,
-	.enable	= NULL,
+	.enable	= enable_lvds,
 	.mode	= {
 		.name           = "Hannstar-XGA",
 		.refresh        = 60,
-- 
2.7.4

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

* [U-Boot] [PATCH] mx6sabresd: Allow LVDS backlight to be functional after a kernel reboot
  2016-06-08 18:05 [U-Boot] [PATCH] mx6sabresd: Allow LVDS backlight to be functional after a kernel reboot Marco Franchi
@ 2016-06-08 20:31 ` Stefano Babic
  2016-06-08 20:47 ` Fabio Estevam
  2016-06-18  8:28 ` Stefano Babic
  2 siblings, 0 replies; 4+ messages in thread
From: Stefano Babic @ 2016-06-08 20:31 UTC (permalink / raw)
  To: u-boot

Hi Marco,

On 08/06/2016 20:05, Marco Franchi wrote:
> Currently the LVDS backlight does not work in U-Boot after a ?reboot? comand
> in the kernel.
> 
> This problem occurs because the kernel uses this pin in PWM mode and U-Boot
> does not configure the backlight pin as GPIO functionality.
> 
> So fix the problem by explicitly configuring the backlight pin as GPIO in
> U-Boot.
> 
> Signed-off-by: Marco Franchi <marco.franchi@nxp.com>
> ---
>  board/freescale/mx6sabresd/mx6sabresd.c | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c
> index 54ba36b..28c969d 100644
> --- a/board/freescale/mx6sabresd/mx6sabresd.c
> +++ b/board/freescale/mx6sabresd/mx6sabresd.c
> @@ -177,13 +177,27 @@ static iomux_v3_cfg_t const rgb_pads[] = {
>  	MX6_PAD_DISP0_DAT21__IPU1_DISP0_DATA21 | MUX_PAD_CTRL(NO_PAD_CTRL),
>  	MX6_PAD_DISP0_DAT22__IPU1_DISP0_DATA22 | MUX_PAD_CTRL(NO_PAD_CTRL),
>  	MX6_PAD_DISP0_DAT23__IPU1_DISP0_DATA23 | MUX_PAD_CTRL(NO_PAD_CTRL),
> +};
> +
> +static iomux_v3_cfg_t const bl_pads[] = {
>  	MX6_PAD_SD1_DAT3__GPIO1_IO21 | MUX_PAD_CTRL(NO_PAD_CTRL),
>  };
>  
> +static void enable_backlight(void)
> +{
> +	imx_iomux_v3_setup_multiple_pads(bl_pads, ARRAY_SIZE(bl_pads));
> +	gpio_direction_output(DISP0_PWR_EN, 1);
> +}
> +
>  static void enable_rgb(struct display_info_t const *dev)
>  {
>  	imx_iomux_v3_setup_multiple_pads(rgb_pads, ARRAY_SIZE(rgb_pads));
> -	gpio_direction_output(DISP0_PWR_EN, 1);
> +	enable_backlight();
> +}
> +
> +static void enable_lvds(struct display_info_t const *dev)
> +{
> +	enable_backlight();
>  }
>  
>  static struct i2c_pads_info i2c_pad_info1 = {
> @@ -370,7 +384,7 @@ struct display_info_t const displays[] = {{
>  	.addr	= 0,
>  	.pixfmt	= IPU_PIX_FMT_RGB666,
>  	.detect	= NULL,
> -	.enable	= NULL,
> +	.enable	= enable_lvds,
>  	.mode	= {
>  		.name           = "Hannstar-XGA",
>  		.refresh        = 60,
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic


-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

* [U-Boot] [PATCH] mx6sabresd: Allow LVDS backlight to be functional after a kernel reboot
  2016-06-08 18:05 [U-Boot] [PATCH] mx6sabresd: Allow LVDS backlight to be functional after a kernel reboot Marco Franchi
  2016-06-08 20:31 ` Stefano Babic
@ 2016-06-08 20:47 ` Fabio Estevam
  2016-06-18  8:28 ` Stefano Babic
  2 siblings, 0 replies; 4+ messages in thread
From: Fabio Estevam @ 2016-06-08 20:47 UTC (permalink / raw)
  To: u-boot

Hi Marco,

On Wed, Jun 8, 2016 at 3:05 PM, Marco Franchi <marco.franchi@nxp.com> wrote:
> Currently the LVDS backlight does not work in U-Boot after a ?reboot? comand
> in the kernel.
>
> This problem occurs because the kernel uses this pin in PWM mode and U-Boot
> does not configure the backlight pin as GPIO functionality.
>
> So fix the problem by explicitly configuring the backlight pin as GPIO in
> U-Boot.
>
> Signed-off-by: Marco Franchi <marco.franchi@nxp.com>

Thanks for fixing this bug:

Tested-by: Fabio Estevam <fabio.estevam@nxp.com>

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

* [U-Boot] [PATCH] mx6sabresd: Allow LVDS backlight to be functional after a kernel reboot
  2016-06-08 18:05 [U-Boot] [PATCH] mx6sabresd: Allow LVDS backlight to be functional after a kernel reboot Marco Franchi
  2016-06-08 20:31 ` Stefano Babic
  2016-06-08 20:47 ` Fabio Estevam
@ 2016-06-18  8:28 ` Stefano Babic
  2 siblings, 0 replies; 4+ messages in thread
From: Stefano Babic @ 2016-06-18  8:28 UTC (permalink / raw)
  To: u-boot

On 08/06/2016 20:05, Marco Franchi wrote:
> Currently the LVDS backlight does not work in U-Boot after a ?reboot? comand
> in the kernel.
> 
> This problem occurs because the kernel uses this pin in PWM mode and U-Boot
> does not configure the backlight pin as GPIO functionality.
> 
> So fix the problem by explicitly configuring the backlight pin as GPIO in
> U-Boot.
> 
> Signed-off-by: Marco Franchi <marco.franchi@nxp.com>
> ---


Applied to master (bug fix), thanks !

Best regards,
Stefano Babic


-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

end of thread, other threads:[~2016-06-18  8:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-08 18:05 [U-Boot] [PATCH] mx6sabresd: Allow LVDS backlight to be functional after a kernel reboot Marco Franchi
2016-06-08 20:31 ` Stefano Babic
2016-06-08 20:47 ` Fabio Estevam
2016-06-18  8:28 ` Stefano Babic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.