[Linux-stm32] [PATCH 4/4] i2c: stm32f7: Add SMBus-specific protocols support
Wolfram Sang
wsa at kernel.org
Sat May 23 11:01:40 UTC 2020
> +static int stm32f7_i2c_reg_client(struct i2c_client *client)
> +{
> + struct stm32f7_i2c_dev *i2c_dev = i2c_get_adapdata(client->adapter);
> + int ret;
> +
> + if (client->flags & I2C_CLIENT_HOST_NOTIFY) {
> + /* Only enable on the first device registration */
> + if (atomic_inc_return(&i2c_dev->host_notify_cnt) == 1) {
> + ret = stm32f7_i2c_enable_smbus_host(i2c_dev);
> + if (ret) {
> + dev_err(i2c_dev->dev,
> + "failed to enable SMBus host notify (%d)\n",
> + ret);
> + return ret;
> + }
> + }
> + }
> +
> + return 0;
> +}
So, as mentioned in the other review, I'd like to evaluate other
possibilities for the above:
- One option is to enable it globally in probe(). Then you lose the
possibility to have a device at address 0x08.
- Enable it in probe() only if there is a generic binding "host-notify".
- Let the core scan for a device with HOST_NOTIFY when registering an
adapter and then call back into the driver somehow?
Other ideas?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://st-md-mailman.stormreply.com/pipermail/linux-stm32/attachments/20200523/22a828b5/attachment.sig>
More information about the Linux-stm32
mailing list