shkim has uploaded this change for review. ( https://review.coreboot.org/23010
Change subject: mb/google/poppy/variants/nautilus: enable digitizer pen device ......................................................................
mb/google/poppy/variants/nautilus: enable digitizer pen device
- Add pen device property into devicetree.cb. - Add new ACPI device for pen eject event. It will be used by OS.
BUG=none BRANCH=master TEST=emerge-nautilus coreboot and check pen device operation Signed-off-by: sh.kim sh_.kim@samsung.com
Change-Id: I050671c8b46fd92b1dd9164be2646727cd67da9f --- M src/mainboard/google/poppy/Kconfig M src/mainboard/google/poppy/dsdt.asl M src/mainboard/google/poppy/variants/nautilus/devicetree.cb M src/mainboard/google/poppy/variants/nautilus/gpio.c A src/mainboard/google/poppy/variants/nautilus/include/variant/acpi/pen_eject.asl M src/mainboard/google/poppy/variants/nautilus/include/variant/gpio.h 6 files changed, 61 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/23010/1
diff --git a/src/mainboard/google/poppy/Kconfig b/src/mainboard/google/poppy/Kconfig index 9315d96..f0bad35 100644 --- a/src/mainboard/google/poppy/Kconfig +++ b/src/mainboard/google/poppy/Kconfig @@ -115,6 +115,11 @@ select SPI_TPM select TPM2
+# Select this option to add an ACPI device for pen eject event on the variant. +config VARIANT_HAS_PEN_EJECT_ACPI + bool + default n + config VARIANT_SPECIFIC_OPTIONS_POPPY def_bool n select DRIVERS_I2C_MAX98927 @@ -137,6 +142,7 @@ select DRIVERS_I2C_DA7219 select DRIVERS_PS2_KEYBOARD select VARIANT_HAS_I2C_TPM if !VBOOT_MOCK_SECDATA + select VARIANT_HAS_PEN_EJECT_ACPI
config VARIANT_SPECIFIC_OPTIONS_SORAKA def_bool n diff --git a/src/mainboard/google/poppy/dsdt.asl b/src/mainboard/google/poppy/dsdt.asl index a922d10..2634f31 100644 --- a/src/mainboard/google/poppy/dsdt.asl +++ b/src/mainboard/google/poppy/dsdt.asl @@ -73,5 +73,10 @@ { /* Dynamic Platform Thermal Framework */ #include <variant/acpi/dptf.asl> + +#if IS_ENABLED(CONFIG_VARIANT_HAS_PEN_EJECT_ACPI) + /* Pen eject event */ + #include <variant/acpi/pen_eject.asl> +#endif } } diff --git a/src/mainboard/google/poppy/variants/nautilus/devicetree.cb b/src/mainboard/google/poppy/variants/nautilus/devicetree.cb index a548ac9..d74588d 100644 --- a/src/mainboard/google/poppy/variants/nautilus/devicetree.cb +++ b/src/mainboard/google/poppy/variants/nautilus/devicetree.cb @@ -308,7 +308,20 @@ end end # I2C #1 device pci 15.2 on end # I2C #2 - device pci 15.3 on end # I2C #3 + device pci 15.3 on + chip drivers/i2c/hid + register "generic.hid" = ""ACPI0C50"" + register "generic.cid" = ""PNP0C50"" + register "generic.desc" = ""Digitizer device"" + register "generic.irq" = "ACPI_IRQ_LEVEL_LOW(GPP_A22_IRQ)" + register "generic.enable_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_C9)" + register "generic.has_power_resource" = "1" + register "generic.disable_gpio_export_in_crs" = "1" + register "generic.wake" = "GPE0_DW0_21" + register "hid_desc_reg_offset" = "0x1" + device i2c 0x9 on end + end + end # I2C #3 device pci 16.0 on end # Management Engine Interface 1 device pci 16.1 off end # Management Engine Interface 2 device pci 16.2 off end # Management Engine IDE-R diff --git a/src/mainboard/google/poppy/variants/nautilus/gpio.c b/src/mainboard/google/poppy/variants/nautilus/gpio.c index ca05ae9..2a76fd1 100644 --- a/src/mainboard/google/poppy/variants/nautilus/gpio.c +++ b/src/mainboard/google/poppy/variants/nautilus/gpio.c @@ -130,7 +130,7 @@ /* C8 : UART0_RXD ==> NC */ PAD_CFG_NC(GPP_C8), /* C9 : UART0_TXD ==> CHP3_P3.3V_DX_DIG_EN */ - PAD_CFG_GPO(GPP_C9, 1, DEEP), + PAD_CFG_GPO(GPP_C9, 0, DEEP), /* C10 : UART0_RTS# ==> CHP3_CAM_PMIC_RST_L */ PAD_CFG_GPO(GPP_C10, 1, DEEP), /* C11 : UART0_CTS# ==> CHP3_P3.3V_DX_CAM_EN */ diff --git a/src/mainboard/google/poppy/variants/nautilus/include/variant/acpi/pen_eject.asl b/src/mainboard/google/poppy/variants/nautilus/include/variant/acpi/pen_eject.asl new file mode 100644 index 0000000..ffe2f03 --- /dev/null +++ b/src/mainboard/google/poppy/variants/nautilus/include/variant/acpi/pen_eject.asl @@ -0,0 +1,33 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2017 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ +Device (PENH) +{ + Name (_HID, "PRP0001") + + Name (_CRS, ResourceTemplate () { + GpioIo (Exclusive, PullNone, 0, 0, IoRestrictionInputOnly, + "\_SB.PCI0.GPIO", 0, ResourceConsumer) { GPIO_DIG_EJECT } + }) + + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package () { + "compatible", + Package () { "gpio-keys"} + }, + } + }) +} diff --git a/src/mainboard/google/poppy/variants/nautilus/include/variant/gpio.h b/src/mainboard/google/poppy/variants/nautilus/include/variant/gpio.h index 4f79495..98f6d6e 100644 --- a/src/mainboard/google/poppy/variants/nautilus/include/variant/gpio.h +++ b/src/mainboard/google/poppy/variants/nautilus/include/variant/gpio.h @@ -18,4 +18,6 @@
#include <baseboard/gpio.h>
+#define GPIO_DIG_EJECT GPP_B19 + #endif /* __MAINBOARD_GPIO_H__ */