diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-04-25 16:44:45 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2020-05-13 12:36:22 +0200 |
commit | 3ebe40ed1c39016eeae947acc9fd57d6b10d43b2 (patch) | |
tree | a00b3780566879df4e4e79d0992918272d4aae88 /drivers/i2c/busses/i2c-designware-slave.c | |
parent | 188fe480cd65c53dca02a464d62be02ca3158290 (diff) | |
download | linux-3ebe40ed1c39016eeae947acc9fd57d6b10d43b2.tar.bz2 |
i2c: designware: Move configuration routines to respective modules
Move configuration routines to respective modules, i.e. master and slave.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-designware-slave.c')
-rw-r--r-- | drivers/i2c/busses/i2c-designware-slave.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-designware-slave.c b/drivers/i2c/busses/i2c-designware-slave.c index f5ecf76c0d02..576e7af4e94b 100644 --- a/drivers/i2c/busses/i2c-designware-slave.c +++ b/drivers/i2c/busses/i2c-designware-slave.c @@ -241,6 +241,17 @@ static const struct i2c_algorithm i2c_dw_algo = { .unreg_slave = i2c_dw_unreg_slave, }; +void i2c_dw_configure_slave(struct dw_i2c_dev *dev) +{ + dev->functionality = I2C_FUNC_SLAVE | DW_IC_DEFAULT_FUNCTIONALITY; + + dev->slave_cfg = DW_IC_CON_RX_FIFO_FULL_HLD_CTRL | + DW_IC_CON_RESTART_EN | DW_IC_CON_STOP_DET_IFADDRESSED; + + dev->mode = DW_IC_SLAVE; +} +EXPORT_SYMBOL_GPL(i2c_dw_configure_slave); + int i2c_dw_probe_slave(struct dw_i2c_dev *dev) { struct i2c_adapter *adap = &dev->adapter; |