13 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
15 #include <linux/module.h>
16 #include <linux/device.h>
18 #include <linux/kdev_t.h>
23 #include <linux/pci.h>
25 #define HWMON_ID_PREFIX "hwmon"
26 #define HWMON_ID_FORMAT HWMON_ID_PREFIX "%d"
28 static struct class *hwmon_class;
74 "hwmon_device_unregister() failed: bad class ID!\n");
78 static void __init hwmon_pci_quirks(
void)
80 #if defined CONFIG_X86 && defined CONFIG_PCI
91 pci_read_config_byte(sb, 0x48, &enable);
92 pci_read_config_word(sb, 0x64, &base);
94 if (base == 0 && !(enable &
BIT(2))) {
96 "Opening wide generic port at 0x295\n");
97 pci_write_config_word(sb, 0x64, 0x295);
98 pci_write_config_byte(sb, 0x48, enable |
BIT(2));
104 static int __init hwmon_init(
void)
109 if (IS_ERR(hwmon_class)) {
110 pr_err(
"couldn't create sysfs class\n");
111 return PTR_ERR(hwmon_class);
116 static void __exit hwmon_exit(
void)