From: Marcel Ziswiler <marcel.ziswiler@toradex.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] board: toradex: turn off lcd backlight before OS handover
Date: Wed, 14 Nov 2018 22:52:39 +0000 [thread overview]
Message-ID: <1542235956.10375.33.camel@toradex.com> (raw)
In-Reply-To: <20181026122958.28977-1-dev@pschenker.ch>
On Fri, 2018-10-26 at 14:29 +0200, Philippe Schenker wrote:
> From: Gerard Salvatella <gerard.salvatella@toradex.com>
>
> U-Boot typically tears down the display controller before handing
> control over to Linux. On LCD displays disabling pixel clock leads to
> a
> fading out effect with vertical/horizontal lines. Make sure to
> disable
> back light before booting Linux.
>
> Signed-off-by: Gerard Salvatella <gerard.salvatella@toradex.com>
> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> ---
> board/toradex/apalis-tk1/apalis-tk1.c | 9 +++++++++
> board/toradex/apalis_imx6/apalis_imx6.c | 9 +++++++++
> board/toradex/apalis_t30/apalis_t30.c | 9 +++++++++
> board/toradex/colibri_imx6/colibri_imx6.c | 9 +++++++++
> board/toradex/colibri_imx7/colibri_imx7.c | 9 +++++++++
> board/toradex/colibri_t20/colibri_t20.c | 9 +++++++++
> board/toradex/colibri_t30/colibri_t30.c | 9 +++++++++
> board/toradex/colibri_vf/colibri_vf.c | 12 +++++++++++-
> 8 files changed, 74 insertions(+), 1 deletion(-)
>
> diff --git a/board/toradex/apalis-tk1/apalis-tk1.c
> b/board/toradex/apalis-tk1/apalis-tk1.c
> index d6a736d8aa..b87e9e7a3e 100644
> --- a/board/toradex/apalis-tk1/apalis-tk1.c
> +++ b/board/toradex/apalis-tk1/apalis-tk1.c
> @@ -240,3 +240,12 @@ void tegra_pcie_board_port_reset(struct
> tegra_pcie_port *port)
> }
> }
> #endif /* CONFIG_PCI_TEGRA */
> +
> +/*
> + * Backlight off before OS handover
> + */
> +void board_preboot_os(void)
> +{
> + gpio_request(TEGRA_GPIO(BB, 5), "BL_ON");
> + gpio_direction_output(TEGRA_GPIO(BB, 5), 0);
> +}
> diff --git a/board/toradex/apalis_imx6/apalis_imx6.c
> b/board/toradex/apalis_imx6/apalis_imx6.c
> index 368db9c488..d11207c7f4 100644
> --- a/board/toradex/apalis_imx6/apalis_imx6.c
> +++ b/board/toradex/apalis_imx6/apalis_imx6.c
> @@ -745,6 +745,15 @@ static void setup_display(void)
> gpio_direction_output(RGB_BACKLIGHTPWM_OE, 0);
> gpio_direction_output(RGB_BACKLIGHT_GP, 1);
> }
> +
> +/*
> + * Backlight off before OS handover
> + */
> +void board_preboot_os(void)
> +{
> + gpio_direction_output(RGB_BACKLIGHTPWM_GP, 1);
> + gpio_direction_output(RGB_BACKLIGHT_GP, 0);
> +}
> #endif /* defined(CONFIG_VIDEO_IPUV3) */
>
> int board_early_init_f(void)
> diff --git a/board/toradex/apalis_t30/apalis_t30.c
> b/board/toradex/apalis_t30/apalis_t30.c
> index ace9c5b168..df9bc8e707 100644
> --- a/board/toradex/apalis_t30/apalis_t30.c
> +++ b/board/toradex/apalis_t30/apalis_t30.c
> @@ -164,3 +164,12 @@ void tegra_pcie_board_port_reset(struct
> tegra_pcie_port *port)
> #endif /* CONFIG_APALIS_T30_PCIE_EVALBOARD_INIT */
> }
> #endif /* CONFIG_PCI_TEGRA */
> +
> +/*
> + * Backlight off before OS handover
> + */
> +void board_preboot_os(void)
> +{
> + gpio_request(TEGRA_GPIO(V, 2), "BKL1_ON");
> + gpio_direction_output(TEGRA_GPIO(V, 2), 0);
> +}
> diff --git a/board/toradex/colibri_imx6/colibri_imx6.c
> b/board/toradex/colibri_imx6/colibri_imx6.c
> index 68c0c02a8a..17876f27e9 100644
> --- a/board/toradex/colibri_imx6/colibri_imx6.c
> +++ b/board/toradex/colibri_imx6/colibri_imx6.c
> @@ -622,6 +622,15 @@ static void setup_display(void)
> gpio_direction_output(RGB_BACKLIGHTPWM_GP, 0);
> gpio_direction_output(RGB_BACKLIGHT_GP, 1);
> }
> +
> +/*
> + * Backlight off before OS handover
> + */
> +void board_preboot_os(void)
> +{
> + gpio_direction_output(RGB_BACKLIGHTPWM_GP, 1);
> + gpio_direction_output(RGB_BACKLIGHT_GP, 0);
> +}
> #endif /* defined(CONFIG_VIDEO_IPUV3) */
>
> int board_early_init_f(void)
> diff --git a/board/toradex/colibri_imx7/colibri_imx7.c
> b/board/toradex/colibri_imx7/colibri_imx7.c
> index a4c99626b4..be027afd10 100644
> --- a/board/toradex/colibri_imx7/colibri_imx7.c
> +++ b/board/toradex/colibri_imx7/colibri_imx7.c
> @@ -182,6 +182,15 @@ static int setup_lcd(void)
> }
> #endif
>
> +/*
> + * Backlight off before OS handover
> + */
> +void board_preboot_os(void)
> +{
> + gpio_direction_output(GPIO_PWM_A, 1);
> + gpio_direction_output(GPIO_BL_ON, 0);
> +}
> +
> #ifdef CONFIG_FEC_MXC
> static iomux_v3_cfg_t const fec1_pads[] = {
> #ifndef CONFIG_COLIBRI_IMX7_EXT_PHYCLK
> diff --git a/board/toradex/colibri_t20/colibri_t20.c
> b/board/toradex/colibri_t20/colibri_t20.c
> index 5dd0f288ed..e0b27e92f8 100644
> --- a/board/toradex/colibri_t20/colibri_t20.c
> +++ b/board/toradex/colibri_t20/colibri_t20.c
> @@ -150,4 +150,13 @@ void pin_mux_display(void)
> pinmux_set_func(PMUX_PINGRP_SDC, PMUX_FUNC_PWM);
> pinmux_tristate_disable(PMUX_PINGRP_SDC);
> }
> +
> +/*
> + * Backlight off before OS handover
> + */
> +void board_preboot_os(void)
> +{
> + gpio_request(TEGRA_GPIO(T, 4), "BL_ON");
> + gpio_direction_output(TEGRA_GPIO(T, 4), 0);
> +}
> #endif
> diff --git a/board/toradex/colibri_t30/colibri_t30.c
> b/board/toradex/colibri_t30/colibri_t30.c
> index 8ea96188f6..b6b00e3860 100644
> --- a/board/toradex/colibri_t30/colibri_t30.c
> +++ b/board/toradex/colibri_t30/colibri_t30.c
> @@ -66,3 +66,12 @@ void pin_mux_usb(void)
> udelay(5);
> gpio_set_value(TEGRA_GPIO(DD, 0), 1);
> }
> +
> +/*
> + * Backlight off before OS handover
> + */
> +void board_preboot_os(void)
> +{
> + gpio_request(TEGRA_GPIO(V, 2), "BL_ON");
> + gpio_direction_output(TEGRA_GPIO(V, 2), 0);
> +}
> diff --git a/board/toradex/colibri_vf/colibri_vf.c
> b/board/toradex/colibri_vf/colibri_vf.c
> index 4db1757469..176c5201f9 100644
> --- a/board/toradex/colibri_vf/colibri_vf.c
> +++ b/board/toradex/colibri_vf/colibri_vf.c
> @@ -38,8 +38,9 @@ DECLARE_GLOBAL_DATA_PTR;
> #define ENET_PAD_CTRL (PAD_CTL_PUS_47K_UP |
> PAD_CTL_SPEED_HIGH | \
> PAD_CTL_DSE_50ohm | PAD_CTL_OBE_IBE_ENABLE)
>
> -#define USB_PEN_GPIO 83
> +#define USB_PEN_GPIO 83
> #define USB_CDET_GPIO 102
> +#define PTC0_GPIO_45 45
>
> static struct ddrmc_cr_setting colibri_vf_cr_settings[] = {
> /* levelling */
> @@ -640,3 +641,12 @@ int board_usb_phy_mode(int port)
> }
> }
> #endif
> +
> +/*
> + * Backlight off before OS handover
> + */
> +void board_preboot_os(void)
> +{
> + gpio_request(PTC0_GPIO_45, "BL_ON");
> + gpio_direction_output(PTC0_GPIO_45, 0);
> +}
prev parent reply other threads:[~2018-11-14 22:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-26 12:29 [U-Boot] [PATCH] board: toradex: turn off lcd backlight before OS handover Philippe Schenker
2018-11-14 22:52 ` Marcel Ziswiler [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1542235956.10375.33.camel@toradex.com \
--to=marcel.ziswiler@toradex.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox