]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: designware: don't infer timings described by ACPI from clock rate
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 19 May 2017 08:56:40 +0000 (09:56 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Fri, 19 May 2017 12:36:24 +0000 (14:36 +0200)
commitb0de83e10498f0905187dc538a29ad8d50e7357b
tree7475c97c5a420f29f4f867ddf6256a9dba75d7aa
parent42e5dccb60be15ae095647601bd210c5951ed90a
i2c: designware: don't infer timings described by ACPI from clock rate

Commit 372205e6212f1 ("i2c: designware: Get selected speed mode
sda-hold-time via ACPI") updated the logic that reads the timing
parameters for various I2C bus rates from the DSDT, to only read
the timing parameters for the currently selected mode.

This causes a WARN_ON() splat on platforms that legally omit the clock
frequency from the ACPI description, because in the new situation, the
core I2C designware driver still accesses the fields in the driver
struct that we no longer populate, and proceeds to calculate them from
the clock frequency. Since the clock frequency is unspecified, the
driver complains loudly using a WARN_ON().

So revert back to the old situation, where the struct fields for all
timings are populated, but retain the new logic which chooses the SDA
hold time from the timing mode that is currently in use.

Fixes: 372205e6212f1 ("i2c: designware: Get selected speed mode ...")
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reported-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-designware-platdrv.c