[PATCH] i3c: Allow OF-alias-based persistent bus numbering

Jeremy Kerr jk at codeconstruct.com.au
Wed Apr 5 05:40:20 PDT 2023


Hi Ben,

> > @@ -419,9 +420,9 @@ static void i3c_bus_cleanup(struct i3c_bus *i3cbus)
> >         mutex_unlock(&i3c_core_lock);
> >   }
> >   
> > -static int i3c_bus_init(struct i3c_bus *i3cbus)
> > +static int i3c_bus_init(struct i3c_bus *i3cbus, struct device_node *np)
> 
> would it be worth passing the struct i3c_master_controller through
> this in case other info is needed at a later date? Does ACPI have
> anything similar?

We could certainly add other platform enumeration data in future, but I
don't know enough about ACPI device discovery to cater for everything at
this stage.

I'm just passing the OF node because that's all we need now; we can
certainly extend once we have a concrete pattern for other platforms -
this is just a static function, so it'll be easy to update.

If we want to follow i2c: for non-OF-based static bus numbering, it's up
to whatever is instantiating the i2c bus device to provide an id for
i2c_add_numbered_adapter(). We don't have any users for that in i3c at
present though, so it's probably a bit premature to add an equivalent
API.

Cheers,


Jeremy



More information about the linux-i3c mailing list