diff options
author | Sue Chen <sue.chen@quanta.corp-partner.google.com> | 2019-01-17 13:32:20 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-01-30 13:06:39 -0800 |
commit | cc98aa2569f249071d75b435ac400a4c060c43fb (patch) | |
tree | d94ba905a1633a7b7a6dcd4c3dfa32adb3563420 /board/karma | |
parent | 1cee8540fcb75523238c6ba19cf4fa5bbf1d6c11 (diff) | |
download | chrome-ec-cc98aa2569f249071d75b435ac400a4c060c43fb.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/1418251
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'board/karma')
-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 57164e9227..1b265ed6ca 100644 --- a/board/karma/gpio.inc +++ b/board/karma/gpio.inc @@ -83,13 +83,14 @@ GPIO(EC_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 */ |