mb/google/nissa/var/uldren: Add fw_config probe for touchscreen

Use fw_config to probe touchscreen.

BUG=b:283199751
BRANCH=firmware-nissa-15217.B
TEST=emerge-nissa coreboot chromeos-bootimage

Change-Id: I5d8129b3af3aa09e5bc31160de82d9ef7af0dd59
Signed-off-by: Dtrain Hsu <dtrain_hsu@compal.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/75335
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-by: Derek Huang <derekhuang@google.com>
This commit is contained in:
Dtrain Hsu 2023-05-18 17:28:42 +08:00 committed by Felix Held
parent b7dc12dc6c
commit a6d337badf
2 changed files with 55 additions and 5 deletions

View File

@ -1,3 +1,15 @@
fw_config
field TOUCHSCREEN 10 12
option TOUCHSCREEN_UNKNOWN 0
option TOUCHSCREEN_NONE 1
option TOUCHSCREEN_EKTH7D18 2
option TOUCHSCREEN_GT7996F 3
option TOUCHSCREEN_EKTH5012 4
option TOUCHSCREEN_WDT8752A 5
option TOUCHSCREEN_GTCH7502 6
end
end
chip soc/intel/alderlake
register "sagv" = "SaGv_Enabled"
@ -159,7 +171,10 @@ chip soc/intel/alderlake
register "generic.enable_delay_ms" = "1"
register "generic.has_power_resource" = "1"
register "hid_desc_reg_offset" = "0x20"
device i2c 2c on end
device i2c 2c on
probe TOUCHSCREEN TOUCHSCREEN_UNKNOWN
probe TOUCHSCREEN TOUCHSCREEN_WDT8752A
end
end
chip drivers/i2c/generic
register "hid" = ""ELAN0001""
@ -175,7 +190,10 @@ chip soc/intel/alderlake
register "enable_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_C0)"
register "enable_delay_ms" = "1"
register "has_power_resource" = "1"
device i2c 10 on end
device i2c 10 on
probe TOUCHSCREEN TOUCHSCREEN_UNKNOWN
probe TOUCHSCREEN TOUCHSCREEN_EKTH5012
end
end
chip drivers/i2c/hid
register "generic.hid" = ""ELAN900C""
@ -191,7 +209,10 @@ chip soc/intel/alderlake
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_UNKNOWN
probe TOUCHSCREEN TOUCHSCREEN_EKTH7D18
end
end
chip drivers/i2c/hid
register "generic.hid" = ""GXTP7996""
@ -206,7 +227,10 @@ chip soc/intel/alderlake
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_UNKNOWN
probe TOUCHSCREEN TOUCHSCREEN_GT7996F
end
end
chip drivers/i2c/hid
register "generic.hid" = ""GTCH7502""
@ -221,7 +245,10 @@ chip soc/intel/alderlake
register "generic.enable_delay_ms" = "30"
register "generic.has_power_resource" = "1"
register "hid_desc_reg_offset" = "0x01"
device i2c 40 on end
device i2c 40 on
probe TOUCHSCREEN TOUCHSCREEN_UNKNOWN
probe TOUCHSCREEN TOUCHSCREEN_GTCH7502
end
end
end
device ref i2c3 on

View File

@ -1,8 +1,31 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <baseboard/gpio.h>
#include <baseboard/variants.h>
#include <console/console.h>
#include <sar.h>
static const struct pad_config touchscreen_disable_pads[] = {
/* C0 : SMBCLK ==> EN_PP3300_TCHSCR_X */
PAD_NC(GPP_C0, NONE),
/* C1 : SMBDATA ==> TCHSCR_RST_L */
PAD_NC(GPP_C1, NONE),
/* H6 : I2C1_SDA ==> SOC_I2C_TCHSCR_SDA */
PAD_NC(GPP_H6, NONE),
/* H7 : I2C1_SCL ==> SOC_I2C_TCHSCR_SCL */
PAD_NC(GPP_H7, NONE),
};
const char *get_wifi_sar_cbfs_filename(void)
{
return "wifi_sar_0.hex";
}
void fw_config_gpio_padbased_override(struct pad_config *padbased_table)
{
if (fw_config_probe(FW_CONFIG(TOUCHSCREEN, TOUCHSCREEN_NONE))) {
printk(BIOS_INFO, "Disable touchscreen GPIO pins.\n");
gpio_padbased_override(padbased_table, touchscreen_disable_pads,
ARRAY_SIZE(touchscreen_disable_pads));
}
}