* [PATCH] (0/7) I2C: Kill i2c_algorithm.{name,id}
@ 2005-08-11 21:18 Jean Delvare
2005-08-11 21:33 ` [PATCH] (1/7) I2C: Kill i2c_algorithm.name Jean Delvare
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Jean Delvare @ 2005-08-11 21:18 UTC (permalink / raw)
To: LKML
Hi all,
Here comes another patchset affecting the whole i2c subsystem. I am
posting it here mainly for the media/video folks to look at, as it
affects most of their drivers and may conflict with their own pending
patches. But comments from everyone are also welcome, of course.
The goal of this patchset is to get rid of the name and id members of
the i2c_algorithm struct. I believe that they are not useful enough to
justify their existence. "name" is filled by all drivers but not used
anywhere. "id" is filled by most drivers, and used at places, but all
uses can easily be replaced, and doing so is even benefical in term of
code quality. There were quite a significant number of cases where i2c
algorithm IDs were missing or misused, proving my point that we better
get rid of it.
This patchset is composed of 7 patches, which apply on top of each other
in order, and which I'll be posting as replies to this post.
This patchset is (obviously) not meant for 2.6.13 (maybe not even
2.6.14). It should go to -mm through Greg KH's i2c tree. BTW, it is
meant to be applied on top of Greg's current i2c tree, and may not apply
properly to -stable or -linus. It should hopefully apply properly to -mm
though.
Thanks.
drivers/i2c/algos/i2c-algo-bit.c | 4 -
drivers/i2c/algos/i2c-algo-ite.c | 4 -
drivers/i2c/algos/i2c-algo-pca.c | 4 -
drivers/i2c/algos/i2c-algo-pcf.c | 4 -
drivers/i2c/algos/i2c-algo-sgi.c | 3 -
drivers/i2c/algos/i2c-algo-sibyte.c | 4 -
drivers/i2c/busses/i2c-ali1535.c | 2 -
drivers/i2c/busses/i2c-ali1563.c | 2 -
drivers/i2c/busses/i2c-ali15x3.c | 2 -
drivers/i2c/busses/i2c-amd756.c | 2 -
drivers/i2c/busses/i2c-amd8111.c | 2 -
drivers/i2c/busses/i2c-au1550.c | 2 -
drivers/i2c/busses/i2c-i801.c | 2 -
drivers/i2c/busses/i2c-ibm_iic.c | 4 -
drivers/i2c/busses/i2c-iop3xx.c | 2 -
drivers/i2c/busses/i2c-isa.c | 3 -
drivers/i2c/busses/i2c-keywest.c | 3 -
drivers/i2c/busses/i2c-mpc.c | 4 -
drivers/i2c/busses/i2c-mv64xxx.c | 4 -
drivers/i2c/busses/i2c-nforce2.c | 2 -
drivers/i2c/busses/i2c-piix4.c | 2 -
drivers/i2c/busses/i2c-s3c2410.c | 1 -
drivers/i2c/busses/i2c-sis5595.c | 2 -
drivers/i2c/busses/i2c-sis630.c | 2 -
drivers/i2c/busses/i2c-sis96x.c | 2 -
drivers/i2c/busses/i2c-stub.c | 2 -
drivers/i2c/busses/i2c-viapro.c | 2 -
drivers/i2c/busses/scx200_acb.c | 4 -
drivers/media/common/saa7146_i2c.c | 4 -
drivers/media/dvb/b2c2/flexcop-i2c.c | 3 -
drivers/media/dvb/dvb-usb/cxusb.c | 2 -
drivers/media/dvb/dvb-usb/dibusb-common.c | 2 -
drivers/media/dvb/dvb-usb/digitv.c | 2 -
drivers/media/dvb/dvb-usb/dvb-usb-i2c.c | 1 -
drivers/media/dvb/pluto2/pluto2.c | 1 -
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 3 -
drivers/media/video/bt832.c | 2
drivers/media/video/bttv-i2c.c | 4 -
drivers/media/video/ir-kbd-i2c.c | 4
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/saa7134/saa7134-i2c.c | 4 -
drivers/media/video/tda7432.c | 2
drivers/media/video/tda9840.c | 2
drivers/media/video/tda9875.c | 2
drivers/media/video/tda9887.c | 6
drivers/media/video/tea6415c.c | 2
drivers/media/video/tea6420.c | 2
drivers/media/video/tuner-3036.c | 2
drivers/media/video/tvaudio.c | 10
drivers/media/video/tveeprom.c | 2
drivers/media/video/tvmixer.c | 6
drivers/usb/media/w9968cf.c | 4 -
drivers/video/aty/radeon_i2c.c | 2
drivers/video/matrox/matroxfb_maven.c | 2
drivers/video/nvidia/nv_i2c.c | 3 -
drivers/video/riva/rivafb-i2c.c | 3 -
drivers/video/savage/savagefb-i2c.c | 3 -
include/linux/i2c-id.h | 192 ++++++++--------------
include/linux/i2c-isa.h | 6
include/linux/i2c.h | 3 -
include/media/id.h | 5 -
63 files changed, 119 insertions(+), 266 deletions(-)
--
Jean Delvare
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] (1/7) I2C: Kill i2c_algorithm.name
2005-08-11 21:18 [PATCH] (0/7) I2C: Kill i2c_algorithm.{name,id} Jean Delvare
@ 2005-08-11 21:33 ` Jean Delvare
2005-08-11 21:36 ` [PATCH] (2/7) I2C: Kill i2c_algorithm.id Jean Delvare
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Jean Delvare @ 2005-08-11 21:33 UTC (permalink / raw)
To: LKML
The name member of the i2c_algorithm is never used, although all
drivers conscientiously fill it. We can drop it completely, this
structure doesn't need to have a name.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/i2c/algos/i2c-algo-bit.c | 1 -
drivers/i2c/algos/i2c-algo-ite.c | 1 -
drivers/i2c/algos/i2c-algo-pca.c | 1 -
drivers/i2c/algos/i2c-algo-pcf.c | 1 -
drivers/i2c/algos/i2c-algo-sgi.c | 1 -
drivers/i2c/algos/i2c-algo-sibyte.c | 1 -
drivers/i2c/busses/i2c-ali1535.c | 1 -
drivers/i2c/busses/i2c-ali1563.c | 1 -
drivers/i2c/busses/i2c-ali15x3.c | 1 -
drivers/i2c/busses/i2c-amd756.c | 1 -
drivers/i2c/busses/i2c-amd8111.c | 1 -
drivers/i2c/busses/i2c-au1550.c | 1 -
drivers/i2c/busses/i2c-i801.c | 1 -
drivers/i2c/busses/i2c-ibm_iic.c | 1 -
drivers/i2c/busses/i2c-iop3xx.c | 1 -
drivers/i2c/busses/i2c-isa.c | 1 -
drivers/i2c/busses/i2c-keywest.c | 1 -
drivers/i2c/busses/i2c-mpc.c | 1 -
drivers/i2c/busses/i2c-mv64xxx.c | 1 -
drivers/i2c/busses/i2c-nforce2.c | 1 -
drivers/i2c/busses/i2c-piix4.c | 1 -
drivers/i2c/busses/i2c-s3c2410.c | 1 -
drivers/i2c/busses/i2c-sis5595.c | 1 -
drivers/i2c/busses/i2c-sis630.c | 1 -
drivers/i2c/busses/i2c-sis96x.c | 1 -
drivers/i2c/busses/i2c-stub.c | 1 -
drivers/i2c/busses/i2c-viapro.c | 1 -
drivers/i2c/busses/scx200_acb.c | 1 -
drivers/media/common/saa7146_i2c.c | 1 -
drivers/media/dvb/b2c2/flexcop-i2c.c | 1 -
drivers/media/dvb/dvb-usb/cxusb.c | 1 -
drivers/media/dvb/dvb-usb/dibusb-common.c | 1 -
drivers/media/dvb/dvb-usb/digitv.c | 1 -
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 1 -
drivers/media/video/bttv-i2c.c | 1 -
drivers/media/video/saa7134/saa7134-i2c.c | 1 -
drivers/usb/media/w9968cf.c | 1 -
include/linux/i2c.h | 1 -
38 files changed, 38 deletions(-)
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-bit.c 2005-08-01 22:48:49.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-bit.c 2005-08-02 20:30:04.000000000 +0200
@@ -519,7 +519,6 @@
/* -----exported algorithm data: ------------------------------------- */
static struct i2c_algorithm i2c_bit_algo = {
- .name = "Bit-shift algorithm",
.id = I2C_ALGO_BIT,
.master_xfer = bit_xfer,
.functionality = bit_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-ite.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-ite.c 2005-08-02 20:30:04.000000000 +0200
@@ -713,7 +713,6 @@
/* -----exported algorithm data: ------------------------------------- */
static struct i2c_algorithm iic_algo = {
- .name = "ITE IIC algorithm",
.id = I2C_ALGO_IIC,
.master_xfer = iic_xfer,
.algo_control = algo_control, /* ioctl */
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-pca.c 2005-08-02 18:49:31.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-pca.c 2005-08-02 20:30:04.000000000 +0200
@@ -356,7 +356,6 @@
}
static struct i2c_algorithm pca_algo = {
- .name = "PCA9564 algorithm",
.id = I2C_ALGO_PCA,
.master_xfer = pca_xfer,
.functionality = pca_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-pcf.c 2005-08-01 22:48:49.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-pcf.c 2005-08-02 20:30:04.000000000 +0200
@@ -459,7 +459,6 @@
/* -----exported algorithm data: ------------------------------------- */
static struct i2c_algorithm pcf_algo = {
- .name = "PCF8584 algorithm",
.id = I2C_ALGO_PCF,
.master_xfer = pcf_xfer,
.functionality = pcf_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-sgi.c 2005-08-01 22:48:49.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-sgi.c 2005-08-02 20:30:04.000000000 +0200
@@ -158,7 +158,6 @@
}
static struct i2c_algorithm sgi_algo = {
- .name = "SGI algorithm",
.id = I2C_ALGO_SGI,
.master_xfer = sgi_xfer,
.functionality = sgi_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-sibyte.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-sibyte.c 2005-08-02 18:49:40.000000000 +0200
@@ -135,7 +135,6 @@
/* -----exported algorithm data: ------------------------------------- */
static struct i2c_algorithm i2c_sibyte_algo = {
- .name = "SiByte algorithm",
.id = I2C_ALGO_SIBYTE,
.smbus_xfer = smbus_xfer,
.algo_control = algo_control, /* ioctl */
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-ali1535.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-ali1535.c 2005-08-02 18:49:40.000000000 +0200
@@ -472,7 +472,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .name = "Non-i2c SMBus adapter",
.id = I2C_ALGO_SMBUS,
.smbus_xfer = ali1535_access,
.functionality = ali1535_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-ali1563.c 2005-08-01 22:48:49.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-ali1563.c 2005-08-02 18:49:40.000000000 +0200
@@ -366,7 +366,6 @@
}
static struct i2c_algorithm ali1563_algorithm = {
- .name = "Non-i2c SMBus adapter",
.id = I2C_ALGO_SMBUS,
.smbus_xfer = ali1563_access,
.functionality = ali1563_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-ali15x3.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-ali15x3.c 2005-08-02 18:49:40.000000000 +0200
@@ -462,7 +462,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .name = "Non-I2C SMBus adapter",
.id = I2C_ALGO_SMBUS,
.smbus_xfer = ali15x3_access,
.functionality = ali15x3_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-amd756.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-amd756.c 2005-08-02 18:49:40.000000000 +0200
@@ -295,7 +295,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .name = "Non-I2C SMBus adapter",
.id = I2C_ALGO_SMBUS,
.smbus_xfer = amd756_access,
.functionality = amd756_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-amd8111.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-amd8111.c 2005-08-02 18:49:40.000000000 +0200
@@ -323,7 +323,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .name = "Non-I2C SMBus 2.0 adapter",
.id = I2C_ALGO_SMBUS,
.smbus_xfer = amd8111_access,
.functionality = amd8111_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-au1550.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-au1550.c 2005-08-02 18:49:40.000000000 +0200
@@ -283,7 +283,6 @@
}
static struct i2c_algorithm au1550_algo = {
- .name = "Au1550 algorithm",
.id = I2C_ALGO_AU1550,
.master_xfer = au1550_xfer,
.functionality = au1550_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-i801.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-i801.c 2005-08-02 18:49:40.000000000 +0200
@@ -535,7 +535,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .name = "Non-I2C SMBus adapter",
.id = I2C_ALGO_SMBUS,
.smbus_xfer = i801_access,
.functionality = i801_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-ibm_iic.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-ibm_iic.c 2005-08-02 20:30:04.000000000 +0200
@@ -627,7 +627,6 @@
}
static struct i2c_algorithm iic_algo = {
- .name = "IBM IIC algorithm",
.id = I2C_ALGO_OCP,
.master_xfer = iic_xfer,
.functionality = iic_func
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-iop3xx.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-iop3xx.c 2005-08-02 18:49:40.000000000 +0200
@@ -399,7 +399,6 @@
}
static struct i2c_algorithm iop3xx_i2c_algo = {
- .name = "IOP3xx I2C algorithm",
.id = I2C_ALGO_IOP3XX,
.master_xfer = iop3xx_i2c_master_xfer,
.algo_control = iop3xx_i2c_algo_control,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-isa.c 2005-08-02 18:42:06.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-isa.c 2005-08-02 20:30:04.000000000 +0200
@@ -43,7 +43,6 @@
/* This is the actual algorithm we define */
static struct i2c_algorithm isa_algorithm = {
- .name = "ISA bus algorithm",
.id = I2C_ALGO_ISA,
.functionality = isa_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-keywest.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-keywest.c 2005-08-02 18:49:40.000000000 +0200
@@ -498,7 +498,6 @@
/* For now, we only handle combined mode (smbus) */
static struct i2c_algorithm keywest_algorithm = {
- .name = "Keywest i2c",
.id = I2C_ALGO_SMBUS,
.smbus_xfer = keywest_smbus_xfer,
.master_xfer = keywest_xfer,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-mpc.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-mpc.c 2005-08-02 18:49:40.000000000 +0200
@@ -272,7 +272,6 @@
}
static struct i2c_algorithm mpc_algo = {
- .name = "MPC algorithm",
.id = I2C_ALGO_MPC107,
.master_xfer = mpc_xfer,
.functionality = mpc_functionality,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-mv64xxx.c 2005-08-01 22:48:49.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-mv64xxx.c 2005-08-02 18:49:40.000000000 +0200
@@ -433,7 +433,6 @@
}
static struct i2c_algorithm mv64xxx_i2c_algo = {
- .name = MV64XXX_I2C_CTLR_NAME " algorithm",
.id = I2C_ALGO_MV64XXX,
.master_xfer = mv64xxx_i2c_xfer,
.functionality = mv64xxx_i2c_functionality,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-nforce2.c 2005-08-02 18:47:21.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-nforce2.c 2005-08-02 18:49:40.000000000 +0200
@@ -105,7 +105,6 @@
static struct i2c_algorithm smbus_algorithm = {
- .name = "Non-I2C SMBus adapter",
.id = I2C_ALGO_SMBUS,
.smbus_xfer = nforce2_access,
.functionality = nforce2_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-piix4.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-piix4.c 2005-08-02 18:49:40.000000000 +0200
@@ -399,7 +399,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .name = "Non-I2C SMBus adapter",
.id = I2C_ALGO_SMBUS,
.smbus_xfer = piix4_access,
.functionality = piix4_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-s3c2410.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-s3c2410.c 2005-08-02 18:49:40.000000000 +0200
@@ -568,7 +568,6 @@
/* i2c bus registration info */
static struct i2c_algorithm s3c24xx_i2c_algorithm = {
- .name = "S3C2410-I2C-Algorithm",
.master_xfer = s3c24xx_i2c_xfer,
.functionality = s3c24xx_i2c_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-sis5595.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-sis5595.c 2005-08-02 18:49:40.000000000 +0200
@@ -357,7 +357,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .name = "Non-I2C SMBus adapter",
.id = I2C_ALGO_SMBUS,
.smbus_xfer = sis5595_access,
.functionality = sis5595_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-sis630.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-sis630.c 2005-08-02 18:49:40.000000000 +0200
@@ -448,7 +448,6 @@
static struct i2c_algorithm smbus_algorithm = {
- .name = "Non-I2C SMBus adapter",
.id = I2C_ALGO_SMBUS,
.smbus_xfer = sis630_access,
.functionality = sis630_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-sis96x.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-sis96x.c 2005-08-02 18:49:40.000000000 +0200
@@ -249,7 +249,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .name = "Non-I2C SMBus adapter",
.id = I2C_ALGO_SMBUS,
.smbus_xfer = sis96x_access,
.functionality = sis96x_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-stub.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-stub.c 2005-08-02 18:49:40.000000000 +0200
@@ -109,7 +109,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .name = "Non-I2C SMBus adapter",
.id = I2C_ALGO_SMBUS,
.functionality = stub_func,
.smbus_xfer = stub_xfer,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-viapro.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-viapro.c 2005-08-02 18:49:40.000000000 +0200
@@ -286,7 +286,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .name = "Non-I2C SMBus adapter",
.id = I2C_ALGO_SMBUS,
.smbus_xfer = vt596_access,
.functionality = vt596_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/scx200_acb.c 2005-08-02 18:31:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/scx200_acb.c 2005-08-02 18:49:40.000000000 +0200
@@ -395,7 +395,6 @@
/* For now, we only handle combined mode (smbus) */
static struct i2c_algorithm scx200_acb_algorithm = {
- .name = "NatSemi SCx200 ACCESS.bus",
.id = I2C_ALGO_SMBUS,
.smbus_xfer = scx200_acb_smbus_xfer,
.functionality = scx200_acb_func,
--- linux-2.6.13-rc5.orig/drivers/media/common/saa7146_i2c.c 2005-08-01 22:48:49.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/common/saa7146_i2c.c 2005-08-02 18:49:40.000000000 +0200
@@ -387,7 +387,6 @@
/* exported algorithm data */
static struct i2c_algorithm saa7146_algo = {
- .name = "saa7146 i2c algorithm",
.id = I2C_ALGO_SAA7146,
.master_xfer = saa7146_i2c_xfer,
.functionality = saa7146_i2c_func,
--- linux-2.6.13-rc5.orig/drivers/media/dvb/b2c2/flexcop-i2c.c 2005-08-01 22:48:49.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/dvb/b2c2/flexcop-i2c.c 2005-08-02 18:49:40.000000000 +0200
@@ -172,7 +172,6 @@
}
static struct i2c_algorithm flexcop_algo = {
- .name = "FlexCop I2C algorithm",
.id = I2C_ALGO_BIT,
.master_xfer = flexcop_master_xfer,
.functionality = flexcop_i2c_func,
--- linux-2.6.13-rc5.orig/drivers/media/dvb/dvb-usb/cxusb.c 2005-08-02 18:31:07.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/dvb/dvb-usb/cxusb.c 2005-08-02 18:49:40.000000000 +0200
@@ -141,7 +141,6 @@
}
static struct i2c_algorithm cxusb_i2c_algo = {
- .name = "Conexant USB I2C algorithm",
.id = I2C_ALGO_BIT,
.master_xfer = cxusb_i2c_xfer,
.functionality = cxusb_i2c_func,
--- linux-2.6.13-rc5.orig/drivers/media/dvb/dvb-usb/dibusb-common.c 2005-08-02 18:31:07.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/dvb/dvb-usb/dibusb-common.c 2005-08-02 18:49:40.000000000 +0200
@@ -147,7 +147,6 @@
}
struct i2c_algorithm dibusb_i2c_algo = {
- .name = "DiBcom USB I2C algorithm",
.id = I2C_ALGO_BIT,
.master_xfer = dibusb_i2c_xfer,
.functionality = dibusb_i2c_func,
--- linux-2.6.13-rc5.orig/drivers/media/dvb/dvb-usb/digitv.c 2005-08-02 18:31:07.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/dvb/dvb-usb/digitv.c 2005-08-02 18:49:40.000000000 +0200
@@ -77,7 +77,6 @@
}
static struct i2c_algorithm digitv_i2c_algo = {
- .name = "Nebula DigiTV USB I2C algorithm",
.id = I2C_ALGO_BIT,
.master_xfer = digitv_i2c_xfer,
.functionality = digitv_i2c_func,
--- linux-2.6.13-rc5.orig/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c 2005-08-02 18:31:08.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c 2005-08-02 18:49:40.000000000 +0200
@@ -1472,7 +1472,6 @@
static struct i2c_algorithm ttusb_dec_algo = {
- .name = "ttusb dec i2c algorithm",
.id = I2C_ALGO_BIT,
.master_xfer = master_xfer,
.functionality = functionality,
--- linux-2.6.13-rc5.orig/drivers/media/video/bttv-i2c.c 2005-08-02 18:31:08.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/bttv-i2c.c 2005-08-02 18:49:40.000000000 +0200
@@ -270,7 +270,6 @@
}
static struct i2c_algorithm bttv_algo = {
- .name = "bt878",
.id = I2C_ALGO_BIT | I2C_HW_B_BT848 /* FIXME */,
.master_xfer = bttv_i2c_xfer,
.algo_control = algo_control,
--- linux-2.6.13-rc5.orig/drivers/media/video/saa7134/saa7134-i2c.c 2005-08-02 18:31:08.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/saa7134/saa7134-i2c.c 2005-08-02 18:49:40.000000000 +0200
@@ -370,7 +370,6 @@
}
static struct i2c_algorithm saa7134_algo = {
- .name = "saa7134",
.id = I2C_ALGO_SAA7134,
.master_xfer = saa7134_i2c_xfer,
.algo_control = algo_control,
--- linux-2.6.13-rc5.orig/drivers/usb/media/w9968cf.c 2005-08-01 22:48:49.000000000 +0200
+++ linux-2.6.13-rc5/drivers/usb/media/w9968cf.c 2005-08-02 18:49:40.000000000 +0200
@@ -1573,7 +1573,6 @@
int err = 0;
static struct i2c_algorithm algo = {
- .name = "W996[87]CF algorithm",
.id = I2C_ALGO_SMBUS,
.smbus_xfer = w9968cf_i2c_smbus_xfer,
.algo_control = w9968cf_i2c_control,
--- linux-2.6.13-rc5.orig/include/linux/i2c.h 2005-08-02 18:49:38.000000000 +0200
+++ linux-2.6.13-rc5/include/linux/i2c.h 2005-08-02 18:49:40.000000000 +0200
@@ -192,7 +192,6 @@
* to name two of the most common.
*/
struct i2c_algorithm {
- char name[32]; /* textual description */
unsigned int id;
/* If an adapter algorithm can't do I2C-level access, set master_xfer
--
Jean Delvare
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] (2/7) I2C: Kill i2c_algorithm.id
2005-08-11 21:18 [PATCH] (0/7) I2C: Kill i2c_algorithm.{name,id} Jean Delvare
2005-08-11 21:33 ` [PATCH] (1/7) I2C: Kill i2c_algorithm.name Jean Delvare
@ 2005-08-11 21:36 ` Jean Delvare
2005-08-11 21:38 ` [PATCH] (3/7) " Jean Delvare
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Jean Delvare @ 2005-08-11 21:36 UTC (permalink / raw)
To: LKML
Use the adapter id rather than the algorithm id to detect the i2c-isa
pseudo-adapter. This saves one level of dereferencing, and the
algorithm ids will soon be gone anyway.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/i2c/busses/i2c-isa.c | 1 +
include/linux/i2c-isa.h | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-isa.c 2005-08-02 20:30:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-isa.c 2005-08-02 20:30:24.000000000 +0200
@@ -50,6 +50,7 @@
/* There can only be one... */
static struct i2c_adapter isa_adapter = {
.owner = THIS_MODULE,
+ .id = I2C_ALGO_ISA | I2C_HW_ISA,
.class = I2C_CLASS_HWMON,
.algo = &isa_algorithm,
.name = "ISA main adapter",
--- linux-2.6.13-rc5.orig/include/linux/i2c-isa.h 2005-08-02 20:30:04.000000000 +0200
+++ linux-2.6.13-rc5/include/linux/i2c-isa.h 2005-08-02 20:30:24.000000000 +0200
@@ -28,9 +28,9 @@
/* Detect whether we are on the isa bus. This is only useful to hybrid
(i2c+isa) drivers. */
-#define i2c_is_isa_client(clientptr) \
- ((clientptr)->adapter->algo->id == I2C_ALGO_ISA)
#define i2c_is_isa_adapter(adapptr) \
- ((adapptr)->algo->id == I2C_ALGO_ISA)
+ ((adapptr)->id == (I2C_ALGO_ISA | I2C_HW_ISA))
+#define i2c_is_isa_client(clientptr) \
+ i2c_is_isa_adapter((clientptr)->adapter)
#endif /* _LINUX_I2C_ISA_H */
--
Jean Delvare
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] (3/7) I2C: Kill i2c_algorithm.id
2005-08-11 21:18 [PATCH] (0/7) I2C: Kill i2c_algorithm.{name,id} Jean Delvare
2005-08-11 21:33 ` [PATCH] (1/7) I2C: Kill i2c_algorithm.name Jean Delvare
2005-08-11 21:36 ` [PATCH] (2/7) I2C: Kill i2c_algorithm.id Jean Delvare
@ 2005-08-11 21:38 ` Jean Delvare
2005-08-11 21:40 ` [PATCH] (4/7) " Jean Delvare
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Jean Delvare @ 2005-08-11 21:38 UTC (permalink / raw)
To: LKML
Don't rely on i2c_algorithm.id to alter the i2c adapter's id, use the
I2C_ALGO_* value directly instead, because i2c_algorithm will soon
have no id member no more.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
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 | 2 +-
drivers/i2c/algos/i2c-algo-sibyte.c | 2 +-
drivers/i2c/busses/i2c-ibm_iic.c | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-bit.c 2005-08-02 20:30:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-bit.c 2005-08-02 20:43:50.000000000 +0200
@@ -541,7 +541,7 @@
/* register new adapter to i2c module... */
- adap->id |= i2c_bit_algo.id;
+ adap->id |= I2C_ALGO_BIT;
adap->algo = &i2c_bit_algo;
adap->timeout = 100; /* default values, should */
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-ite.c 2005-08-02 20:30:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-ite.c 2005-08-02 20:43:50.000000000 +0200
@@ -738,7 +738,7 @@
/* register new adapter to i2c module... */
- adap->id |= iic_algo.id;
+ adap->id |= I2C_ALGO_IIC;
adap->algo = &iic_algo;
adap->timeout = 100; /* default values, should */
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-pca.c 2005-08-02 20:30:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-pca.c 2005-08-02 20:43:50.000000000 +0200
@@ -371,7 +371,7 @@
/* register new adapter to i2c module... */
- adap->id |= pca_algo.id;
+ adap->id |= I2C_ALGO_PCA;
adap->algo = &pca_algo;
adap->timeout = 100; /* default values, should */
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-pcf.c 2005-08-02 20:30:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-pcf.c 2005-08-02 20:43:50.000000000 +0200
@@ -476,7 +476,7 @@
/* register new adapter to i2c module... */
- adap->id |= pcf_algo.id;
+ adap->id |= I2C_ALGO_PCF;
adap->algo = &pcf_algo;
adap->timeout = 100; /* default values, should */
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-sgi.c 2005-08-02 20:30:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-sgi.c 2005-08-02 20:43:50.000000000 +0200
@@ -168,7 +168,7 @@
*/
int i2c_sgi_add_bus(struct i2c_adapter *adap)
{
- adap->id |= sgi_algo.id;
+ adap->id |= I2C_ALGO_SGI;
adap->algo = &sgi_algo;
return i2c_add_adapter(adap);
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-ibm_iic.c 2005-08-02 20:30:04.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-ibm_iic.c 2005-08-02 20:43:50.000000000 +0200
@@ -726,7 +726,7 @@
adap = &dev->adap;
strcpy(adap->name, "IBM IIC");
i2c_set_adapdata(adap, dev);
- adap->id = I2C_HW_OCP | iic_algo.id;
+ adap->id = I2C_ALGO_OCP | I2C_HW_OCP;
adap->algo = &iic_algo;
adap->client_register = NULL;
adap->client_unregister = NULL;
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-sibyte.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-sibyte.c 2005-08-02 20:44:27.000000000 +0200
@@ -151,7 +151,7 @@
/* register new adapter to i2c module... */
- i2c_adap->id |= i2c_sibyte_algo.id;
+ i2c_adap->id |= I2C_ALGO_SIBYTE;
i2c_adap->algo = &i2c_sibyte_algo;
/* Set the frequency to 100 kHz */
--
Jean Delvare
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] (4/7) I2C: Kill i2c_algorithm.id
2005-08-11 21:18 [PATCH] (0/7) I2C: Kill i2c_algorithm.{name,id} Jean Delvare
` (2 preceding siblings ...)
2005-08-11 21:38 ` [PATCH] (3/7) " Jean Delvare
@ 2005-08-11 21:40 ` Jean Delvare
2005-08-11 21:41 ` [PATCH] (5/7) " Jean Delvare
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Jean Delvare @ 2005-08-11 21:40 UTC (permalink / raw)
To: LKML
There are no more users of i2c_algorithm.id, so we can finally drop
this structure member.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/i2c/algos/i2c-algo-bit.c | 1 -
drivers/i2c/algos/i2c-algo-ite.c | 1 -
drivers/i2c/algos/i2c-algo-pca.c | 1 -
drivers/i2c/algos/i2c-algo-pcf.c | 1 -
drivers/i2c/algos/i2c-algo-sgi.c | 1 -
drivers/i2c/algos/i2c-algo-sibyte.c | 1 -
drivers/i2c/busses/i2c-ali1535.c | 1 -
drivers/i2c/busses/i2c-ali1563.c | 1 -
drivers/i2c/busses/i2c-ali15x3.c | 1 -
drivers/i2c/busses/i2c-amd756.c | 1 -
drivers/i2c/busses/i2c-amd8111.c | 1 -
drivers/i2c/busses/i2c-au1550.c | 1 -
drivers/i2c/busses/i2c-i801.c | 1 -
drivers/i2c/busses/i2c-ibm_iic.c | 1 -
drivers/i2c/busses/i2c-iop3xx.c | 1 -
drivers/i2c/busses/i2c-isa.c | 1 -
drivers/i2c/busses/i2c-keywest.c | 1 -
drivers/i2c/busses/i2c-mpc.c | 1 -
drivers/i2c/busses/i2c-mv64xxx.c | 1 -
drivers/i2c/busses/i2c-nforce2.c | 1 -
drivers/i2c/busses/i2c-piix4.c | 1 -
drivers/i2c/busses/i2c-sis5595.c | 1 -
drivers/i2c/busses/i2c-sis630.c | 1 -
drivers/i2c/busses/i2c-sis96x.c | 1 -
drivers/i2c/busses/i2c-stub.c | 1 -
drivers/i2c/busses/i2c-viapro.c | 1 -
drivers/i2c/busses/scx200_acb.c | 1 -
drivers/media/common/saa7146_i2c.c | 1 -
drivers/media/dvb/b2c2/flexcop-i2c.c | 1 -
drivers/media/dvb/dvb-usb/cxusb.c | 1 -
drivers/media/dvb/dvb-usb/dibusb-common.c | 1 -
drivers/media/dvb/dvb-usb/digitv.c | 1 -
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 1 -
drivers/media/video/bttv-i2c.c | 1 -
drivers/media/video/saa7134/saa7134-i2c.c | 1 -
drivers/usb/media/w9968cf.c | 1 -
include/linux/i2c.h | 2 --
37 files changed, 38 deletions(-)
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-bit.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-bit.c 2005-08-02 20:44:33.000000000 +0200
@@ -519,7 +519,6 @@
/* -----exported algorithm data: ------------------------------------- */
static struct i2c_algorithm i2c_bit_algo = {
- .id = I2C_ALGO_BIT,
.master_xfer = bit_xfer,
.functionality = bit_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-ite.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-ite.c 2005-08-02 20:44:33.000000000 +0200
@@ -713,7 +713,6 @@
/* -----exported algorithm data: ------------------------------------- */
static struct i2c_algorithm iic_algo = {
- .id = I2C_ALGO_IIC,
.master_xfer = iic_xfer,
.algo_control = algo_control, /* ioctl */
.functionality = iic_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-pca.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-pca.c 2005-08-02 20:44:33.000000000 +0200
@@ -356,7 +356,6 @@
}
static struct i2c_algorithm pca_algo = {
- .id = I2C_ALGO_PCA,
.master_xfer = pca_xfer,
.functionality = pca_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-pcf.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-pcf.c 2005-08-02 20:44:33.000000000 +0200
@@ -459,7 +459,6 @@
/* -----exported algorithm data: ------------------------------------- */
static struct i2c_algorithm pcf_algo = {
- .id = I2C_ALGO_PCF,
.master_xfer = pcf_xfer,
.functionality = pcf_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-sgi.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-sgi.c 2005-08-02 20:44:33.000000000 +0200
@@ -158,7 +158,6 @@
}
static struct i2c_algorithm sgi_algo = {
- .id = I2C_ALGO_SGI,
.master_xfer = sgi_xfer,
.functionality = sgi_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-sibyte.c 2005-08-02 20:44:27.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-sibyte.c 2005-08-02 20:44:33.000000000 +0200
@@ -135,7 +135,6 @@
/* -----exported algorithm data: ------------------------------------- */
static struct i2c_algorithm i2c_sibyte_algo = {
- .id = I2C_ALGO_SIBYTE,
.smbus_xfer = smbus_xfer,
.algo_control = algo_control, /* ioctl */
.functionality = bit_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-ali1535.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-ali1535.c 2005-08-02 20:44:33.000000000 +0200
@@ -472,7 +472,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .id = I2C_ALGO_SMBUS,
.smbus_xfer = ali1535_access,
.functionality = ali1535_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-ali1563.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-ali1563.c 2005-08-02 20:44:33.000000000 +0200
@@ -366,7 +366,6 @@
}
static struct i2c_algorithm ali1563_algorithm = {
- .id = I2C_ALGO_SMBUS,
.smbus_xfer = ali1563_access,
.functionality = ali1563_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-ali15x3.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-ali15x3.c 2005-08-02 20:44:33.000000000 +0200
@@ -462,7 +462,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .id = I2C_ALGO_SMBUS,
.smbus_xfer = ali15x3_access,
.functionality = ali15x3_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-amd756.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-amd756.c 2005-08-02 20:44:33.000000000 +0200
@@ -295,7 +295,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .id = I2C_ALGO_SMBUS,
.smbus_xfer = amd756_access,
.functionality = amd756_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-amd8111.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-amd8111.c 2005-08-02 20:44:33.000000000 +0200
@@ -323,7 +323,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .id = I2C_ALGO_SMBUS,
.smbus_xfer = amd8111_access,
.functionality = amd8111_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-au1550.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-au1550.c 2005-08-02 20:44:33.000000000 +0200
@@ -283,7 +283,6 @@
}
static struct i2c_algorithm au1550_algo = {
- .id = I2C_ALGO_AU1550,
.master_xfer = au1550_xfer,
.functionality = au1550_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-i801.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-i801.c 2005-08-02 20:44:33.000000000 +0200
@@ -535,7 +535,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .id = I2C_ALGO_SMBUS,
.smbus_xfer = i801_access,
.functionality = i801_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-ibm_iic.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-ibm_iic.c 2005-08-02 20:44:33.000000000 +0200
@@ -627,7 +627,6 @@
}
static struct i2c_algorithm iic_algo = {
- .id = I2C_ALGO_OCP,
.master_xfer = iic_xfer,
.functionality = iic_func
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-iop3xx.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-iop3xx.c 2005-08-02 20:44:33.000000000 +0200
@@ -399,7 +399,6 @@
}
static struct i2c_algorithm iop3xx_i2c_algo = {
- .id = I2C_ALGO_IOP3XX,
.master_xfer = iop3xx_i2c_master_xfer,
.algo_control = iop3xx_i2c_algo_control,
.functionality = iop3xx_i2c_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-isa.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-isa.c 2005-08-02 20:44:33.000000000 +0200
@@ -43,7 +43,6 @@
/* This is the actual algorithm we define */
static struct i2c_algorithm isa_algorithm = {
- .id = I2C_ALGO_ISA,
.functionality = isa_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-keywest.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-keywest.c 2005-08-02 20:44:33.000000000 +0200
@@ -498,7 +498,6 @@
/* For now, we only handle combined mode (smbus) */
static struct i2c_algorithm keywest_algorithm = {
- .id = I2C_ALGO_SMBUS,
.smbus_xfer = keywest_smbus_xfer,
.master_xfer = keywest_xfer,
.functionality = keywest_func,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-mpc.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-mpc.c 2005-08-02 20:44:33.000000000 +0200
@@ -272,7 +272,6 @@
}
static struct i2c_algorithm mpc_algo = {
- .id = I2C_ALGO_MPC107,
.master_xfer = mpc_xfer,
.functionality = mpc_functionality,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-mv64xxx.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-mv64xxx.c 2005-08-02 20:44:33.000000000 +0200
@@ -433,7 +433,6 @@
}
static struct i2c_algorithm mv64xxx_i2c_algo = {
- .id = I2C_ALGO_MV64XXX,
.master_xfer = mv64xxx_i2c_xfer,
.functionality = mv64xxx_i2c_functionality,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-nforce2.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-nforce2.c 2005-08-02 20:44:33.000000000 +0200
@@ -105,7 +105,6 @@
static struct i2c_algorithm smbus_algorithm = {
- .id = I2C_ALGO_SMBUS,
.smbus_xfer = nforce2_access,
.functionality = nforce2_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-piix4.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-piix4.c 2005-08-02 20:44:33.000000000 +0200
@@ -399,7 +399,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .id = I2C_ALGO_SMBUS,
.smbus_xfer = piix4_access,
.functionality = piix4_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-sis5595.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-sis5595.c 2005-08-02 20:44:33.000000000 +0200
@@ -357,7 +357,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .id = I2C_ALGO_SMBUS,
.smbus_xfer = sis5595_access,
.functionality = sis5595_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-sis630.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-sis630.c 2005-08-02 20:44:33.000000000 +0200
@@ -448,7 +448,6 @@
static struct i2c_algorithm smbus_algorithm = {
- .id = I2C_ALGO_SMBUS,
.smbus_xfer = sis630_access,
.functionality = sis630_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-sis96x.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-sis96x.c 2005-08-02 20:44:33.000000000 +0200
@@ -249,7 +249,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .id = I2C_ALGO_SMBUS,
.smbus_xfer = sis96x_access,
.functionality = sis96x_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-stub.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-stub.c 2005-08-02 20:44:33.000000000 +0200
@@ -109,7 +109,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .id = I2C_ALGO_SMBUS,
.functionality = stub_func,
.smbus_xfer = stub_xfer,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-viapro.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-viapro.c 2005-08-02 20:44:33.000000000 +0200
@@ -286,7 +286,6 @@
}
static struct i2c_algorithm smbus_algorithm = {
- .id = I2C_ALGO_SMBUS,
.smbus_xfer = vt596_access,
.functionality = vt596_func,
};
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/scx200_acb.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/scx200_acb.c 2005-08-02 20:44:33.000000000 +0200
@@ -395,7 +395,6 @@
/* For now, we only handle combined mode (smbus) */
static struct i2c_algorithm scx200_acb_algorithm = {
- .id = I2C_ALGO_SMBUS,
.smbus_xfer = scx200_acb_smbus_xfer,
.functionality = scx200_acb_func,
};
--- linux-2.6.13-rc5.orig/drivers/media/common/saa7146_i2c.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/common/saa7146_i2c.c 2005-08-02 20:44:33.000000000 +0200
@@ -387,7 +387,6 @@
/* exported algorithm data */
static struct i2c_algorithm saa7146_algo = {
- .id = I2C_ALGO_SAA7146,
.master_xfer = saa7146_i2c_xfer,
.functionality = saa7146_i2c_func,
};
--- linux-2.6.13-rc5.orig/drivers/media/dvb/b2c2/flexcop-i2c.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/dvb/b2c2/flexcop-i2c.c 2005-08-02 20:44:33.000000000 +0200
@@ -172,7 +172,6 @@
}
static struct i2c_algorithm flexcop_algo = {
- .id = I2C_ALGO_BIT,
.master_xfer = flexcop_master_xfer,
.functionality = flexcop_i2c_func,
};
--- linux-2.6.13-rc5.orig/drivers/media/dvb/dvb-usb/cxusb.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/dvb/dvb-usb/cxusb.c 2005-08-02 20:44:33.000000000 +0200
@@ -141,7 +141,6 @@
}
static struct i2c_algorithm cxusb_i2c_algo = {
- .id = I2C_ALGO_BIT,
.master_xfer = cxusb_i2c_xfer,
.functionality = cxusb_i2c_func,
};
--- linux-2.6.13-rc5.orig/drivers/media/dvb/dvb-usb/dibusb-common.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/dvb/dvb-usb/dibusb-common.c 2005-08-02 20:44:33.000000000 +0200
@@ -147,7 +147,6 @@
}
struct i2c_algorithm dibusb_i2c_algo = {
- .id = I2C_ALGO_BIT,
.master_xfer = dibusb_i2c_xfer,
.functionality = dibusb_i2c_func,
};
--- linux-2.6.13-rc5.orig/drivers/media/dvb/dvb-usb/digitv.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/dvb/dvb-usb/digitv.c 2005-08-02 20:44:33.000000000 +0200
@@ -77,7 +77,6 @@
}
static struct i2c_algorithm digitv_i2c_algo = {
- .id = I2C_ALGO_BIT,
.master_xfer = digitv_i2c_xfer,
.functionality = digitv_i2c_func,
};
--- linux-2.6.13-rc5.orig/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c 2005-08-02 20:44:33.000000000 +0200
@@ -1472,7 +1472,6 @@
static struct i2c_algorithm ttusb_dec_algo = {
- .id = I2C_ALGO_BIT,
.master_xfer = master_xfer,
.functionality = functionality,
};
--- linux-2.6.13-rc5.orig/drivers/media/video/bttv-i2c.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/bttv-i2c.c 2005-08-02 20:44:33.000000000 +0200
@@ -270,7 +270,6 @@
}
static struct i2c_algorithm bttv_algo = {
- .id = I2C_ALGO_BIT | I2C_HW_B_BT848 /* FIXME */,
.master_xfer = bttv_i2c_xfer,
.algo_control = algo_control,
.functionality = functionality,
--- linux-2.6.13-rc5.orig/drivers/media/video/saa7134/saa7134-i2c.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/saa7134/saa7134-i2c.c 2005-08-02 20:44:33.000000000 +0200
@@ -370,7 +370,6 @@
}
static struct i2c_algorithm saa7134_algo = {
- .id = I2C_ALGO_SAA7134,
.master_xfer = saa7134_i2c_xfer,
.algo_control = algo_control,
.functionality = functionality,
--- linux-2.6.13-rc5.orig/drivers/usb/media/w9968cf.c 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/usb/media/w9968cf.c 2005-08-02 20:44:33.000000000 +0200
@@ -1573,7 +1573,6 @@
int err = 0;
static struct i2c_algorithm algo = {
- .id = I2C_ALGO_SMBUS,
.smbus_xfer = w9968cf_i2c_smbus_xfer,
.algo_control = w9968cf_i2c_control,
.functionality = w9968cf_i2c_func,
--- linux-2.6.13-rc5.orig/include/linux/i2c.h 2005-08-02 20:43:50.000000000 +0200
+++ linux-2.6.13-rc5/include/linux/i2c.h 2005-08-02 20:44:33.000000000 +0200
@@ -192,8 +192,6 @@
* to name two of the most common.
*/
struct i2c_algorithm {
- unsigned int id;
-
/* If an adapter algorithm can't do I2C-level access, set master_xfer
to NULL. If an adapter algorithm can do SMBus access, set
smbus_xfer. If set to NULL, the SMBus protocol is simulated
--
Jean Delvare
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] (5/7) I2C: Kill i2c_algorithm.id
2005-08-11 21:18 [PATCH] (0/7) I2C: Kill i2c_algorithm.{name,id} Jean Delvare
` (3 preceding siblings ...)
2005-08-11 21:40 ` [PATCH] (4/7) " Jean Delvare
@ 2005-08-11 21:41 ` Jean Delvare
2005-08-11 21:51 ` [PATCH] (6/7) " Jean Delvare
2005-08-11 21:52 ` [PATCH] (7/7) " Jean Delvare
6 siblings, 0 replies; 8+ messages in thread
From: Jean Delvare @ 2005-08-11 21:41 UTC (permalink / raw)
To: LKML
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 <khali@linux-fr.org>
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(-)
--- linux-2.6.13-rc5.orig/include/linux/i2c-id.h 2005-08-02 18:31:22.000000000 +0200
+++ linux-2.6.13-rc5/include/linux/i2c-id.h 2005-08-02 21:40:11.000000000 +0200
@@ -218,103 +218,103 @@
*/
/* --- Bit algorithm adapters */
-#define I2C_HW_B_LP 0x00 /* Parallel port Philips style adapter */
-#define I2C_HW_B_LPC 0x01 /* Parallel port, over control reg. */
-#define I2C_HW_B_SER 0x02 /* Serial line interface */
-#define I2C_HW_B_ELV 0x03 /* ELV Card */
-#define I2C_HW_B_VELLE 0x04 /* Vellemann K8000 */
-#define I2C_HW_B_BT848 0x05 /* BT848 video boards */
-#define I2C_HW_B_WNV 0x06 /* Winnov Videums */
-#define I2C_HW_B_VIA 0x07 /* Via vt82c586b */
-#define I2C_HW_B_HYDRA 0x08 /* Apple Hydra Mac I/O */
-#define I2C_HW_B_G400 0x09 /* Matrox G400 */
-#define I2C_HW_B_I810 0x0a /* Intel I810 */
-#define I2C_HW_B_VOO 0x0b /* 3dfx Voodoo 3 / Banshee */
-#define I2C_HW_B_PPORT 0x0c /* Primitive parallel port adapter */
-#define I2C_HW_B_SAVG 0x0d /* Savage 4 */
-#define I2C_HW_B_SCX200 0x0e /* Nat'l Semi SCx200 I2C */
-#define I2C_HW_B_RIVA 0x10 /* Riva based graphics cards */
-#define I2C_HW_B_IOC 0x11 /* IOC bit-wiggling */
-#define I2C_HW_B_TSUNA 0x12 /* DEC Tsunami chipset */
-#define I2C_HW_B_FRODO 0x13 /* 2d3D, Inc. SA-1110 Development Board */
-#define I2C_HW_B_OMAHA 0x14 /* Omaha I2C interface (ARM) */
-#define I2C_HW_B_GUIDE 0x15 /* Guide bit-basher */
-#define I2C_HW_B_IXP2000 0x16 /* GPIO on IXP2000 systems */
-#define I2C_HW_B_IXP4XX 0x17 /* GPIO on IXP4XX systems */
-#define I2C_HW_B_S3VIA 0x18 /* S3Via ProSavage adapter */
-#define I2C_HW_B_ZR36067 0x19 /* Zoran-36057/36067 based boards */
-#define I2C_HW_B_PCILYNX 0x1a /* TI PCILynx I2C adapter */
-#define I2C_HW_B_CX2388x 0x1b /* connexant 2388x based tv cards */
+#define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */
+#define I2C_HW_B_LPC 0x010001 /* Parallel port control reg. */
+#define I2C_HW_B_SER 0x010002 /* Serial line interface */
+#define I2C_HW_B_ELV 0x010003 /* ELV Card */
+#define I2C_HW_B_VELLE 0x010004 /* Vellemann K8000 */
+#define I2C_HW_B_BT848 0x010005 /* BT848 video boards */
+#define I2C_HW_B_WNV 0x010006 /* Winnov Videums */
+#define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */
+#define I2C_HW_B_HYDRA 0x010008 /* Apple Hydra Mac I/O */
+#define I2C_HW_B_G400 0x010009 /* Matrox G400 */
+#define I2C_HW_B_I810 0x01000a /* Intel I810 */
+#define I2C_HW_B_VOO 0x01000b /* 3dfx Voodoo 3 / Banshee */
+#define I2C_HW_B_PPORT 0x01000c /* Primitive parallel port adapter */
+#define I2C_HW_B_SAVG 0x01000d /* Savage 4 */
+#define I2C_HW_B_SCX200 0x01000e /* Nat'l Semi SCx200 I2C */
+#define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */
+#define I2C_HW_B_IOC 0x010011 /* IOC bit-wiggling */
+#define I2C_HW_B_TSUNA 0x010012 /* DEC Tsunami chipset */
+#define I2C_HW_B_FRODO 0x010013 /* 2d3D SA-1110 Development Board */
+#define I2C_HW_B_OMAHA 0x010014 /* Omaha I2C interface (ARM) */
+#define I2C_HW_B_GUIDE 0x010015 /* Guide bit-basher */
+#define I2C_HW_B_IXP2000 0x010016 /* GPIO on IXP2000 systems */
+#define I2C_HW_B_IXP4XX 0x010017 /* GPIO on IXP4XX systems */
+#define I2C_HW_B_S3VIA 0x010018 /* S3Via ProSavage adapter */
+#define I2C_HW_B_ZR36067 0x010019 /* Zoran-36057/36067 based boards */
+#define I2C_HW_B_PCILYNX 0x01001a /* TI PCILynx I2C adapter */
+#define I2C_HW_B_CX2388x 0x01001b /* connexant 2388x based tv cards */
/* --- PCF 8584 based algorithms */
-#define I2C_HW_P_LP 0x00 /* Parallel port interface */
-#define I2C_HW_P_ISA 0x01 /* generic ISA Bus inteface card */
-#define I2C_HW_P_ELEK 0x02 /* Elektor ISA Bus inteface card */
+#define I2C_HW_P_LP 0x020000 /* Parallel port interface */
+#define I2C_HW_P_ISA 0x020001 /* generic ISA Bus inteface card */
+#define I2C_HW_P_ELEK 0x020002 /* Elektor ISA Bus inteface card */
/* --- PCA 9564 based algorithms */
-#define I2C_HW_A_ISA 0x00 /* generic ISA Bus interface card */
+#define I2C_HW_A_ISA 0x1a0000 /* generic ISA Bus interface card */
/* --- ACPI Embedded controller algorithms */
-#define I2C_HW_ACPI_EC 0x00
+#define I2C_HW_ACPI_EC 0x1f0000
/* --- MPC824x PowerPC adapters */
-#define I2C_HW_MPC824X 0x00 /* Motorola 8240 / 8245 */
+#define I2C_HW_MPC824X 0x100001 /* Motorola 8240 / 8245 */
/* --- MPC8xx PowerPC adapters */
-#define I2C_HW_MPC8XX_EPON 0x00 /* Eponymous MPC8xx I2C adapter */
+#define I2C_HW_MPC8XX_EPON 0x110000 /* Eponymous MPC8xx I2C adapter */
/* --- ITE based algorithms */
-#define I2C_HW_I_IIC 0x00 /* controller on the ITE */
+#define I2C_HW_I_IIC 0x080000 /* controller on the ITE */
/* --- PowerPC on-chip adapters */
-#define I2C_HW_OCP 0x00 /* IBM on-chip I2C adapter */
+#define I2C_HW_OCP 0x120000 /* IBM on-chip I2C adapter */
/* --- Broadcom SiByte adapters */
-#define I2C_HW_SIBYTE 0x00
+#define I2C_HW_SIBYTE 0x150000
/* --- SGI adapters */
-#define I2C_HW_SGI_VINO 0x00
-#define I2C_HW_SGI_MACE 0x01
+#define I2C_HW_SGI_VINO 0x160000
+#define I2C_HW_SGI_MACE 0x160001
/* --- XSCALE on-chip adapters */
-#define I2C_HW_IOP3XX 0x00
+#define I2C_HW_IOP3XX 0x140000
/* --- Au1550 PSC adapters adapters */
-#define I2C_HW_AU1550_PSC 0x00
+#define I2C_HW_AU1550_PSC 0x1b0000
/* --- SMBus only adapters */
-#define I2C_HW_SMBUS_PIIX4 0x00
-#define I2C_HW_SMBUS_ALI15X3 0x01
-#define I2C_HW_SMBUS_VIA2 0x02
-#define I2C_HW_SMBUS_VOODOO3 0x03
-#define I2C_HW_SMBUS_I801 0x04
-#define I2C_HW_SMBUS_AMD756 0x05
-#define I2C_HW_SMBUS_SIS5595 0x06
-#define I2C_HW_SMBUS_ALI1535 0x07
-#define I2C_HW_SMBUS_SIS630 0x08
-#define I2C_HW_SMBUS_SIS96X 0x09
-#define I2C_HW_SMBUS_AMD8111 0x0a
-#define I2C_HW_SMBUS_SCX200 0x0b
-#define I2C_HW_SMBUS_NFORCE2 0x0c
-#define I2C_HW_SMBUS_W9968CF 0x0d
-#define I2C_HW_SMBUS_OV511 0x0e /* OV511(+) USB 1.1 webcam ICs */
-#define I2C_HW_SMBUS_OV518 0x0f /* OV518(+) USB 1.1 webcam ICs */
-#define I2C_HW_SMBUS_OV519 0x10 /* OV519 USB 1.1 webcam IC */
-#define I2C_HW_SMBUS_OVFX2 0x11 /* Cypress/OmniVision FX2 webcam */
+#define I2C_HW_SMBUS_PIIX4 0x040000
+#define I2C_HW_SMBUS_ALI15X3 0x040001
+#define I2C_HW_SMBUS_VIA2 0x040002
+#define I2C_HW_SMBUS_VOODOO3 0x040003
+#define I2C_HW_SMBUS_I801 0x040004
+#define I2C_HW_SMBUS_AMD756 0x040005
+#define I2C_HW_SMBUS_SIS5595 0x040006
+#define I2C_HW_SMBUS_ALI1535 0x040007
+#define I2C_HW_SMBUS_SIS630 0x040008
+#define I2C_HW_SMBUS_SIS96X 0x040009
+#define I2C_HW_SMBUS_AMD8111 0x04000a
+#define I2C_HW_SMBUS_SCX200 0x04000b
+#define I2C_HW_SMBUS_NFORCE2 0x04000c
+#define I2C_HW_SMBUS_W9968CF 0x04000d
+#define I2C_HW_SMBUS_OV511 0x04000e /* OV511(+) USB 1.1 webcam ICs */
+#define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */
+#define I2C_HW_SMBUS_OV519 0x040010 /* OV519 USB 1.1 webcam IC */
+#define I2C_HW_SMBUS_OVFX2 0x040011 /* Cypress/OmniVision FX2 webcam */
/* --- ISA pseudo-adapter */
-#define I2C_HW_ISA 0x00
+#define I2C_HW_ISA 0x050000
/* --- IPMI pseudo-adapter */
-#define I2C_HW_IPMI 0x00
+#define I2C_HW_IPMI 0x0b0000
/* --- IPMB adapter */
-#define I2C_HW_IPMB 0x00
+#define I2C_HW_IPMB 0x0c0000
/* --- MCP107 adapter */
-#define I2C_HW_MPC107 0x00
+#define I2C_HW_MPC107 0x0d0000
/* --- Marvell mv64xxx i2c adapter */
-#define I2C_HW_MV64XXX 0x00
+#define I2C_HW_MV64XXX 0x190000
#endif /* LINUX_I2C_ID_H */
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-bit.c 2005-08-02 20:44:33.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-bit.c 2005-08-02 22:14:32.000000000 +0200
@@ -539,8 +539,6 @@
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 */
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-ite.c 2005-08-02 20:44:33.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-ite.c 2005-08-02 22:14:27.000000000 +0200
@@ -736,8 +736,6 @@
adap->name));
/* register new adapter to i2c module... */
-
- adap->id |= I2C_ALGO_IIC;
adap->algo = &iic_algo;
adap->timeout = 100; /* default values, should */
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-pca.c 2005-08-02 20:44:33.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-pca.c 2005-08-02 22:14:23.000000000 +0200
@@ -369,8 +369,6 @@
int rval;
/* register new adapter to i2c module... */
-
- adap->id |= I2C_ALGO_PCA;
adap->algo = &pca_algo;
adap->timeout = 100; /* default values, should */
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-pcf.c 2005-08-02 20:44:33.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-pcf.c 2005-08-02 22:14:19.000000000 +0200
@@ -474,8 +474,6 @@
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 */
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-sgi.c 2005-08-02 20:44:33.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-sgi.c 2005-08-02 22:14:14.000000000 +0200
@@ -167,7 +167,6 @@
*/
int i2c_sgi_add_bus(struct i2c_adapter *adap)
{
- adap->id |= I2C_ALGO_SGI;
adap->algo = &sgi_algo;
return i2c_add_adapter(adap);
--- linux-2.6.13-rc5.orig/drivers/i2c/algos/i2c-algo-sibyte.c 2005-08-02 20:44:33.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/algos/i2c-algo-sibyte.c 2005-08-02 22:14:03.000000000 +0200
@@ -149,8 +149,6 @@
struct 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 */
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-ibm_iic.c 2005-08-02 20:44:33.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-ibm_iic.c 2005-08-02 22:13:57.000000000 +0200
@@ -725,7 +725,7 @@
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;
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-isa.c 2005-08-02 20:44:33.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-isa.c 2005-08-02 22:13:51.000000000 +0200
@@ -49,7 +49,7 @@
/* 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",
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-mpc.c 2005-08-02 20:44:33.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-mpc.c 2005-08-02 22:13:45.000000000 +0200
@@ -279,7 +279,7 @@
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,
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-mv64xxx.c 2005-08-02 20:44:33.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-mv64xxx.c 2005-08-02 22:13:39.000000000 +0200
@@ -521,7 +521,7 @@
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;
--- linux-2.6.13-rc5.orig/drivers/media/video/bt832.c 2005-08-02 18:31:08.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/bt832.c 2005-08-02 22:13:31.000000000 +0200
@@ -188,7 +188,7 @@
if (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;
--- linux-2.6.13-rc5.orig/drivers/media/video/bttv-i2c.c 2005-08-02 20:44:33.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/bttv-i2c.c 2005-08-02 22:13:21.000000000 +0200
@@ -281,7 +281,7 @@
.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,
};
--- linux-2.6.13-rc5.orig/drivers/media/video/ir-kbd-i2c.c 2005-08-02 18:31:08.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/ir-kbd-i2c.c 2005-08-02 22:13:11.000000000 +0200
@@ -429,7 +429,7 @@
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:
--- linux-2.6.13-rc5.orig/drivers/media/video/ovcamchip/ov6x20.c 2004-12-24 22:34:44.000000000 +0100
+++ linux-2.6.13-rc5/drivers/media/video/ovcamchip/ov6x20.c 2005-08-02 22:13:03.000000000 +0200
@@ -164,10 +164,10 @@
DDEBUG(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 @@
/******** 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
--- linux-2.6.13-rc5.orig/drivers/media/video/ovcamchip/ov6x30.c 2004-12-24 22:35:21.000000000 +0100
+++ linux-2.6.13-rc5/drivers/media/video/ovcamchip/ov6x30.c 2005-08-02 22:12:47.000000000 +0200
@@ -301,7 +301,7 @@
/******** 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 @@
* 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 {
--- linux-2.6.13-rc5.orig/drivers/media/video/ovcamchip/ovcamchip_core.c 2005-06-18 09:32:24.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/ovcamchip/ovcamchip_core.c 2005-08-02 22:12:25.000000000 +0200
@@ -296,10 +296,10 @@
* 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:
--- linux-2.6.13-rc5.orig/drivers/media/video/tda7432.c 2005-08-02 18:31:08.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/tda7432.c 2005-08-02 22:12:06.000000000 +0200
@@ -328,7 +328,7 @@
if (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;
--- linux-2.6.13-rc5.orig/drivers/media/video/tda9875.c 2005-08-02 18:31:08.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/tda9875.c 2005-08-02 22:11:59.000000000 +0200
@@ -262,7 +262,7 @@
if (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;
--- linux-2.6.13-rc5.orig/drivers/media/video/tda9887.c 2005-08-02 18:31:08.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/tda9887.c 2005-08-02 22:11:48.000000000 +0200
@@ -618,8 +618,8 @@
return 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;
--- linux-2.6.13-rc5.orig/drivers/media/video/tuner-3036.c 2005-08-02 18:49:18.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/tuner-3036.c 2005-08-02 22:11:29.000000000 +0200
@@ -165,7 +165,7 @@
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;
}
--- linux-2.6.13-rc5.orig/drivers/media/video/tvaudio.c 2005-08-02 18:31:08.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/tvaudio.c 2005-08-02 22:11:14.000000000 +0200
@@ -1098,7 +1098,7 @@
/* 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 @@
return 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);
}
--- linux-2.6.13-rc5.orig/drivers/media/video/tveeprom.c 2005-08-02 18:31:08.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/tveeprom.c 2005-08-02 22:08:35.000000000 +0200
@@ -534,7 +534,7 @@
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);
}
--- linux-2.6.13-rc5.orig/drivers/media/video/tvmixer.c 2005-08-02 18:31:08.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/tvmixer.c 2005-08-02 22:08:24.000000000 +0200
@@ -276,9 +276,9 @@
#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:
--- linux-2.6.13-rc5.orig/drivers/usb/media/w9968cf.c 2005-08-02 20:44:33.000000000 +0200
+++ linux-2.6.13-rc5/drivers/usb/media/w9968cf.c 2005-08-02 22:08:06.000000000 +0200
@@ -1579,7 +1579,7 @@
};
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,
--- linux-2.6.13-rc5.orig/drivers/video/matrox/matroxfb_maven.c 2005-08-02 18:31:14.000000000 +0200
+++ linux-2.6.13-rc5/drivers/video/matrox/matroxfb_maven.c 2005-08-02 22:08:00.000000000 +0200
@@ -1271,7 +1271,7 @@
}
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;
}
--- linux-2.6.13-rc5.orig/include/linux/i2c-isa.h 2005-08-02 20:30:24.000000000 +0200
+++ linux-2.6.13-rc5/include/linux/i2c-isa.h 2005-08-02 21:49:43.000000000 +0200
@@ -29,7 +29,7 @@
/* 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)
--
Jean Delvare
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] (6/7) I2C: Kill i2c_algorithm.id
2005-08-11 21:18 [PATCH] (0/7) I2C: Kill i2c_algorithm.{name,id} Jean Delvare
` (4 preceding siblings ...)
2005-08-11 21:41 ` [PATCH] (5/7) " Jean Delvare
@ 2005-08-11 21:51 ` Jean Delvare
2005-08-11 21:52 ` [PATCH] (7/7) " Jean Delvare
6 siblings, 0 replies; 8+ messages in thread
From: Jean Delvare @ 2005-08-11 21:51 UTC (permalink / raw)
To: LKML
In theory, there should be no more users of I2C_ALGO_* at this point.
However, it happens that several drivers were using I2C_ALGO_* for
adapter ids, so we need to correct these before we can get rid of all
the I2C_ALGO_* definitions.
Note that this also fixes a bug in media/video/tvaudio.c:
/* don't attach on saa7146 based cards,
because dedicated drivers are used */
if ((adap->id & I2C_ALGO_SAA7146))
return 0;
This test was plain broken, as it would succeed for many more adapters
than just the saa7146: any those id would share at least one bit with
the saa7146 id. We are really lucky that the few other adapters we want
this driver to work with did not fulfill that condition.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/i2c/busses/i2c-keywest.c | 1 -
drivers/i2c/busses/scx200_acb.c | 2 +-
drivers/media/common/saa7146_i2c.c | 2 +-
drivers/media/dvb/b2c2/flexcop-i2c.c | 1 -
drivers/media/dvb/dvb-usb/dvb-usb-i2c.c | 1 -
drivers/media/dvb/pluto2/pluto2.c | 1 -
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 1 -
drivers/media/video/ir-kbd-i2c.c | 2 +-
drivers/media/video/saa7134/saa7134-i2c.c | 2 +-
drivers/media/video/tda9840.c | 2 +-
drivers/media/video/tda9887.c | 2 +-
drivers/media/video/tea6415c.c | 2 +-
drivers/media/video/tea6420.c | 2 +-
drivers/media/video/tvaudio.c | 4 ++--
drivers/video/aty/radeon_i2c.c | 2 +-
drivers/video/nvidia/nv_i2c.c | 3 +--
drivers/video/riva/rivafb-i2c.c | 3 +--
drivers/video/savage/savagefb-i2c.c | 3 +--
include/linux/i2c-id.h | 7 +++++++
include/media/id.h | 5 -----
20 files changed, 21 insertions(+), 27 deletions(-)
--- linux-2.6.13-rc5.orig/drivers/video/aty/radeon_i2c.c 2005-06-18 09:32:50.000000000 +0200
+++ linux-2.6.13-rc5/drivers/video/aty/radeon_i2c.c 2005-08-02 22:40:54.000000000 +0200
@@ -75,7 +75,7 @@
strcpy(chan->adapter.name, name);
chan->adapter.owner = THIS_MODULE;
- chan->adapter.id = I2C_ALGO_ATI;
+ chan->adapter.id = I2C_HW_B_RADEON;
chan->adapter.algo_data = &chan->algo;
chan->adapter.dev.parent = &chan->rinfo->pdev->dev;
chan->algo.setsda = radeon_gpio_setsda;
--- linux-2.6.13-rc5.orig/drivers/video/nvidia/nv_i2c.c 2005-06-18 09:32:53.000000000 +0200
+++ linux-2.6.13-rc5/drivers/video/nvidia/nv_i2c.c 2005-08-02 22:36:42.000000000 +0200
@@ -90,14 +90,13 @@
return val;
}
-#define I2C_ALGO_NVIDIA 0x0e0000
static int nvidia_setup_i2c_bus(struct nvidia_i2c_chan *chan, const char *name)
{
int rc;
strcpy(chan->adapter.name, name);
chan->adapter.owner = THIS_MODULE;
- chan->adapter.id = I2C_ALGO_NVIDIA;
+ chan->adapter.id = I2C_HW_B_NVIDIA;
chan->adapter.algo_data = &chan->algo;
chan->adapter.dev.parent = &chan->par->pci_dev->dev;
chan->algo.setsda = nvidia_gpio_setsda;
--- linux-2.6.13-rc5.orig/drivers/video/riva/rivafb-i2c.c 2005-06-18 09:32:53.000000000 +0200
+++ linux-2.6.13-rc5/drivers/video/riva/rivafb-i2c.c 2005-08-02 22:37:35.000000000 +0200
@@ -92,14 +92,13 @@
return val;
}
-#define I2C_ALGO_RIVA 0x0e0000
static int riva_setup_i2c_bus(struct riva_i2c_chan *chan, const char *name)
{
int rc;
strcpy(chan->adapter.name, name);
chan->adapter.owner = THIS_MODULE;
- chan->adapter.id = I2C_ALGO_RIVA;
+ chan->adapter.id = I2C_HW_B_RIVA;
chan->adapter.algo_data = &chan->algo;
chan->adapter.dev.parent = &chan->par->pdev->dev;
chan->algo.setsda = riva_gpio_setsda;
--- linux-2.6.13-rc5.orig/drivers/video/savage/savagefb-i2c.c 2005-06-18 09:32:53.000000000 +0200
+++ linux-2.6.13-rc5/drivers/video/savage/savagefb-i2c.c 2005-08-02 22:39:13.000000000 +0200
@@ -137,7 +137,6 @@
return (0 != (GET_CR_DATA(chan->ioaddr) & PROSAVAGE_I2C_SDA_IN));
}
-#define I2C_ALGO_SAVAGE 0x0f0000
static int savage_setup_i2c_bus(struct savagefb_i2c_chan *chan,
const char *name)
{
@@ -147,7 +146,7 @@
if (add_bus && chan->par) {
strcpy(chan->adapter.name, name);
chan->adapter.owner = THIS_MODULE;
- chan->adapter.id = I2C_ALGO_SAVAGE;
+ chan->adapter.id = I2C_HW_B_SAVAGE;
chan->adapter.algo_data = &chan->algo;
chan->adapter.dev.parent = &chan->par->pcidev->dev;
chan->algo.udelay = 40;
--- linux-2.6.13-rc5.orig/include/linux/i2c-id.h 2005-08-02 21:40:11.000000000 +0200
+++ linux-2.6.13-rc5/include/linux/i2c-id.h 2005-08-03 20:04:58.000000000 +0200
@@ -245,6 +245,9 @@
#define I2C_HW_B_ZR36067 0x010019 /* Zoran-36057/36067 based boards */
#define I2C_HW_B_PCILYNX 0x01001a /* TI PCILynx I2C adapter */
#define I2C_HW_B_CX2388x 0x01001b /* connexant 2388x based tv cards */
+#define I2C_HW_B_NVIDIA 0x01001c /* nvidia framebuffer driver */
+#define I2C_HW_B_SAVAGE 0x01001d /* savage framebuffer driver */
+#define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */
/* --- PCF 8584 based algorithms */
#define I2C_HW_P_LP 0x020000 /* Parallel port interface */
@@ -317,4 +320,8 @@
/* --- Marvell mv64xxx i2c adapter */
#define I2C_HW_MV64XXX 0x190000
+/* --- Miscellaneous adapters */
+#define I2C_HW_SAA7146 0x060000 /* SAA7146 video decoder bus */
+#define I2C_HW_SAA7134 0x090000 /* SAA7134 video decoder bus */
+
#endif /* LINUX_I2C_ID_H */
--- linux-2.6.13-rc5.orig/include/media/id.h 2005-08-02 18:31:23.000000000 +0200
+++ linux-2.6.13-rc5/include/media/id.h 2005-08-02 22:41:16.000000000 +0200
@@ -34,8 +34,3 @@
#ifndef I2C_DRIVERID_SAA6752HS
# define I2C_DRIVERID_SAA6752HS I2C_DRIVERID_EXP0+8
#endif
-
-/* algorithms */
-#ifndef I2C_ALGO_SAA7134
-# define I2C_ALGO_SAA7134 0x090000
-#endif
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/i2c-keywest.c 2005-08-02 20:44:33.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/i2c-keywest.c 2005-08-03 20:05:26.000000000 +0200
@@ -619,7 +619,6 @@
sprintf(chan->adapter.name, "%s %d", np->parent->name, i);
chan->iface = iface;
chan->chan_no = i;
- chan->adapter.id = I2C_ALGO_SMBUS;
chan->adapter.algo = &keywest_algorithm;
chan->adapter.algo_data = NULL;
chan->adapter.client_register = NULL;
--- linux-2.6.13-rc5.orig/drivers/i2c/busses/scx200_acb.c 2005-08-02 20:44:33.000000000 +0200
+++ linux-2.6.13-rc5/drivers/i2c/busses/scx200_acb.c 2005-08-02 22:50:38.000000000 +0200
@@ -454,7 +454,7 @@
i2c_set_adapdata(adapter, iface);
snprintf(adapter->name, I2C_NAME_SIZE, "SCx200 ACB%d", index);
adapter->owner = THIS_MODULE;
- adapter->id = I2C_ALGO_SMBUS;
+ adapter->id = I2C_HW_SMBUS_SCX200;
adapter->algo = &scx200_acb_algorithm;
adapter->class = I2C_CLASS_HWMON;
--- linux-2.6.13-rc5.orig/drivers/media/common/saa7146_i2c.c 2005-08-02 20:44:33.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/common/saa7146_i2c.c 2005-08-02 22:54:24.000000000 +0200
@@ -410,7 +410,7 @@
#endif
i2c_adapter->algo = &saa7146_algo;
i2c_adapter->algo_data = NULL;
- i2c_adapter->id = I2C_ALGO_SAA7146;
+ i2c_adapter->id = I2C_HW_SAA7146;
i2c_adapter->timeout = SAA7146_I2C_TIMEOUT;
i2c_adapter->retries = SAA7146_I2C_RETRIES;
}
--- linux-2.6.13-rc5.orig/drivers/media/video/tda9840.c 2005-08-02 18:31:08.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/tda9840.c 2005-08-02 22:54:54.000000000 +0200
@@ -205,7 +205,7 @@
static int attach(struct i2c_adapter *adapter)
{
/* let's see whether this is a know adapter we can attach to */
- if (adapter->id != I2C_ALGO_SAA7146) {
+ if (adapter->id != I2C_HW_SAA7146) {
dprintk("refusing to probe on unknown adapter [name='%s',id=0x%x]\n", adapter->name, adapter->id);
return -ENODEV;
}
--- linux-2.6.13-rc5.orig/drivers/media/video/tda9887.c 2005-08-02 22:11:48.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/tda9887.c 2005-08-02 22:54:36.000000000 +0200
@@ -620,7 +620,7 @@
switch (adap->id) {
case I2C_HW_B_BT848:
case I2C_HW_B_RIVA:
- case I2C_ALGO_SAA7134:
+ case I2C_HW_SAA7134:
return i2c_probe(adap, &addr_data, tda9887_attach);
break;
}
--- linux-2.6.13-rc5.orig/drivers/media/video/tea6415c.c 2005-08-02 18:31:08.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/tea6415c.c 2005-08-02 22:54:47.000000000 +0200
@@ -86,7 +86,7 @@
static int attach(struct i2c_adapter *adapter)
{
/* let's see whether this is a know adapter we can attach to */
- if (adapter->id != I2C_ALGO_SAA7146) {
+ if (adapter->id != I2C_HW_SAA7146) {
dprintk("refusing to probe on unknown adapter [name='%s',id=0x%x]\n", adapter->name, adapter->id);
return -ENODEV;
}
--- linux-2.6.13-rc5.orig/drivers/media/video/tea6420.c 2005-08-02 18:31:08.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/tea6420.c 2005-08-02 22:54:59.000000000 +0200
@@ -135,7 +135,7 @@
static int attach(struct i2c_adapter *adapter)
{
/* let's see whether this is a know adapter we can attach to */
- if (adapter->id != I2C_ALGO_SAA7146) {
+ if (adapter->id != I2C_HW_SAA7146) {
dprintk("refusing to probe on unknown adapter [name='%s',id=0x%x]\n", adapter->name, adapter->id);
return -ENODEV;
}
--- linux-2.6.13-rc5.orig/drivers/media/video/tvaudio.c 2005-08-02 22:11:14.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/tvaudio.c 2005-08-02 22:57:04.000000000 +0200
@@ -1548,7 +1548,7 @@
{
/* don't attach on saa7146 based cards,
because dedicated drivers are used */
- if ((adap->id & I2C_ALGO_SAA7146))
+ if (adap->id == I2C_HW_SAA7146)
return 0;
#ifdef I2C_CLASS_TV_ANALOG
if (adap->class & I2C_CLASS_TV_ANALOG)
@@ -1557,7 +1557,7 @@
switch (adap->id) {
case I2C_HW_B_BT848:
case I2C_HW_B_RIVA:
- case I2C_ALGO_SAA7134:
+ case I2C_HW_SAA7134:
return i2c_probe(adap, &addr_data, chip_attach);
}
#endif
--- linux-2.6.13-rc5.orig/drivers/media/dvb/b2c2/flexcop-i2c.c 2005-08-02 20:44:33.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/dvb/b2c2/flexcop-i2c.c 2005-08-03 20:04:44.000000000 +0200
@@ -190,7 +190,6 @@
fc->i2c_adap.class = I2C_CLASS_TV_DIGITAL;
fc->i2c_adap.algo = &flexcop_algo;
fc->i2c_adap.algo_data = NULL;
- fc->i2c_adap.id = I2C_ALGO_BIT;
if ((ret = i2c_add_adapter(&fc->i2c_adap)) < 0)
return ret;
--- linux-2.6.13-rc5.orig/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c 2005-08-02 18:31:07.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c 2005-08-03 20:04:41.000000000 +0200
@@ -27,7 +27,6 @@
#endif
d->i2c_adap.algo = d->props.i2c_algo;
d->i2c_adap.algo_data = NULL;
- d->i2c_adap.id = I2C_ALGO_BIT;
i2c_set_adapdata(&d->i2c_adap, d);
--- linux-2.6.13-rc5.orig/drivers/media/dvb/pluto2/pluto2.c 2005-08-02 18:31:07.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/dvb/pluto2/pluto2.c 2005-08-03 20:04:38.000000000 +0200
@@ -633,7 +633,6 @@
i2c_set_adapdata(&pluto->i2c_adap, pluto);
strcpy(pluto->i2c_adap.name, DRIVER_NAME);
pluto->i2c_adap.owner = THIS_MODULE;
- pluto->i2c_adap.id = I2C_ALGO_BIT;
pluto->i2c_adap.class = I2C_CLASS_TV_DIGITAL;
pluto->i2c_adap.dev.parent = &pdev->dev;
pluto->i2c_adap.algo_data = &pluto->i2c_bit;
--- linux-2.6.13-rc5.orig/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c 2005-08-02 20:44:33.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c 2005-08-03 20:04:34.000000000 +0200
@@ -1523,7 +1523,6 @@
#endif
ttusb->i2c_adap.algo = &ttusb_dec_algo;
ttusb->i2c_adap.algo_data = NULL;
- ttusb->i2c_adap.id = I2C_ALGO_BIT;
result = i2c_add_adapter(&ttusb->i2c_adap);
if (result) {
--- linux-2.6.13-rc5.orig/drivers/media/video/ir-kbd-i2c.c 2005-08-02 22:13:11.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/ir-kbd-i2c.c 2005-08-02 22:57:18.000000000 +0200
@@ -432,7 +432,7 @@
case I2C_HW_B_BT848:
probe = probe_bttv;
break;
- case I2C_ALGO_SAA7134:
+ case I2C_HW_SAA7134:
probe = probe_saa7134;
break;
}
--- linux-2.6.13-rc5.orig/drivers/media/video/saa7134/saa7134-i2c.c 2005-08-02 20:44:33.000000000 +0200
+++ linux-2.6.13-rc5/drivers/media/video/saa7134/saa7134-i2c.c 2005-08-02 22:56:20.000000000 +0200
@@ -381,7 +381,7 @@
.class = I2C_CLASS_TV_ANALOG,
#endif
I2C_DEVNAME("saa7134"),
- .id = I2C_ALGO_SAA7134,
+ .id = I2C_HW_SAA7134,
.algo = &saa7134_algo,
.client_register = attach_inform,
};
--
Jean Delvare
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] (7/7) I2C: Kill i2c_algorithm.id
2005-08-11 21:18 [PATCH] (0/7) I2C: Kill i2c_algorithm.{name,id} Jean Delvare
` (5 preceding siblings ...)
2005-08-11 21:51 ` [PATCH] (6/7) " Jean Delvare
@ 2005-08-11 21:52 ` Jean Delvare
6 siblings, 0 replies; 8+ messages in thread
From: Jean Delvare @ 2005-08-11 21:52 UTC (permalink / raw)
To: LKML
The I2C_ALGO_* constants have no more users, delete them. Also update
the comments in i2c-id.h so that they reflect the current state of the
file.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
include/linux/i2c-id.h | 57 -------------------------------------------------
1 files changed, 1 insertion(+), 56 deletions(-)
--- linux-2.6.13-rc5.orig/include/linux/i2c-id.h 2005-08-03 20:04:58.000000000 +0200
+++ linux-2.6.13-rc5/include/linux/i2c-id.h 2005-08-03 20:25:27.000000000 +0200
@@ -1,6 +1,6 @@
/* ------------------------------------------------------------------------- */
/* */
-/* i2c.h - definitions for the i2c-bus interface */
+/* i2c-id.h - identifier values for i2c drivers and adapters */
/* */
/* ------------------------------------------------------------------------- */
/* Copyright (C) 1995-1999 Simon G. Vogl
@@ -24,16 +24,6 @@
#define LINUX_I2C_ID_H
/*
- * This file is part of the i2c-bus package and contains the identifier
- * values for drivers, adapters and other folk populating these serial
- * worlds.
- *
- * These will change often (i.e. additions) , therefore this has been
- * separated from the functional interface definitions of the i2c api.
- *
- */
-
-/*
* ---- Driver types -----------------------------------------------------
* device id name + number function description, i2c address(es)
*
@@ -170,51 +160,6 @@
/*
* ---- Adapter types ----------------------------------------------------
- *
- * First, we distinguish between several algorithms to access the hardware
- * interface types, as a PCF 8584 needs other care than a bit adapter.
- */
-
-#define I2C_ALGO_NONE 0x000000
-#define I2C_ALGO_BIT 0x010000 /* bit style adapters */
-#define I2C_ALGO_PCF 0x020000 /* PCF 8584 style adapters */
-#define I2C_ALGO_ATI 0x030000 /* ATI video card */
-#define I2C_ALGO_SMBUS 0x040000
-#define I2C_ALGO_ISA 0x050000 /* lm_sensors ISA pseudo-adapter */
-#define I2C_ALGO_SAA7146 0x060000 /* SAA 7146 video decoder bus */
-#define I2C_ALGO_ACB 0x070000 /* ACCESS.bus algorithm */
-#define I2C_ALGO_IIC 0x080000 /* ITE IIC bus */
-#define I2C_ALGO_SAA7134 0x090000
-#define I2C_ALGO_MPC824X 0x0a0000 /* Motorola 8240 / 8245 */
-#define I2C_ALGO_IPMI 0x0b0000 /* IPMI dummy adapter */
-#define I2C_ALGO_IPMB 0x0c0000 /* IPMB adapter */
-#define I2C_ALGO_MPC107 0x0d0000
-#define I2C_ALGO_EC 0x100000 /* ACPI embedded controller */
-
-#define I2C_ALGO_MPC8XX 0x110000 /* MPC8xx PowerPC I2C algorithm */
-#define I2C_ALGO_OCP 0x120000 /* IBM or otherwise On-chip I2C algorithm */
-#define I2C_ALGO_BITHS 0x130000 /* enhanced bit style adapters */
-#define I2C_ALGO_IOP3XX 0x140000 /* XSCALE IOP3XX On-chip I2C alg */
-#define I2C_ALGO_SIBYTE 0x150000 /* Broadcom SiByte SOCs */
-#define I2C_ALGO_SGI 0x160000 /* SGI algorithm */
-
-#define I2C_ALGO_USB 0x170000 /* USB algorithm */
-#define I2C_ALGO_VIRT 0x180000 /* Virtual bus adapter */
-
-#define I2C_ALGO_MV64XXX 0x190000 /* Marvell mv64xxx i2c ctlr */
-#define I2C_ALGO_PCA 0x1a0000 /* PCA 9564 style adapters */
-#define I2C_ALGO_AU1550 0x1b0000 /* Au1550 PSC algorithm */
-
-#define I2C_ALGO_EXP 0x800000 /* experimental */
-
-#define I2C_ALGO_MASK 0xff0000 /* Mask for algorithms */
-#define I2C_ALGO_SHIFT 0x10 /* right shift to get index values */
-
-#define I2C_HW_ADAPS 0x10000 /* # adapter types */
-#define I2C_HW_MASK 0xffff
-
-
-/* hw specific modules that are defined per algorithm layer
*/
/* --- Bit algorithm adapters */
--
Jean Delvare
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-08-11 21:52 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-11 21:18 [PATCH] (0/7) I2C: Kill i2c_algorithm.{name,id} Jean Delvare
2005-08-11 21:33 ` [PATCH] (1/7) I2C: Kill i2c_algorithm.name Jean Delvare
2005-08-11 21:36 ` [PATCH] (2/7) I2C: Kill i2c_algorithm.id Jean Delvare
2005-08-11 21:38 ` [PATCH] (3/7) " Jean Delvare
2005-08-11 21:40 ` [PATCH] (4/7) " Jean Delvare
2005-08-11 21:41 ` [PATCH] (5/7) " Jean Delvare
2005-08-11 21:51 ` [PATCH] (6/7) " Jean Delvare
2005-08-11 21:52 ` [PATCH] (7/7) " Jean Delvare
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox