Message ID | 1561236905-8901-4-git-send-email-pgaj@cadence.com (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
Series | Add the I3C mastership request | expand |
On Sat, 22 Jun 2019 21:55:01 +0100 Przemyslaw Gaj <pgaj@cadence.com> wrote: > I need to export this function to let secondary master update the bus mode. > Some newly added I2C devices may operate in slower mode. > > Signed-off-by: Przemyslaw Gaj <pgaj@cadence.com> > --- > drivers/i3c/master.c | 10 ++++++++++ > include/linux/i3c/master.h | 1 + > 2 files changed, 11 insertions(+) > > diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c > index 759078f..cbace14 100644 > --- a/drivers/i3c/master.c > +++ b/drivers/i3c/master.c > @@ -566,6 +566,15 @@ static const struct device_type i3c_masterdev_type = { > .groups = i3c_masterdev_groups, > }; > > +/** > + * i3c_bus_set_mode() - set a bus mode > + * @i3cbus: I3C bus object > + * @mode: new bus mode > + * > + * This is called at initialization time and should be called when > + * bus mode has changed, for example when secondary master registered > + * devices after successful masership takeover. > + */ > int i3c_bus_set_mode(struct i3c_bus *i3cbus, enum i3c_bus_mode mode) > { > i3cbus->mode = mode; > @@ -590,6 +599,7 @@ int i3c_bus_set_mode(struct i3c_bus *i3cbus, enum i3c_bus_mode mode) > > return 0; > } > +EXPORT_SYMBOL_GPL(i3c_bus_set_mode); I'd rather not export this function and instead let the core decide when the bus mode needs to be changed (based on the type of devices added by the master). > > static struct i3c_master_controller * > i2c_adapter_to_i3c_master(struct i2c_adapter *adap) > diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h > index df3d769..e089771 100644 > --- a/include/linux/i3c/master.h > +++ b/include/linux/i3c/master.h > @@ -538,6 +538,7 @@ void i3c_master_cleanup(struct i3c_master_controller *master); > int i3c_master_register(struct i3c_master_controller *master, > struct i3c_device_info *info); > int i3c_master_unregister(struct i3c_master_controller *master); > +int i3c_bus_set_mode(struct i3c_bus *i3cbus, enum i3c_bus_mode mode); > > /** > * i3c_dev_get_master_data() - get master private data attached to an I3C
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 759078f..cbace14 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -566,6 +566,15 @@ static const struct device_type i3c_masterdev_type = { .groups = i3c_masterdev_groups, }; +/** + * i3c_bus_set_mode() - set a bus mode + * @i3cbus: I3C bus object + * @mode: new bus mode + * + * This is called at initialization time and should be called when + * bus mode has changed, for example when secondary master registered + * devices after successful masership takeover. + */ int i3c_bus_set_mode(struct i3c_bus *i3cbus, enum i3c_bus_mode mode) { i3cbus->mode = mode; @@ -590,6 +599,7 @@ int i3c_bus_set_mode(struct i3c_bus *i3cbus, enum i3c_bus_mode mode) return 0; } +EXPORT_SYMBOL_GPL(i3c_bus_set_mode); static struct i3c_master_controller * i2c_adapter_to_i3c_master(struct i2c_adapter *adap) diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h index df3d769..e089771 100644 --- a/include/linux/i3c/master.h +++ b/include/linux/i3c/master.h @@ -538,6 +538,7 @@ void i3c_master_cleanup(struct i3c_master_controller *master); int i3c_master_register(struct i3c_master_controller *master, struct i3c_device_info *info); int i3c_master_unregister(struct i3c_master_controller *master); +int i3c_bus_set_mode(struct i3c_bus *i3cbus, enum i3c_bus_mode mode); /** * i3c_dev_get_master_data() - get master private data attached to an I3C
I need to export this function to let secondary master update the bus mode. Some newly added I2C devices may operate in slower mode. Signed-off-by: Przemyslaw Gaj <pgaj@cadence.com> --- drivers/i3c/master.c | 10 ++++++++++ include/linux/i3c/master.h | 1 + 2 files changed, 11 insertions(+)