On Thu, Aug 23, 2012 at 11:13:17AM -0700, Guenter Roeck wrote:Hi Guenter,On Thu, Aug 23, 2012 at 05:32:12PM +0200, Christophe Leroy wrote:Hi again,Hello,Hi Christophe,
[ ... ]
Ok, then I'll prepare a patch for this.After looking into the above, the proper change or fix is really to remove the- /* 3-wire link (shared SI/SO) for LM70 */Ok for now, but I'll have to check this. The driver does not really write
- if (chip == LM70_CHIP_LM70 && !(spi->mode & SPI_3WIRE))
+ /* 3-wire link (shared SI/SO) for LM70 and LM74 */
+ if ((chip == LM70_CHIP_LM70 || chip == LM70_CHIP_LM74)
+ && !(spi->mode & SPI_3WIRE))
anything to the chip, so it should be irrelevant which mode the SPI master
controller supports (MOSI does not have to be connected). Besides, from the
chip specification it looks like it is possible to connect the chip to a
standard SPI interface by adding a 10k resistor between MOSI and MISO.
above check for SPI_3WIRE entirely. The driver works perfectly fine if a LM70 is
connected to a controller which does not explicitly support SPI_3WIRE; all that
needs to be done is to connect MOSI through a resistor or not at all. This is,
however, a board design decision, not a SPI master chip limitation.
Yes, could be the solution, but I'm however a bit puzzled with doing this. The driver is originaly for NS LM70 component. Later on an extension has been added for TMP121 which is from a different family, even if compatible. Now we are talking about the LM74 which is in the same family as the original LM70. Therefore I would expect to be able to handle the LM74 directly from this driver, not through a tricky compatibility with the 'tmp121'. I would expect to handle it the other way round, ie consider the 'tmp121' as compatible with the LM74.
With that, we don't need to explicitly add any LM74 specific code to the driver,
since the TMP121 code does the trick. All we need to do is to update the
documentation, adding a note that LM74 is supported as well, and that it can be
selected with 'tmp121'.
Thanks
Thanks,
Guenter