From 67100b414799c7b90c42d506de4ababdfb47119b Mon Sep 17 00:00:00 2001 From: "peichao.wang" Date: Fri, 15 Feb 2019 10:15:23 +0800 Subject: mb/google/laser: Disable touch screen device that according to SKU ID We need disable touch screen device on laser SKU ID 6. BUG=none TEST=according to sku_id (Laser(convertible): 5, Laser14(clamshell): 6, Laser14(clamshell + touch):7) distinguish whether disable touch screen device. Signed-off-by: peichao.wang Change-Id: I6953c35a5e8c93d88fe63362156faa351e8ee71f Reviewed-on: https://review.coreboot.org/c/31428 Reviewed-by: Furquan Shaikh Tested-by: build bot (Jenkins) --- .../octopus/variants/baseboard/include/baseboard/variants.h | 3 +++ src/mainboard/google/octopus/variants/phaser/gpio.c | 10 +++++++++- src/mainboard/google/octopus/variants/phaser/variant.c | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h index 04f87968d0..96381183b8 100644 --- a/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h @@ -46,4 +46,7 @@ void variant_nhlt_init(struct nhlt *nhlt); struct device; void variant_update_devtree(struct device *dev); +/* Get no touchscreen SKU ID. */ +bool no_touchscreen_sku(uint32_t sku_id); + #endif /* BASEBOARD_VARIANTS_H */ diff --git a/src/mainboard/google/octopus/variants/phaser/gpio.c b/src/mainboard/google/octopus/variants/phaser/gpio.c index 322b44b205..6883ab0831 100644 --- a/src/mainboard/google/octopus/variants/phaser/gpio.c +++ b/src/mainboard/google/octopus/variants/phaser/gpio.c @@ -68,13 +68,21 @@ static const struct pad_config sku1_default_override_table[] = { PAD_NC(GPIO_214, DN_20K), }; +bool no_touchscreen_sku(uint32_t sku_id) +{ + if ((sku_id == 1) || (sku_id == 6)) + return true; + else + return false; +} + const struct pad_config *variant_override_gpio_table(size_t *num) { const struct pad_config *c; uint32_t sku_id = SKU_UNKNOWN; google_chromeec_cbi_get_sku_id(&sku_id); - if (sku_id == 1) { + if (no_touchscreen_sku(sku_id)) { c = sku1_default_override_table; *num = ARRAY_SIZE(sku1_default_override_table); } else { diff --git a/src/mainboard/google/octopus/variants/phaser/variant.c b/src/mainboard/google/octopus/variants/phaser/variant.c index 22f4f71b92..eb080f025f 100644 --- a/src/mainboard/google/octopus/variants/phaser/variant.c +++ b/src/mainboard/google/octopus/variants/phaser/variant.c @@ -30,8 +30,8 @@ void variant_update_devtree(struct device *dev) if (touchscreen_i2c_host == NULL) return; - /* SKU ID 1 does not have a touchscreen device, hence disable it. */ + /* SKU ID 1, 6 does not have a touchscreen device, hence disable it. */ google_chromeec_cbi_get_sku_id(&sku_id); - if (sku_id == 1) + if (no_touchscreen_sku(sku_id)) touchscreen_i2c_host->enabled = 0; } -- cgit v1.2.3