aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-i801.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-i801.c')
-rw-r--r--drivers/i2c/busses/i2c-i801.c61
1 files changed, 38 insertions, 23 deletions
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index ec36208c9977..ab26840d0c70 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -50,6 +50,7 @@
50 Patsburg (PCH) IDF 0x1d71 32 hard yes yes yes 50 Patsburg (PCH) IDF 0x1d71 32 hard yes yes yes
51 Patsburg (PCH) IDF 0x1d72 32 hard yes yes yes 51 Patsburg (PCH) IDF 0x1d72 32 hard yes yes yes
52 DH89xxCC (PCH) 0x2330 32 hard yes yes yes 52 DH89xxCC (PCH) 0x2330 32 hard yes yes yes
53 Panther Point (PCH) 0x1e22 32 hard yes yes yes
53 54
54 Features supported by this driver: 55 Features supported by this driver:
55 Software PEC no 56 Software PEC no
@@ -137,11 +138,11 @@
137/* Older devices have their ID defined in <linux/pci_ids.h> */ 138/* Older devices have their ID defined in <linux/pci_ids.h> */
138#define PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS 0x1c22 139#define PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS 0x1c22
139#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22 140#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22
140#define PCI_DEVICE_ID_INTEL_PANTHERPOINT_SMBUS 0x1e22
141/* Patsburg also has three 'Integrated Device Function' SMBus controllers */ 141/* Patsburg also has three 'Integrated Device Function' SMBus controllers */
142#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF0 0x1d70 142#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF0 0x1d70
143#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF1 0x1d71 143#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF1 0x1d71
144#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF2 0x1d72 144#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF2 0x1d72
145#define PCI_DEVICE_ID_INTEL_PANTHERPOINT_SMBUS 0x1e22
145#define PCI_DEVICE_ID_INTEL_DH89XXCC_SMBUS 0x2330 146#define PCI_DEVICE_ID_INTEL_DH89XXCC_SMBUS 0x2330
146#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_SMBUS 0x3b30 147#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_SMBUS 0x3b30
147 148
@@ -159,6 +160,8 @@ static struct pci_driver i801_driver;
159#define FEATURE_BLOCK_BUFFER (1 << 1) 160#define FEATURE_BLOCK_BUFFER (1 << 1)
160#define FEATURE_BLOCK_PROC (1 << 2) 161#define FEATURE_BLOCK_PROC (1 << 2)
161#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)
162 165
163static const char *i801_feature_names[] = { 166static const char *i801_feature_names[] = {
164 "SMBus PEC", 167 "SMBus PEC",
@@ -629,12 +632,13 @@ static const struct pci_device_id i801_ids[] = {
629 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF1) }, 632 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF1) },
630 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF2) }, 633 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF2) },
631 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DH89XXCC_SMBUS) }, 634 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DH89XXCC_SMBUS) },
635 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PANTHERPOINT_SMBUS) },
632 { 0, } 636 { 0, }
633}; 637};
634 638
635MODULE_DEVICE_TABLE(pci, i801_ids); 639MODULE_DEVICE_TABLE(pci, i801_ids);
636 640
637#if defined CONFIG_INPUT_APANEL || defined CONFIG_INPUT_APANEL_MODULE 641#if defined CONFIG_X86 && defined CONFIG_DMI
638static unsigned char apanel_addr; 642static unsigned char apanel_addr;
639 643
640/* Scan the system ROM for the signature "FJKEYINF" */ 644/* Scan the system ROM for the signature "FJKEYINF" */
@@ -664,11 +668,7 @@ static void __init input_apanel_init(void)
664 } 668 }
665 iounmap(bios); 669 iounmap(bios);
666} 670}
667#else
668static void __init input_apanel_init(void) {}
669#endif
670 671
671#if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE
672struct dmi_onboard_device_info { 672struct dmi_onboard_device_info {
673 const char *name; 673 const char *name;
674 u8 type; 674 u8 type;
@@ -734,7 +734,30 @@ static void __devinit dmi_check_onboard_devices(const struct dmi_header *dm,
734 dmi_check_onboard_device(type, name, adap); 734 dmi_check_onboard_device(type, name, adap);
735 } 735 }
736} 736}
737#endif 737
738/* Register optional slaves */
739static void __devinit i801_probe_optional_slaves(struct i801_priv *priv)
740{
741 /* Only register slaves on main SMBus channel */
742 if (priv->features & FEATURE_IDF)
743 return;
744
745 if (apanel_addr) {
746 struct i2c_board_info info;
747
748 memset(&info, 0, sizeof(struct i2c_board_info));
749 info.addr = apanel_addr;
750 strlcpy(info.type, "fujitsu_apanel", I2C_NAME_SIZE);
751 i2c_new_device(&priv->adapter, &info);
752 }
753
754 if (dmi_name_in_vendors("FUJITSU"))
755 dmi_walk(dmi_check_onboard_devices, &priv->adapter);
756}
757#else
758static void __init input_apanel_init(void) {}
759static void __devinit i801_probe_optional_slaves(struct i801_priv *priv) {}
760#endif /* CONFIG_X86 && CONFIG_DMI */
738 761
739static int __devinit i801_probe(struct pci_dev *dev, 762static int __devinit i801_probe(struct pci_dev *dev,
740 const struct pci_device_id *id) 763 const struct pci_device_id *id)
@@ -754,6 +777,11 @@ static int __devinit i801_probe(struct pci_dev *dev,
754 777
755 priv->pci_dev = dev; 778 priv->pci_dev = dev;
756 switch (dev->device) { 779 switch (dev->device) {
780 case PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF0:
781 case PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF1:
782 case PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF2:
783 priv->features |= FEATURE_IDF;
784 /* fall through */
757 default: 785 default:
758 priv->features |= FEATURE_I2C_BLOCK_READ; 786 priv->features |= FEATURE_I2C_BLOCK_READ;
759 /* fall through */ 787 /* fall through */
@@ -839,21 +867,7 @@ static int __devinit i801_probe(struct pci_dev *dev,
839 goto exit_release; 867 goto exit_release;
840 } 868 }
841 869
842 /* Register optional slaves */ 870 i801_probe_optional_slaves(priv);
843#if defined CONFIG_INPUT_APANEL || defined CONFIG_INPUT_APANEL_MODULE
844 if (apanel_addr) {
845 struct i2c_board_info info;
846
847 memset(&info, 0, sizeof(struct i2c_board_info));
848 info.addr = apanel_addr;
849 strlcpy(info.type, "fujitsu_apanel", I2C_NAME_SIZE);
850 i2c_new_device(&priv->adapter, &info);
851 }
852#endif
853#if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE
854 if (dmi_name_in_vendors("FUJITSU"))
855 dmi_walk(dmi_check_onboard_devices, &priv->adapter);
856#endif
857 871
858 pci_set_drvdata(dev, priv); 872 pci_set_drvdata(dev, priv);
859 return 0; 873 return 0;
@@ -913,7 +927,8 @@ static struct pci_driver i801_driver = {
913 927
914static int __init i2c_i801_init(void) 928static int __init i2c_i801_init(void)
915{ 929{
916 input_apanel_init(); 930 if (dmi_name_in_vendors("FUJITSU"))
931 input_apanel_init();
917 return pci_register_driver(&i801_driver); 932 return pci_register_driver(&i801_driver);
918} 933}
919 934