summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2014-05-02 21:15:09 +0200
committerStephane Desneux <stephane.desneux@open.eurogiciel.org>2015-02-04 11:14:17 +0100
commit71e82295c68abb5e75b249734217f487b7f405a0 (patch)
tree2b99a27f5b7f909deada7bc9a8b23e2d3caaeeb5 /drivers/i2c
parent8e06315bbbd9b5e32bf17d1c3c6f226caf84500d (diff)
downloadlinux-stable-71e82295c68abb5e75b249734217f487b7f405a0.tar.gz
linux-stable-71e82295c68abb5e75b249734217f487b7f405a0.tar.bz2
linux-stable-71e82295c68abb5e75b249734217f487b7f405a0.zip
i2c: sh_mobile: honor DT bus speed settings
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> (cherry picked from commit 88c289ec28dfb0f383dcdbadd2c759f910585815) Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-sh_mobile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index d2fa222df3d1..2e481abd50ce 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -657,6 +657,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
struct resource *res;
int size;
int ret;
+ u32 bus_speed;
pd = kzalloc(sizeof(struct sh_mobile_i2c_data), GFP_KERNEL);
if (pd == NULL) {
@@ -697,7 +698,9 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
}
/* Use platform data bus speed or STANDARD_MODE */
- pd->bus_speed = STANDARD_MODE;
+ ret = of_property_read_u32(dev->dev.of_node, "clock-frequency", &bus_speed);
+ pd->bus_speed = ret ? STANDARD_MODE : bus_speed;
+
if (pdata && pdata->bus_speed)
pd->bus_speed = pdata->bus_speed;
pd->clks_per_count = 1;