veyron: Add "backlight" GPIO to coreboot table

This patch adds a new "backlight" output GPIO to the coreboot table in
order to avoid redundantly defining that GPIO in the payload.

BRANCH=veyron
BUG=chrome-os-partner:34713
TEST=Tested together with corresponding depthcharge CL.

Change-Id: I69b3c7ac6be4b9723b6a0dfecef5e1c4ea681aff
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/242400
Tested-by: Lin Huang <hl@rock-chips.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
(cherry picked from commit 04ce4c23573cf926aeef3d817d3ab00835f897c7)
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/243121
This commit is contained in:
Julius Werner 2015-01-21 15:28:07 -08:00 committed by ChromeOS Commit Bot
commit 73c8abe4a1
21 changed files with 78 additions and 15 deletions

View file

@ -23,6 +23,7 @@
#include <boardid.h>
#include <gpio.h>
#define GPIO_BACKLIGHT GPIO(7, A, 0)
#define GPIO_RESET GPIO(0, B, 5)
void setup_chromeos_gpios(void);

View file

@ -100,6 +100,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
GPIO_MAX_NAME_LENGTH);
count++;
/* Backlight: GPIO active high (output) */
gpios->gpios[count].port = GPIO_BACKLIGHT.raw;
gpios->gpios[count].polarity = ACTIVE_HIGH;
gpios->gpios[count].value = -1;
strncpy((char *)gpios->gpios[count].name, "backlight",
GPIO_MAX_NAME_LENGTH);
count++;
gpios->size = sizeof(*gpios) + (count * sizeof(struct lb_gpio));
gpios->count = count;

View file

@ -139,5 +139,5 @@ void mainboard_power_on_backlight(void)
mdelay(10);
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
}

View file

@ -23,6 +23,7 @@
#include <boardid.h>
#include <gpio.h>
#define GPIO_BACKLIGHT GPIO(7, A, 0)
#define GPIO_RESET GPIO(0, B, 5)
void setup_chromeos_gpios(void);

View file

@ -100,6 +100,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
GPIO_MAX_NAME_LENGTH);
count++;
/* Backlight: GPIO active high (output) */
gpios->gpios[count].port = GPIO_BACKLIGHT.raw;
gpios->gpios[count].polarity = ACTIVE_HIGH;
gpios->gpios[count].value = -1;
strncpy((char *)gpios->gpios[count].name, "backlight",
GPIO_MAX_NAME_LENGTH);
count++;
gpios->size = sizeof(*gpios) + (count * sizeof(struct lb_gpio));
gpios->count = count;

View file

@ -139,5 +139,5 @@ void mainboard_power_on_backlight(void)
mdelay(10);
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
}

View file

@ -23,6 +23,7 @@
#include <boardid.h>
#include <gpio.h>
#define GPIO_BACKLIGHT GPIO(7, A, 0)
#define GPIO_RESET GPIO(0, B, 5)
void setup_chromeos_gpios(void);

View file

@ -100,6 +100,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
GPIO_MAX_NAME_LENGTH);
count++;
/* Backlight: GPIO active high (output) */
gpios->gpios[count].port = GPIO_BACKLIGHT.raw;
gpios->gpios[count].polarity = ACTIVE_HIGH;
gpios->gpios[count].value = -1;
strncpy((char *)gpios->gpios[count].name, "backlight",
GPIO_MAX_NAME_LENGTH);
count++;
gpios->size = sizeof(*gpios) + (count * sizeof(struct lb_gpio));
gpios->count = count;

View file

@ -146,17 +146,17 @@ void mainboard_power_on_backlight(void)
{
switch (board_id()) {
case 2:
gpio_output(GPIO(7, A, 0), 0); /* BL_EN */
gpio_output(GPIO_BACKLIGHT, 0); /* BL_EN */
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break;
default:
gpio_output(GPIO(2, B, 4), 1); /* BL_PWR_EN */
mdelay(10);
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break;
}
}

View file

@ -23,6 +23,7 @@
#include <boardid.h>
#include <gpio.h>
#define GPIO_BACKLIGHT GPIO(7, A, 0)
#define GPIO_RESET GPIO(0, B, 5)
void setup_chromeos_gpios(void);

View file

