summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKashyap Nanavati <kashyap.nanavati@intel.com>2019-03-03 21:42:53 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-03-06 06:51:39 -0800
commit9941542d3563a79533185f0892a5a19c5f25e29b (patch)
tree1cc06b7149fea5a4f96f3d354296df6450d5bd0a
parent9b3355b2f3fdc921b72a35a7bb2ae6cfe7395faa (diff)
downloadchrome-ec-9941542d3563a79533185f0892a5a19c5f25e29b.tar.gz
hatch : Add volume buttons functionality
Enable config and gpio changes for volume buttons BUG=b:122799547 BRANCH=none TEST=gpioget shows volume UP/DOWN gpios and while pressing/releasing the button observed log messages on EC console ('Volume Up' was released/pressed) Also, we need to do the rework(volume down should be reroute to gpio93 from gpio57) on proto boards before testing. still no change in audio volume Change-Id: I8fae622550508eb3ab92f8c3b8a11d10d5ecbcee Signed-off-by: Kashyap Nanavati <kashyap.nanavati@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1504122 Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
-rw-r--r--board/hatch/board.c1
-rw-r--r--board/hatch/board.h5
-rw-r--r--board/hatch/gpio.inc10
3 files changed, 10 insertions, 6 deletions
diff --git a/board/hatch/board.c b/board/hatch/board.c
index cae726e504..c4178f4169 100644
--- a/board/hatch/board.c
+++ b/board/hatch/board.c
@@ -7,6 +7,7 @@
#include "adc.h"
#include "adc_chip.h"
+#include "button.h"
#include "common.h"
#include "driver/accel_bma2x2.h"
#include "driver/accelgyro_bmi160.h"
diff --git a/board/hatch/board.h b/board/hatch/board.h
index f5730cccec..7ee08f8d1e 100644
--- a/board/hatch/board.h
+++ b/board/hatch/board.h
@@ -48,6 +48,11 @@
#define CONFIG_ALS_OPT3001
#define OPT3001_I2C_ADDR OPT3001_I2C_ADDR1
+/* Volume Button feature */
+#define CONFIG_VOLUME_BUTTONS
+#define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL
+#define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_BTN_ODL
+
/* Fan features */
#define CONFIG_FANS 1
#undef CONFIG_FAN_INIT_SPEED
diff --git a/board/hatch/gpio.inc b/board/hatch/gpio.inc
index 8400b570ca..f7a15e04ef 100644
--- a/board/hatch/gpio.inc
+++ b/board/hatch/gpio.inc
@@ -35,12 +35,10 @@ GPIO_INT(USB_C0_BC12_INT_ODL, PIN(9, 5), GPIO_INT_FALLING, bc12_interrupt)
GPIO_INT(USB_C1_BC12_INT_ODL, PIN(E, 4), GPIO_INT_FALLING, bc12_interrupt)
GPIO_INT(HDMI_CONN_HPD, PIN(7, 2), GPIO_INT_BOTH, hdmi_hpd_interrupt)
-/*
- * This signal is not used by the EC for MST control, but leaving it here as an
- * input as it may be useful for debugging/hw validation purposes. This can
- * removed when EVT units are available.
- */
-GPIO(TCPC_USB_C1_HPD, PIN(9, 3), GPIO_INPUT)
+
+/* Volume button interrupts */
+GPIO_INT(EC_VOLDN_BTN_ODL, PIN(9, 3), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt)
+GPIO_INT(EC_VOLUP_BTN_ODL, PIN(7, 5), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt)
GPIO(SYS_RESET_L, PIN(0, 2), GPIO_ODR_HIGH) /* SYS_RST_ODL */
GPIO(ENTERING_RW, PIN(E, 3), GPIO_OUT_LOW) /* EC_ENTERING_RW */