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

From: Mark McClelland (mark@alpha.dyndns.org)
Date: Wed May 07 2003 - 05:12:56 EST


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

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

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



This archive was generated by hypermail 2b29 : Wed May 07 2003 - 22:00:30 EST