summaryrefslogtreecommitdiff
path: root/board/flapjack/board.c
diff options
context:
space:
mode:
authorJessy jiang <jiangchao5@huaqin.corp-partner.google.com>2019-02-15 14:08:33 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-02-27 01:13:52 -0800
commit56cd91fda92d1dc8147c487737444933a665852a (patch)
tree93f19b12352339f7df0df79c2abad8de9e4013f5 /board/flapjack/board.c
parente4ac1eccf0920f53c1e3532b7ccbc3155c178508 (diff)
downloadchrome-ec-56cd91fda92d1dc8147c487737444933a665852a.tar.gz
flapjack: Enable backlight channel for Flapjackstabilize-11839.Bstabilize-11839.3.B
flapjack requires to enable LED Bias to control LCD backlight. For C18 boards, three channels are required, and each channel has a current of 24 mA. For C19 boards, four channels are required, each channel having a current of 23.5mA. BUG=b:124465980 BRANCH=none TEST=1:)When the system boots, the backlight will light up. 2:)Use the ectool commands to check the channel and current. channle: ectool i2cread 8 0 104 0xA0 current: ectool i2cread 8 0 104 0xA5 If it's C18 board, get 0xfa in channel command and 0xc8 in current command. If it's C19 board, get 0xfe in channel command and 0xc4 in current command. If the SKU value of the board is empty or incorrect, the default value is the data of the C18 board. Change-Id: I2e51feec830c4cfd46e3eaec0f9db0e1cfdd620c Reviewed-on: https://chromium-review.googlesource.com/1475094 Commit-Ready: Jessy Jiang <jiangchao5@huaqin.corp-partner.google.com> Tested-by: Jessy Jiang <jiangchao5@huaqin.corp-partner.google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'board/flapjack/board.c')
-rw-r--r--board/flapjack/board.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/board/flapjack/board.c b/board/flapjack/board.c
index 13372d92f3..2077ff6b31 100644
--- a/board/flapjack/board.c
+++ b/board/flapjack/board.c
@@ -53,6 +53,25 @@ uint16_t board_version;
uint8_t oem;
uint32_t sku;
+static void board_setup_panel(void)
+{
+ uint8_t channel;
+ uint8_t dim;
+ int rv = 0;
+
+ channel = sku & SKU_ID_PANEL_SIZE_MASK ? 0xfe : 0xfa;
+ dim = sku & SKU_ID_PANEL_SIZE_MASK ? 0xc4 : 0xc8;
+
+ rv |= i2c_write8(I2C_PORT_CHARGER, RT946X_ADDR, MT6370_BACKLIGHT_BLEN,
+ channel);
+ rv |= i2c_write8(I2C_PORT_CHARGER, RT946X_ADDR, MT6370_BACKLIGHT_BLDIM,
+ dim);
+ rv |= i2c_write8(I2C_PORT_CHARGER, RT946X_ADDR, MT6370_BACKLIGHT_BLPWM,
+ 0xac);
+ if (rv)
+ CPRINTS("Board setup panel failed\n");
+}
+
static void cbi_init(void)
{
uint32_t val;
@@ -249,6 +268,7 @@ static void board_init(void)
/* Enable gauge interrupt from max17055 */
gpio_enable_interrupt(GPIO_GAUGE_INT_ODL);
+ board_setup_panel();
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);