[PATCH v2 0/6] i2c: designware: Enable mode swapping

Heikki Krogerus posted 6 patches 1 month, 3 weeks ago
There is a newer version of this series
drivers/i2c/busses/Kconfig                 |  10 +-
drivers/i2c/busses/Makefile                |   2 +-
drivers/i2c/busses/i2c-designware-amdisp.c |   4 +-
drivers/i2c/busses/i2c-designware-common.c | 211 +++++++++++++++++++--
drivers/i2c/busses/i2c-designware-core.h   |  25 +--
drivers/i2c/busses/i2c-designware-master.c | 174 ++---------------
drivers/i2c/busses/i2c-designware-slave.c  | 127 ++-----------
7 files changed, 254 insertions(+), 299 deletions(-)
[PATCH v2 0/6] i2c: designware: Enable mode swapping
Posted by Heikki Krogerus 1 month, 3 weeks ago
Hi,

Changed since v1:
- The init cb is replaced with i2c_dw_init() also in i2c-designware-amdisp.c
- Checking I2C_FUNC_SLAVE in i2c_dw_reg_slave()

The original cover letter:

It's currently not possible to support MCTP or any other protocol that
requires support for both modes with the DesignWare I2C because the
driver can only be used in one mode. I'm assuming that the driver was
designed this way because the DesignWare I2C can not be operated as
I2C master and I2C slave simultaneously, however, that does not
actually mean both modes could not be supported at the same time. See
the patch 5/6 for more detailed explanation.

This series will enable support for both modes in the driver by
utilising a simple mode swap method, and that way make it possible to
support MCTP, IPMI, SMBus Host Notification Protocol, and any other
protocol requires the support for both modes with the DesignWare I2C.

thanks,

Heikki Krogerus (6):
  i2c: designware: Remove useless driver specific option for I2C target
  i2c: designware: Remove unnecessary function exports
  i2c: designware: Combine some of the common functions
  i2c: designware: Combine the init functions
  i2c: designware: Enable mode swapping
  i2c: designware: Remove an unnecessary condition

 drivers/i2c/busses/Kconfig                 |  10 +-
 drivers/i2c/busses/Makefile                |   2 +-
 drivers/i2c/busses/i2c-designware-amdisp.c |   4 +-
 drivers/i2c/busses/i2c-designware-common.c | 211 +++++++++++++++++++--
 drivers/i2c/busses/i2c-designware-core.h   |  25 +--
 drivers/i2c/busses/i2c-designware-master.c | 174 ++---------------
 drivers/i2c/busses/i2c-designware-slave.c  | 127 ++-----------
 7 files changed, 254 insertions(+), 299 deletions(-)

-- 
2.50.1
Re: [PATCH v2 0/6] i2c: designware: Enable mode swapping
Posted by Andi Shyti 1 month, 1 week ago
Hi Heikki,

> Heikki Krogerus (6):
>   i2c: designware: Remove useless driver specific option for I2C target
>   i2c: designware: Remove unnecessary function exports

to unburden you a little, I applied the first two patches.

Andi
Re: [PATCH v2 0/6] i2c: designware: Enable mode swapping
Posted by Mika Westerberg 1 month, 2 weeks ago
On Thu, Dec 18, 2025 at 04:14:59PM +0100, Heikki Krogerus wrote:
> Hi,
> 
> Changed since v1:
> - The init cb is replaced with i2c_dw_init() also in i2c-designware-amdisp.c
> - Checking I2C_FUNC_SLAVE in i2c_dw_reg_slave()
> 
> The original cover letter:
> 
> It's currently not possible to support MCTP or any other protocol that
> requires support for both modes with the DesignWare I2C because the
> driver can only be used in one mode. I'm assuming that the driver was
> designed this way because the DesignWare I2C can not be operated as
> I2C master and I2C slave simultaneously, however, that does not
> actually mean both modes could not be supported at the same time. See
> the patch 5/6 for more detailed explanation.
> 
> This series will enable support for both modes in the driver by
> utilising a simple mode swap method, and that way make it possible to
> support MCTP, IPMI, SMBus Host Notification Protocol, and any other
> protocol requires the support for both modes with the DesignWare I2C.
> 
> thanks,
> 
> Heikki Krogerus (6):
>   i2c: designware: Remove useless driver specific option for I2C target
>   i2c: designware: Remove unnecessary function exports
>   i2c: designware: Combine some of the common functions
>   i2c: designware: Combine the init functions
>   i2c: designware: Enable mode swapping
>   i2c: designware: Remove an unnecessary condition

For the whole series,

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>