blob: ada0bfe261e111b3a212c8293c3ac45b8c62dc71 [file] [log] [blame]
From 275bf45e69de0faa2531f0752333b4dedcb2caa0 Mon Sep 17 00:00:00 2001
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date: Mon, 18 Dec 2017 22:57:56 +0100
Subject: [PATCH 0544/1795] i2c: sh_mobile: move type detection upwards
For refactoring reasons, we will need this information before the setup
callback. Also, simplify the comment to a oneliner.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit 9e422131167583092a560c1ac4837a12aa11da96)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/i2c/busses/i2c-sh_mobile.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index b01607b4fce2..1ac896e46b39 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -873,6 +873,10 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
pd->bus_speed = ret ? STANDARD_MODE : bus_speed;
pd->clks_per_count = 1;
+ /* Newer variants come with two new bits in ICIC */
+ if (resource_size(res) > 0x17)
+ pd->flags |= IIC_FLAG_HAS_ICIC67;
+
config = of_device_get_match_data(&dev->dev);
if (config) {
pd->clks_per_count = config->clks_per_count;
@@ -881,12 +885,6 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
config->setup(pd);
}
- /* The IIC blocks on SH-Mobile ARM processors
- * come with two new bits in ICIC.
- */
- if (resource_size(res) > 0x17)
- pd->flags |= IIC_FLAG_HAS_ICIC67;
-
ret = sh_mobile_i2c_init(pd);
if (ret)
return ret;
--
2.19.0