Re: i2c multimaster and the device driver detect function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Salut Jean, merci de participer!

On 2013-05-13, at 4:11 AM, Jean Delvare wrote:

> 
> Guenter is right. You never have to disable auto-detection in the slave
> drivers (jc42 etc.) All these slave drivers do is claim "I _can_ do
> auto-detection", not "I _will_ do auto-detection." It's always up to the
> I2C adapter driver, whether auto-detection will happen or not. And it
> is disabled by default. So if you don't want it, just do not enable it
> in the bus driver. You can even set it per adapter, when the driver
> controls more than one adapter, and per bus segment, when multiplexing
> is taking place.

I am just wondering where the clean hook is for doing this. From what I can
gather, the master driver(s I've seen) declare ".class = I2C_CLASS_HWMON |
I2C_CLASS_SPD," pretty statically. Is it just that they are missing this
flexibility? Something along the lines of patching the pdata of such a master
driver to provide a 'class' variable in pdata? If so, one would have to take
into account the existing users of the master which expect the previous class
setting which may not be '0', thus requiring patching the existing upstreamed
users...  Suggestions?

> [...]
> It might be a little late now, but you may want to look into the
> PCA9541, for which Guenter has written a driver.

Thanks for that. Unfortunately, I am bound to existing hardware on this
platform. I will keep it in mind for future designs though.

Since my first post, I have stumbled on more problems with multimaster. Namely,
the master drivers are not consistent with the way they deal with arbitration
loss. I've all but re-written i2c-xiic, and dealt with arblost by catching
BusNotBusy interrupt and retrying the transfer. But the same cannot be said
about i2c-kempld (Kontron's in-PLD i2c master). Even if I manage to get the
kempld driver to handle this correctly, xiic still has some issues. The IP core
seems to enter a state when scanning unpopulated addresses (i2cdetect) for which
only a soft reset is required to recover, but this means it looses track of the
peer start-stop sequences and it's detection of the bus being busy or not.

I have decided to abandon the multimaster option for now as the hurdles are too
great. The only time I need another i2c master is when I need to hot reset the
fpga which houses the xiic core. (the reset pin is driven from gpo on an i2c i/o
expander). I will therefore handle this special case in userspace by unloading
i2c-xiic, then loading i2c-kempld. The slaves are arch declared on hard-coded
bus 0, so this should just work.

Thanks for all your help!
/jfd




_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux