drivers/i2c/generic: Drop 'disable_gpio_export_in_crs' flag
Exposing the GPIOs via an ACPI PowerResource and the _CRS results in the OS driver and ACPI thinking they own the GPIO. This can cause timing problems because it's not clear which system should be controlling the GPIO. Previously, we flagged as an error any device which set the 'has_power_resource' flag but did not set 'disable_gpio_export_in_crs.' There's no reason to require explicit disablement however, so drop the superfluous 'disable' flag, and change the _CRS generation to check if the GPIOs will be exported via the 'has_power_resource' flag instead. BUG=b:265055477 TEST=build/boot skyrim, dump SSDT and verify touchscreen GPIOs only listed under PRx, not under _CRS. Change-Id: I837ae6c6fe4b8e1c4e10686406cba06bdb7759d2 Signed-off-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/71849 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <gaumless@gmail.com>
This commit is contained in:
committed by
Martin L Roth
parent
2e6c55946c
commit
4902e9b35f
@@ -46,9 +46,6 @@ struct drivers_i2c_generic_config {
|
||||
unsigned int device_present_gpio;
|
||||
unsigned int device_present_gpio_invert;
|
||||
|
||||
/* Disable reset and enable GPIO export in _CRS */
|
||||
bool disable_gpio_export_in_crs;
|
||||
|
||||
/* Does the device have a power resource? */
|
||||
bool has_power_resource;
|
||||
|
||||
|
@@ -17,10 +17,10 @@ static bool i2c_generic_add_gpios_to_crs(struct drivers_i2c_generic_config *cfg)
|
||||
{
|
||||
/*
|
||||
* Return false if:
|
||||
* 1. Request to explicitly disable export of GPIOs in CRS, or
|
||||
* 1. GPIOs are exported via a power resource, or
|
||||
* 2. Both reset and enable GPIOs are not provided.
|
||||
*/
|
||||
if (cfg->disable_gpio_export_in_crs ||
|
||||
if (cfg->has_power_resource ||
|
||||
((cfg->reset_gpio.pin_count == 0) &&
|
||||
(cfg->enable_gpio.pin_count == 0)))
|
||||
return false;
|
||||
@@ -77,16 +77,6 @@ void i2c_generic_fill_ssdt(const struct device *dev,
|
||||
}
|
||||
}
|
||||
|
||||
if (config->has_power_resource && !config->disable_gpio_export_in_crs) {
|
||||
/*
|
||||
* This case will most likely cause timing problems. The OS driver might be
|
||||
* controlling the GPIOs, but the ACPI Power Resource will also be controlling
|
||||
* them. This will result in the two fighting and stomping on each other.
|
||||
*/
|
||||
printk(BIOS_ERR, "%s: Exposing GPIOs in Power Resource and _CRS\n",
|
||||
dev_path(dev));
|
||||
}
|
||||
|
||||
/* Device */
|
||||
acpigen_write_scope(scope);
|
||||
acpigen_write_device(acpi_device_name(dev));
|
||||
|
Reference in New Issue
Block a user