The patch titled lis3: add power management functions has been added to the -mm tree. Its filename is lis3-add-power-management-functions.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: lis3: add power management functions From: Daniel Mack <daniel@xxxxxxxx> This enabled power management functions for the SPI transport layer of the lis3 devices. The device's suspend mode is only entered in case no wakeup threshold has been given. In this case, the device is supposed to wake up the system and must thus not be put to deep sleep. Signed-off-by: Daniel Mack <daniel@xxxxxxxx> Acked-by: Pavel Machek <pavel@xxxxxx> Cc: Eric Piel <eric.piel@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/hwmon/lis3lv02d_spi.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff -puN drivers/hwmon/lis3lv02d_spi.c~lis3-add-power-management-functions drivers/hwmon/lis3lv02d_spi.c --- a/drivers/hwmon/lis3lv02d_spi.c~lis3-add-power-management-functions +++ a/drivers/hwmon/lis3lv02d_spi.c @@ -87,6 +87,32 @@ static int __devexit lis302dl_spi_remove return 0; } +#ifdef CONFIG_PM +static int lis3lv02d_spi_suspend(struct spi_device *spi, pm_message_t mesg) +{ + struct lis3lv02d *lis3 = spi_get_drvdata(spi); + + if (!lis3->pdata->wakeup_flags) + lis3lv02d_poweroff(&lis3_dev); + + return 0; +} + +static int lis3lv02d_spi_resume(struct spi_device *spi) +{ + struct lis3lv02d *lis3 = spi_get_drvdata(spi); + + if (!lis3->pdata->wakeup_flags) + lis3lv02d_poweron(lis3); + + return 0; +} + +#else +#define lis3_spi_suspend NULL +#define lis3_spi_resume NULL +#endif + static struct spi_driver lis302dl_spi_driver = { .driver = { .name = DRV_NAME, @@ -94,6 +120,8 @@ static struct spi_driver lis302dl_spi_dr }, .probe = lis302dl_spi_probe, .remove = __devexit_p(lis302dl_spi_remove), + .suspend = lis3lv02d_spi_suspend, + .resume = lis3lv02d_spi_resume, }; static int __init lis302dl_init(void) _ Patches currently in -mm which might be from daniel@xxxxxxxx are lis3-fix-typo.patch lis3-add-free-fall-wakeup-function-via-platform_data.patch lis3-add-power-management-functions.patch lis3_spi-code-cleanups.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