diff options
-rw-r--r-- | src/drivers/i2c/generic/chip.h | 6 | ||||
-rw-r--r-- | src/drivers/i2c/generic/generic.c | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/drivers/i2c/generic/chip.h b/src/drivers/i2c/generic/chip.h index c5d458b6ee..8b285f054c 100644 --- a/src/drivers/i2c/generic/chip.h +++ b/src/drivers/i2c/generic/chip.h @@ -19,6 +19,8 @@ #include <arch/acpi_device.h> #include <device/i2c_simple.h> +#define MAX_GENERIC_PROPERTY_LIST 10 + struct drivers_i2c_generic_config { const char *hid; /* ACPI _HID (required) */ const char *cid; /* ACPI _CID */ @@ -59,6 +61,10 @@ struct drivers_i2c_generic_config { struct acpi_gpio enable_gpio; /* Delay to be inserted after device is enabled. */ unsigned enable_delay_ms; + + /* Generic properties for exporting device-specific data to the OS */ + struct acpi_dp property_list[MAX_GENERIC_PROPERTY_LIST]; + int property_count; }; /* diff --git a/src/drivers/i2c/generic/generic.c b/src/drivers/i2c/generic/generic.c index b7a535e47f..fa27b0e9fd 100644 --- a/src/drivers/i2c/generic/generic.c +++ b/src/drivers/i2c/generic/generic.c @@ -116,7 +116,8 @@ void i2c_generic_fill_ssdt(struct device *dev, } /* DSD */ - if (config->probed || (reset_gpio_index != -1) || + if (config->probed || config->property_count || + (reset_gpio_index != -1) || (enable_gpio_index != -1) || (irq_gpio_index != -1)) { dsd = acpi_dp_new_table("_DSD"); if (config->probed) @@ -134,6 +135,9 @@ void i2c_generic_fill_ssdt(struct device *dev, acpi_dp_add_gpio(dsd, "enable-gpios", path, enable_gpio_index, 0, config->enable_gpio.polarity); + /* Add generic property list */ + acpi_dp_add_property_list(dsd, config->property_list, + config->property_count); acpi_dp_write(dsd); } |