From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: linux-i2c@vger.kernel.org
Cc: Wolfram Sang <wsa@the-dreams.de>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Weifeng Voon <weifeng.voon@intel.com>,
Jarkko Nikula <jarkko.nikula@linux.intel.com>
Subject: [PATCH 8/8] i2c: designware: Find bus speed from ACPI
Date: Fri, 12 Aug 2016 17:02:54 +0300 [thread overview]
Message-ID: <1471010574-28598-9-git-send-email-jarkko.nikula@linux.intel.com> (raw)
In-Reply-To: <1471010574-28598-1-git-send-email-jarkko.nikula@linux.intel.com>
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>
---
drivers/i2c/busses/i2c-designware-platdrv.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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)
struct i2c_adapter *adap;
struct resource *mem;
int irq, r;
- u32 ht = 0;
+ u32 acpi_speed, ht = 0;
irq = platform_get_irq(pdev, 0);
if (irq < 0)
@@ -192,6 +192,10 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
&dev->clk_freq);
}
+ acpi_speed = i2c_acpi_find_bus_speed(&pdev->dev);
+ if (acpi_speed)
+ dev->clk_freq = acpi_speed;
+
if (has_acpi_companion(&pdev->dev))
dw_i2c_acpi_configure(pdev);
--
2.8.1
next prev parent reply other threads:[~2016-08-12 14:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-12 14:02 [PATCH 0/8] i2c: designware: Support fast mode plus and high speed Jarkko Nikula
2016-08-12 14:02 ` [PATCH 1/8] i2c: designware: Move clk_freq into struct dw_i2c_dev Jarkko Nikula
2016-08-12 14:02 ` [PATCH 2/8] i2c: designware: get fast plus and high speed *CNT configuration Jarkko Nikula
2016-08-12 14:02 ` [PATCH 3/8] i2c: designware: Enable fast mode plus Jarkko Nikula
2016-08-12 14:02 ` [PATCH 4/8] i2c: designware: set the common config before the if else Jarkko Nikula
2016-08-12 14:02 ` [PATCH 5/8] i2c: designware: Enable high speed mode Jarkko Nikula
2016-08-12 14:02 ` [PATCH 6/8] i2c: core: Cleanup I2C ACPI namespace, take 2 Jarkko Nikula
2016-08-12 14:02 ` [PATCH 7/8] i2c: core: Add function for finding the bus speed from ACPI, " Jarkko Nikula
2016-08-12 14:02 ` Jarkko Nikula [this message]
2016-08-17 16:53 ` [PATCH 0/8] i2c: designware: Support fast mode plus and high speed Andy Shevchenko
2016-08-25 19:55 ` Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1471010574-28598-9-git-send-email-jarkko.nikula@linux.intel.com \
--to=jarkko.nikula@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-i2c@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=weifeng.voon@intel.com \
--cc=wsa@the-dreams.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).