- hdaps-power-off-accelerometer-on-suspend-and-unload.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     hdaps: Power off accelerometer on suspend and unload

has been removed from the -mm tree.  Its filename is

     hdaps-power-off-accelerometer-on-suspend-and-unload.patch

This patch was dropped because we shall not be accepting anonymous contributions, sorry.

------------------------------------------------------
Subject: hdaps: Power off accelerometer on suspend and unload
From: Shem Multinymous <multinymous@xxxxxxxxx>

This patch disables accelerometer power and stops its polling by the embedded
controller upon suspend and module unload.  The power saving is negligible,
but it's the right thing to do.

Signed-off-by: Shem Multinymous <multinymous@xxxxxxxxx>
Signed-off-by: Pavel Machek <pavel@xxxxxxx>
Acked-by: Robert Love <rml@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/hwmon/hdaps.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+)

diff -puN drivers/hwmon/hdaps.c~hdaps-power-off-accelerometer-on-suspend-and-unload drivers/hwmon/hdaps.c
--- a/drivers/hwmon/hdaps.c~hdaps-power-off-accelerometer-on-suspend-and-unload
+++ a/drivers/hwmon/hdaps.c
@@ -373,6 +373,23 @@ good:
 	return ret;
 }
 
+/**
+ * hdaps_device_shutdown - power off the accelerometer
+ * Returns nonzero on failure. Can sleep.
+ */
+static int hdaps_device_shutdown(void)
+{
+	int ret;
+	ret = hdaps_set_power(0);
+	if (ret) {
+		printk(KERN_WARNING "hdaps: cannot power off\n");
+		return ret;
+	}
+	ret = hdaps_set_ec_config(0, 1);
+	if (ret)
+		printk(KERN_WARNING "hdaps: cannot stop EC sampling\n");
+	return ret;
+}
 
 /* Device model stuff */
 
@@ -388,6 +405,12 @@ static int hdaps_probe(struct platform_d
 	return 0;
 }
 
+static int hdaps_suspend(struct platform_device *dev, pm_message_t state)
+{
+	hdaps_device_shutdown(); /* ignore errors, effect is negligible */
+	return 0;
+}
+
 static int hdaps_resume(struct platform_device *dev)
 {
 	return hdaps_device_init();
@@ -395,6 +418,7 @@ static int hdaps_resume(struct platform_
 
 static struct platform_driver hdaps_driver = {
 	.probe = hdaps_probe,
+	.suspend = hdaps_suspend,
 	.resume = hdaps_resume,
 	.driver	= {
 		.name = "hdaps",
@@ -780,6 +804,7 @@ out_device:
 	platform_device_unregister(pdev);
 out_driver:
 	platform_driver_unregister(&hdaps_driver);
+	hdaps_device_shutdown();
 out:
 	printk(KERN_WARNING "hdaps: driver init failed (ret=%d)!\n", ret);
 	return ret;
@@ -789,6 +814,7 @@ static void __exit hdaps_exit(void)
 {
 	del_timer_sync(&hdaps_timer);
 	input_unregister_device(hdaps_idev);
+	hdaps_device_shutdown(); /* ignore errors, effect is negligible */
 	sysfs_remove_group(&pdev->dev.kobj, &hdaps_attribute_group);
 	platform_device_unregister(pdev);
 	platform_driver_unregister(&hdaps_driver);
_

Patches currently in -mm which might be from multinymous@xxxxxxxxx are

dmi-decode-and-save-oem-string-information.patch
hdaps-power-off-accelerometer-on-suspend-and-unload.patch
hdaps-stop-polling-timer-when-suspended.patch
hdaps-simplify-whitelist.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux