diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-viapro.c')
-rw-r--r-- | drivers/i2c/busses/i2c-viapro.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c index c9ce77f13c0e..77b13d027f86 100644 --- a/drivers/i2c/busses/i2c-viapro.c +++ b/drivers/i2c/busses/i2c-viapro.c | |||
@@ -4,7 +4,7 @@ | |||
4 | Copyright (c) 1998 - 2002 Frodo Looijaard <frodol@dds.nl>, | 4 | Copyright (c) 1998 - 2002 Frodo Looijaard <frodol@dds.nl>, |
5 | Philip Edelbrock <phil@netroedge.com>, Kyösti Mälkki <kmalkki@cc.hut.fi>, | 5 | Philip Edelbrock <phil@netroedge.com>, Kyösti Mälkki <kmalkki@cc.hut.fi>, |
6 | Mark D. Studebaker <mdsxyz123@yahoo.com> | 6 | Mark D. Studebaker <mdsxyz123@yahoo.com> |
7 | Copyright (C) 2005 - 2007 Jean Delvare <khali@linux-fr.org> | 7 | Copyright (C) 2005 - 2008 Jean Delvare <khali@linux-fr.org> |
8 | 8 | ||
9 | This program is free software; you can redistribute it and/or modify | 9 | This program is free software; you can redistribute it and/or modify |
10 | it under the terms of the GNU General Public License as published by | 10 | it under the terms of the GNU General Public License as published by |
@@ -35,6 +35,7 @@ | |||
35 | VT8235 0x3177 yes | 35 | VT8235 0x3177 yes |
36 | VT8237R 0x3227 yes | 36 | VT8237R 0x3227 yes |
37 | VT8237A 0x3337 yes | 37 | VT8237A 0x3337 yes |
38 | VT8237S 0x3372 yes | ||
38 | VT8251 0x3287 yes | 39 | VT8251 0x3287 yes |
39 | CX700 0x8324 yes | 40 | CX700 0x8324 yes |
40 | 41 | ||
@@ -318,6 +319,10 @@ static int __devinit vt596_probe(struct pci_dev *pdev, | |||
318 | unsigned char temp; | 319 | unsigned char temp; |
319 | int error = -ENODEV; | 320 | int error = -ENODEV; |
320 | 321 | ||
322 | /* driver_data might come from user-space, so check it */ | ||
323 | if (id->driver_data & 1 || id->driver_data > 0xff) | ||
324 | return -EINVAL; | ||
325 | |||
321 | /* Determine the address of the SMBus areas */ | 326 | /* Determine the address of the SMBus areas */ |
322 | if (force_addr) { | 327 | if (force_addr) { |
323 | vt596_smba = force_addr & 0xfff0; | 328 | vt596_smba = force_addr & 0xfff0; |
@@ -389,6 +394,7 @@ found: | |||
389 | case PCI_DEVICE_ID_VIA_8251: | 394 | case PCI_DEVICE_ID_VIA_8251: |
390 | case PCI_DEVICE_ID_VIA_8237: | 395 | case PCI_DEVICE_ID_VIA_8237: |
391 | case PCI_DEVICE_ID_VIA_8237A: | 396 | case PCI_DEVICE_ID_VIA_8237A: |
397 | case PCI_DEVICE_ID_VIA_8237S: | ||
392 | case PCI_DEVICE_ID_VIA_8235: | 398 | case PCI_DEVICE_ID_VIA_8235: |
393 | case PCI_DEVICE_ID_VIA_8233A: | 399 | case PCI_DEVICE_ID_VIA_8233A: |
394 | case PCI_DEVICE_ID_VIA_8233_0: | 400 | case PCI_DEVICE_ID_VIA_8233_0: |
@@ -440,6 +446,8 @@ static struct pci_device_id vt596_ids[] = { | |||
440 | .driver_data = SMBBA3 }, | 446 | .driver_data = SMBBA3 }, |
441 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237A), | 447 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237A), |
442 | .driver_data = SMBBA3 }, | 448 | .driver_data = SMBBA3 }, |
449 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237S), | ||
450 | .driver_data = SMBBA3 }, | ||
443 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231_4), | 451 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231_4), |
444 | .driver_data = SMBBA1 }, | 452 | .driver_data = SMBBA1 }, |
445 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8251), | 453 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8251), |
@@ -455,6 +463,7 @@ static struct pci_driver vt596_driver = { | |||
455 | .name = "vt596_smbus", | 463 | .name = "vt596_smbus", |
456 | .id_table = vt596_ids, | 464 | .id_table = vt596_ids, |
457 | .probe = vt596_probe, | 465 | .probe = vt596_probe, |
466 | .dynids.use_driver_data = 1, | ||
458 | }; | 467 | }; |
459 | 468 | ||
460 | static int __init i2c_vt596_init(void) | 469 | static int __init i2c_vt596_init(void) |