Skip to content

Commit

Permalink
i2c: sh_mobile: honor DT bus speed settings
Browse files Browse the repository at this point in the history
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Wolfram Sang authored and Wolfram Sang committed May 22, 2014
1 parent 5a72b25 commit 88c289e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/i2c/busses/i2c-sh_mobile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 88c289e

Please sign in to comment.