• Michael Hunold's avatar
    [PATCH] I2C: add .class to i2c drivers · 223f4b75
    Michael Hunold authored
    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
    223f4b75
tda9887.c 12.4 KB