Skip to content

Commit 4befedc

Browse files
Ard Biesheuvelherbertx
authored andcommitted
i2c: acpi: permit bus speed to be discovered after enumeration
Currently, the I2C ACPI enumeration code only permits the max bus rate to be discovered before enumerating the slaves on the bus. In some cases, drivers for slave devices may require this information, e.g., some ATmel crypto drivers need to generate a so-called wake token of a fixed duration, regardless of the bus rate. So tweak the code so i2c_acpi_lookup_speed() is able to obtain this information after enumeration as well. Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 8a82451 commit 4befedc

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎drivers/i2c/i2c-core-acpi.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ static int i2c_acpi_do_lookup(struct acpi_device *adev,
115115
struct list_head resource_list;
116116
int ret;
117117

118-
if (acpi_bus_get_status(adev) || !adev->status.present ||
119-
acpi_device_enumerated(adev))
118+
if (acpi_bus_get_status(adev) || !adev->status.present)
120119
return -EINVAL;
121120

122121
if (acpi_match_device_ids(adev, i2c_acpi_ignored_device_ids) == 0)
@@ -151,6 +150,9 @@ static int i2c_acpi_get_info(struct acpi_device *adev,
151150
lookup.info = info;
152151
lookup.index = -1;
153152

153+
if (acpi_device_enumerated(adev))
154+
return -EINVAL;
155+
154156
ret = i2c_acpi_do_lookup(adev, &lookup);
155157
if (ret)
156158
return ret;

0 commit comments

Comments
 (0)