Dtrain Hsu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/56248 )
Change subject: mb/google/dedede/var/cret: Enable/disable Touchscreen based on FW_CONFIG ......................................................................
mb/google/dedede/var/cret: Enable/disable Touchscreen based on FW_CONFIG
Enable/disable Touchscreen function based on Touchscreen bit of FW_CONFIG. The Touchscreen settings are included GPIO settings.
BUG=b:xxxxxxxx BRANCH=dedede TEST=Build and test the change on cret.
Signed-off-by: Dtrain Hsu dtrain_hsu@compal.corp-partner.google.com Change-Id: Ice517c034e2dab93bb27e75dccf06d9a0936526b --- M src/mainboard/google/dedede/variants/baseboard/devicetree.cb M src/mainboard/google/dedede/variants/cret/gpio.c M src/mainboard/google/dedede/variants/cret/overridetree.cb 3 files changed, 37 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/48/56248/1
diff --git a/src/mainboard/google/dedede/variants/baseboard/devicetree.cb b/src/mainboard/google/dedede/variants/baseboard/devicetree.cb index 9064297..65dd7f8 100644 --- a/src/mainboard/google/dedede/variants/baseboard/devicetree.cb +++ b/src/mainboard/google/dedede/variants/baseboard/devicetree.cb @@ -10,6 +10,10 @@ option DB_PORTS_1C 7 option DB_PORTS_1A_HDMI_LTE 8 end + field TOUCHSCREEN 5 + option TOUCHSCREEN_ABSENT 0 + option TOUCHSCREEN_PRESENT 1 + end field TABLETMODE 10 option TABLETMODE_DISABLED 0 option TABLETMODE_ENABLED 1 diff --git a/src/mainboard/google/dedede/variants/cret/gpio.c b/src/mainboard/google/dedede/variants/cret/gpio.c index 8cff365..9908d37 100644 --- a/src/mainboard/google/dedede/variants/cret/gpio.c +++ b/src/mainboard/google/dedede/variants/cret/gpio.c @@ -77,6 +77,21 @@ PAD_NC(GPP_D18, NONE), };
+static const struct pad_config touchscreen_disable_pads[] = { + /* A11 : TOUCH_RPT_EN */ + PAD_NC(GPP_A11, NONE), + /* D4 : TOUCH_INT_ODL */ + PAD_NC(GPP_D4, NONE), + /* D5 : TOUCH_RESET_L */ + PAD_NC(GPP_D5, NONE), + /* D6 : EN_PP3300_TOUCH_S0 */ + PAD_NC(GPP_D6, NONE), + /* H4 : AP_I2C_TS_SDA */ + PAD_NC(GPP_H4, NONE), + /* H5 : AP_I2C_TS_SCL */ + PAD_NC(GPP_H5, NONE), +}; + const struct pad_config *variant_override_gpio_table(size_t *num) { *num = ARRAY_SIZE(override_gpio_table); @@ -85,11 +100,17 @@
static void fw_config_handle(void *unused) { + // Audio codec if (!fw_config_probe(FW_CONFIG(LTE, LTE_PRESENT))) gpio_configure_pads(lte_disable_pads, ARRAY_SIZE(lte_disable_pads)); if (fw_config_probe(FW_CONFIG(AUDIO_CODEC_SOURCE, AUDIO_CODEC_DA7219))) gpio_configure_pads(codec_da7219_pads, ARRAY_SIZE(codec_da7219_pads)); if (fw_config_probe(FW_CONFIG(AUDIO_CODEC_SOURCE, AUDIO_CODEC_CS42l42))) gpio_configure_pads(codec_cs42l42_pads, ARRAY_SIZE(codec_cs42l42_pads)); + + // Touchscreen + if (fw_config_probe(FW_CONFIG(TOUCHSCREEN, TOUCHSCREEN_ABSENT))) + gpio_configure_pads(touchscreen_disable_pads, + ARRAY_SIZE(touchscreen_disable_pads)); } BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL); diff --git a/src/mainboard/google/dedede/variants/cret/overridetree.cb b/src/mainboard/google/dedede/variants/cret/overridetree.cb index 8b26d5d..cf34db1 100644 --- a/src/mainboard/google/dedede/variants/cret/overridetree.cb +++ b/src/mainboard/google/dedede/variants/cret/overridetree.cb @@ -139,7 +139,9 @@ register "generic.has_power_resource" = "1" register "generic.disable_gpio_export_in_crs" = "1" register "hid_desc_reg_offset" = "0x20" - device i2c 2c on end + device i2c 2c on + probe TOUCHSCREEN TOUCHSCREEN_PRESENT + end end chip drivers/i2c/generic register "hid" = ""ELAN0001"" @@ -155,7 +157,9 @@ register "enable_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_D6)" register "enable_delay_ms" = "1" register "has_power_resource" = "1" - device i2c 10 on end + device i2c 10 on + probe TOUCHSCREEN TOUCHSCREEN_PRESENT + end end chip drivers/i2c/hid register "generic.hid" = ""ELAN900C"" @@ -173,7 +177,9 @@ register "generic.enable_delay_ms" = "6" register "generic.has_power_resource" = "1" register "hid_desc_reg_offset" = "0x01" - device i2c 16 on end + device i2c 16 on + probe TOUCHSCREEN TOUCHSCREEN_PRESENT + end end chip drivers/i2c/hid register "generic.hid" = ""GXTP7996"" @@ -191,7 +197,9 @@ register "generic.enable_delay_ms" = "10" register "generic.has_power_resource" = "1" register "hid_desc_reg_offset" = "0x01" - device i2c 5d on end + device i2c 5d on + probe TOUCHSCREEN TOUCHSCREEN_PRESENT + end end end # I2C 2 device pci 15.3 off end # I2C 3