[PATCH RESEND] hwmon: lm70: TI TMP121 support.

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

 



On Thu, 23 Oct 2008 10:46:29 -0700, David Brownell wrote:
> On Thursday 23 October 2008, Jean Delvare wrote:
> > 
> > > For SPI, everything is MSB first ... else insist (spi->mode & SPI_LSB_FIRST)
> > > is true. ?Please strike the comment implying it might not be MSB first.
> > 
> > Except that the LM70 transmits the LSB first, so it seems valuable to
> > underline that the TMP121 behaves differently.
> 
> If true, then this driver has a bug ... it should require
> SPI_LSB_FIRST as well as SPI_3WIRE in spi->mode, for lm70.
> 
> But no, I checked the data sheet and it shows MSB first.
> See the table in section 1.5.2 (MSB = D15) and the figures
> in section 2 (D15 first).
> 
> 
> See what confusion comes from implying things which are
> contrary-to-fact?  :)

I didn't assume anything, I simply read the code:

+	switch (p_lm70->chip) {
+	case LM70_CHIP_LM70:
+		raw = (rxbuf[1] << 8) + rxbuf[0];
+		val = ((int)raw/32) * 250;
+		break;
+
+	case LM70_CHIP_TMP121:
+		raw = (rxbuf[0] << 8) + rxbuf[1];
+		val = (raw / 8) * 625 / 10;
+		break;
+	}

Does it look to you like both chips expect the same byte order? Me not.

-- 
Jean Delvare




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

  Powered by Linux