mfd: intel-lpss: Pass SDA hold time to I2C host controller driver
authorMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 30 Nov 2015 15:11:42 +0000 (17:11 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 7 Dec 2015 01:29:24 +0000 (02:29 +0100)
commit028af5941dd870afd5eb6a95c39f25564dcca79a
treecf281d7af22c25e1effc747149d7c7b7755ae894
parente15ad2154b6166804fc04487e0398c9aef9e7c97
mfd: intel-lpss: Pass SDA hold time to I2C host controller driver

Intel Skylake the LPSS I2C pad circuit has internal delays that require
programming non-zero SDA hold time for the I2C host controller. If this is
not done communication to slave devices may fail with arbitration lost
errors like the one seen below taken from Lenovo Yoga 900:

  i2c_hid i2c-SYNA2B29:00: Fetching the HID descriptor
  i2c_hid i2c-SYNA2B29:00: __i2c_hid_command: cmd=20 00
  i2c_designware i2c_designware.1: i2c_dw_handle_tx_abort: lost arbitration

To fix this we follow what the Windows driver is doing and pass the default
SDA hold time of 230 ns to all Intel Skylake host controllers. This still
allows the platform to override these values by passing special ACPI
methods SSCN and FMCN.

Reported-by: Kevin Fenzi <kevin@scrye.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/mfd/intel-lpss-acpi.c
drivers/mfd/intel-lpss-pci.c