diff options
-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 */ |