[i2c] [PATCH] [2.6.21] [v4] PA Semi SMBus driver

Jean Delvare khali at linux-fr.org
Sun Feb 4 12:02:07 CET 2007


Hi Olof,

On Fri, 2 Feb 2007 14:22:26 -0600, Olof Johansson wrote:
> Driver for PA Semi SMBus interface.
> 
> Signed-off-by: Olof Johansson <olof at lixom.net>

OK, I've taken this version. I'll go to -mm now, and into 2.6.21-rc1.
>From now on, any change to this driver should be submitted as an
incremental patch on top of:
http://khali.linux-fr.org/devel/linux-2.6/jdelvare-i2c/i2c-pasemi-new-bus-driver.patch

Just one thing I found strange:

> +	case I2C_SMBUS_BLOCK_DATA:
> +		TXFIFO_WR(smbus, addr | MTXFIFO_START);
> +		TXFIFO_WR(smbus, command);
> +		if (read_write) {
> +			TXFIFO_WR(smbus, addr | I2C_SMBUS_READ | MTXFIFO_START);
> +			TXFIFO_WR(smbus, 1 | MTXFIFO_READ);
> +			rd = RXFIFO_RD(smbus);
> +			len = min_t(u8, (rd & MRXFIFO_DATA_M),
> +				    I2C_SMBUS_BLOCK_MAX);
> +			TXFIFO_WR(smbus, (len+1) | MTXFIFO_READ | MTXFIFO_STOP);

Why "len + 1" and not just "len"?

(It might be correct, I don't have the hardware specifications to
check. Are these public, BTW?)

> +		} else {
> +			len = min_t(u8, data->block[0], I2C_SMBUS_BLOCK_MAX);
> +			TXFIFO_WR(smbus, len);
> +			for (i = 1; i < len; i++)
> +				TXFIFO_WR(smbus, data->block[i]);
> +			TXFIFO_WR(smbus, data->block[len] | MTXFIFO_STOP);
> +		}

Thanks,
-- 
Jean Delvare



More information about the i2c mailing list