diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-16 14:28:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-16 14:28:50 -0400 |
commit | 86ade88e15b0852fa437e816037ecb266ae990ad (patch) | |
tree | a821259c9a08414f930feab42bc8d917a9da9fb4 /drivers/hwmon/hwmon.c | |
parent | 9bd47bf9324d4c6a49292d98019938b04791a35d (diff) | |
parent | 52b5226f481c09cc499cc28b1e9347d314b340f1 (diff) |
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
hwmon: (max6650) Add support for alarms
hwmon: (f71882fg) Add support for the F71858F
hwmon: (f71882fg) Add temp#_fault sysfs attr for f8000
hwmon: (f71882fg) Sanity check f8000 pwm settings
hwmon: (f71882fg) Cleanup f8000 pwm handling
hwmon: PCI quirk for hwmon access on MSI MS-7031 board
hwmon: (w83627ehf) Add W83627DHG-P support
hwmon: (tmp401) Add documentation
hwmon: (tmp401) Add support for TI's TMP411 sensors chip
hwmon: (tmp401) Add support for TI's TMP401 sensor chip
hwmon: (ibmaem) Automatically load on HC10 blade
hwmon: Fix more __devexit_p glitches
Diffstat (limited to 'drivers/hwmon/hwmon.c')
-rw-r--r-- | drivers/hwmon/hwmon.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c index e15c3e7b07e9..29ea6753f3bb 100644 --- a/drivers/hwmon/hwmon.c +++ b/drivers/hwmon/hwmon.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/hwmon.h> | 18 | #include <linux/hwmon.h> |
19 | #include <linux/gfp.h> | 19 | #include <linux/gfp.h> |
20 | #include <linux/spinlock.h> | 20 | #include <linux/spinlock.h> |
21 | #include <linux/pci.h> | ||
21 | 22 | ||
22 | #define HWMON_ID_PREFIX "hwmon" | 23 | #define HWMON_ID_PREFIX "hwmon" |
23 | #define HWMON_ID_FORMAT HWMON_ID_PREFIX "%d" | 24 | #define HWMON_ID_FORMAT HWMON_ID_PREFIX "%d" |
@@ -86,8 +87,36 @@ void hwmon_device_unregister(struct device *dev) | |||
86 | "hwmon_device_unregister() failed: bad class ID!\n"); | 87 | "hwmon_device_unregister() failed: bad class ID!\n"); |
87 | } | 88 | } |
88 | 89 | ||
90 | static void __init hwmon_pci_quirks(void) | ||
91 | { | ||
92 | #if defined CONFIG_X86 && defined CONFIG_PCI | ||
93 | struct pci_dev *sb; | ||
94 | u16 base; | ||
95 | u8 enable; | ||
96 | |||
97 | /* Open access to 0x295-0x296 on MSI MS-7031 */ | ||
98 | sb = pci_get_device(PCI_VENDOR_ID_ATI, 0x436c, NULL); | ||
99 | if (sb && | ||
100 | (sb->subsystem_vendor == 0x1462 && /* MSI */ | ||
101 | sb->subsystem_device == 0x0031)) { /* MS-7031 */ | ||
102 | |||
103 | pci_read_config_byte(sb, 0x48, &enable); | ||
104 | pci_read_config_word(sb, 0x64, &base); | ||
105 | |||
106 | if (base == 0 && !(enable & BIT(2))) { | ||
107 | dev_info(&sb->dev, | ||
108 | "Opening wide generic port at 0x295\n"); | ||
109 | pci_write_config_word(sb, 0x64, 0x295); | ||
110 | pci_write_config_byte(sb, 0x48, enable | BIT(2)); | ||
111 | } | ||
112 | } | ||
113 | #endif | ||
114 | } | ||
115 | |||
89 | static int __init hwmon_init(void) | 116 | static int __init hwmon_init(void) |
90 | { | 117 | { |
118 | hwmon_pci_quirks(); | ||
119 | |||
91 | hwmon_class = class_create(THIS_MODULE, "hwmon"); | 120 | hwmon_class = class_create(THIS_MODULE, "hwmon"); |
92 | if (IS_ERR(hwmon_class)) { | 121 | if (IS_ERR(hwmon_class)) { |
93 | printk(KERN_ERR "hwmon.c: couldn't create sysfs class\n"); | 122 | printk(KERN_ERR "hwmon.c: couldn't create sysfs class\n"); |