diff options
author | Phil Edworthy <phil.edworthy@renesas.com> | 2019-02-28 16:52:10 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2019-03-20 19:57:18 +0300 |
commit | c62ebb3d5f0d0e9dafe990c9ce680ca9b46fd4c1 (patch) | |
tree | 2f3d3a2dcbbda1b6fcd46b9fe193071641d2d0f4 /drivers/i2c/busses/i2c-designware-platdrv.c | |
parent | bdfdf4b2ba644347d63a61da941f30aea1bd35fc (diff) | |
download | linux-c62ebb3d5f0d0e9dafe990c9ce680ca9b46fd4c1.tar.xz |
i2c: designware: Add support for an interface clock
The Synopsys I2C Controller has an interface clock, but most SoCs hide
this away. However, on some SoCs you need to explicitly enable the
interface clock in order to access the registers. Therefore, add
support for an optional interface clock.
Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Gareth Williams <gareth.williams.jx@renesas.com>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-designware-platdrv.c')
-rw-r--r-- | drivers/i2c/busses/i2c-designware-platdrv.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 416f89b8f881..ddfb81872906 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -344,6 +344,11 @@ static int dw_i2c_plat_probe(struct platform_device *pdev) else i2c_dw_configure_master(dev); + /* Optional interface clock */ + dev->pclk = devm_clk_get_optional(&pdev->dev, "pclk"); + if (IS_ERR(dev->pclk)) + return PTR_ERR(dev->pclk); + dev->clk = devm_clk_get(&pdev->dev, NULL); if (!i2c_dw_prepare_clk(dev, true)) { u64 clk_khz; |