Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164539
b: refs/heads/master
c: 2cd9645
h: refs/heads/master
i:
  164537: a250735
  164535: e0e4d99
v: v3
  • Loading branch information
Daniel Mack authored and Linus Torvalds committed Sep 22, 2009
1 parent 45429f8 commit 66fbe92
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8873c33483e62988ed886230aab71ef4c678f710
refs/heads/master: 2cd9645e2f0d60ed12268fe1738e79c119e2fe5a
28 changes: 28 additions & 0 deletions trunk/drivers/hwmon/lis3lv02d_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,41 @@ static int __devexit lis302dl_spi_remove(struct spi_device *spi)
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 lis3lv02d_spi_suspend NULL
#define lis3lv02d_spi_resume NULL
#endif

static struct spi_driver lis302dl_spi_driver = {
.driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
},
.probe = lis302dl_spi_probe,
.remove = __devexit_p(lis302dl_spi_remove),
.suspend = lis3lv02d_spi_suspend,
.resume = lis3lv02d_spi_resume,
};

static int __init lis302dl_init(void)
Expand Down

0 comments on commit 66fbe92

Please sign in to comment.