Re: [patch] i2c #3/3: add class field to i2c_adapter

Mark McClelland (mark@alpha.dyndns.org)
Wed, 07 May 2003 03:12:56 -0700


This is a MIME-formatted message. If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_courier-27982-1052302500-0001-2
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Gerd Knorr wrote:

>This is the last of three patches for i2c. It introduces a new field
>to i2c_adapter which classifies the kind of hardware a i2c adapter
>belongs to (analog tv card / dvb card / smbus / gfx card ...).
>

I've attached a patch that adds classes for analog and digital cameras
(webcams, etc...). I plan to submit one such driver in the next few days.

The patch also fixes a typo ("DIGINAL").

>i2c chip
>drivers can use this infomation to decide whenever they want to look for
>hardware on that adapter or not. It doesn't make sense to probe for a
>tv tuner on a smbus for example ...
>

Actually it does in some cases. I know of two devices that have analog
tuners on an smbus-like interface (OV511 USB TV and W9967CF USB TV). The
tuner can be controlled using a pair of i2c_smbus_write_byte_data()
calls. This works because, AFAIK, all four-byte tuners can differentiate
between bytes 0-1 and 2-3 due to their bit patterns.

Would a patch that adds smbus algorithm support to tuner.c be
acceptable? It will only add about twelve lines, and will still use
i2c_master_send() when possible.

-- 
Mark McClelland
mark@alpha.dyndns.org

--=_courier-27982-1052302500-0001-2 Content-Type: text/plain; name="i2c_adap_class_cam-2.5.69.patch"; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Content-disposition: inline; filename=i2c_adap_class_cam-2.5.69.patch

Add I2C classes for analog and digital cameras, and fix a typo.

diff -Nru a/include/linux/i2c.h b/include/linux/i2c.h --- a/include/linux/i2c.h Wed May 7 01:29:59 2003 +++ b/include/linux/i2c.h Wed May 7 01:29:59 2003 @@ -280,10 +280,12 @@ /* Must equal I2C_M_TEN below */ /* i2c adapter classes (bitmask) */ -#define I2C_ADAP_CLASS_SMBUS (1<<0) /* lm_sensors, ... */ -#define I2C_ADAP_CLASS_TV_ANALOG (1<<1) /* bttv + friends */ -#define I2C_ADAP_CLASS_TV_DIGINAL (1<<2) /* dbv cards */ -#define I2C_ADAP_CLASS_DDC (1<<3) /* i2c-matroxfb ? */ +#define I2C_ADAP_CLASS_SMBUS (1<<0) /* lm_sensors, ... */ +#define I2C_ADAP_CLASS_TV_ANALOG (1<<1) /* bttv + friends */ +#define I2C_ADAP_CLASS_TV_DIGITAL (1<<2) /* dbv cards */ +#define I2C_ADAP_CLASS_DDC (1<<3) /* i2c-matroxfb ? */ +#define I2C_ADAP_CLASS_CAM_ANALOG (1<<4) /* camera with analog CCD */ +#define I2C_ADAP_CLASS_CAM_DIGITAL (1<<5) /* most webcams */ /* i2c_client_address_data is the struct for holding default client * addresses for a driver and for the parameters supplied on the

--=_courier-27982-1052302500-0001-2--