Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 393cc1ce authored by Mika Westerberg's avatar Mika Westerberg Committed by Wolfram Sang
Browse files

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: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 8a86c3ae
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -102,7 +102,7 @@ static int acpi_i2c_add_resource(struct acpi_resource *ares, void *data)
		struct acpi_resource_i2c_serialbus *sb;
		struct acpi_resource_i2c_serialbus *sb;


		sb = &ares->data.i2c_serial_bus;
		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;
			info->addr = sb->slave_address;
			if (sb->access_mode == ACPI_I2C_10BIT_MODE)
			if (sb->access_mode == ACPI_I2C_10BIT_MODE)
				info->flags |= I2C_CLIENT_TEN;
				info->flags |= I2C_CLIENT_TEN;