summaryrefslogtreecommitdiff
path: root/src/ec/lenovo/h8/h8.c
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2014-01-12 15:19:50 +0100
committerVladimir Serbinenko <phcoder@gmail.com>2014-01-12 18:04:27 +0100
commitf3c3dae580d92feba8fe07f407c89843ea9721cc (patch)
tree4557991ca30887eda42f127c4ac1a84212df55e5 /src/ec/lenovo/h8/h8.c
parenteada34faaa19766ed9e1584130b1a99491f47487 (diff)
downloadcoreboot-f3c3dae580d92feba8fe07f407c89843ea9721cc.tar.xz
ec/lenovo/h8: Add backlight control.
Change-Id: I773793bf53d91ae787bd0d0ae7bd882243196d56 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/4678 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'src/ec/lenovo/h8/h8.c')
-rw-r--r--src/ec/lenovo/h8/h8.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c
index da5b478646..8fffd5a754 100644
--- a/src/ec/lenovo/h8/h8.c
+++ b/src/ec/lenovo/h8/h8.c
@@ -160,12 +160,19 @@ static void h8_enable(device_t dev)
{
struct ec_lenovo_h8_config *conf = dev->chip_info;
u8 val, tmp;
- u8 beepmask0, beepmask1;
+ u8 beepmask0, beepmask1, config1;
h8_log_ec_version();
ec_write(H8_CONFIG0, conf->config0);
- ec_write(H8_CONFIG1, conf->config1);
+ config1 = conf->config1;
+
+ if (conf->has_keyboard_backlight) {
+ if (get_option(&val, "backlight") != CB_SUCCESS)
+ val = 0; /* Both backlights. */
+ config1 = (config1 & 0xf3) | ((val & 0x3) << 2);
+ }
+ ec_write(H8_CONFIG1, config1);
ec_write(H8_CONFIG2, conf->config2);
ec_write(H8_CONFIG3, conf->config3);