From: Minkyu Kang <mk7.kang@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 11/12] exynos: Enable the LCD backlight for snow
Date: Thu, 15 May 2014 15:51:36 +0900 [thread overview]
Message-ID: <537463F8.7020004@samsung.com> (raw)
In-Reply-To: <1396481069-24950-12-git-send-email-sjg@chromium.org>
On 03/04/14 08:24, Simon Glass wrote:
> The backlight uses FETs on the TPS65090. Enable this so that the display
> is visible.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
> ---
>
> Changes in v2:
> - Only set up the EDP bridge for snow
> - Add a device tree compatibility string for the EDP bridge
> - Check for EDP failure and print an error in that case
> - Return immediately in exynos_backlight_on() if needed
>
> board/samsung/smdk5250/exynos5-dt.c | 103 ++++++++++++++++++++++++++++++++++++
> include/fdtdec.h | 1 +
> lib/fdtdec.c | 1 +
> 3 files changed, 105 insertions(+)
>
> diff --git a/board/samsung/smdk5250/exynos5-dt.c b/board/samsung/smdk5250/exynos5-dt.c
> index 2c1cf8a..73c9a35 100644
> --- a/board/samsung/smdk5250/exynos5-dt.c
> +++ b/board/samsung/smdk5250/exynos5-dt.c
> @@ -183,6 +183,61 @@ int exynos_power_init(void)
> #endif /* CONFIG_POWER */
>
> #ifdef CONFIG_LCD
> +static int board_dp_bridge_setup(void)
> +{
> + struct exynos5_gpio_part1 *gpio1 =
> + (struct exynos5_gpio_part1 *)samsung_get_base_gpio_part1();
> + const int MAX_TRIES = 10;
please don't use upper case at local variable.
If need, please define it.
> + int num_tries, node;
> +
> + /*
> + * TODO(sjg): Use device tree for GPIOs when exynos GPIO
> + * numbering patch is in mainline.
> + */
> + debug("%s\n", __func__);
> + node = fdtdec_next_compatible(gd->fdt_blob, 0, COMPAT_NXP_PTN3460);
> + if (node < 0) {
> + debug("%s: No node for DP bridge in device tree\n", __func__);
> + return -ENODEV;
> + }
> +
> + /* Setup the GPIOs */
> +
> + /* PD is ACTIVE_LOW, and initially de-asserted */
> + s5p_gpio_set_pull(&gpio1->y2, 5, GPIO_PULL_NONE);
> + s5p_gpio_direction_output(&gpio1->y2, 5, 1);
> +
> + /* Reset is ACTIVE_LOW */
> + s5p_gpio_set_pull(&gpio1->x1, 5, GPIO_PULL_NONE);
> + s5p_gpio_direction_output(&gpio1->x1, 5, 0);
> +
> + udelay(10);
> + s5p_gpio_set_value(&gpio1->x1, 5, 1);
> +
> + s5p_gpio_direction_input(&gpio1->x0, 7);
seems to need rebase this patch.
> +
> + /*
> + * We need to wait for 90ms after bringing up the bridge since there
> + * is a phantom "high" on the HPD chip during its bootup. The phantom
> + * high comes within 7ms of de-asserting PD and persists for at least
> + * 15ms. The real high comes roughly 50ms after PD is de-asserted. The
> + * phantom high makes it hard for us to know when the NXP chip is up.
> + */
> + mdelay(90);
> +
> + for (num_tries = 0; num_tries < MAX_TRIES; num_tries++) {
> + /* Check HPD. If it's high, we're all good. */
> + if (s5p_gpio_get_value(&gpio1->x0, 7))
> + return 0;
> +
> + debug("%s: eDP bridge failed to come up; try %d of %d\n",
> + __func__, num_tries, MAX_TRIES);
> + }
> +
> + /* Immediately go into bridge reset if the hp line is not high */
> + return -ENODEV;
> +}
> +
> void exynos_cfg_lcd_gpio(void)
> {
> struct exynos5_gpio_part1 *gpio1 =
> @@ -204,4 +259,52 @@ void exynos_set_dp_phy(unsigned int onoff)
> {
> set_dp_phy_ctrl(onoff);
> }
> +
> +void exynos_backlight_on(unsigned int onoff)
onoff, then value is 1. is it on or off?
How about rename it to "on"?
> +{
> + debug("%s(%u)\n", __func__, onoff);
> +
> + if (!onoff)
> + return;
> +
> +#ifdef CONFIG_POWER_TPS65090
> + struct exynos5_gpio_part1 *gpio1 =
> + (struct exynos5_gpio_part1 *)
> + samsung_get_base_gpio_part1();
> + int ret;
> +
> + ret = tps65090_fet_enable(1); /* Enable FET1, backlight */
> + if (ret)
> + return;
> +
> + /* T5 in the LCD timing spec (defined as > 10ms) */
> + mdelay(10);
> +
> + /* board_dp_backlight_pwm */
> + s5p_gpio_direction_output(&gpio1->b2, 0, 1);
> +
> + /* T6 in the LCD timing spec (defined as > 10ms) */
> + mdelay(10);
> +
> + /* board_dp_backlight_en */
> + s5p_gpio_direction_output(&gpio1->x3, 0, 1);
> +#endif
> +}
> +
> +void exynos_lcd_power_on(void)
> +{
> + int ret;
> +
> + debug("%s\n", __func__);
> +
> +#ifdef CONFIG_POWER_TPS65090
> + /* board_dp_lcd_vdd */
> + tps65090_fet_enable(6); /* Enable FET6, lcd panel */
> +#endif
> +
> + ret = board_dp_bridge_setup();
> + if (ret && ret != -ENODEV)
> + printf("LCD bridge failed to enable: %d\n", ret);
> +}
> +
> #endif
> diff --git a/include/fdtdec.h b/include/fdtdec.h
> index 669ab90..ea50d75 100644
> --- a/include/fdtdec.h
> +++ b/include/fdtdec.h
> @@ -93,6 +93,7 @@ enum fdt_compat_id {
> COMPAT_SANDBOX_HOST_EMULATION, /* Sandbox emulation of a function */
> COMPAT_SANDBOX_LCD_SDL, /* Sandbox LCD emulation with SDL */
> COMPAT_TI_TPS65090, /* Texas Instrument TPS65090 */
> + COMPAT_NXP_PTN3460, /* NXP PTN3460 DP/LVDS bridge */
>
> COMPAT_COUNT,
> };
> diff --git a/lib/fdtdec.c b/lib/fdtdec.c
> index e15e0ad..13e3f45 100644
> --- a/lib/fdtdec.c
> +++ b/lib/fdtdec.c
> @@ -66,6 +66,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
> COMPAT(SANDBOX_HOST_EMULATION, "sandbox,host-emulation"),
> COMPAT(SANDBOX_LCD_SDL, "sandbox,lcd-sdl"),
> COMPAT(TI_TPS65090, "ti,tps65090"),
> + COMPAT(COMPAT_NXP_PTN3460, "nxp,ptn3460"),
> };
>
> const char *fdtdec_get_compatible(enum fdt_compat_id id)
>
Thanks,
Minkyu Kang.
next prev parent reply other threads:[~2014-05-15 6:51 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-02 23:24 [U-Boot] [PATCH v2 0/12] Enable LCD display on snow Simon Glass
2014-04-02 23:24 ` [U-Boot] [PATCH v2 01/12] exynos: Drop old smdk5250.c file Simon Glass
2014-04-02 23:24 ` [U-Boot] [PATCH v2 02/12] power: Rename CONFIG_PMIC_... to CONFIG_POWER_ Simon Glass
2014-04-02 23:24 ` [U-Boot] [PATCH v2 03/12] power: Add PMIC_ prefix to CHARGER_EN/DISABLE Simon Glass
2014-04-02 23:24 ` [U-Boot] [PATCH v2 04/12] power: Add support for TPS65090 PMU chip Simon Glass
2014-05-15 6:52 ` Minkyu Kang
2014-05-20 11:46 ` Simon Glass
2014-04-02 23:24 ` [U-Boot] [PATCH v2 05/12] exynos5: Enable tps65090 on exynos5-dt Simon Glass
2014-04-02 23:24 ` [U-Boot] [PATCH v2 06/12] power: Explicitly select pmic device's bus Simon Glass
2014-04-02 23:24 ` [U-Boot] [PATCH v2 07/12] exynos5: support tps65090 pmic Simon Glass
2014-05-15 6:51 ` Minkyu Kang
2014-05-20 11:47 ` Simon Glass
2014-05-21 10:05 ` Minkyu Kang
2014-05-21 18:58 ` Simon Glass
2014-05-22 1:20 ` Minkyu Kang
2014-05-22 17:27 ` Simon Glass
2014-05-22 18:24 ` David Nelson
2014-05-22 20:07 ` Simon Glass
2014-05-26 7:15 ` Minkyu Kang
2014-05-27 0:01 ` Simon Glass
2014-05-28 13:02 ` Minkyu Kang
2014-05-29 23:36 ` Simon Glass
2014-04-02 23:24 ` [U-Boot] [PATCH v2 08/12] exynos: Enable PSHOLD in SPL Simon Glass
2014-04-02 23:24 ` [U-Boot] [PATCH v2 09/12] exynos: dts: Disable cros_ec interrupts due to broken GPIOs Simon Glass
2014-05-15 6:51 ` Minkyu Kang
2014-05-19 21:27 ` Simon Glass
2014-05-20 0:53 ` Minkyu Kang
2014-05-20 11:49 ` Simon Glass
2014-04-02 23:24 ` [U-Boot] [PATCH v2 10/12] exynos: dts: Enable LCD for snow Simon Glass
2014-05-15 6:51 ` Minkyu Kang
2014-05-20 11:53 ` Simon Glass
2014-04-02 23:24 ` [U-Boot] [PATCH v2 11/12] exynos: Enable the LCD backlight " Simon Glass
2014-05-15 6:51 ` Minkyu Kang [this message]
2014-05-20 11:48 ` Simon Glass
2014-04-02 23:24 ` [U-Boot] [PATCH v2 12/12] initcall: Improve debugging support Simon Glass
2014-05-12 22:45 ` [U-Boot] [PATCH v2 0/12] Enable LCD display on snow Simon Glass
2014-05-14 5:19 ` Minkyu Kang
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=537463F8.7020004@samsung.com \
--to=mk7.kang@samsung.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 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.