]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: designware: Adjust bus speed independently of ACPI
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 23 Jun 2020 09:15:01 +0000 (12:15 +0300)
committerWolfram Sang <wsa@kernel.org>
Tue, 23 Jun 2020 19:24:33 +0000 (21:24 +0200)
commitb1346fc1d135b2e2cbe324cfd18848b50cd6fc95
tree992d967c2a5481f76401b1d39736d4ef1b534a0b
parent239bea99f45907d04135ef7b506467c1835f59f6
i2c: designware: Adjust bus speed independently of ACPI

John Stultz reported that commit ae0f0cc06108a ("i2c: designware: Move
ACPI parts into common module") caused a regression on the HiKey board
where adv7511 HDMI bridge driver wasn't probing anymore due the I2C bus
failed to start.

It seems the change caused the bus speed being zero when CONFIG_ACPI
not set and neither speed based on "clock-frequency" device property
or default fast mode is set.

Fix this by splitting i2c_dw_acpi_adjust_bus_speed() to
i2c_dw_acpi_round_bus_speed() and i2c_dw_adjust_bus_speed(), where
the latter one has the code that runs independently of ACPI.

Fixes: ae0f0cc06108a ("i2c: designware: Move ACPI parts into common module")
Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-designware-common.c
drivers/i2c/busses/i2c-designware-core.h
drivers/i2c/busses/i2c-designware-pcidrv.c
drivers/i2c/busses/i2c-designware-platdrv.c