]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
i2c: designware: Some broken DSTDs use 1MiHz instead of 1MHz
authorHans de Goede <hdegoede@redhat.com>
Thu, 13 Jul 2017 13:45:02 +0000 (15:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Aug 2017 20:46:51 +0000 (13:46 -0700)
commit 682c6c2188f39d13548ccdc89c9888fbcb547889 upstream.

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.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/busses/i2c-designware-platdrv.c

index d1263b82d646a1524697b38e2f63b31bd14f153d..0703da1d946a7a21d9345144e45efabc80ab5daa 100644 (file)
@@ -254,6 +254,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.