summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongBeum.Ha <ybha@samsung.corp-partner.google.com>2021-10-08 08:36:36 +0900
committerCommit Bot <commit-bot@chromium.org>2021-10-18 12:15:26 +0000
commitb7f5f40c7d183e4c79451106c8b434ddf3265db3 (patch)
tree1f700525b962ca8b089557ea1ea33adb88d5a1e5
parent9a8fdc56534c16473afe7f98964e02978b9e51a7 (diff)
downloadchrome-ec-b7f5f40c7d183e4c79451106c8b434ddf3265db3.tar.gz
bugzzy : LCD current setting on MP3372
In order to meet the specification of LCD brightness, it is necessary to set the current value of the LCD controller. BUG=b:202344727 BRANCH=None TEST=make -j BOARD=bugzzy Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: I4a688613681e9a68d9bb4c9103ddbf342c416d17 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3217483 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--board/bugzzy/board.c28
-rw-r--r--board/bugzzy/board.h5
2 files changed, 33 insertions, 0 deletions
diff --git a/board/bugzzy/board.c b/board/bugzzy/board.c
index 499e6c5e62..7fc6776b3f 100644
--- a/board/bugzzy/board.c
+++ b/board/bugzzy/board.c
@@ -774,3 +774,31 @@ DECLARE_HOOK(HOOK_AC_CHANGE, handle_tsp_ta, HOOK_PRIO_DEFAULT);
const int usb_port_enable[USB_PORT_COUNT] = {
GPIO_EN_USB_A0_VBUS,
};
+
+/*
+ * Change LED Driver Current
+ * LED driver current must be written when EN_BL_OD goes from Low to High.
+ */
+static int backup_enable_backlight = -1;
+void backlit_gpio_tick(void)
+{
+ int signal = gpio_get_level(GPIO_ENABLE_BACKLIGHT);
+
+ if (backup_enable_backlight == signal)
+ return;
+
+ backup_enable_backlight = signal;
+ if (board_id == -1) {
+ uint32_t val;
+
+ if (cbi_get_board_version(&val) == EC_SUCCESS)
+ board_id = val;
+ }
+
+ if (board_id >= 4 && signal == 1)
+ i2c_write16(I2C_PORT_LCD, I2C_ADDR_MP3372_FLAGS,
+ MP3372_REG_ISET_CHEN,
+ MP3372_ISET_21P8_CHEN_ALL);
+
+}
+DECLARE_HOOK(HOOK_TICK, backlit_gpio_tick, HOOK_PRIO_DEFAULT);
diff --git a/board/bugzzy/board.h b/board/bugzzy/board.h
index dba33aac0b..617d99ea1d 100644
--- a/board/bugzzy/board.h
+++ b/board/bugzzy/board.h
@@ -122,6 +122,7 @@
#define I2C_ADDR_EEPROM_FLAGS 0x50 /* 7b address */
#define I2C_ADDR_ISL98607_FLAGS 0x29
+#define I2C_ADDR_MP3372_FLAGS 0x28
/* ISL98607 registers and value */
/* VBST Voltage Adjustment */
@@ -136,6 +137,10 @@
#define ISL98607_REG_VP_OUT 0x09
#define ISL98607_VP_OUT_5P5 0x0a
+/* MP3372 registers and value */
+/* ISET & CHEN */
+#define MP3372_REG_ISET_CHEN 0x00
+#define MP3372_ISET_21P8_CHEN_ALL 0x70ff
/*
* I2C pin names for baseboard
*