diff options
author | Ted Kuo <tedkuo@ami.com.tw> | 2015-04-16 15:37:58 +0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-04-17 01:07:37 +0000 |
commit | edd4022a94fd6059d23f0ceda80a2c56eb9a50a3 (patch) | |
tree | 9830abfc5a36e474b2323e868c8de1e324af35c9 | |
parent | 5a148c83344f16607115a3ca6c566a3f0bfb6712 (diff) | |
download | chrome-ec-edd4022a94fd6059d23f0ceda80a2c56eb9a50a3.tar.gz |
Sumo: Implement brightness buttons
Add brightness up/down button to control display panel backlight.
BUG=chrome-os-partner:39182
TEST=Compiled, verified
BRANCH=None
Signed-off-by: Ted Kuo <tedkuo@ami.com.tw>
Change-Id: I817297137d9e318603362767620f153af58b988d
Reviewed-on: https://chromium-review.googlesource.com/265848
Reviewed-by: Mohammed Habibulla <moch@google.com>
Commit-Queue: Ted Kuo <tedkuo@ami.com.tw>
Tested-by: Ted Kuo <tedkuo@ami.com.tw>
-rw-r--r-- | board/sumo/board.c | 14 | ||||
-rw-r--r-- | board/sumo/board.h | 3 | ||||
-rw-r--r-- | common/keyboard_8042.c | 2 | ||||
-rw-r--r-- | include/button.h | 2 |
4 files changed, 21 insertions, 0 deletions
diff --git a/board/sumo/board.c b/board/sumo/board.c index 455f5c1fa3..62194eec16 100644 --- a/board/sumo/board.c +++ b/board/sumo/board.c @@ -7,6 +7,7 @@ #include "adc.h" #include "adc_chip.h" #include "backlight.h" +#include "button.h" #include "charge_state.h" #include "charger.h" #include "common.h" @@ -66,6 +67,10 @@ const struct gpio_info gpio_list[] = { {"UART0_RX", LM4_GPIO_A, (1<<0), GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, uart_deepsleep_interrupt}, + {"BUTTON_BRIGHTNESS_DOWN_L", LM4_GPIO_M, (1<<6), GPIO_INT_BOTH, + button_interrupt}, + {"BUTTON_BRIGHTNESS_UP_L", LM4_GPIO_J, (1<<5), GPIO_INT_BOTH, + button_interrupt}, /* Other inputs */ {"BOARD_VERSION1", LM4_GPIO_Q, (1<<5), GPIO_INPUT, NULL}, @@ -196,3 +201,12 @@ struct ec_thermal_config thermal_params[] = { {{0, 0, 0}, 0, 0}, }; BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); + +const struct button_config buttons[] = { + {"Brightness Down", KEYBOARD_BUTTON_BRIGHTNESS_DOWN, + GPIO_BUTTON_BRIGHTNESS_DOWN_L, 30 * MSEC, 0}, + {"Brightness Up", KEYBOARD_BUTTON_BRIGHTNESS_UP, + GPIO_BUTTON_BRIGHTNESS_UP_L, 30 * MSEC, 0}, +}; +BUILD_ASSERT(ARRAY_SIZE(buttons) == CONFIG_BUTTON_COUNT); + diff --git a/board/sumo/board.h b/board/sumo/board.h index 9071991087..553bcbdb9c 100644 --- a/board/sumo/board.h +++ b/board/sumo/board.h @@ -12,6 +12,7 @@ #define CONFIG_AP_HANG_DETECT #define CONFIG_BACKLIGHT_LID #define CONFIG_BOARD_VERSION +#define CONFIG_BUTTON_COUNT 2 #define CONFIG_CHIPSET_BAYTRAIL #define CONFIG_CHIPSET_CAN_THROTTLE #define CONFIG_CHIPSET_X86 @@ -78,6 +79,8 @@ enum gpio_signal { GPIO_WP_L, /* Write protect input */ GPIO_JTAG_TCK, /* JTAG clock input */ GPIO_UART0_RX, /* UART0 RX input */ + GPIO_BUTTON_BRIGHTNESS_DOWN_L, /* Brightness down button */ + GPIO_BUTTON_BRIGHTNESS_UP_L, /* Brightness up button */ /* Other inputs */ GPIO_BOARD_VERSION1, /* Board version stuffing resistor 1 */ diff --git a/common/keyboard_8042.c b/common/keyboard_8042.c index 0d8192b166..cdcb6d2359 100644 --- a/common/keyboard_8042.c +++ b/common/keyboard_8042.c @@ -206,6 +206,8 @@ static const struct button_8042_t buttons_8042[] = { {0xe05e, 0xe037, 0}, /* Power */ {0xe02e, 0xe021, 1}, /* Volume Down */ {0xe030, 0xe032, 1}, /* Volume Up */ + {0x40, 0x0b, 1}, /* Brightness Down */ + {0x41, 0x83, 1}, /* Brightness Up */ }; BUILD_ASSERT(ARRAY_SIZE(buttons_8042) == KEYBOARD_BUTTON_COUNT); diff --git a/include/button.h b/include/button.h index eedf7974f8..349ed178be 100644 --- a/include/button.h +++ b/include/button.h @@ -17,6 +17,8 @@ enum keyboard_button_type { KEYBOARD_BUTTON_POWER = 0, KEYBOARD_BUTTON_VOLUME_DOWN, KEYBOARD_BUTTON_VOLUME_UP, + KEYBOARD_BUTTON_BRIGHTNESS_DOWN, + KEYBOARD_BUTTON_BRIGHTNESS_UP, KEYBOARD_BUTTON_COUNT }; |