[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200526103938.GC14423@gnbcxd0016.gnb.st.com>
Date: Tue, 26 May 2020 12:39:38 +0200
From: Alain Volmat <alain.volmat@...com>
To: Wolfram Sang <wsa@...nel.org>
CC: Benjamin Tissoires <benjamin.tissoires@...hat.com>,
<robh+dt@...nel.org>, <mark.rutland@....com>,
<pierre-yves.mordret@...com>, <mcoquelin.stm32@...il.com>,
<alexandre.torgue@...com>, <linux-i2c@...r.kernel.org>,
<devicetree@...r.kernel.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <fabrice.gasnier@...com>
Subject: Re: [PATCH 4/4] i2c: stm32f7: Add SMBus-specific protocols support
On Sat, May 23, 2020 at 01:01:40PM +0200, Wolfram Sang wrote:
>
> > +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.
I'd prefer avoid this solution to not lose the address 0x08.
> - Enable it in probe() only if there is a generic binding "host-notify".
Do you mean having the adapter walk through childs node and see if at least
one of them have the host-notify property ? This mean that such solution
wouldn't work for device relying on platform data rather than DT nodes.
> - Let the core scan for a device with HOST_NOTIFY when registering an
> adapter and then call back into the driver somehow?
You mean at adapter registration time only ? Not device probing time ?
At probing time, we could have the core (i2c_device_probe) check for the flag
HOST_NOTIFY and if setted call a dedicated host-notify reg callback ?
>
> Other ideas?
>
Powered by blists - more mailing lists