Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 358a9afc authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6

* 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
  hwmon/applesmc: Handle name file creation error and deletion
  hwmon/applesmc: Simplify dependencies
  hwmon-vid: Don't spam the logs when VRM version is missing
  hwmon/w83627hf: Be quiet when no chip is found
  hwmon/coretemp: Add more safety checks
  hwmon/ds1621: Fix swapped temperature limits
parents 55663219 6996abf0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -620,7 +620,7 @@ config SENSORS_HDAPS

config SENSORS_APPLESMC
	tristate "Apple SMC (Motion sensor, light sensor, keyboard backlight)"
	depends on HWMON && INPUT && X86
	depends on INPUT && X86
	select NEW_LEDS
	select LEDS_CLASS
	default n
+6 −1
Original line number Diff line number Diff line
@@ -1206,11 +1206,13 @@ static int __init applesmc_init(void)
	}

	ret = sysfs_create_file(&pdev->dev.kobj, &dev_attr_name.attr);
	if (ret)
		goto out_device;

	/* Create key enumeration sysfs files */
	ret = sysfs_create_group(&pdev->dev.kobj, &key_enumeration_group);
	if (ret)
		goto out_device;
		goto out_name;

	/* create fan files */
	count = applesmc_get_fan_count();
@@ -1310,6 +1312,8 @@ static int __init applesmc_init(void)
	sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]);
out_key_enumeration:
	sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group);
out_name:
	sysfs_remove_file(&pdev->dev.kobj, &dev_attr_name.attr);
out_device:
	platform_device_unregister(pdev);
out_driver:
@@ -1335,6 +1339,7 @@ static void __exit applesmc_exit(void)
	sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[0]);
	sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]);
	sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group);
	sysfs_remove_file(&pdev->dev.kobj, &dev_attr_name.attr);
	platform_device_unregister(pdev);
	platform_driver_unregister(&applesmc_driver);
	release_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS);
+29 −3
Original line number Diff line number Diff line
@@ -176,6 +176,22 @@ static int __devinit coretemp_probe(struct platform_device *pdev)
		goto exit_free;
	}

	/* Check if we have problem with errata AE18 of Core processors:
	   Readings might stop update when processor visited too deep sleep,
	   fixed for stepping D0 (6EC).
	*/

	if ((c->x86_model == 0xe) && (c->x86_mask < 0xc)) {
		/* check for microcode update */
		rdmsr_on_cpu(data->id, MSR_IA32_UCODE_REV, &eax, &edx);
		if (edx < 0x39) {
			dev_err(&pdev->dev,
				"Errata AE18 not fixed, update BIOS or "
				"microcode of the CPU!\n");
			goto exit_free;
		}
	}

	/* Some processors have Tjmax 85 following magic should detect it
	   Intel won't disclose the information without signed NDA, but
	   individuals cannot sign it. Catch(ed) 22.
@@ -193,6 +209,19 @@ static int __devinit coretemp_probe(struct platform_device *pdev)
		}
	}

	/* Intel says that above should not work for desktop Core2 processors,
	   but it seems to work. There is no other way how get the absolute
	   readings. Warn the user about this. First check if are desktop,
	   bit 50 of MSR_IA32_PLATFORM_ID should be 0.
	*/

	rdmsr_safe_on_cpu(data->id, MSR_IA32_PLATFORM_ID, &eax, &edx);

	if ((c->x86_model == 0xf) && (!(edx & 0x00040000))) {
		dev_warn(&pdev->dev, "Using undocumented features, absolute "
			 "temperature might be wrong!\n");
	}

	platform_set_drvdata(pdev, data);

	if ((err = sysfs_create_group(&pdev->dev.kobj, &coretemp_group)))
@@ -330,9 +359,6 @@ static int __init coretemp_init(void)
	int i, err = -ENODEV;
	struct pdev_entry *p, *n;

	printk(KERN_NOTICE DRVNAME ": This driver uses undocumented features "
		"of Core CPU. Temperature might be wrong!\n");

	/* quick check if we run Intel */
	if (cpu_data[0].x86_vendor != X86_VENDOR_INTEL)
		goto exit;
+4 −4
Original line number Diff line number Diff line
@@ -53,8 +53,8 @@ MODULE_PARM_DESC(polarity, "Output's polarity: 0 = active high, 1 = active low")

/* The DS1621 registers */
#define DS1621_REG_TEMP			0xAA /* word, RO */
#define DS1621_REG_TEMP_MIN		0xA1 /* word, RW */
#define DS1621_REG_TEMP_MAX		0xA2 /* word, RW */
#define DS1621_REG_TEMP_MIN		0xA2 /* word, RW */
#define DS1621_REG_TEMP_MAX		0xA1 /* word, RW */
#define DS1621_REG_CONF			0xAC /* byte, RW */
#define DS1621_COM_START		0xEE /* no data */
#define DS1621_COM_STOP			0x22 /* no data */
@@ -328,9 +328,9 @@ static struct ds1621_data *ds1621_update_client(struct device *dev)

		/* reset alarms if necessary */
		new_conf = data->conf;
		if (data->temp < data->temp_min)
		if (data->temp > data->temp_min)
			new_conf &= ~DS1621_ALARM_TEMP_LOW;
		if (data->temp > data->temp_max)
		if (data->temp < data->temp_max)
			new_conf &= ~DS1621_ALARM_TEMP_HIGH;
		if (data->conf != new_conf)
			ds1621_write_value(client, DS1621_REG_CONF,
+3 −1
Original line number Diff line number Diff line
@@ -132,7 +132,9 @@ int vid_from_reg(int val, u8 vrm)
		val &= 0x7f;
		return(val > 0x77 ? 0 : (1500000 - (val * 12500) + 500) / 1000);
	default:		/* report 0 for unknown */
		printk(KERN_INFO "hwmon-vid: requested unknown VRM version\n");
		if (vrm)
			printk(KERN_WARNING "hwmon-vid: Requested unsupported "
			       "VRM version (%u)\n", (unsigned int)vrm);
		return 0;
	}
}
Loading