diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-nforce2.c')
-rw-r--r-- | drivers/i2c/busses/i2c-nforce2.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c index 43c9f8df950..f95efff9b3d 100644 --- a/drivers/i2c/busses/i2c-nforce2.c +++ b/drivers/i2c/busses/i2c-nforce2.c | |||
@@ -124,6 +124,20 @@ static struct dmi_system_id __devinitdata nforce2_dmi_blacklist2[] = { | |||
124 | 124 | ||
125 | static struct pci_driver nforce2_driver; | 125 | static struct pci_driver nforce2_driver; |
126 | 126 | ||
127 | /* For multiplexing support, we need a global reference to the 1st | ||
128 | SMBus channel */ | ||
129 | #if defined CONFIG_I2C_NFORCE2_S4985 || defined CONFIG_I2C_NFORCE2_S4985_MODULE | ||
130 | struct i2c_adapter *nforce2_smbus; | ||
131 | EXPORT_SYMBOL_GPL(nforce2_smbus); | ||
132 | |||
133 | static void nforce2_set_reference(struct i2c_adapter *adap) | ||
134 | { | ||
135 | nforce2_smbus = adap; | ||
136 | } | ||
137 | #else | ||
138 | static inline void nforce2_set_reference(struct i2c_adapter *adap) { } | ||
139 | #endif | ||
140 | |||
127 | static void nforce2_abort(struct i2c_adapter *adap) | 141 | static void nforce2_abort(struct i2c_adapter *adap) |
128 | { | 142 | { |
129 | struct nforce2_smbus *smbus = adap->algo_data; | 143 | struct nforce2_smbus *smbus = adap->algo_data; |
@@ -398,6 +412,7 @@ static int __devinit nforce2_probe(struct pci_dev *dev, const struct pci_device_ | |||
398 | return -ENODEV; | 412 | return -ENODEV; |
399 | } | 413 | } |
400 | 414 | ||
415 | nforce2_set_reference(&smbuses[0].adapter); | ||
401 | return 0; | 416 | return 0; |
402 | } | 417 | } |
403 | 418 | ||
@@ -406,6 +421,7 @@ static void __devexit nforce2_remove(struct pci_dev *dev) | |||
406 | { | 421 | { |
407 | struct nforce2_smbus *smbuses = (void*) pci_get_drvdata(dev); | 422 | struct nforce2_smbus *smbuses = (void*) pci_get_drvdata(dev); |
408 | 423 | ||
424 | nforce2_set_reference(NULL); | ||
409 | if (smbuses[0].base) { | 425 | if (smbuses[0].base) { |
410 | i2c_del_adapter(&smbuses[0].adapter); | 426 | i2c_del_adapter(&smbuses[0].adapter); |
411 | release_region(smbuses[0].base, smbuses[0].size); | 427 | release_region(smbuses[0].base, smbuses[0].size); |