I2C: Kill i2c_algorithm.id (5/7)
Subsystems (6)
PATCH 1/1 I2C: Kill i2c_algorithm.id (5/7)
[PATCH] I2C: Kill i2c_algorithm.id (5/7)
Merge the algorithm id part (16 upper bits) of the i2c adapters ids into the definition of the adapters ids directly. After that, we don't need to OR both ids together for each i2c_adapter structure.
Signed-off-by Jean Delvare <[email protected]>
Signed-off-by Greg Kroah-Hartman <[email protected]>
---
commit c7a46533ff7ef9e1c51bae6e54208527c5275b24
tree 4b952a757d60d9cfa4aad8462ee8ef7e03fec6dd
parent 1d8b9e1bad35fa3ea829990b9056c2a257d8fe79
author Jean Delvare <[email protected]> Thu, 11 Aug 2005 23:41:56 +0200 committer Greg Kroah-Hartman <[email protected]> Mon, 05 Sep 2005 09:14:31 -0700
drivers/i2c/algos/i2c-algo-bit.c | 2 drivers/i2c/algos/i2c-algo-ite.c | 2 drivers/i2c/algos/i2c-algo-pca.c | 2 drivers/i2c/algos/i2c-algo-pcf.c | 2 drivers/i2c/algos/i2c-algo-sgi.c | 1 drivers/i2c/algos/i2c-algo-sibyte.c | 2 drivers/i2c/busses/i2c-ibm_iic.c | 2 drivers/i2c/busses/i2c-isa.c | 2 drivers/i2c/busses/i2c-mpc.c | 2 drivers/i2c/busses/i2c-mv64xxx.c | 2 drivers/media/video/bt832.c | 2 drivers/media/video/bttv-i2c.c | 2 drivers/media/video/ir-kbd-i2c.c | 2 drivers/media/video/ovcamchip/ov6x20.c | 6 + drivers/media/video/ovcamchip/ov6x30.c | 4 - drivers/media/video/ovcamchip/ovcamchip_core.c | 8 +- drivers/media/video/tda7432.c | 2 drivers/media/video/tda9875.c | 2 drivers/media/video/tda9887.c | 4 - drivers/media/video/tuner-3036.c | 2 drivers/media/video/tvaudio.c | 6 + drivers/media/video/tveeprom.c | 2 drivers/media/video/tvmixer.c | 6 + drivers/usb/media/w9968cf.c | 2 drivers/video/matrox/matroxfb_maven.c | 2 include/linux/i2c-id.h | 128 ++++++++++++------------ include/linux/i2c-isa.h | 2 27 files changed, 95 insertions(+), 106 deletions(-)
drivers/i2c/algos/i2c-algo-bit.c +0 -2
@@ -539,8 +539,6 @@ int i2c_bit_add_bus(struct i2c_adapter *DEB2 (dev_dbg (&adap->dev,"hw routines registered.\n" ));/* register new adapter to i2c module... */ - - adap->id |=I2C_ALGO_BIT ; adap->algo = &i2c_bit_algo; adap->timeout =100 ;/* default values, should */
drivers/i2c/algos/i2c-algo-ite.c +0 -2
@@ -736,8 +736,6 @@ int i2c_iic_add_bus(struct i2c_adapter * adap->name));/* register new adapter to i2c module... */ - - adap->id |=I2C_ALGO_IIC ; adap->algo = &iic_algo; adap->timeout =100 ;/* default values, should */
drivers/i2c/algos/i2c-algo-pca.c +0 -2
@@ -369,8 +369,6 @@ int i2c_pca_add_bus(struct i2c_adapter *int rval;/* register new adapter to i2c module... */ - - adap->id |=I2C_ALGO_PCA ; adap->algo = &pca_algo; adap->timeout =100 ;/* default values, should */
drivers/i2c/algos/i2c-algo-pcf.c +0 -2
@@ -474,8 +474,6 @@ int i2c_pcf_add_bus(struct i2c_adapter *DEB2 (dev_dbg (&adap->dev,"hw routines registered.\n" ));/* register new adapter to i2c module... */ - - adap->id |=I2C_ALGO_PCF ; adap->algo = &pcf_algo; adap->timeout =100 ;/* default values, should */
drivers/i2c/algos/i2c-algo-sgi.c +0 -1
@@ -167,7 +167,6 @@ static struct i2c_algorithm sgi_algo = {*/ int i2c_sgi_add_bus (struct i2c_adapter *adap) { - adap->id |=I2C_ALGO_SGI ; adap->algo = &sgi_algo;return i2c_add_adapter (adap);
drivers/i2c/algos/i2c-algo-sibyte.c +0 -2
@@ -149,8 +149,6 @@ int i2c_sibyte_add_bus(struct i2c_adaptestruct i2c_algo_sibyte_data *adap = i2c_adap->algo_data;/* register new adapter to i2c module... */ - - i2c_adap->id |=I2C_ALGO_SIBYTE ; i2c_adap->algo = &i2c_sibyte_algo;/* Set the frequency to 100 kHz */
drivers/i2c/busses/i2c-ibm_iic.c +1 -1
@@ -725,7 +725,7 @@ static int __devinit iic_probe(struct oc adap = &dev->adap;strcpy (adap->name,"IBM IIC" );i2c_set_adapdata (adap, dev); - adap->id =I2C_ALGO_OCP |I2C_HW_OCP ; + adap->id =I2C_HW_OCP ; adap->algo = &iic_algo; adap->client_register =NULL ; adap->client_unregister =NULL ;
drivers/i2c/busses/i2c-isa.c +1 -1
@@ -49,7 +49,7 @@ static struct i2c_algorithm isa_algorith/* There can only be one... */ static struct i2c_adapter isa_adapter = { .owner =THIS_MODULE , - .id =I2C_ALGO_ISA |I2C_HW_ISA , + .id =I2C_HW_ISA , .class =I2C_CLASS_HWMON , .algo = &isa_algorithm, .name ="ISA main adapter" ,
drivers/i2c/busses/i2c-mpc.c +1 -1
@@ -279,7 +279,7 @@ static struct i2c_algorithm mpc_algo = {static struct i2c_adapter mpc_ops = { .owner =THIS_MODULE , .name ="MPC adapter" , - .id =I2C_ALGO_MPC107 |I2C_HW_MPC107 , + .id =I2C_HW_MPC107 , .algo = &mpc_algo, .class =I2C_CLASS_HWMON , .timeout =1 ,
drivers/i2c/busses/i2c-mv64xxx.c +1 -1
@@ -521,7 +521,7 @@ mv64xxx_i2c_probe(struct device *dev) drv_data->freq_m = pdata->freq_m; drv_data->freq_n = pdata->freq_n; drv_data->irq =platform_get_irq (pd,0 ); - drv_data->adapter.id =I2C_ALGO_MV64XXX |I2C_HW_MV64XXX ; + drv_data->adapter.id =I2C_HW_MV64XXX ; drv_data->adapter.algo = &mv64xxx_i2c_algo; drv_data->adapter.owner =THIS_MODULE ; drv_data->adapter.class =I2C_CLASS_HWMON ;
drivers/media/video/bt832.c +1 -1
@@ -188,7 +188,7 @@ static int bt832_probe(struct i2c_adapteif (adap->class &I2C_CLASS_TV_ANALOG )return i2c_probe (adap, &addr_data, bt832_attach);#else -if (adap->id = (I2C_ALGO_BIT |I2C_HW_B_BT848 )) +if (adap->id =I2C_HW_B_BT848 )return i2c_probe (adap, &addr_data, bt832_attach);#endif return 0 ;
drivers/media/video/bttv-i2c.c +1 -1
@@ -281,7 +281,7 @@ static struct i2c_adapter bttv_i2c_adap_ .class = I2C_CLASS_TV_ANALOG,#endif I2C_DEVNAME("bt878"), - .id = I2C_ALGO_BIT | I2C_HW_B_BT848 /* FIXME */, + .id = I2C_HW_B_BT848 /* FIXME */, .algo = &bttv_algo, .client_register = attach_inform, };
drivers/media/video/ir-kbd-i2c.c +1 -1
@@ -429,7 +429,7 @@ static int ir_probe(struct i2c_adapter *struct i2c_client c;char buf;int i,rc;switch (adap->id) { -case I2C_ALGO_BIT |I2C_HW_B_BT848 : +case I2C_HW_B_BT848 : probe = probe_bttv;break ;case I2C_ALGO_SAA7134 :
drivers/media/video/ovcamchip/ov6x20.c +3 -3
@@ -164,10 +164,10 @@ static int ov6x20_init(struct i2c_clientDDEBUG (4 , &c->dev,"entered" );switch (c->adapter->id) { -case I2C_ALGO_SMBUS |I2C_HW_SMBUS_OV511 : +case I2C_HW_SMBUS_OV511 : rc =ov_write_regvals (c, regvals_init_6x20_511);break ; -case I2C_ALGO_SMBUS |I2C_HW_SMBUS_OV518 : +case I2C_HW_SMBUS_OV518 : rc =ov_write_regvals (c, regvals_init_6x20_518);break ;default :
@@ -338,7 +338,7 @@ static int ov6x20_mode_init(struct i2c_c/******** Palette-specific regs ********/ /* OV518 needs 8 bit multiplexed in color mode, and 16 bit in B&W */ -if (c->adapter->id = (I2C_ALGO_SMBUS |I2C_HW_SMBUS_OV518 )) { +if (c->adapter->id =I2C_HW_SMBUS_OV518 ) {if (win->format =VIDEO_PALETTE_GREY )ov_write_mask (c,0x13 ,0x00 ,0x20 );else
drivers/media/video/ovcamchip/ov6x30.c +2 -2
@@ -301,7 +301,7 @@ static int ov6x30_mode_init(struct i2c_c/******** Palette-specific regs ********/ if (win->format =VIDEO_PALETTE_GREY ) { -if (c->adapter->id = (I2C_ALGO_SMBUS |I2C_HW_SMBUS_OV518 )) { +if (c->adapter->id =I2C_HW_SMBUS_OV518 ) {/* Do nothing - we're already in 8-bit mode */ }else {ov_write_mask (c,0x13 ,0x20 ,0x20 );
@@ -313,7 +313,7 @@ static int ov6x30_mode_init(struct i2c_c* Therefore, the OV6630 needs to be in 8-bit multiplexed * output mode */ -if (c->adapter->id = (I2C_ALGO_SMBUS |I2C_HW_SMBUS_OV518 )) { +if (c->adapter->id =I2C_HW_SMBUS_OV518 ) {/* Do nothing - we want to stay in 8-bit mode */ /* Warning: Messing with reg 0x13 breaks OV518 color */ }else {
drivers/media/video/ovcamchip/ovcamchip_core.c +4 -4
@@ -296,10 +296,10 @@ static int ovcamchip_attach(struct i2c_a* attach to adapters that are known to contain OV camera chips. */ switch (adap->id) { -case (I2C_ALGO_SMBUS |I2C_HW_SMBUS_OV511 ): -case (I2C_ALGO_SMBUS |I2C_HW_SMBUS_OV518 ): -case (I2C_ALGO_SMBUS |I2C_HW_SMBUS_OVFX2 ): -case (I2C_ALGO_SMBUS |I2C_HW_SMBUS_W9968CF ): +case I2C_HW_SMBUS_OV511 : +case I2C_HW_SMBUS_OV518 : +case I2C_HW_SMBUS_OVFX2 : +case I2C_HW_SMBUS_W9968CF :PDEBUG (1 ,"Adapter ID 0x%06x accepted" , adap->id);break ;default :
drivers/media/video/tda7432.c +1 -1
@@ -328,7 +328,7 @@ static int tda7432_probe(struct i2c_adapif (adap->class &I2C_CLASS_TV_ANALOG )return i2c_probe (adap, &addr_data, tda7432_attach);#else -if (adap->id = (I2C_ALGO_BIT |I2C_HW_B_BT848 )) +if (adap->id =I2C_HW_B_BT848 )return i2c_probe (adap, &addr_data, tda7432_attach);#endif return 0 ;
drivers/media/video/tda9875.c +1 -1
@@ -262,7 +262,7 @@ static int tda9875_probe(struct i2c_adapif (adap->class &I2C_CLASS_TV_ANALOG )return i2c_probe (adap, &addr_data, tda9875_attach);#else -if (adap->id = (I2C_ALGO_BIT |I2C_HW_B_BT848 )) +if (adap->id =I2C_HW_B_BT848 )return i2c_probe (adap, &addr_data, tda9875_attach);#endif return 0 ;
drivers/media/video/tda9887.c +2 -2
@@ -618,8 +618,8 @@ static int tda9887_probe(struct i2c_adapreturn i2c_probe (adap, &addr_data, tda9887_attach);#else switch (adap->id) { -case I2C_ALGO_BIT |I2C_HW_B_BT848 : -case I2C_ALGO_BIT |I2C_HW_B_RIVA : +case I2C_HW_B_BT848 : +case I2C_HW_B_RIVA :case I2C_ALGO_SAA7134 :return i2c_probe (adap, &addr_data, tda9887_attach);break ;
drivers/media/video/tuner-3036.c +1 -1
@@ -165,7 +165,7 @@ static int tuner_probe(struct i2c_adapter *adap) { this_adap =0 ; -if (adap->id = (I2C_ALGO_BIT |I2C_HW_B_LP )) +if (adap->id =I2C_HW_B_LP )return i2c_probe (adap, &addr_data, tuner_attach);return 0 ; }
drivers/media/video/tvaudio.c +3 -3
@@ -1098,7 +1098,7 @@ static int tda8425_initialize(struct CHI/* extern */ TDA8425_S1_CH1 ,/* intern */ TDA8425_S1_OFF , /* off */ TDA8425_S1_OFF, /* on */ TDA8425_S1_CH2}; -if (chip->c.adapter->id = (I2C_ALGO_BIT |I2C_HW_B_RIVA )) { +if (chip->c.adapter->id =I2C_HW_B_RIVA ) {memcpy (desc->inputmap, inputmap,sizeof (inputmap)); }return 0 ;
@@ -1555,8 +1555,8 @@ static int chip_probe(struct i2c_adapterreturn i2c_probe (adap, &addr_data, chip_attach);#else switch (adap->id) { -case I2C_ALGO_BIT |I2C_HW_B_BT848 : -case I2C_ALGO_BIT |I2C_HW_B_RIVA : +case I2C_HW_B_BT848 : +case I2C_HW_B_RIVA :case I2C_ALGO_SAA7134 :return i2c_probe (adap, &addr_data, chip_attach); }
drivers/media/video/tveeprom.c +1 -1
@@ -534,7 +534,7 @@ static int tveeprom_attach_adapter (struct i2c_adapter *adapter) {dprintk (1 ,"%s: id 0x%x\n" ,__FUNCTION__,adapter->id); -if (adapter->id != (I2C_ALGO_BIT |I2C_HW_B_BT848 )) +if (adapter->id !=I2C_HW_B_BT848 )return 0 ;return i2c_probe (adapter, &addr_data, tveeprom_detect_client); }
drivers/media/video/tvmixer.c +3 -3
@@ -276,9 +276,9 @@ static int tvmixer_clients(struct i2c_cl#else /* TV card ??? */ switch (client->adapter->id) { -case I2C_ALGO_BIT |I2C_HW_SMBUS_VOODOO3 : -case I2C_ALGO_BIT |I2C_HW_B_BT848 : -case I2C_ALGO_BIT |I2C_HW_B_RIVA : +case I2C_HW_SMBUS_VOODOO3 : +case I2C_HW_B_BT848 : +case I2C_HW_B_RIVA :/* ok, have a look ... */ break ;default :
drivers/usb/media/w9968cf.c +1 -1
@@ -1579,7 +1579,7 @@ static int w9968cf_i2c_init(struct w9968 };static struct i2c_adapter adap = { - .id =I2C_ALGO_SMBUS |I2C_HW_SMBUS_W9968CF , + .id =I2C_HW_SMBUS_W9968CF , .class =I2C_CLASS_CAM_DIGITAL , .owner =THIS_MODULE , .client_register = w9968cf_i2c_attach_inform,
drivers/video/matrox/matroxfb_maven.c +1 -1
@@ -1271,7 +1271,7 @@ ERROR0:; }static int maven_attach_adapter (struct i2c_adapter * adapter) { -if (adapter->id = (I2C_ALGO_BIT |I2C_HW_B_G400 )) +if (adapter->id =I2C_HW_B_G400 )return i2c_probe (adapter, &addr_data, &maven_detect_client);return 0 ; }
include/linux/i2c-id.h +64 -64
167 lines not on this page · raw message
include/linux/i2c-isa.h +1 -1
@@ -29,7 +29,7 @@ extern int i2c_isa_del_driver(struct i2c/* Detect whether we are on the isa bus. This is only useful to hybrid (i2c+isa) drivers. */ #define i2c_is_isa_adapter (adapptr) \ - ((adapptr)->id = (I2C_ALGO_ISA | I2C_HW_ISA)) + ((adapptr)->id = I2C_HW_ISA)#define i2c_is_isa_client (clientptr) \ i2c_is_isa_adapter((clientptr)->adapter)