From 12649c9611981dd8d6567ba0238c8b8247c52215 Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Thu, 24 Oct 2013 14:02:24 -0700 Subject: [PATCH] Nyan: turn on the backlight. These few changes will turn on the backlight. There is a redundant (at present) power on of the panel vdd but we should leave it there, as we are not sure whether to keep it in romstage or not. Note in this mode (at Nvidia's recommendation) we don't run the PWM as a PWM, just a GPIO. That keeps things simple. The backlight, incidentally, is turning out to be a nice, visible, power LED. BUG=None TEST=Build, boot, backlight comes on. BRANCH=None Change-Id: I5def9a0255d82fdd240be7e9097de3889595db2d Signed-off-by: Ronald G. Minnich Reviewed-on: https://chromium-review.googlesource.com/174533 Commit-Queue: Ronald Minnich Tested-by: Ronald Minnich Reviewed-by: Gabe Black --- src/mainboard/google/nyan/pmic.c | 7 ++++++- src/soc/nvidia/tegra124/display.c | 30 +++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/mainboard/google/nyan/pmic.c b/src/mainboard/google/nyan/pmic.c index ab951ea3a3..f52a48b8af 100644 --- a/src/mainboard/google/nyan/pmic.c +++ b/src/mainboard/google/nyan/pmic.c @@ -61,9 +61,14 @@ static struct pmic_write pmic_writes[] = * NOTE: We do this early because doing it later seems to hose the CPU * power rail/partition startup. Need to debug. */ - { 0x16, 0x3f } + { 0x16, 0x3f }, /* Don't write LDCONTROL - it's already 0xFF, i.e. all LDOs enabled. */ + /* panel power GPIO O4. Set mode for GPIO4 (0x0c to 7), then set + * the value (register 0x20 bit 4) + */ + { 0x0c, 0x07 }, + { 0x20, 0x10 }, }; void pmic_init(unsigned bus) diff --git a/src/soc/nvidia/tegra124/display.c b/src/soc/nvidia/tegra124/display.c index b7d3d7f736..cdc10b2067 100644 --- a/src/soc/nvidia/tegra124/display.c +++ b/src/soc/nvidia/tegra124/display.c @@ -222,7 +222,36 @@ void display_startup(device_t dev) /* should probably just make it all MiB ... in future */ u32 framebuffer_size_mb = config->framebuffer_size / MiB; u32 framebuffer_base_mb= config->framebuffer_base / MiB; + /* light it all up */ + /* This one may have been done in romstage but that's ok for now. */ + if (config->panel_vdd_gpio){ + gpio_output(config->panel_vdd_gpio, 1); + printk(BIOS_SPEW,"%s: panel_vdd setting gpio %08x to %d\n", + __func__, config->panel_vdd_gpio, 1); + } + delay(1); + if (config->backlight_vdd_gpio){ + gpio_output(config->backlight_vdd_gpio, 1); + printk(BIOS_SPEW,"%s: backlight vdd setting gpio %08x to %d\n", + __func__, config->backlight_vdd_gpio, 1); + } + delay(1); + if (config->lvds_shutdown_gpio){ + gpio_output(config->lvds_shutdown_gpio, 0); + printk(BIOS_SPEW,"%s: lvds shutdown setting gpio %08x to %d\n", + __func__, config->lvds_shutdown_gpio, 0); + } + if (config->backlight_en_gpio){ + gpio_output(config->backlight_en_gpio, 1); + printk(BIOS_SPEW,"%s: backlight enable setting gpio %08x to %d\n", + __func__, config->backlight_en_gpio, 1); + } + if (config->pwm){ + gpio_output(config->pwm, 1); + printk(BIOS_SPEW,"%s: pwm setting gpio %08x to %d\n", + __func__, config->pwm, 1); + } printk(BIOS_SPEW, "%s: xres %d yres %d framebuffer_bits_per_pixel %d\n", __func__, @@ -299,6 +328,5 @@ void display_startup(device_t dev) if (!setup_window(&window, config)) update_window(dc, &window, config); - }