diff options
author | Jean Delvare <khali@linux-fr.org> | 2011-05-24 14:58:49 -0400 |
---|---|---|
committer | Jean Delvare <khali@endymion.delvare> | 2011-05-24 14:58:49 -0400 |
commit | e7198fbf50fd5db4cc9681beed760403f794320d (patch) | |
tree | bc0c9ce63b540b697d4a877b880f6ebd4d5d2f59 | |
parent | 6e2a851e71e65d4ec5bbc51802c36a61322d792b (diff) |
i2c-i801: Don't probe for slaves on IDF channels
I don't know if Fujitsu is ever going to produce Patsburg-based
machines, but if they do, I'd rather not probe the secondary (IDF)
SMBus channels. At least not until we have a good reason for doing so.
On a side note, I'm not even sure if it is right to enable detection
of HWMON and DDC devices on the IDF channels. Time will tell...
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r-- | drivers/i2c/busses/i2c-i801.c | 46 |
1 files changed, 31 insertions, 15 deletions
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 6d36ad628caa..4228691ffde8 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c | |||
@@ -160,6 +160,8 @@ static struct pci_driver i801_driver; | |||
160 | #define FEATURE_BLOCK_BUFFER (1 << 1) | 160 | #define FEATURE_BLOCK_BUFFER (1 << 1) |
161 | #define FEATURE_BLOCK_PROC (1 << 2) | 161 | #define FEATURE_BLOCK_PROC (1 << 2) |
162 | #define FEATURE_I2C_BLOCK_READ (1 << 3) | 162 | #define FEATURE_I2C_BLOCK_READ (1 << 3) |
163 | /* Not really a feature, but it's convenient to handle it as such */ | ||
164 | #define FEATURE_IDF (1 << 15) | ||
163 | 165 | ||
164 | static const char *i801_feature_names[] = { | 166 | static const char *i801_feature_names[] = { |
165 | "SMBus PEC", | 167 | "SMBus PEC", |
@@ -738,6 +740,29 @@ static void __devinit dmi_check_onboard_devices(const struct dmi_header *dm, | |||
738 | } | 740 | } |
739 | #endif | 741 | #endif |
740 | 742 | ||
743 | /* Register optional slaves */ | ||
744 | static void __devinit i801_probe_optional_slaves(struct i801_priv *priv) | ||
745 | { | ||
746 | /* Only register slaves on main SMBus channel */ | ||
747 | if (priv->features & FEATURE_IDF) | ||
748 | return; | ||
749 | |||
750 | #if defined CONFIG_INPUT_APANEL || defined CONFIG_INPUT_APANEL_MODULE | ||
751 | if (apanel_addr) { | ||
752 | struct i2c_board_info info; | ||
753 | |||
754 | memset(&info, 0, sizeof(struct i2c_board_info)); | ||
755 | info.addr = apanel_addr; | ||
756 | strlcpy(info.type, "fujitsu_apanel", I2C_NAME_SIZE); | ||
757 | i2c_new_device(&priv->adapter, &info); | ||
758 | } | ||
759 | #endif | ||
760 | #if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE | ||
761 | if (dmi_name_in_vendors("FUJITSU")) | ||
762 | dmi_walk(dmi_check_onboard_devices, &priv->adapter); | ||
763 | #endif | ||
764 | } | ||
765 | |||
741 | static int __devinit i801_probe(struct pci_dev *dev, | 766 | static int __devinit i801_probe(struct pci_dev *dev, |
742 | const struct pci_device_id *id) | 767 | const struct pci_device_id *id) |
743 | { | 768 | { |
@@ -756,6 +781,11 @@ static int __devinit i801_probe(struct pci_dev *dev, | |||
756 | 781 | ||
757 | priv->pci_dev = dev; | 782 | priv->pci_dev = dev; |
758 | switch (dev->device) { | 783 | switch (dev->device) { |
784 | case PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF0: | ||
785 | case PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF1: | ||
786 | case PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF2: | ||
787 | priv->features |= FEATURE_IDF; | ||
788 | /* fall through */ | ||
759 | default: | 789 | default: |
760 | priv->features |= FEATURE_I2C_BLOCK_READ; | 790 | priv->features |= FEATURE_I2C_BLOCK_READ; |
761 | /* fall through */ | 791 | /* fall through */ |
@@ -841,21 +871,7 @@ static int __devinit i801_probe(struct pci_dev *dev, | |||
841 | goto exit_release; | 871 | goto exit_release; |
842 | } | 872 | } |
843 | 873 | ||
844 | /* Register optional slaves */ | 874 | i801_probe_optional_slaves(priv); |
845 | #if defined CONFIG_INPUT_APANEL || defined CONFIG_INPUT_APANEL_MODULE | ||
846 | if (apanel_addr) { | ||
847 | struct i2c_board_info info; | ||
848 | |||
849 | memset(&info, 0, sizeof(struct i2c_board_info)); | ||
850 | info.addr = apanel_addr; | ||
851 | strlcpy(info.type, "fujitsu_apanel", I2C_NAME_SIZE); | ||
852 | i2c_new_device(&priv->adapter, &info); | ||
853 | } | ||
854 | #endif | ||
855 | #if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE | ||
856 | if (dmi_name_in_vendors("FUJITSU")) | ||
857 | dmi_walk(dmi_check_onboard_devices, &priv->adapter); | ||
858 | #endif | ||
859 | 875 | ||
860 | pci_set_drvdata(dev, priv); | 876 | pci_set_drvdata(dev, priv); |
861 | return 0; | 877 | return 0; |