i2c-nforce2: Add support for multiplexing on the Tyan S4985

Just like the Tyan S4882, the S4985 uses a multiplexer to give access
to all 16 memory module SPD EEPROMs. This specific i2c-nforce2-s4985
driver adds support for this. It is heavily based on the older
i2c-amd756-s4882 driver.

As more mainboards will use multiplexer chips, we will have to find a
way to support them without having to write a new specfic driver for
each. The recent changes to the i2c subsystem should help us, and the
new gpio subsystem might help, too.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Šī revīzija ir iekļauta:
Jean Delvare
2008-07-14 22:38:21 +02:00
revīziju iesūtīja Jean Delvare
vecāks 2e74378798
revīzija 279e902445
4 mainīti faili ar 287 papildinājumiem un 0 dzēšanām

Parādīt failu

@@ -124,6 +124,20 @@ static struct dmi_system_id __devinitdata nforce2_dmi_blacklist2[] = {
static struct pci_driver nforce2_driver;
/* For multiplexing support, we need a global reference to the 1st
SMBus channel */
#if defined CONFIG_I2C_NFORCE2_S4985 || defined CONFIG_I2C_NFORCE2_S4985_MODULE
struct i2c_adapter *nforce2_smbus;
EXPORT_SYMBOL_GPL(nforce2_smbus);
static void nforce2_set_reference(struct i2c_adapter *adap)
{
nforce2_smbus = adap;
}
#else
static inline void nforce2_set_reference(struct i2c_adapter *adap) { }
#endif
static void nforce2_abort(struct i2c_adapter *adap)
{
struct nforce2_smbus *smbus = adap->algo_data;
@@ -398,6 +412,7 @@ static int __devinit nforce2_probe(struct pci_dev *dev, const struct pci_device_
return -ENODEV;
}
nforce2_set_reference(&smbuses[0].adapter);
return 0;
}
@@ -406,6 +421,7 @@ static void __devexit nforce2_remove(struct pci_dev *dev)
{
struct nforce2_smbus *smbuses = (void*) pci_get_drvdata(dev);
nforce2_set_reference(NULL);
if (smbuses[0].base) {
i2c_del_adapter(&smbuses[0].adapter);
release_region(smbuses[0].base, smbuses[0].size);