Skip to content

Commit cbf4f73

Browse files
vitor-soares-snpsbbrezillon
authored andcommitted
i3c: add mixed limited bus mode
The i3c bus spec defines a bus configuration where i2c devices don't have a 50ns filter but support SCL running at SDR max rate (12.5MHz). This patch introduces the limited bus mode so that users can use a higher speed in presence of i2c devices index 1. Signed-off-by: Vitor Soares <vitor.soares@synopsys.com> Cc: Boris Brezillon <bbrezillon@kernel.org> Cc: <linux-kernel@vger.kernel.org> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
1 parent ecc8fb5 commit cbf4f73

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎drivers/i3c/master.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ static int i3c_bus_init(struct i3c_bus *i3cbus)
470470
static const char * const i3c_bus_mode_strings[] = {
471471
[I3C_BUS_MODE_PURE] = "pure",
472472
[I3C_BUS_MODE_MIXED_FAST] = "mixed-fast",
473+
[I3C_BUS_MODE_MIXED_LIMITED] = "mixed-limited",
473474
[I3C_BUS_MODE_MIXED_SLOW] = "mixed-slow",
474475
};
475476

@@ -584,6 +585,7 @@ int i3c_bus_set_mode(struct i3c_bus *i3cbus, enum i3c_bus_mode mode,
584585
i3cbus->scl_rate.i3c = I3C_BUS_TYP_I3C_SCL_RATE;
585586
break;
586587
case I3C_BUS_MODE_MIXED_FAST:
588+
case I3C_BUS_MODE_MIXED_LIMITED:
587589
if (!i3cbus->scl_rate.i3c)
588590
i3cbus->scl_rate.i3c = I3C_BUS_TYP_I3C_SCL_RATE;
589591
if (!i3cbus->scl_rate.i2c)
@@ -2487,6 +2489,9 @@ int i3c_master_register(struct i3c_master_controller *master,
24872489
mode = I3C_BUS_MODE_MIXED_FAST;
24882490
break;
24892491
case I3C_LVR_I2C_INDEX(1):
2492+
if (mode < I3C_BUS_MODE_MIXED_LIMITED)
2493+
mode = I3C_BUS_MODE_MIXED_LIMITED;
2494+
break;
24902495
case I3C_LVR_I2C_INDEX(2):
24912496
if (mode < I3C_BUS_MODE_MIXED_SLOW)
24922497
mode = I3C_BUS_MODE_MIXED_SLOW;

‎include/linux/i3c/master.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,17 @@ struct i3c_device {
250250
* the bus. The only impact in this mode is that the
251251
* high SCL pulse has to stay below 50ns to trick I2C
252252
* devices when transmitting I3C frames
253+
* @I3C_BUS_MODE_MIXED_LIMITED: I2C devices without 50ns spike filter are
254+
* present on the bus. However they allow
255+
* compliance up to the maximum SDR SCL clock
256+
* frequency.
253257
* @I3C_BUS_MODE_MIXED_SLOW: I2C devices without 50ns spike filter are present
254258
* on the bus
255259
*/
256260
enum i3c_bus_mode {
257261
I3C_BUS_MODE_PURE,
258262
I3C_BUS_MODE_MIXED_FAST,
263+
I3C_BUS_MODE_MIXED_LIMITED,
259264
I3C_BUS_MODE_MIXED_SLOW,
260265
};
261266

0 commit comments

Comments
 (0)