~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to drivers/i2c/busses/i2c-i801.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
  Patsburg (PCH) IDF    0x1d71     32     hard     yes     yes     yes
51
51
  Patsburg (PCH) IDF    0x1d72     32     hard     yes     yes     yes
52
52
  DH89xxCC (PCH)        0x2330     32     hard     yes     yes     yes
 
53
  Panther Point (PCH)   0x1e22     32     hard     yes     yes     yes
53
54
 
54
55
  Features supported by this driver:
55
56
  Software PEC                     no
141
142
#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF0 0x1d70
142
143
#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF1 0x1d71
143
144
#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF2 0x1d72
 
145
#define PCI_DEVICE_ID_INTEL_PANTHERPOINT_SMBUS  0x1e22
144
146
#define PCI_DEVICE_ID_INTEL_DH89XXCC_SMBUS      0x2330
145
147
#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_SMBUS 0x3b30
146
148
 
158
160
#define FEATURE_BLOCK_BUFFER    (1 << 1)
159
161
#define FEATURE_BLOCK_PROC      (1 << 2)
160
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)
161
165
 
162
166
static const char *i801_feature_names[] = {
163
167
        "SMBus PEC",
628
632
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF1) },
629
633
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF2) },
630
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) },
631
636
        { 0, }
632
637
};
633
638
 
634
639
MODULE_DEVICE_TABLE(pci, i801_ids);
635
640
 
636
 
#if defined CONFIG_INPUT_APANEL || defined CONFIG_INPUT_APANEL_MODULE
 
641
#if defined CONFIG_X86 && defined CONFIG_DMI
637
642
static unsigned char apanel_addr;
638
643
 
639
644
/* Scan the system ROM for the signature "FJKEYINF" */
663
668
        }
664
669
        iounmap(bios);
665
670
}
666
 
#else
667
 
static void __init input_apanel_init(void) {}
668
 
#endif
669
671
 
670
 
#if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE
671
672
struct dmi_onboard_device_info {
672
673
        const char *name;
673
674
        u8 type;
733
734
                dmi_check_onboard_device(type, name, adap);
734
735
        }
735
736
}
736
 
#endif
 
737
 
 
738
/* Register optional slaves */
 
739
static 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
 
758
static void __init input_apanel_init(void) {}
 
759
static void __devinit i801_probe_optional_slaves(struct i801_priv *priv) {}
 
760
#endif  /* CONFIG_X86 && CONFIG_DMI */
737
761
 
738
762
static int __devinit i801_probe(struct pci_dev *dev,
739
763
                                const struct pci_device_id *id)
753
777
 
754
778
        priv->pci_dev = dev;
755
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 */
756
785
        default:
757
786
                priv->features |= FEATURE_I2C_BLOCK_READ;
758
787
                /* fall through */
838
867
                goto exit_release;
839
868
        }
840
869
 
841
 
        /* Register optional slaves */
842
 
#if defined CONFIG_INPUT_APANEL || defined CONFIG_INPUT_APANEL_MODULE
843
 
        if (apanel_addr) {
844
 
                struct i2c_board_info info;
845
 
 
846
 
                memset(&info, 0, sizeof(struct i2c_board_info));
847
 
                info.addr = apanel_addr;
848
 
                strlcpy(info.type, "fujitsu_apanel", I2C_NAME_SIZE);
849
 
                i2c_new_device(&priv->adapter, &info);
850
 
        }
851
 
#endif
852
 
#if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE
853
 
        if (dmi_name_in_vendors("FUJITSU"))
854
 
                dmi_walk(dmi_check_onboard_devices, &priv->adapter);
855
 
#endif
 
870
        i801_probe_optional_slaves(priv);
856
871
 
857
872
        pci_set_drvdata(dev, priv);
858
873
        return 0;
912
927
 
913
928
static int __init i2c_i801_init(void)
914
929
{
915
 
        input_apanel_init();
 
930
        if (dmi_name_in_vendors("FUJITSU"))
 
931
                input_apanel_init();
916
932
        return pci_register_driver(&i801_driver);
917
933
}
918
934