[i2c] [PATCH] i2c: add id's to devices
Jean Delvare
khali at linux-fr.org
Sun Jan 7 10:50:57 CET 2007
Hi Stephen,
On Fri, 5 Jan 2007 14:01:53 -0800, Stephen Hemminger wrote:
> There are id's available in the adapter data structure but few of the
> drivers were setting them. This patches adds the id initialization to
> several of them.
>
> Signed-off-by: Stephen Hemminger <shemminger at osdl.org>
>
> ---
> 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-i801.c | 1 +
> drivers/i2c/busses/i2c-i810.c | 2 ++
> drivers/i2c/busses/i2c-nforce2.c | 1 +
> drivers/i2c/busses/i2c-piix4.c | 1 +
> drivers/i2c/busses/i2c-savage4.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-via.c | 1 +
> drivers/i2c/busses/i2c-viapro.c | 2 ++
> drivers/i2c/busses/i2c-voodoo3.c | 1 +
> drivers/i2c/busses/scx200_i2c.c | 1 +
> 17 files changed, 19 insertions(+)
>
> --- lifebook.orig/drivers/i2c/busses/i2c-ali1535.c 2007-01-04 10:11:23.000000000 -0800
> +++ lifebook/drivers/i2c/busses/i2c-ali1535.c 2007-01-04 12:31:03.000000000 -0800
> @@ -475,6 +475,7 @@
>
> static struct i2c_adapter ali1535_adapter = {
> .owner = THIS_MODULE,
> + .id = I2C_HW_SMBUS_ALI1535,
> .class = I2C_CLASS_HWMON,
> .algo = &smbus_algorithm,
> };
> --- lifebook.orig/drivers/i2c/busses/i2c-ali15x3.c 2007-01-04 10:11:23.000000000 -0800
> +++ lifebook/drivers/i2c/busses/i2c-ali15x3.c 2007-01-04 10:13:02.000000000 -0800
> @@ -470,6 +470,7 @@
>
> static struct i2c_adapter ali15x3_adapter = {
> .owner = THIS_MODULE,
> + .id = I2C_HW_SMBUS_ALI15X3,
> .class = I2C_CLASS_HWMON,
> .algo = &smbus_algorithm,
> };
> --- lifebook.orig/drivers/i2c/busses/i2c-amd756.c 2007-01-04 10:11:23.000000000 -0800
> +++ lifebook/drivers/i2c/busses/i2c-amd756.c 2007-01-04 10:14:26.000000000 -0800
> @@ -302,6 +302,7 @@
> struct i2c_adapter amd756_smbus = {
> .owner = THIS_MODULE,
> .class = I2C_CLASS_HWMON,
> + .id = I2C_HW_SMBUS_AMD756,
> .algo = &smbus_algorithm,
> };
>
> --- lifebook.orig/drivers/i2c/busses/i2c-amd8111.c 2007-01-04 10:11:23.000000000 -0800
> +++ lifebook/drivers/i2c/busses/i2c-amd8111.c 2007-01-04 12:32:27.000000000 -0800
> @@ -352,6 +352,7 @@
> snprintf(smbus->adapter.name, I2C_NAME_SIZE,
> "SMBus2 AMD8111 adapter at %04x", smbus->base);
> smbus->adapter.class = I2C_CLASS_HWMON;
> + smbus->adapter.id = I2C_HW_SMBUS_AMD8111;
> smbus->adapter.algo = &smbus_algorithm;
> smbus->adapter.algo_data = smbus;
>
> --- lifebook.orig/drivers/i2c/busses/i2c-i801.c 2007-01-04 10:05:20.000000000 -0800
> +++ lifebook/drivers/i2c/busses/i2c-i801.c 2007-01-04 10:10:28.000000000 -0800
> @@ -443,6 +443,7 @@
> static struct i2c_adapter i801_adapter = {
> .owner = THIS_MODULE,
> .class = I2C_CLASS_HWMON,
> + .id = I2C_HW_SMBUS_I801,
> .algo = &smbus_algorithm,
> };
>
> --- lifebook.orig/drivers/i2c/busses/i2c-nforce2.c 2007-01-04 10:11:23.000000000 -0800
> +++ lifebook/drivers/i2c/busses/i2c-nforce2.c 2007-01-04 12:33:03.000000000 -0800
> @@ -239,6 +239,7 @@
> }
> smbus->adapter.owner = THIS_MODULE;
> smbus->adapter.class = I2C_CLASS_HWMON;
> + smbus->adapter.id = I2C_HW_SMBUS_NFORCE2;
> smbus->adapter.algo = &smbus_algorithm;
> smbus->adapter.algo_data = smbus;
> smbus->adapter.dev.parent = &dev->dev;
> --- lifebook.orig/drivers/i2c/busses/i2c-piix4.c 2007-01-04 10:11:24.000000000 -0800
> +++ lifebook/drivers/i2c/busses/i2c-piix4.c 2007-01-04 10:12:24.000000000 -0800
> @@ -383,6 +383,7 @@
>
> static struct i2c_adapter piix4_adapter = {
> .owner = THIS_MODULE,
> + .id = I2C_HW_SMBUS_PIIX4,
> .class = I2C_CLASS_HWMON,
> .algo = &smbus_algorithm,
> };
> --- lifebook.orig/drivers/i2c/busses/i2c-sis5595.c 2007-01-04 10:11:24.000000000 -0800
> +++ lifebook/drivers/i2c/busses/i2c-sis5595.c 2007-01-04 12:30:41.000000000 -0800
> @@ -366,6 +366,7 @@
> static struct i2c_adapter sis5595_adapter = {
> .owner = THIS_MODULE,
> .class = I2C_CLASS_HWMON,
> + .id = I2C_HW_SMBUS_SIS5595,
> .algo = &smbus_algorithm,
> };
>
> --- lifebook.orig/drivers/i2c/busses/i2c-sis630.c 2007-01-04 10:11:24.000000000 -0800
> +++ lifebook/drivers/i2c/busses/i2c-sis630.c 2007-01-04 12:31:32.000000000 -0800
> @@ -458,6 +458,7 @@
> static struct i2c_adapter sis630_adapter = {
> .owner = THIS_MODULE,
> .class = I2C_CLASS_HWMON,
> + .id = I2C_HW_SMBUS_SIS630,
> .algo = &smbus_algorithm,
> };
>
> --- lifebook.orig/drivers/i2c/busses/i2c-sis96x.c 2007-01-04 10:11:24.000000000 -0800
> +++ lifebook/drivers/i2c/busses/i2c-sis96x.c 2007-01-04 12:31:53.000000000 -0800
> @@ -250,6 +250,7 @@
> static struct i2c_adapter sis96x_adapter = {
> .owner = THIS_MODULE,
> .class = I2C_CLASS_HWMON,
> + .id = I2C_HW_SMBUS_SIS96X,
> .algo = &smbus_algorithm,
> };
>
> --- lifebook.orig/drivers/i2c/busses/i2c-via.c 2007-01-04 10:11:24.000000000 -0800
> +++ lifebook/drivers/i2c/busses/i2c-via.c 2007-01-05 13:58:04.000000000 -0800
> @@ -87,6 +87,7 @@
> static struct i2c_adapter vt586b_adapter = {
> .owner = THIS_MODULE,
> .class = I2C_CLASS_HWMON,
> + .id = I2C_HW_B_VIA,
> .name = "VIA i2c",
> .algo_data = &bit_data,
> };
> --- lifebook.orig/drivers/i2c/busses/i2c-voodoo3.c 2007-01-04 10:11:24.000000000 -0800
> +++ lifebook/drivers/i2c/busses/i2c-voodoo3.c 2007-01-05 13:53:53.000000000 -0800
> @@ -166,6 +166,7 @@
> static struct i2c_adapter voodoo3_i2c_adapter = {
> .owner = THIS_MODULE,
> .class = I2C_CLASS_TV_ANALOG,
> + .id = I2C_HW_B_VOO,
> .name = "I2C Voodoo3/Banshee adapter",
> .algo_data = &voo_i2c_bit_data,
> };
What about the second bus of that device?
> --- lifebook.orig/drivers/i2c/busses/i2c-ali1563.c 2007-01-04 10:11:23.000000000 -0800
> +++ lifebook/drivers/i2c/busses/i2c-ali1563.c 2007-01-05 13:51:32.000000000 -0800
> @@ -375,6 +375,7 @@
> static struct i2c_adapter ali1563_adapter = {
> .owner = THIS_MODULE,
> .class = I2C_CLASS_HWMON,
> + .id = I2C_HW_SMBUS_ALI15X3,
> .algo = &ali1563_algorithm,
> };
>
Not correct. I2C_HW_SMBUS_ALI15X3 is the ID of the i2c-ali15x3 driver.
The i2c-ali1563 currently doesn'ty have any ID reserved.
> --- lifebook.orig/drivers/i2c/busses/i2c-i810.c 2007-01-04 10:11:23.000000000 -0800
> +++ lifebook/drivers/i2c/busses/i2c-i810.c 2007-01-05 13:54:15.000000000 -0800
> @@ -172,6 +172,7 @@
> static struct i2c_adapter i810_i2c_adapter = {
> .owner = THIS_MODULE,
> .name = "I810/I815 I2C Adapter",
> + .id = I2C_HW_B_I810,
> .algo_data = &i810_i2c_bit_data,
> };
>
> @@ -187,6 +188,7 @@
> static struct i2c_adapter i810_ddc_adapter = {
> .owner = THIS_MODULE,
> .name = "I810/I815 DDC Adapter",
> + .id = I2C_HW_B_I810,
> .algo_data = &i810_ddc_bit_data,
> };
>
> --- lifebook.orig/drivers/i2c/busses/i2c-savage4.c 2007-01-04 10:11:24.000000000 -0800
> +++ lifebook/drivers/i2c/busses/i2c-savage4.c 2007-01-05 13:56:59.000000000 -0800
> @@ -146,6 +146,7 @@
> static struct i2c_adapter savage4_i2c_adapter = {
> .owner = THIS_MODULE,
> .name = "I2C Savage4 adapter",
> + .id = I2C_HW_B_SAVAGE,
> .algo_data = &sav_i2c_bit_data,
> };
>
> --- lifebook.orig/drivers/i2c/busses/i2c-viapro.c 2007-01-04 10:11:24.000000000 -0800
> +++ lifebook/drivers/i2c/busses/i2c-viapro.c 2007-01-05 13:48:11.000000000 -0800
> @@ -306,7 +306,9 @@
>
> static struct i2c_adapter vt596_adapter = {
> .owner = THIS_MODULE,
> + .name = "VIA Pro",
Useless, the proper name is set in nforce2_probe_smb().
> .class = I2C_CLASS_HWMON,
> + .id = I2C_HW_SMBUS_VIA2,
> .algo = &smbus_algorithm,
> };
>
> --- lifebook.orig/drivers/i2c/busses/scx200_i2c.c 2007-01-04 10:11:24.000000000 -0800
> +++ lifebook/drivers/i2c/busses/scx200_i2c.c 2007-01-05 13:58:37.000000000 -0800
> @@ -81,6 +81,7 @@
>
> static struct i2c_adapter scx200_i2c_ops = {
> .owner = THIS_MODULE,
> + .id = I2C_HW_B_SCX200,
> .algo_data = &scx200_i2c_data,
> .name = "NatSemi SCx200 I2C",
> };
Please resend a patch with these issues addressed.
Thanks,
--
Jean Delvare
More information about the i2c
mailing list