[PATCH] I2C: add .class to i2c drivers
commit223f4b75909baf050e95de4b7c88acaf9b423464
authorMichael Hunold <hunold@convergence.de>
Wed, 5 May 2004 09:14:40 +0000 (5 02:14 -0700)
committerDeepak Saxena <dsaxena@plexity.net>
Wed, 5 May 2004 09:14:40 +0000 (5 02:14 -0700)
treec3455eb148ac889882c795443f62d048f3a28c25
parentabfd324f692c5271600c4b845e56968999a1e804
[PATCH] I2C: add .class to i2c drivers

in the "[RFC|PATCH][2.6] Additional i2c adapter flags for i2c client
isolation" thread, the i2c people have  agreed that an ".class" field
should be added to struct i2c_driver.

Currently only drivers do checks for plausibility ("Is this an adapter I
can attach to?"), but adapters don't have a chance to keep drivers away
from their bus.

If both drivers and adapters provide a .class entry, the i2c-core can
easily compare them and let devices only probe on busses where they can
really exist.

Real world example: DVB i2c adapters cannot ensure that only known DVB
i2c chipsets probe their busses. Most client drivers probe every bus
they get their hands on. This will confuse some DVB i2c busses.

With the new I2C_CLASS_ALL flag it will be possible that an adapter can
request that really all drivers are probed on the adapter. On the other
hand, drivers can make sure that they get the chance to probe on every
i2c adapter out there (this is not encouraged, though)

The attached patch does the first step:
- add .class member to struct i2c_device
- remove unused .flags member from struct i2c_adapter
- rename I2C_ADAP_CLASS_xxx to I2C_CLASS_xxx (to be used both for
  drivers and adapters)
- add new I2C_CLASS_ALL and I2C_CLASS_SOUND classes
- follow these changes in the existing drivers with copy & paste
51 files changed:
Documentation/i2c/porting-clients
drivers/i2c/busses/i2c-ali1535.c
drivers/i2c/busses/i2c-ali1563.c
drivers/i2c/busses/i2c-ali15x3.c
drivers/i2c/busses/i2c-amd756.c
drivers/i2c/busses/i2c-amd8111.c
drivers/i2c/busses/i2c-i801.c
drivers/i2c/busses/i2c-isa.c
drivers/i2c/busses/i2c-nforce2.c
drivers/i2c/busses/i2c-parport-light.c
drivers/i2c/busses/i2c-parport.c
drivers/i2c/busses/i2c-piix4.c
drivers/i2c/busses/i2c-sis5595.c
drivers/i2c/busses/i2c-sis630.c
drivers/i2c/busses/i2c-sis96x.c
drivers/i2c/busses/i2c-via.c
drivers/i2c/busses/i2c-viapro.c
drivers/i2c/busses/i2c-voodoo3.c
drivers/i2c/chips/adm1021.c
drivers/i2c/chips/asb100.c
drivers/i2c/chips/fscher.c
drivers/i2c/chips/gl518sm.c
drivers/i2c/chips/it87.c
drivers/i2c/chips/lm75.c
drivers/i2c/chips/lm78.c
drivers/i2c/chips/lm80.c
drivers/i2c/chips/lm83.c
drivers/i2c/chips/lm90.c
drivers/i2c/chips/via686a.c
drivers/i2c/chips/w83781d.c
drivers/i2c/chips/w83l785ts.c
drivers/media/video/bt832.c
drivers/media/video/bttv-i2c.c
drivers/media/video/cx88/cx88-i2c.c
drivers/media/video/dpc7146.c
drivers/media/video/hexium_gemini.c
drivers/media/video/hexium_orion.c
drivers/media/video/msp3400.c
drivers/media/video/mxb.c
drivers/media/video/saa5246a.c
drivers/media/video/saa5249.c
drivers/media/video/saa7134/saa6752hs.c
drivers/media/video/saa7134/saa7134-i2c.c
drivers/media/video/tda7432.c
drivers/media/video/tda9875.c
drivers/media/video/tda9887.c
drivers/media/video/tuner.c
drivers/media/video/tvaudio.c
drivers/media/video/tvmixer.c
drivers/usb/media/w9968cf.c
include/linux/i2c.h