diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/i2c/generic/chip.h | 9 | ||||
-rw-r--r-- | src/drivers/i2c/generic/generic.c | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/drivers/i2c/generic/chip.h b/src/drivers/i2c/generic/chip.h index 84657d5241..d84097f6c6 100644 --- a/src/drivers/i2c/generic/chip.h +++ b/src/drivers/i2c/generic/chip.h @@ -10,6 +10,15 @@ struct drivers_i2c_generic_config { unsigned wake; /* Wake GPE */ struct acpi_irq irq; /* Interrupt */ + /* + * This flag will add a device propery which will indicate + * to the OS that it should probe this device before adding it. + * + * This can be used to declare a device that may not exist on + * the board, for example to support multiple trackpad vendors. + */ + int probed; + /* GPIO used to indicate if this device is present */ unsigned device_present_gpio; unsigned device_present_gpio_invert; diff --git a/src/drivers/i2c/generic/generic.c b/src/drivers/i2c/generic/generic.c index 62e2e9a813..30a280bcff 100644 --- a/src/drivers/i2c/generic/generic.c +++ b/src/drivers/i2c/generic/generic.c @@ -35,6 +35,7 @@ static void i2c_generic_fill_ssdt(struct device *dev) .speed = config->speed ? : I2C_SPEED_FAST, .resource = scope, }; + struct acpi_dp *dsd = NULL; if (!dev->enabled || !scope) return; @@ -65,6 +66,12 @@ static void i2c_generic_fill_ssdt(struct device *dev) acpigen_write_PRW(config->wake, 3); } + if (config->probed) { + dsd = acpi_dp_new_table("_DSD"); + acpi_dp_add_integer(dsd, "linux,probed", 1); + acpi_dp_write(dsd); + } + acpigen_pop_len(); /* Device */ acpigen_pop_len(); /* Scope */ |