Re: I2C block read

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

 



On 07/06/06 20:50 +0200, Jean Delvare wrote:
> Signed-off-by: Jean Delvare <[email protected]>
> ---
>  drivers/i2c/busses/scx200_acb.c |    8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> --- linux-2.6.17-rc6.orig/drivers/i2c/busses/scx200_acb.c	2006-06-07 18:13:53.000000000 +0200
> +++ linux-2.6.17-rc6/drivers/i2c/busses/scx200_acb.c	2006-06-07 20:29:27.000000000 +0200
> @@ -308,6 +308,12 @@
>  		break;
>  
>  	case I2C_SMBUS_BLOCK_DATA:
> +		/* Sanity check */
> +		if (rw == I2C_SMBUS_READ) {
> +			dev_warn(&adapter->dev, "SMBus block read is not "
> +				 "supported!\n");
> +			return -EINVAL;
> +		}
>  		len = data->block[0];
>  		buffer = &data->block[1];
>  		break;
> @@ -372,7 +378,7 @@
>  {
>  	return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
>  	       I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
> -	       I2C_FUNC_SMBUS_BLOCK_DATA;
> +	       I2C_FUNC_SMBUS_WRITE_BLOCK_DATA;
>  }
>  
>  /* For now, we only handle combined mode (smbus) */
> 

ACKed (if my opinion matters).  It will take some more thinking to handle
block reads, and they're really not very interesting anyway.  At the very
least, this will keep implementations from freaking out, and thats a 
Good Thing (TM).

Jordan

--
Jordan Crouse
Senior Linux Engineer
Advanced Micro Devices, Inc.
<www.amd.com/embeddedprocessors>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux