diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2014-12-29 15:48:48 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2015-01-14 11:56:06 +0100 |
commit | 393cc1ceb96648f842eb81f41f8f56d1eba9b637 (patch) | |
tree | b06047887d17030b0dd8b541035da56755a22742 /drivers/i2c | |
parent | 8a86c3aee0cfec09b35159da9d925157f3e4f2cc (diff) | |
download | linux-393cc1ceb96648f842eb81f41f8f56d1eba9b637.tar.gz linux-393cc1ceb96648f842eb81f41f8f56d1eba9b637.tar.bz2 linux-393cc1ceb96648f842eb81f41f8f56d1eba9b637.zip |
i2c: ACPI: Pick the first address if device has multiple
ACPI specification allows I2C devices with multiple addresses. The current
implementation goes over all addresses and assigns the last one to the
device. This is typically not the primary address of the device.
Instead of doing that we assign the first address to the device and then
let the driver handle rest of the addresses as it wishes.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/i2c-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 393bb0e8c8f2..79ac8605936d 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -102,7 +102,7 @@ static int acpi_i2c_add_resource(struct acpi_resource *ares, void *data) struct acpi_resource_i2c_serialbus *sb; sb = &ares->data.i2c_serial_bus; - if (sb->type == ACPI_RESOURCE_SERIAL_TYPE_I2C) { + if (!info->addr && sb->type == ACPI_RESOURCE_SERIAL_TYPE_I2C) { info->addr = sb->slave_address; if (sb->access_mode == ACPI_I2C_10BIT_MODE) info->flags |= I2C_CLIENT_TEN; |