Skip to content

Commit

Permalink
i2c: designware: Some broken DSTDs use 1MiHz instead of 1MHz
Browse files Browse the repository at this point in the history
At least the Acer Iconia Tab8 / aka W1-810 uses 1MiHz instead of
1MHz for one of its busses, fix this up to 1MHz instead of failing
the probe of that bus.

This fixes the accelerometer on the Acer Iconia Tab8 not working.

Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Hans de Goede authored and Wolfram Sang committed Jul 31, 2017
1 parent 22acc37 commit 682c6c2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/i2c/busses/i2c-designware-platdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
}

acpi_speed = i2c_acpi_find_bus_speed(&pdev->dev);
/* Some broken DSTDs use 1MiHz instead of 1MHz */
if (acpi_speed == 1048576)
acpi_speed = 1000000;
/*
* Find bus speed from the "clock-frequency" device property, ACPI
* or by using fast mode if neither is set.
Expand Down

0 comments on commit 682c6c2

Please sign in to comment.