summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDtrain Hsu <dtrain_hsu@compal.corp-partner.google.com>2019-03-08 14:39:00 +0800
committerPatrick Georgi <pgeorgi@google.com>2019-03-27 08:23:30 +0000
commit12724d6ad6fd6ab0ca8ea5d258c0ca7cce807441 (patch)
tree17f2d8d05b9876dd4fc4161ce67db35d4b916350
parent5f0f045da820d9fb72b6c82a4c5a8991b0039444 (diff)
mb/google/hatch: Add GPIO_A8 for Pen detect function
Add GPIO_A8 for pen detect function. BUG=b:122765828 TEST=flash BIOS and using switch to verify GPIO_A8 value change. Signed-off-by: Dtrain Hsu <dtrain_hsu@compal.corp-partner.google.com> Change-Id: Ie7c888ea61dd61e60c1d184565bd95e6b03777be Reviewed-on: https://review.coreboot.org/c/coreboot/+/31815 Reviewed-by: Furquan Shaikh <furquan@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/mainboard/google/hatch/Kconfig1
-rw-r--r--src/mainboard/google/hatch/variants/baseboard/devicetree.cb12
-rw-r--r--src/mainboard/google/hatch/variants/baseboard/gpio.c4
3 files changed, 14 insertions, 3 deletions
diff --git a/src/mainboard/google/hatch/Kconfig b/src/mainboard/google/hatch/Kconfig
index 19c71841b2..b551065ea0 100644
--- a/src/mainboard/google/hatch/Kconfig
+++ b/src/mainboard/google/hatch/Kconfig
@@ -2,6 +2,7 @@
config BOARD_GOOGLE_BASEBOARD_HATCH
def_bool n
select BOARD_ROMSIZE_KB_32768
+ select DRIVERS_GENERIC_GPIO_KEYS
select DRIVERS_GENERIC_MAX98357A
select DRIVERS_I2C_GENERIC
select DRIVERS_I2C_HID
diff --git a/src/mainboard/google/hatch/variants/baseboard/devicetree.cb b/src/mainboard/google/hatch/variants/baseboard/devicetree.cb
index 0399dc1709..bda6e2adfc 100644
--- a/src/mainboard/google/hatch/variants/baseboard/devicetree.cb
+++ b/src/mainboard/google/hatch/variants/baseboard/devicetree.cb
@@ -236,7 +236,17 @@ chip soc/intel/cannonlake
device i2c 49 on end
end
end # I2C #1
- device pci 15.2 on end # I2C #2
+ device pci 15.2 on
+ chip drivers/generic/gpio_keys
+ register "name" = ""PENH""
+ register "gpio" = "ACPI_GPIO_INPUT_ACTIVE_HIGH(GPP_A8)"
+ register "key.dev_name" = ""EJCT""
+ register "key.linux_code" = "SW_PEN_INSERTED"
+ register "key.linux_input_type" = "EV_SW"
+ register "key.label" = ""pen_eject""
+ device generic 0 on end
+ end
+ end # I2C #2
device pci 15.3 on
chip drivers/i2c/sx9310
register "desc" = ""SAR Proximity Sensor""
diff --git a/src/mainboard/google/hatch/variants/baseboard/gpio.c b/src/mainboard/google/hatch/variants/baseboard/gpio.c
index 73d6645c71..3d6be33682 100644
--- a/src/mainboard/google/hatch/variants/baseboard/gpio.c
+++ b/src/mainboard/google/hatch/variants/baseboard/gpio.c
@@ -30,8 +30,8 @@ static const struct pad_config gpio_table[] = {
PAD_CFG_GPI_APIC(GPP_A6, NONE, DEEP, LEVEL, NONE),
/* A7 : PP3300_SOC_A */
PAD_NC(GPP_A7, NONE),
- /* A8 : EMR_GARAGE_DET ==> NC */
- PAD_NC(GPP_A8, NONE),
+ /* A8 : EMR_GARAGE_DET */
+ PAD_CFG_GPI_GPIO_DRIVER(GPP_A8, NONE, DEEP),
/* A9 : ESPI_CLK */
/* A10 : PEN_RESET_ODL */
PAD_NC(GPP_A10, NONE),