diff options
author | Serge Semin <Sergey.Semin@baikalelectronics.ru> | 2020-03-06 14:19:54 +0100 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2020-03-21 19:32:15 +0100 |
commit | 1f1a714658307a1a5ec65b0a23d87a87da64c86f (patch) | |
tree | 02a1e3e9e6b51a68c539e1596fdd4f2f03787c10 /drivers/i2c/busses/i2c-designware-master.c | |
parent | i2c: dev: Fix the race between the release of i2c_dev and cdev (diff) | |
download | linux-1f1a714658307a1a5ec65b0a23d87a87da64c86f.tar.xz linux-1f1a714658307a1a5ec65b0a23d87a87da64c86f.zip |
i2c: designware: Detect the FIFO size in the common code
The problem with detecting the FIFO depth in the platform driver
is that in order to implement this we have to access the controller
IC_COMP_PARAM_1 register. Currently it's done before the
i2c_dw_set_reg_access() method execution, which is errors prone since
the method determines the registers endianness and access mode and we
can't use dw_readl/dw_writel accessors before this information is
retrieved. We also can't move the i2c_dw_set_reg_access() function
invocation to after the master/slave probe functions call (when endianness
and access mode are determined), since the FIFO depth information is used
by them for initializations. So in order to fix the problem we have no
choice but to move the FIFO size detection methods to the common code and
call it at the probe stage.
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-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-master.c')
-rw-r--r-- | drivers/i2c/busses/i2c-designware-master.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c index e8b328242256..05da900cf375 100644 --- a/drivers/i2c/busses/i2c-designware-master.c +++ b/drivers/i2c/busses/i2c-designware-master.c @@ -698,6 +698,8 @@ int i2c_dw_probe(struct dw_i2c_dev *dev) if (ret) return ret; + i2c_dw_set_fifo_size(dev); + ret = dev->init(dev); if (ret) return ret; |