aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-12-14 12:30:19 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-18 19:47:04 -0500
commit26d093821f41030feee88e0150fbfb5550e8edce (patch)
tree8b2b1c8baaf8ff1bebde7f7535385d1257970571 /drivers/char
parent919a0304a833a0dc131425c70e603c0ccf32c843 (diff)
i8k: Use driver_data field of dmi_system_id to override fan multiplier
At least on Studio 1555 and XPS M140, the fan speed is reported directly, not with the default speed multiplier of 30. Information on the web suggests that this may be true for other models as well, though it is unknown at this time which systems may be affected. Use the driver_data field of dmi_system_id to override the default fan multiplier value for the two systems known to use a multiplier of 1. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/i8k.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c
index 18571b5d5c46..889b87bf4629 100644
--- a/drivers/char/i8k.c
+++ b/drivers/char/i8k.c
@@ -65,6 +65,7 @@ static DEFINE_MUTEX(i8k_mutex);
65static char bios_version[4]; 65static char bios_version[4];
66static struct device *i8k_hwmon_dev; 66static struct device *i8k_hwmon_dev;
67static u32 i8k_hwmon_flags; 67static u32 i8k_hwmon_flags;
68static int i8k_fan_mult;
68 69
69#define I8K_HWMON_HAVE_TEMP1 (1 << 0) 70#define I8K_HWMON_HAVE_TEMP1 (1 << 0)
70#define I8K_HWMON_HAVE_TEMP2 (1 << 1) 71#define I8K_HWMON_HAVE_TEMP2 (1 << 1)
@@ -275,7 +276,7 @@ static int i8k_get_fan_speed(int fan)
275 struct smm_regs regs = { .eax = I8K_SMM_GET_SPEED, }; 276 struct smm_regs regs = { .eax = I8K_SMM_GET_SPEED, };
276 277
277 regs.ebx = fan & 0xff; 278 regs.ebx = fan & 0xff;
278 return i8k_smm(&regs) ? : (regs.eax & 0xffff) * fan_mult; 279 return i8k_smm(&regs) ? : (regs.eax & 0xffff) * i8k_fan_mult;
279} 280}
280 281
281/* 282/*
@@ -698,6 +699,7 @@ static struct dmi_system_id i8k_dmi_table[] __initdata = {
698 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 699 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
699 DMI_MATCH(DMI_PRODUCT_NAME, "Studio"), 700 DMI_MATCH(DMI_PRODUCT_NAME, "Studio"),
700 }, 701 },
702 .driver_data = (void *)1, /* fan multiplier override */
701 }, 703 },
702 { 704 {
703 .ident = "Dell XPS M140", 705 .ident = "Dell XPS M140",
@@ -705,6 +707,7 @@ static struct dmi_system_id i8k_dmi_table[] __initdata = {
705 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 707 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
706 DMI_MATCH(DMI_PRODUCT_NAME, "MXC051"), 708 DMI_MATCH(DMI_PRODUCT_NAME, "MXC051"),
707 }, 709 },
710 .driver_data = (void *)1, /* fan multiplier override */
708 }, 711 },
709 { } 712 { }
710}; 713};
@@ -716,6 +719,7 @@ static int __init i8k_probe(void)
716{ 719{
717 char buff[4]; 720 char buff[4];
718 int version; 721 int version;
722 const struct dmi_system_id *id;
719 723
720 /* 724 /*
721 * Get DMI information 725 * Get DMI information
@@ -769,6 +773,11 @@ static int __init i8k_probe(void)
769 buff, bios_version); 773 buff, bios_version);
770 } 774 }
771 775
776 i8k_fan_mult = fan_mult;
777 id = dmi_first_match(i8k_dmi_table);
778 if (id && fan_mult == I8K_FAN_MULT && id->driver_data)
779 i8k_fan_mult = (unsigned long)id->driver_data;
780
772 return 0; 781 return 0;
773} 782}
774 783