i2c: Add IDs to adapters
Stephen Hemminger [Tue, 13 Feb 2007 21:09:01 +0000 (22:09 +0100)]
IDs have been defined but not used by most of the I2C adapters.
By having a unique ID, clients can check for correct connection
during probe.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>

18 files changed:
drivers/i2c/busses/i2c-ali1535.c
drivers/i2c/busses/i2c-ali1563.c
drivers/i2c/busses/i2c-ali15x3.c
drivers/i2c/busses/i2c-amd756.c
drivers/i2c/busses/i2c-amd8111.c
drivers/i2c/busses/i2c-i801.c
drivers/i2c/busses/i2c-i810.c
drivers/i2c/busses/i2c-nforce2.c
drivers/i2c/busses/i2c-piix4.c
drivers/i2c/busses/i2c-savage4.c
drivers/i2c/busses/i2c-sis5595.c
drivers/i2c/busses/i2c-sis630.c
drivers/i2c/busses/i2c-sis96x.c
drivers/i2c/busses/i2c-via.c
drivers/i2c/busses/i2c-viapro.c
drivers/i2c/busses/i2c-voodoo3.c
drivers/i2c/busses/scx200_i2c.c
include/linux/i2c-id.h

index e75d339..0b0a87b 100644 (file)
@@ -475,6 +475,7 @@ static const struct i2c_algorithm smbus_algorithm = {
 
 static struct i2c_adapter ali1535_adapter = {
        .owner          = THIS_MODULE,
+       .id             = I2C_HW_SMBUS_ALI1535,
        .class          = I2C_CLASS_HWMON,
        .algo           = &smbus_algorithm,
 };
index 55ebbef..6b68074 100644 (file)
@@ -370,6 +370,7 @@ static const struct i2c_algorithm ali1563_algorithm = {
 
 static struct i2c_adapter ali1563_adapter = {
        .owner  = THIS_MODULE,
+       .id     = I2C_HW_SMBUS_ALI1563,
        .class  = I2C_CLASS_HWMON,
        .algo   = &ali1563_algorithm,
 };
index 3f11b6e..c537441 100644 (file)
@@ -470,6 +470,7 @@ static const struct i2c_algorithm smbus_algorithm = {
 
 static struct i2c_adapter ali15x3_adapter = {
        .owner          = THIS_MODULE,
+       .id             = I2C_HW_SMBUS_ALI15X3,
        .class          = I2C_CLASS_HWMON,
        .algo           = &smbus_algorithm,
 };
index 2d21afd..91fbc0e 100644 (file)
@@ -301,6 +301,7 @@ static const struct i2c_algorithm smbus_algorithm = {
 
 struct i2c_adapter amd756_smbus = {
        .owner          = THIS_MODULE,
+       .id             = I2C_HW_SMBUS_AMD756,
        .class          = I2C_CLASS_HWMON,
        .algo           = &smbus_algorithm,
 };
index 0fbc718..21f8a82 100644 (file)
@@ -351,6 +351,7 @@ static int __devinit amd8111_probe(struct pci_dev *dev, const struct pci_device_
        smbus->adapter.owner = THIS_MODULE;
        snprintf(smbus->adapter.name, I2C_NAME_SIZE,
                "SMBus2 AMD8111 adapter at %04x", smbus->base);
+       smbus->adapter.id = I2C_HW_SMBUS_AMD8111;
        smbus->adapter.class = I2C_CLASS_HWMON;
        smbus->adapter.algo = &smbus_algorithm;
        smbus->adapter.algo_data = smbus;
index de5e23a..8c3569a 100644 (file)
@@ -442,6 +442,7 @@ static const struct i2c_algorithm smbus_algorithm = {
 
 static struct i2c_adapter i801_adapter = {
        .owner          = THIS_MODULE,
+       .id             = I2C_HW_SMBUS_I801,
        .class          = I2C_CLASS_HWMON,
        .algo           = &smbus_algorithm,
 };
index 10c98bc..42e8d94 100644 (file)
@@ -171,6 +171,7 @@ static struct i2c_algo_bit_data i810_i2c_bit_data = {
 
 static struct i2c_adapter i810_i2c_adapter = {
        .owner          = THIS_MODULE,
+       .id             = I2C_HW_B_I810,
        .name           = "I810/I815 I2C Adapter",
        .algo_data      = &i810_i2c_bit_data,
 };
@@ -186,6 +187,7 @@ static struct i2c_algo_bit_data i810_ddc_bit_data = {
 
 static struct i2c_adapter i810_ddc_adapter = {
        .owner          = THIS_MODULE,
+       .id             = I2C_HW_B_I810,
        .name           = "I810/I815 DDC Adapter",
        .algo_data      = &i810_ddc_bit_data,
 };
index 69d0730..6535551 100644 (file)
@@ -236,6 +236,7 @@ static int __devinit nforce2_probe_smb (struct pci_dev *dev, int bar,
                return -1;
        }
        smbus->adapter.owner = THIS_MODULE;
+       smbus->adapter.id = I2C_HW_SMBUS_NFORCE2;
        smbus->adapter.class = I2C_CLASS_HWMON;
        smbus->adapter.algo = &smbus_algorithm;
        smbus->adapter.algo_data = smbus;
index 07546c2..03d0aee 100644 (file)
@@ -384,6 +384,7 @@ static const struct i2c_algorithm smbus_algorithm = {
 
 static struct i2c_adapter piix4_adapter = {
        .owner          = THIS_MODULE,
+       .id             = I2C_HW_SMBUS_PIIX4,
        .class          = I2C_CLASS_HWMON,
        .algo           = &smbus_algorithm,
 };
index 844b4ff..b7fb65c 100644 (file)
@@ -145,6 +145,7 @@ static struct i2c_algo_bit_data sav_i2c_bit_data = {
 
 static struct i2c_adapter savage4_i2c_adapter = {
        .owner          = THIS_MODULE,
+       .id             = I2C_HW_B_SAVAGE,
        .name           = "I2C Savage4 adapter",
        .algo_data      = &sav_i2c_bit_data,
 };
index 38bbfd8..d333bab 100644 (file)
@@ -365,6 +365,7 @@ static const struct i2c_algorithm smbus_algorithm = {
 
 static struct i2c_adapter sis5595_adapter = {
        .owner          = THIS_MODULE,
+       .id             = I2C_HW_SMBUS_SIS5595,
        .class          = I2C_CLASS_HWMON,
        .algo           = &smbus_algorithm,
 };
index dec0baf..172bacf 100644 (file)
@@ -457,6 +457,7 @@ static const struct i2c_algorithm smbus_algorithm = {
 
 static struct i2c_adapter sis630_adapter = {
        .owner          = THIS_MODULE,
+       .id             = I2C_HW_SMBUS_SIS630,
        .class          = I2C_CLASS_HWMON,
        .algo           = &smbus_algorithm,
 };
index 7fd07fb..869a635 100644 (file)
@@ -249,6 +249,7 @@ static const struct i2c_algorithm smbus_algorithm = {
 
 static struct i2c_adapter sis96x_adapter = {
        .owner          = THIS_MODULE,
+       .id             = I2C_HW_SMBUS_SIS96X,
        .class          = I2C_CLASS_HWMON,
        .algo           = &smbus_algorithm,
 };
index 15d7e00..bbcc621 100644 (file)
@@ -86,6 +86,7 @@ static struct i2c_algo_bit_data bit_data = {
 
 static struct i2c_adapter vt586b_adapter = {
        .owner          = THIS_MODULE,
+       .id             = I2C_HW_B_VIA,
        .class          = I2C_CLASS_HWMON,
        .name           = "VIA i2c",
        .algo_data      = &bit_data,
index efc6bbf..43a081f 100644 (file)
@@ -306,6 +306,7 @@ static const struct i2c_algorithm smbus_algorithm = {
 
 static struct i2c_adapter vt596_adapter = {
        .owner          = THIS_MODULE,
+       .id             = I2C_HW_SMBUS_VIA2,
        .class          = I2C_CLASS_HWMON,
        .algo           = &smbus_algorithm,
 };
index b0377b8..88a3447 100644 (file)
@@ -165,6 +165,7 @@ static struct i2c_algo_bit_data voo_i2c_bit_data = {
 
 static struct i2c_adapter voodoo3_i2c_adapter = {
        .owner          = THIS_MODULE,
+       .id             = I2C_HW_B_VOO,
        .class          = I2C_CLASS_TV_ANALOG, 
        .name           = "I2C Voodoo3/Banshee adapter",
        .algo_data      = &voo_i2c_bit_data,
@@ -181,6 +182,7 @@ static struct i2c_algo_bit_data voo_ddc_bit_data = {
 
 static struct i2c_adapter voodoo3_ddc_adapter = {
        .owner          = THIS_MODULE,
+       .id             = I2C_HW_B_VOO,
        .class          = I2C_CLASS_DDC, 
        .name           = "DDC Voodoo3/Banshee adapter",
        .algo_data      = &voo_ddc_bit_data,
index 6cd96e4..c3022a0 100644 (file)
@@ -81,6 +81,7 @@ static struct i2c_algo_bit_data scx200_i2c_data = {
 
 static struct i2c_adapter scx200_i2c_ops = {
        .owner             = THIS_MODULE,
+       .id                = I2C_HW_B_SCX200,
        .algo_data         = &scx200_i2c_data,
        .name   = "NatSemi SCx200 I2C",
 };
index b65c1c9..9c21dc7 100644 (file)
 #define I2C_HW_SMBUS_OV519     0x040010 /* OV519 USB 1.1 webcam IC */
 #define I2C_HW_SMBUS_OVFX2     0x040011 /* Cypress/OmniVision FX2 webcam */
 #define I2C_HW_SMBUS_CAFE      0x040012 /* Marvell 88ALP01 "CAFE" cam  */
+#define I2C_HW_SMBUS_ALI1563   0x040013
 
 /* --- ISA pseudo-adapter                                              */
 #define I2C_HW_ISA             0x050000