aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarkko Nikula <jarkko.nikula@linux.intel.com>2016-08-12 10:02:54 -0400
committerWolfram Sang <wsa@the-dreams.de>2016-08-25 18:42:11 -0400
commit10f8e7fb371c9e575e772bc6fcc385dc973f6e87 (patch)
tree8248a8506cb6ec56b66b5bb547fdf04487c311de
parent5853b22d96fa786365ff11fe9f008a68a533f043 (diff)
i2c: designware: Find bus speed from ACPI
Fast mode is the default speed of i2c-designware which can be overridden by platform data or by "clock-frequency" device property. Even though the ACPI 5.1 can pass device properties via _DSD method, shipping systems define the connection speed between I2C host and each slave in their I2cSerialBus resources. Which means speed is not defined per bus but per slave. As there is now support in i2c-core to find the bus speed from ACPI use that to set up the bus speed prior registering the I2C adapter. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r--drivers/i2c/busses/i2c-designware-platdrv.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index cb846cb50512..0b42a12171f3 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -157,7 +157,7 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
157 struct i2c_adapter *adap; 157 struct i2c_adapter *adap;
158 struct resource *mem; 158 struct resource *mem;
159 int irq, r; 159 int irq, r;
160 u32 ht = 0; 160 u32 acpi_speed, ht = 0;
161 161
162 irq = platform_get_irq(pdev, 0); 162 irq = platform_get_irq(pdev, 0);
163 if (irq < 0) 163 if (irq < 0)
@@ -192,6 +192,10 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
192 &dev->clk_freq); 192 &dev->clk_freq);
193 } 193 }
194 194
195 acpi_speed = i2c_acpi_find_bus_speed(&pdev->dev);
196 if (acpi_speed)
197 dev->clk_freq = acpi_speed;
198
195 if (has_acpi_companion(&pdev->dev)) 199 if (has_acpi_companion(&pdev->dev))
196 dw_i2c_acpi_configure(pdev); 200 dw_i2c_acpi_configure(pdev);
197 201