@ -100,6 +100,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
GPIO_MAX_NAME_LENGTH);
count++;
/* Backlight: GPIO active high (output) */
gpios->gpios[count].port = GPIO_BACKLIGHT.raw;
gpios->gpios[count].polarity = ACTIVE_HIGH;
gpios->gpios[count].value = -1;
strncpy((char *)gpios->gpios[count].name, "backlight",
GPIO_MAX_NAME_LENGTH);
count++;
gpios->size = sizeof(*gpios) + (count * sizeof(struct lb_gpio));
gpios->count = count;

View file

@ -146,17 +146,17 @@ void mainboard_power_on_backlight(void)
{
switch (board_id()) {
case 0:
gpio_output(GPIO(7, A, 0), 0); /* BL_EN */
gpio_output(GPIO_BACKLIGHT, 0); /* BL_EN */
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break;
default:
gpio_output(GPIO(2, B, 4), 1); /* BL_PWR_EN */
mdelay(10);
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break;
}
}

View file

@ -23,6 +23,7 @@
#include <boardid.h>
#include <gpio.h>
#define GPIO_BACKLIGHT GPIO(7, A, 0)
#define GPIO_RESET GPIO(0, B, 5)
void setup_chromeos_gpios(void);

View file

@ -100,6 +100,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
GPIO_MAX_NAME_LENGTH);
count++;
/* Backlight: GPIO active high (output) */
gpios->gpios[count].port = GPIO_BACKLIGHT.raw;
gpios->gpios[count].polarity = ACTIVE_HIGH;
gpios->gpios[count].value = -1;
strncpy((char *)gpios->gpios[count].name, "backlight",
GPIO_MAX_NAME_LENGTH);
count++;
gpios->size = sizeof(*gpios) + (count * sizeof(struct lb_gpio));
gpios->count = count;

View file

@ -139,5 +139,5 @@ void mainboard_power_on_backlight(void)
mdelay(10);
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
}

View file

@ -23,6 +23,7 @@
#include <boardid.h>
#include <gpio.h>
#define GPIO_BACKLIGHT GPIO(7, A, 0)
#define GPIO_RESET (board_id() > 0 ? GPIO(0, B, 5) : GPIO(0, B, 2))
void setup_chromeos_gpios(void);

View file

@ -101,6 +101,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
GPIO_MAX_NAME_LENGTH);
count++;
/* Backlight: GPIO active high (output) */
gpios->gpios[count].port = GPIO_BACKLIGHT.raw;
gpios->gpios[count].polarity = ACTIVE_HIGH;
gpios->gpios[count].value = -1;
strncpy((char *)gpios->gpios[count].name, "backlight",
GPIO_MAX_NAME_LENGTH);
count++;
gpios->size = sizeof(*gpios) + (count * sizeof(struct lb_gpio));
gpios->count = count;

View file

@ -192,17 +192,17 @@ void mainboard_power_on_backlight(void)
case 0:
case 1:
case 2:
gpio_output(GPIO(7, A, 0), 0); /* BL_EN */
gpio_output(GPIO_BACKLIGHT, 0); /* BL_EN */
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break;
default:
gpio_output(GPIO(2, B, 4), 1); /* BL_PWR_EN */
mdelay(10);
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break;
}
}

View file

@ -23,6 +23,7 @@
#include <boardid.h>
#include <gpio.h>
#define GPIO_BACKLIGHT GPIO(7, A, 0)
#define GPIO_RESET GPIO(0, B, 5)
void setup_chromeos_gpios(void);

View file

@ -100,6 +100,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
GPIO_MAX_NAME_LENGTH);
count++;
/* Backlight: GPIO active high (output) */
gpios->gpios[count].port = GPIO_BACKLIGHT.raw;
gpios->gpios[count].polarity = ACTIVE_HIGH;
gpios->gpios[count].value = -1;
strncpy((char *)gpios->gpios[count].name, "backlight",
GPIO_MAX_NAME_LENGTH);
count++;
gpios->size = sizeof(*gpios) + (count * sizeof(struct lb_gpio));
gpios->count = count;

View file

@ -146,17 +146,17 @@ void mainboard_power_on_backlight(void)
{
switch (board_id()) {
case 0:
gpio_output(GPIO(7, A, 0), 0); /* BL_EN */
gpio_output(GPIO_BACKLIGHT, 0); /* BL_EN */
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break;
default:
gpio_output(GPIO(2, B, 4), 1); /* BL_PWR_EN */
mdelay(10);
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break;
}
}