diff options
author | Sue Chen <sue.chen@quanta.corp-partner.google.com> | 2019-01-17 13:32:20 +0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2019-01-30 22:06:52 +0000 |
commit | b8c72680e5246f0a1faf0d94e58b64794c8d9250 (patch) | |
tree | 40688d4209eb355b9d88666c448027f2c5106a69 | |
parent | 3cc37b423ae1f8881209efdb51379cad643bff1f (diff) | |
download | chrome-ec-b8c72680e5246f0a1faf0d94e58b64794c8d9250.tar.gz |
Karma: Add PANEL_LM_SSK1 panel settings to OZ554
GPIOC5, GPIO01 and GPIOB1 are used for panel id.
Register 0x02: setting LED current to 55(mA)
(offset = 2, data = 0x55)
BUG=b/120237453
BRANCH=kalista
TEST=make buildall
Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com>
Change-Id: I6668d0930d150c0a10ab70d6539f1415ea231e8a
Reviewed-on: https://chromium-review.googlesource.com/c/1416072
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r-- | board/karma/board.c | 35 | ||||
-rw-r--r-- | board/karma/build.mk | 2 | ||||
-rw-r--r-- | board/karma/gpio.inc | 7 |
3 files changed, 41 insertions, 3 deletions
diff --git a/board/karma/board.c b/board/karma/board.c new file mode 100644 index 0000000000..f8778ad03e --- /dev/null +++ b/board/karma/board.c @@ -0,0 +1,35 @@ +/* Copyright 2019 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "console.h" +#include "gpio.h" +#include "oz554.h" + +#define CPRINTS(format, args...) cprints(CC_I2C, format, ## args) +#define CPRINTF(format, args...) cprintf(CC_I2C, format, ## args) + +void oz554_board_init(void) +{ + int pin_status = 0; + + pin_status |= gpio_get_level(GPIO_PANEL_ID_0) << 0; + pin_status |= gpio_get_level(GPIO_PANEL_ID_1) << 1; + pin_status |= gpio_get_level(GPIO_PANEL_ID_2) << 2; + + switch (pin_status) { + case 0x04: + CPRINTS("PANEL_LM_SSE2"); + break; + case 0x05: + CPRINTS("PANEL_LM_SSK1"); + /* Reigster 0x02: Setting LED current: 55(mA) */ + if (oz554_set_config(2, 0x55)) + CPRINTS("oz554 config failed"); + break; + default: + CPRINTS("PANEL_UNKNOWN"); + break; + } +} diff --git a/board/karma/build.mk b/board/karma/build.mk index 05884cf221..2554425920 100644 --- a/board/karma/build.mk +++ b/board/karma/build.mk @@ -9,3 +9,5 @@ CHIP:=npcx CHIP_VARIANT:=npcx5m6g BASEBOARD:=kalista + +board-y=board.o diff --git a/board/karma/gpio.inc b/board/karma/gpio.inc index 06295b6693..2f93e79ad3 100644 --- a/board/karma/gpio.inc +++ b/board/karma/gpio.inc @@ -83,13 +83,14 @@ GPIO(EC_PANEL_EDID_WRITE_EN_L, PIN(C, 3), GPIO_OUT_HIGH) /* LOW to write EDID /* Speaker */ GPIO(SPKR5, PIN(C, 2), GPIO_INPUT) /* No function */ +GPIO(PANEL_ID_0, PIN(C, 5), GPIO_INPUT) +GPIO(PANEL_ID_1, PIN(0, 1), GPIO_INPUT) +GPIO(PANEL_ID_2, PIN(B, 1), GPIO_INPUT) + /* Test points */ -GPIO(TP48, PIN(B, 1), GPIO_INPUT) GPIO(TP121, PIN(3, 3), GPIO_INPUT) -GPIO(TP123, PIN(C, 5), GPIO_INPUT) GPIO(TP127, PIN(6, 6), GPIO_INPUT) GPIO(TP128, PIN(C, 4), GPIO_INPUT) -GPIO(TP129, PIN(0, 1), GPIO_INPUT) GPIO(TP248, PIN(5, 7), GPIO_INPUT) /* Alternate functions GPIO definitions */ |