提交 e7198fbf 编写于 作者: J Jean Delvare 提交者: Jean Delvare

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: NJean Delvare <khali@linux-fr.org>
Acked-by: NHans de Goede <hdegoede@redhat.com>
Acked-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 6e2a851e
...@@ -160,6 +160,8 @@ static struct pci_driver i801_driver; ...@@ -160,6 +160,8 @@ static struct pci_driver i801_driver;
#define FEATURE_BLOCK_BUFFER (1 << 1) #define FEATURE_BLOCK_BUFFER (1 << 1)
#define FEATURE_BLOCK_PROC (1 << 2) #define FEATURE_BLOCK_PROC (1 << 2)
#define FEATURE_I2C_BLOCK_READ (1 << 3) #define FEATURE_I2C_BLOCK_READ (1 << 3)
/* Not really a feature, but it's convenient to handle it as such */
#define FEATURE_IDF (1 << 15)
static const char *i801_feature_names[] = { static const char *i801_feature_names[] = {
"SMBus PEC", "SMBus PEC",
...@@ -738,6 +740,29 @@ static void __devinit dmi_check_onboard_devices(const struct dmi_header *dm, ...@@ -738,6 +740,29 @@ static void __devinit dmi_check_onboard_devices(const struct dmi_header *dm,
} }
#endif #endif
/* Register optional slaves */
static void __devinit i801_probe_optional_slaves(struct i801_priv *priv)
{
/* Only register slaves on main SMBus channel */
if (priv->features & FEATURE_IDF)
return;
#if defined CONFIG_INPUT_APANEL || defined CONFIG_INPUT_APANEL_MODULE
if (apanel_addr) {
struct i2c_board_info info;
memset(&info, 0, sizeof(struct i2c_board_info));
info.addr = apanel_addr;
strlcpy(info.type, "fujitsu_apanel", I2C_NAME_SIZE);
i2c_new_device(&priv->adapter, &info);
}
#endif
#if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE
if (dmi_name_in_vendors("FUJITSU"))
dmi_walk(dmi_check_onboard_devices, &priv->adapter);
#endif
}
static int __devinit i801_probe(struct pci_dev *dev, static int __devinit i801_probe(struct pci_dev *dev,
const struct pci_device_id *id) const struct pci_device_id *id)
{ {
...@@ -756,6 +781,11 @@ static int __devinit i801_probe(struct pci_dev *dev, ...@@ -756,6 +781,11 @@ static int __devinit i801_probe(struct pci_dev *dev,
priv->pci_dev = dev; priv->pci_dev = dev;
switch (dev->device) { switch (dev->device) {
case PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF0:
case PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF1:
case PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF2:
priv->features |= FEATURE_IDF;
/* fall through */
default: default:
priv->features |= FEATURE_I2C_BLOCK_READ; priv->features |= FEATURE_I2C_BLOCK_READ;
/* fall through */ /* fall through */
...@@ -841,21 +871,7 @@ static int __devinit i801_probe(struct pci_dev *dev, ...@@ -841,21 +871,7 @@ static int __devinit i801_probe(struct pci_dev *dev,
goto exit_release; goto exit_release;
} }
/* Register optional slaves */ i801_probe_optional_slaves(priv);
#if defined CONFIG_INPUT_APANEL || defined CONFIG_INPUT_APANEL_MODULE
if (apanel_addr) {
struct i2c_board_info info;
memset(&info, 0, sizeof(struct i2c_board_info));
info.addr = apanel_addr;
strlcpy(info.type, "fujitsu_apanel", I2C_NAME_SIZE);
i2c_new_device(&priv->adapter, &info);
}
#endif
#if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE
if (dmi_name_in_vendors("FUJITSU"))
dmi_walk(dmi_check_onboard_devices, &priv->adapter);
#endif
pci_set_drvdata(dev, priv); pci_set_drvdata(dev, priv);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册