aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2008-07-14 16:38:29 -0400
committerJean Delvare <khali@mahadeva.delvare>2008-07-14 16:38:29 -0400
commit3401b2fff38fbb8b73ea6bcc69a8370ae5d2a7a0 (patch)
tree8afd803ea49cf8bf8f1db90eabf5c8cd03808ef2
parentc1b6b4f2342d073698dfc2547240c35045a1d00e (diff)
i2c: Let bus drivers add SPD to their class
Let general purpose I2C/SMBus bus drivers add SPD to their class. Once this is done, we will be able to tell the eeprom driver to only probe for SPD EEPROMs and similar on these buses. Note that I took a conservative approach here, adding I2C_CLASS_SPD to many drivers that have no idea whether they can host SPD EEPROMs or not. This is to make sure that the eeprom driver doesn't stop probing buses where SPD EEPROMs or equivalent live. So, bus driver maintainers and users should feel free to remove the SPD class from drivers those buses never have SPD EEPROMs or they don't want the eeprom driver to bind to them. Likewise, feel free to add the SPD class to any bus driver I might have missed. Signed-off-by: Jean Delvare <khali@linux-fr.org>
-rw-r--r--drivers/i2c/busses/i2c-ali1535.c2
-rw-r--r--drivers/i2c/busses/i2c-ali1563.c2
-rw-r--r--drivers/i2c/busses/i2c-ali15x3.c2
-rw-r--r--drivers/i2c/busses/i2c-amd756.c2
-rw-r--r--drivers/i2c/busses/i2c-amd8111.c2
-rw-r--r--drivers/i2c/busses/i2c-cpm.c2
-rw-r--r--drivers/i2c/busses/i2c-elektor.c2
-rw-r--r--drivers/i2c/busses/i2c-gpio.c2
-rw-r--r--drivers/i2c/busses/i2c-i801.c2
-rw-r--r--drivers/i2c/busses/i2c-ibm_iic.c4
-rw-r--r--drivers/i2c/busses/i2c-iop3xx.c2
-rw-r--r--drivers/i2c/busses/i2c-isch.c2
-rw-r--r--drivers/i2c/busses/i2c-mpc.c2
-rw-r--r--drivers/i2c/busses/i2c-mv64xxx.c2
-rw-r--r--drivers/i2c/busses/i2c-nforce2.c2
-rw-r--r--drivers/i2c/busses/i2c-ocores.c2
-rw-r--r--drivers/i2c/busses/i2c-pasemi.c2
-rw-r--r--drivers/i2c/busses/i2c-piix4.c2
-rw-r--r--drivers/i2c/busses/i2c-pmcmsp.c2
-rw-r--r--drivers/i2c/busses/i2c-s3c2410.c2
-rw-r--r--drivers/i2c/busses/i2c-sibyte.c4
-rw-r--r--drivers/i2c/busses/i2c-sis5595.c2
-rw-r--r--drivers/i2c/busses/i2c-sis630.c2
-rw-r--r--drivers/i2c/busses/i2c-sis96x.c2
-rw-r--r--drivers/i2c/busses/i2c-stub.c2
-rw-r--r--drivers/i2c/busses/i2c-via.c2
-rw-r--r--drivers/i2c/busses/i2c-viapro.c2
-rw-r--r--drivers/i2c/busses/scx200_acb.c2
-rw-r--r--include/linux/i2c.h1
29 files changed, 31 insertions, 30 deletions
diff --git a/drivers/i2c/busses/i2c-ali1535.c b/drivers/i2c/busses/i2c-ali1535.c
index 704436cdec8e..8d1d90ab3a90 100644
--- a/drivers/i2c/busses/i2c-ali1535.c
+++ b/drivers/i2c/busses/i2c-ali1535.c
@@ -473,7 +473,7 @@ static const struct i2c_algorithm smbus_algorithm = {
473static struct i2c_adapter ali1535_adapter = { 473static struct i2c_adapter ali1535_adapter = {
474 .owner = THIS_MODULE, 474 .owner = THIS_MODULE,
475 .id = I2C_HW_SMBUS_ALI1535, 475 .id = I2C_HW_SMBUS_ALI1535,
476 .class = I2C_CLASS_HWMON, 476 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
477 .algo = &smbus_algorithm, 477 .algo = &smbus_algorithm,
478}; 478};
479 479
diff --git a/drivers/i2c/busses/i2c-ali1563.c b/drivers/i2c/busses/i2c-ali1563.c
index da5a382eee93..4b55ae19db8d 100644
--- a/drivers/i2c/busses/i2c-ali1563.c
+++ b/drivers/i2c/busses/i2c-ali1563.c
@@ -382,7 +382,7 @@ static const struct i2c_algorithm ali1563_algorithm = {
382static struct i2c_adapter ali1563_adapter = { 382static struct i2c_adapter ali1563_adapter = {
383 .owner = THIS_MODULE, 383 .owner = THIS_MODULE,
384 .id = I2C_HW_SMBUS_ALI1563, 384 .id = I2C_HW_SMBUS_ALI1563,
385 .class = I2C_CLASS_HWMON, 385 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
386 .algo = &ali1563_algorithm, 386 .algo = &ali1563_algorithm,
387}; 387};
388 388
diff --git a/drivers/i2c/busses/i2c-ali15x3.c b/drivers/i2c/busses/i2c-ali15x3.c
index 7b029b147a8e..e922c3950fcd 100644
--- a/drivers/i2c/busses/i2c-ali15x3.c
+++ b/drivers/i2c/busses/i2c-ali15x3.c
@@ -471,7 +471,7 @@ static const struct i2c_algorithm smbus_algorithm = {
471static struct i2c_adapter ali15x3_adapter = { 471static struct i2c_adapter ali15x3_adapter = {
472 .owner = THIS_MODULE, 472 .owner = THIS_MODULE,
473 .id = I2C_HW_SMBUS_ALI15X3, 473 .id = I2C_HW_SMBUS_ALI15X3,
474 .class = I2C_CLASS_HWMON, 474 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
475 .algo = &smbus_algorithm, 475 .algo = &smbus_algorithm,
476}; 476};
477 477
diff --git a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c
index f0baea62067d..bd4f6380fabe 100644
--- a/drivers/i2c/busses/i2c-amd756.c
+++ b/drivers/i2c/busses/i2c-amd756.c
@@ -301,7 +301,7 @@ static const struct i2c_algorithm smbus_algorithm = {
301struct i2c_adapter amd756_smbus = { 301struct i2c_adapter amd756_smbus = {
302 .owner = THIS_MODULE, 302 .owner = THIS_MODULE,
303 .id = I2C_HW_SMBUS_AMD756, 303 .id = I2C_HW_SMBUS_AMD756,
304 .class = I2C_CLASS_HWMON, 304 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
305 .algo = &smbus_algorithm, 305 .algo = &smbus_algorithm,
306}; 306};
307 307
diff --git a/drivers/i2c/busses/i2c-amd8111.c b/drivers/i2c/busses/i2c-amd8111.c
index a4f687915de1..0e18fe846010 100644
--- a/drivers/i2c/busses/i2c-amd8111.c
+++ b/drivers/i2c/busses/i2c-amd8111.c
@@ -383,7 +383,7 @@ static int __devinit amd8111_probe(struct pci_dev *dev,
383 snprintf(smbus->adapter.name, sizeof(smbus->adapter.name), 383 snprintf(smbus->adapter.name, sizeof(smbus->adapter.name),
384 "SMBus2 AMD8111 adapter at %04x", smbus->base); 384 "SMBus2 AMD8111 adapter at %04x", smbus->base);
385 smbus->adapter.id = I2C_HW_SMBUS_AMD8111; 385 smbus->adapter.id = I2C_HW_SMBUS_AMD8111;
386 smbus->adapter.class = I2C_CLASS_HWMON; 386 smbus->adapter.class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
387 smbus->adapter.algo = &smbus_algorithm; 387 smbus->adapter.algo = &smbus_algorithm;
388 smbus->adapter.algo_data = smbus; 388 smbus->adapter.algo_data = smbus;
389 389
diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
index 53af744a91c1..8164de1f4d72 100644
--- a/drivers/i2c/busses/i2c-cpm.c
+++ b/drivers/i2c/busses/i2c-cpm.c
@@ -423,7 +423,7 @@ static const struct i2c_adapter cpm_ops = {
423 .owner = THIS_MODULE, 423 .owner = THIS_MODULE,
424 .name = "i2c-cpm", 424 .name = "i2c-cpm",
425 .algo = &cpm_i2c_algo, 425 .algo = &cpm_i2c_algo,
426 .class = I2C_CLASS_HWMON, 426 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
427}; 427};
428 428
429static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm) 429static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm)
diff --git a/drivers/i2c/busses/i2c-elektor.c b/drivers/i2c/busses/i2c-elektor.c
index b7a9977b025f..c251cf21a62b 100644
--- a/drivers/i2c/busses/i2c-elektor.c
+++ b/drivers/i2c/busses/i2c-elektor.c
@@ -202,7 +202,7 @@ static struct i2c_algo_pcf_data pcf_isa_data = {
202 202
203static struct i2c_adapter pcf_isa_ops = { 203static struct i2c_adapter pcf_isa_ops = {
204 .owner = THIS_MODULE, 204 .owner = THIS_MODULE,
205 .class = I2C_CLASS_HWMON, 205 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
206 .id = I2C_HW_P_ELEK, 206 .id = I2C_HW_P_ELEK,
207 .algo_data = &pcf_isa_data, 207 .algo_data = &pcf_isa_data,
208 .name = "i2c-elektor", 208 .name = "i2c-elektor",
diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
index 7c1b762aa681..79b455a1f090 100644
--- a/drivers/i2c/busses/i2c-gpio.c
+++ b/drivers/i2c/busses/i2c-gpio.c
@@ -140,7 +140,7 @@ static int __init i2c_gpio_probe(struct platform_device *pdev)
140 adap->owner = THIS_MODULE; 140 adap->owner = THIS_MODULE;
141 snprintf(adap->name, sizeof(adap->name), "i2c-gpio%d", pdev->id); 141 snprintf(adap->name, sizeof(adap->name), "i2c-gpio%d", pdev->id);
142 adap->algo_data = bit_data; 142 adap->algo_data = bit_data;
143 adap->class = I2C_CLASS_HWMON; 143 adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
144 adap->dev.parent = &pdev->dev; 144 adap->dev.parent = &pdev->dev;
145 145
146 /* 146 /*
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 213119211e58..9717ffe12921 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -573,7 +573,7 @@ static const struct i2c_algorithm smbus_algorithm = {
573static struct i2c_adapter i801_adapter = { 573static struct i2c_adapter i801_adapter = {
574 .owner = THIS_MODULE, 574 .owner = THIS_MODULE,
575 .id = I2C_HW_SMBUS_I801, 575 .id = I2C_HW_SMBUS_I801,
576 .class = I2C_CLASS_HWMON, 576 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
577 .algo = &smbus_algorithm, 577 .algo = &smbus_algorithm,
578}; 578};
579 579
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
index 85dbf34382e1..6f7bfdec3c69 100644
--- a/drivers/i2c/busses/i2c-ibm_iic.c
+++ b/drivers/i2c/busses/i2c-ibm_iic.c
@@ -740,7 +740,7 @@ static int __devinit iic_probe(struct ocp_device *ocp){
740 strcpy(adap->name, "IBM IIC"); 740 strcpy(adap->name, "IBM IIC");
741 i2c_set_adapdata(adap, dev); 741 i2c_set_adapdata(adap, dev);
742 adap->id = I2C_HW_OCP; 742 adap->id = I2C_HW_OCP;
743 adap->class = I2C_CLASS_HWMON; 743 adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
744 adap->algo = &iic_algo; 744 adap->algo = &iic_algo;
745 adap->client_register = NULL; 745 adap->client_register = NULL;
746 adap->client_unregister = NULL; 746 adap->client_unregister = NULL;
@@ -934,7 +934,7 @@ static int __devinit iic_probe(struct of_device *ofdev,
934 strlcpy(adap->name, "IBM IIC", sizeof(adap->name)); 934 strlcpy(adap->name, "IBM IIC", sizeof(adap->name));
935 i2c_set_adapdata(adap, dev); 935 i2c_set_adapdata(adap, dev);
936 adap->id = I2C_HW_OCP; 936 adap->id = I2C_HW_OCP;
937 adap->class = I2C_CLASS_HWMON; 937 adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
938 adap->algo = &iic_algo; 938 adap->algo = &iic_algo;
939 adap->timeout = 1; 939 adap->timeout = 1;
940 adap->nr = dev->idx; 940 adap->nr = dev->idx;
diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c
index 39884e797594..fc2714ac0c0f 100644
--- a/drivers/i2c/busses/i2c-iop3xx.c
+++ b/drivers/i2c/busses/i2c-iop3xx.c
@@ -482,7 +482,7 @@ iop3xx_i2c_probe(struct platform_device *pdev)
482 memcpy(new_adapter->name, pdev->name, strlen(pdev->name)); 482 memcpy(new_adapter->name, pdev->name, strlen(pdev->name));
483 new_adapter->id = I2C_HW_IOP3XX; 483 new_adapter->id = I2C_HW_IOP3XX;
484 new_adapter->owner = THIS_MODULE; 484 new_adapter->owner = THIS_MODULE;
485 new_adapter->class = I2C_CLASS_HWMON; 485 new_adapter->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
486 new_adapter->dev.parent = &pdev->dev; 486 new_adapter->dev.parent = &pdev->dev;
487 new_adapter->nr = pdev->id; 487 new_adapter->nr = pdev->id;
488 488
diff --git a/drivers/i2c/busses/i2c-isch.c b/drivers/i2c/busses/i2c-isch.c
index c9cd46b22692..8d648911a7f5 100644
--- a/drivers/i2c/busses/i2c-isch.c
+++ b/drivers/i2c/busses/i2c-isch.c
@@ -251,7 +251,7 @@ static const struct i2c_algorithm smbus_algorithm = {
251 251
252static struct i2c_adapter sch_adapter = { 252static struct i2c_adapter sch_adapter = {
253 .owner = THIS_MODULE, 253 .owner = THIS_MODULE,
254 .class = I2C_CLASS_HWMON, 254 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
255 .algo = &smbus_algorithm, 255 .algo = &smbus_algorithm,
256}; 256};
257 257
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index a076129de7e8..10b9342a36c2 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -311,7 +311,7 @@ static struct i2c_adapter mpc_ops = {
311 .name = "MPC adapter", 311 .name = "MPC adapter",
312 .id = I2C_HW_MPC107, 312 .id = I2C_HW_MPC107,
313 .algo = &mpc_algo, 313 .algo = &mpc_algo,
314 .class = I2C_CLASS_HWMON, 314 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
315 .timeout = 1, 315 .timeout = 1,
316}; 316};
317 317
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 036e6a883e67..9e8118d2fe64 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -530,7 +530,7 @@ mv64xxx_i2c_probe(struct platform_device *pd)
530 drv_data->adapter.id = I2C_HW_MV64XXX; 530 drv_data->adapter.id = I2C_HW_MV64XXX;
531 drv_data->adapter.algo = &mv64xxx_i2c_algo; 531 drv_data->adapter.algo = &mv64xxx_i2c_algo;
532 drv_data->adapter.owner = THIS_MODULE; 532 drv_data->adapter.owner = THIS_MODULE;
533 drv_data->adapter.class = I2C_CLASS_HWMON; 533 drv_data->adapter.class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
534 drv_data->adapter.timeout = pdata->timeout; 534 drv_data->adapter.timeout = pdata->timeout;
535 drv_data->adapter.nr = pd->id; 535 drv_data->adapter.nr = pd->id;
536 platform_set_drvdata(pd, drv_data); 536 platform_set_drvdata(pd, drv_data);
diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c
index 081fdf3393f4..2654f20d3a62 100644
--- a/drivers/i2c/busses/i2c-nforce2.c
+++ b/drivers/i2c/busses/i2c-nforce2.c
@@ -350,7 +350,7 @@ static int __devinit nforce2_probe_smb (struct pci_dev *dev, int bar,
350 } 350 }
351 smbus->adapter.owner = THIS_MODULE; 351 smbus->adapter.owner = THIS_MODULE;
352 smbus->adapter.id = I2C_HW_SMBUS_NFORCE2; 352 smbus->adapter.id = I2C_HW_SMBUS_NFORCE2;
353 smbus->adapter.class = I2C_CLASS_HWMON; 353 smbus->adapter.class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
354 smbus->adapter.algo = &smbus_algorithm; 354 smbus->adapter.algo = &smbus_algorithm;
355 smbus->adapter.algo_data = smbus; 355 smbus->adapter.algo_data = smbus;
356 smbus->adapter.dev.parent = &dev->dev; 356 smbus->adapter.dev.parent = &dev->dev;
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
index f145692cbb76..51ca79bf6480 100644
--- a/drivers/i2c/busses/i2c-ocores.c
+++ b/drivers/i2c/busses/i2c-ocores.c
@@ -205,7 +205,7 @@ static const struct i2c_algorithm ocores_algorithm = {
205static struct i2c_adapter ocores_adapter = { 205static struct i2c_adapter ocores_adapter = {
206 .owner = THIS_MODULE, 206 .owner = THIS_MODULE,
207 .name = "i2c-ocores", 207 .name = "i2c-ocores",
208 .class = I2C_CLASS_HWMON, 208 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
209 .algo = &ocores_algorithm, 209 .algo = &ocores_algorithm,
210}; 210};
211 211
diff --git a/drivers/i2c/busses/i2c-pasemi.c b/drivers/i2c/busses/i2c-pasemi.c
index 1603c81e39d4..adf0fbb902f0 100644
--- a/drivers/i2c/busses/i2c-pasemi.c
+++ b/drivers/i2c/busses/i2c-pasemi.c
@@ -365,7 +365,7 @@ static int __devinit pasemi_smb_probe(struct pci_dev *dev,
365 smbus->adapter.owner = THIS_MODULE; 365 smbus->adapter.owner = THIS_MODULE;
366 snprintf(smbus->adapter.name, sizeof(smbus->adapter.name), 366 snprintf(smbus->adapter.name, sizeof(smbus->adapter.name),
367 "PA Semi SMBus adapter at 0x%lx", smbus->base); 367 "PA Semi SMBus adapter at 0x%lx", smbus->base);
368 smbus->adapter.class = I2C_CLASS_HWMON; 368 smbus->adapter.class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
369 smbus->adapter.algo = &smbus_algorithm; 369 smbus->adapter.algo = &smbus_algorithm;
370 smbus->adapter.algo_data = smbus; 370 smbus->adapter.algo_data = smbus;
371 smbus->adapter.nr = PCI_FUNC(dev->devfn); 371 smbus->adapter.nr = PCI_FUNC(dev->devfn);
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
index 2bde47509e1a..85d69f3e624f 100644
--- a/drivers/i2c/busses/i2c-piix4.c
+++ b/drivers/i2c/busses/i2c-piix4.c
@@ -402,7 +402,7 @@ static const struct i2c_algorithm smbus_algorithm = {
402static struct i2c_adapter piix4_adapter = { 402static struct i2c_adapter piix4_adapter = {
403 .owner = THIS_MODULE, 403 .owner = THIS_MODULE,
404 .id = I2C_HW_SMBUS_PIIX4, 404 .id = I2C_HW_SMBUS_PIIX4,
405 .class = I2C_CLASS_HWMON, 405 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
406 .algo = &smbus_algorithm, 406 .algo = &smbus_algorithm,
407}; 407};
408 408
diff --git a/drivers/i2c/busses/i2c-pmcmsp.c b/drivers/i2c/busses/i2c-pmcmsp.c
index 63b3e2c11cff..dcf2045b5222 100644
--- a/drivers/i2c/busses/i2c-pmcmsp.c
+++ b/drivers/i2c/busses/i2c-pmcmsp.c
@@ -622,7 +622,7 @@ static struct i2c_algorithm pmcmsptwi_algo = {
622 622
623static struct i2c_adapter pmcmsptwi_adapter = { 623static struct i2c_adapter pmcmsptwi_adapter = {
624 .owner = THIS_MODULE, 624 .owner = THIS_MODULE,
625 .class = I2C_CLASS_HWMON, 625 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
626 .algo = &pmcmsptwi_algo, 626 .algo = &pmcmsptwi_algo,
627 .name = DRV_NAME, 627 .name = DRV_NAME,
628}; 628};
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 9e8c875437be..007390ad9810 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -590,7 +590,7 @@ static struct s3c24xx_i2c s3c24xx_i2c = {
590 .owner = THIS_MODULE, 590 .owner = THIS_MODULE,
591 .algo = &s3c24xx_i2c_algorithm, 591 .algo = &s3c24xx_i2c_algorithm,
592 .retries = 2, 592 .retries = 2,
593 .class = I2C_CLASS_HWMON, 593 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
594 }, 594 },
595}; 595};
596 596
diff --git a/drivers/i2c/busses/i2c-sibyte.c b/drivers/i2c/busses/i2c-sibyte.c
index 114634da6c6e..ac8822e7a5b4 100644
--- a/drivers/i2c/busses/i2c-sibyte.c
+++ b/drivers/i2c/busses/i2c-sibyte.c
@@ -156,7 +156,7 @@ static struct i2c_adapter sibyte_board_adapter[2] = {
156 { 156 {
157 .owner = THIS_MODULE, 157 .owner = THIS_MODULE,
158 .id = I2C_HW_SIBYTE, 158 .id = I2C_HW_SIBYTE,
159 .class = I2C_CLASS_HWMON, 159 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
160 .algo = NULL, 160 .algo = NULL,
161 .algo_data = &sibyte_board_data[0], 161 .algo_data = &sibyte_board_data[0],
162 .name = "SiByte SMBus 0", 162 .name = "SiByte SMBus 0",
@@ -164,7 +164,7 @@ static struct i2c_adapter sibyte_board_adapter[2] = {
164 { 164 {
165 .owner = THIS_MODULE, 165 .owner = THIS_MODULE,
166 .id = I2C_HW_SIBYTE, 166 .id = I2C_HW_SIBYTE,
167 .class = I2C_CLASS_HWMON, 167 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
168 .algo = NULL, 168 .algo = NULL,
169 .algo_data = &sibyte_board_data[1], 169 .algo_data = &sibyte_board_data[1],
170 .name = "SiByte SMBus 1", 170 .name = "SiByte SMBus 1",
diff --git a/drivers/i2c/busses/i2c-sis5595.c b/drivers/i2c/busses/i2c-sis5595.c
index 328441bb5470..f76944b384f5 100644
--- a/drivers/i2c/busses/i2c-sis5595.c
+++ b/drivers/i2c/busses/i2c-sis5595.c
@@ -362,7 +362,7 @@ static const struct i2c_algorithm smbus_algorithm = {
362static struct i2c_adapter sis5595_adapter = { 362static struct i2c_adapter sis5595_adapter = {
363 .owner = THIS_MODULE, 363 .owner = THIS_MODULE,
364 .id = I2C_HW_SMBUS_SIS5595, 364 .id = I2C_HW_SMBUS_SIS5595,
365 .class = I2C_CLASS_HWMON, 365 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
366 .algo = &smbus_algorithm, 366 .algo = &smbus_algorithm,
367}; 367};
368 368
diff --git a/drivers/i2c/busses/i2c-sis630.c b/drivers/i2c/busses/i2c-sis630.c
index d7e6ff3e0187..eb2b2181fed7 100644
--- a/drivers/i2c/busses/i2c-sis630.c
+++ b/drivers/i2c/busses/i2c-sis630.c
@@ -462,7 +462,7 @@ static const struct i2c_algorithm smbus_algorithm = {
462static struct i2c_adapter sis630_adapter = { 462static struct i2c_adapter sis630_adapter = {
463 .owner = THIS_MODULE, 463 .owner = THIS_MODULE,
464 .id = I2C_HW_SMBUS_SIS630, 464 .id = I2C_HW_SMBUS_SIS630,
465 .class = I2C_CLASS_HWMON, 465 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
466 .algo = &smbus_algorithm, 466 .algo = &smbus_algorithm,
467}; 467};
468 468
diff --git a/drivers/i2c/busses/i2c-sis96x.c b/drivers/i2c/busses/i2c-sis96x.c
index cde8e5880368..413e9e477723 100644
--- a/drivers/i2c/busses/i2c-sis96x.c
+++ b/drivers/i2c/busses/i2c-sis96x.c
@@ -244,7 +244,7 @@ static const struct i2c_algorithm smbus_algorithm = {
244static struct i2c_adapter sis96x_adapter = { 244static struct i2c_adapter sis96x_adapter = {
245 .owner = THIS_MODULE, 245 .owner = THIS_MODULE,
246 .id = I2C_HW_SMBUS_SIS96X, 246 .id = I2C_HW_SMBUS_SIS96X,
247 .class = I2C_CLASS_HWMON, 247 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
248 .algo = &smbus_algorithm, 248 .algo = &smbus_algorithm,
249}; 249};
250 250
diff --git a/drivers/i2c/busses/i2c-stub.c b/drivers/i2c/busses/i2c-stub.c
index e37ccd80f77a..1b7b2af94036 100644
--- a/drivers/i2c/busses/i2c-stub.c
+++ b/drivers/i2c/busses/i2c-stub.c
@@ -140,7 +140,7 @@ static const struct i2c_algorithm smbus_algorithm = {
140 140
141static struct i2c_adapter stub_adapter = { 141static struct i2c_adapter stub_adapter = {
142 .owner = THIS_MODULE, 142 .owner = THIS_MODULE,
143 .class = I2C_CLASS_HWMON, 143 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
144 .algo = &smbus_algorithm, 144 .algo = &smbus_algorithm,
145 .name = "SMBus stub driver", 145 .name = "SMBus stub driver",
146}; 146};
diff --git a/drivers/i2c/busses/i2c-via.c b/drivers/i2c/busses/i2c-via.c
index 61716f6b14dc..6517f8a6d911 100644
--- a/drivers/i2c/busses/i2c-via.c
+++ b/drivers/i2c/busses/i2c-via.c
@@ -87,7 +87,7 @@ static struct i2c_algo_bit_data bit_data = {
87static struct i2c_adapter vt586b_adapter = { 87static struct i2c_adapter vt586b_adapter = {
88 .owner = THIS_MODULE, 88 .owner = THIS_MODULE,
89 .id = I2C_HW_B_VIA, 89 .id = I2C_HW_B_VIA,
90 .class = I2C_CLASS_HWMON, 90 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
91 .name = "VIA i2c", 91 .name = "VIA i2c",
92 .algo_data = &bit_data, 92 .algo_data = &bit_data,
93}; 93};
diff --git a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c
index c611905df009..7957ce515891 100644
--- a/drivers/i2c/busses/i2c-viapro.c
+++ b/drivers/i2c/busses/i2c-viapro.c
@@ -311,7 +311,7 @@ static const struct i2c_algorithm smbus_algorithm = {
311static struct i2c_adapter vt596_adapter = { 311static struct i2c_adapter vt596_adapter = {
312 .owner = THIS_MODULE, 312 .owner = THIS_MODULE,
313 .id = I2C_HW_SMBUS_VIA2, 313 .id = I2C_HW_SMBUS_VIA2,
314 .class = I2C_CLASS_HWMON, 314 .class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
315 .algo = &smbus_algorithm, 315 .algo = &smbus_algorithm,
316}; 316};
317 317
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c
index 61abe0f33255..ed794b145a11 100644
--- a/drivers/i2c/busses/scx200_acb.c
+++ b/drivers/i2c/busses/scx200_acb.c
@@ -442,7 +442,7 @@ static __init struct scx200_acb_iface *scx200_create_iface(const char *text,
442 adapter->owner = THIS_MODULE; 442 adapter->owner = THIS_MODULE;
443 adapter->id = I2C_HW_SMBUS_SCX200; 443 adapter->id = I2C_HW_SMBUS_SCX200;
444 adapter->algo = &scx200_acb_algorithm; 444 adapter->algo = &scx200_acb_algorithm;
445 adapter->class = I2C_CLASS_HWMON; 445 adapter->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
446 adapter->dev.parent = dev; 446 adapter->dev.parent = dev;
447 447
448 mutex_init(&iface->mutex); 448 mutex_init(&iface->mutex);
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 145797fe6a31..839d0ea3dca3 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -353,6 +353,7 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data)
353#define I2C_CLASS_CAM_ANALOG (1<<4) /* camera with analog CCD */ 353#define I2C_CLASS_CAM_ANALOG (1<<4) /* camera with analog CCD */
354#define I2C_CLASS_CAM_DIGITAL (1<<5) /* most webcams */ 354#define I2C_CLASS_CAM_DIGITAL (1<<5) /* most webcams */
355#define I2C_CLASS_SOUND (1<<6) /* sound devices */ 355#define I2C_CLASS_SOUND (1<<6) /* sound devices */
356#define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */
356#define I2C_CLASS_ALL (UINT_MAX) /* all of the above */ 357#define I2C_CLASS_ALL (UINT_MAX) /* all of the above */
357 358
358/* i2c_client_address_data is the struct for holding default client 359/* i2c_client_address_data is the struct for holding default client