summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Chen <philipchen@google.com>2019-06-26 12:17:37 -0700
committerCommit Bot <commit-bot@chromium.org>2019-07-02 02:07:58 +0000
commitcd551f358fb00379ff9b539a840b17a2c56e0b61 (patch)
tree54167253d58286ae197a624b7096bd70304acf3d
parenta2454fb3674c948fa0eb78a305cfb184c3fade60 (diff)
downloadchrome-ec-cd551f358fb00379ff9b539a840b17a2c56e0b61.tar.gz
hatch/helios/kindred/kohaku: Enable EC-based display backlight control
This patch allows EC to override display backlight control for hatch family. Also enable CONFIG_BACKLIGHT_LID so that EC can specifically turn off display backlight when the lid is closed. BUG=b:135511415 BRANCH=none TEST=On hatch rev1 board, turn off/on display backlight by 'ectool backlight 0' and 'ectool backlight 1' TEST='emerge-hatch chromeos-ec' Change-Id: I894ef2879fb584ccf84cd643cc4c0cd5fdcb8525 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1679047 Reviewed-by: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org>
-rw-r--r--baseboard/hatch/baseboard.h4
-rw-r--r--board/hatch/gpio.inc1
-rw-r--r--board/helios/gpio.inc1
-rw-r--r--board/kindred/gpio.inc1
-rw-r--r--board/kohaku/gpio.inc2
-rw-r--r--include/config.h4
6 files changed, 10 insertions, 3 deletions
diff --git a/baseboard/hatch/baseboard.h b/baseboard/hatch/baseboard.h
index 3926108c27..38e414ad2c 100644
--- a/baseboard/hatch/baseboard.h
+++ b/baseboard/hatch/baseboard.h
@@ -159,6 +159,10 @@
#define I2C_PORT_BATTERY I2C_PORT_POWER
#define I2C_PORT_CHARGER I2C_PORT_POWER
+/* Other common defines */
+#define CONFIG_BACKLIGHT_LID
+#define GPIO_ENABLE_BACKLIGHT GPIO_EDP_BKLTEN_OD
+
#define PP5000_PGOOD_POWER_SIGNAL_MASK POWER_SIGNAL_MASK(PP5000_A_PGOOD)
#ifndef __ASSEMBLER__
diff --git a/board/hatch/gpio.inc b/board/hatch/gpio.inc
index 91ee333503..5b7d5b9d5f 100644
--- a/board/hatch/gpio.inc
+++ b/board/hatch/gpio.inc
@@ -73,6 +73,7 @@ GPIO(LED_2_L, PIN(C, 3), GPIO_OUT_HIGH) /* White (hatch)
GPIO(LED_3_L, PIN(C, 2), GPIO_OUT_HIGH)
GPIO(LED_4_L, PIN(6, 0), GPIO_OUT_HIGH)
GPIO(EC_KB_BL_EN, PIN(8, 6), GPIO_OUT_LOW) /* Keyboard backlight */
+GPIO(EDP_BKLTEN_OD, PIN(D, 3), GPIO_ODR_HIGH) /* Display backlight */
GPIO(EN_PP5000_FAN, PIN(6, 1), GPIO_OUT_LOW)
GPIO(EN_MST, PIN(9, 6), GPIO_OUT_LOW)
diff --git a/board/helios/gpio.inc b/board/helios/gpio.inc
index a3c37362fd..b188baf783 100644
--- a/board/helios/gpio.inc
+++ b/board/helios/gpio.inc
@@ -67,6 +67,7 @@ GPIO(LED_1_L, PIN(C, 4), GPIO_OUT_HIGH) /* Yellow (hatch
GPIO(LED_2_L, PIN(C, 3), GPIO_OUT_HIGH) /* White (hatch) */
GPIO(LED_3_L, PIN(C, 2), GPIO_OUT_HIGH)
GPIO(EC_KB_BL_EN, PIN(8, 6), GPIO_OUT_LOW) /* Keyboard backlight */
+GPIO(EDP_BKLTEN_OD, PIN(D, 3), GPIO_ODR_HIGH) /* Display backlight */
GPIO(EN_PP5000_FAN, PIN(6, 1), GPIO_OUT_LOW)
/* I2C pins - Alternate function below configures I2C module on these pins */
diff --git a/board/kindred/gpio.inc b/board/kindred/gpio.inc
index 63ac5a2271..cac7cde055 100644
--- a/board/kindred/gpio.inc
+++ b/board/kindred/gpio.inc
@@ -72,6 +72,7 @@ GPIO(LED_2_L, PIN(C, 3), GPIO_OUT_HIGH) /* White (hatch)
GPIO(LED_3_L, PIN(C, 2), GPIO_OUT_HIGH)
GPIO(LED_4_L, PIN(6, 0), GPIO_OUT_HIGH)
GPIO(EC_KB_BL_EN, PIN(8, 6), GPIO_OUT_LOW) /* Keyboard backlight */
+GPIO(EDP_BKLTEN_OD, PIN(D, 3), GPIO_ODR_HIGH) /* Display backlight */
GPIO(EN_PP5000_FAN, PIN(6, 1), GPIO_OUT_LOW)
GPIO(EN_MST, PIN(9, 6), GPIO_OUT_LOW)
diff --git a/board/kohaku/gpio.inc b/board/kohaku/gpio.inc
index 257a5c493e..6aada6f60f 100644
--- a/board/kohaku/gpio.inc
+++ b/board/kohaku/gpio.inc
@@ -73,6 +73,7 @@ GPIO(LED_1_L, PIN(C, 4), GPIO_OUT_HIGH) /* Yellow (hatch
GPIO(LED_2_L, PIN(C, 3), GPIO_OUT_HIGH) /* White (hatch) */
GPIO(LED_3_L, PIN(C, 2), GPIO_OUT_HIGH)
GPIO(EC_KB_BL_EN, PIN(8, 6), GPIO_OUT_LOW) /* Keyboard backlight */
+GPIO(EDP_BKLTEN_OD, PIN(D, 3), GPIO_ODR_HIGH) /* Display backlight */
GPIO(LID_ACCEL_INT_L, PIN(5, 0), GPIO_INPUT | /* Lid accelerometer */
GPIO_SEL_1P8V)
@@ -114,7 +115,6 @@ GPIO(TP56, PIN(6, 1), GPIO_INPUT | GPIO_PULL_UP)
GPIO(TP57, PIN(8, 1), GPIO_INPUT | GPIO_PULL_UP)
GPIO(TP55, PIN(7, 3), GPIO_INPUT | GPIO_PULL_UP)
GPIO(TP59, PIN(B, 0), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(TP64, PIN(D, 3), GPIO_INPUT | GPIO_PULL_UP)
/* Keyboard pins */
#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP)
diff --git a/include/config.h b/include/config.h
index f6d8792021..9c88792f12 100644
--- a/include/config.h
+++ b/include/config.h
@@ -326,8 +326,8 @@
* Support controlling the display backlight based on the state of the lid
* switch. The EC will disable the backlight when the lid is closed.
*
- * The GPIO should be named GPIO_BACKLIGHT_ENABLED if active high, or
- * GPIO_BACKLIGHT_ENABLED_L if active low. See CONFIG_BACKLIGHT_LID_ACTIVE_LOW.
+ * The GPIO should be named GPIO_ENABLE_BACKLIGHT if active high, or
+ * GPIO_ENABLE_BACKLIGHT_L if active low. See CONFIG_BACKLIGHT_LID_ACTIVE_LOW.
*/
#undef CONFIG_BACKLIGHT_LID