From 2a2e1323aa111df4eec8398a8d251ac324bde548 Mon Sep 17 00:00:00 2001 From: Daniel WILLERUD Date: Thu, 12 Apr 2012 08:15:05 +0200 Subject: [PATCH] --- yaml --- r: 367423 b: refs/heads/master c: 774c50abae2456af492728aee8d282ba5079b744 h: refs/heads/master i: 367421: 95c77608d0aa6f0e64b58b24ae67858dc693b5f0 367419: 3ee02d863b85209e041da9e33a9baa37568bdab0 367415: 4c8dbc6f07ea3df0278e8b90eb59a39bc96ed5df 367407: dccf8826ca70a41458cca9fc0a7be35605a8971d 367391: f9b40a7a66bd5aaae12770056b72009f04028fe2 367359: 066e864ffe6e10d17f059b387bd3fa4855c38273 v: v3 --- [refs] | 2 +- trunk/drivers/mfd/ab8500-gpadc.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 4534acd93d8a..3850aa16bc02 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f04a9d8adf766c480353c0f2427e641251c9b059 +refs/heads/master: 774c50abae2456af492728aee8d282ba5079b744 diff --git a/trunk/drivers/mfd/ab8500-gpadc.c b/trunk/drivers/mfd/ab8500-gpadc.c index b1f3561b023f..9ed3afc31d11 100644 --- a/trunk/drivers/mfd/ab8500-gpadc.c +++ b/trunk/drivers/mfd/ab8500-gpadc.c @@ -605,6 +605,31 @@ static int ab8500_gpadc_runtime_idle(struct device *dev) return 0; } +static int ab8500_gpadc_suspend(struct device *dev) +{ + struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); + + mutex_lock(&gpadc->ab8500_gpadc_lock); + + pm_runtime_get_sync(dev); + + regulator_disable(gpadc->regu); + return 0; +} + +static int ab8500_gpadc_resume(struct device *dev) +{ + struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); + + regulator_enable(gpadc->regu); + + pm_runtime_mark_last_busy(gpadc->dev); + pm_runtime_put_autosuspend(gpadc->dev); + + mutex_unlock(&gpadc->ab8500_gpadc_lock); + return 0; +} + static int ab8500_gpadc_probe(struct platform_device *pdev) { int ret = 0; @@ -698,6 +723,9 @@ static const struct dev_pm_ops ab8500_gpadc_pm_ops = { SET_RUNTIME_PM_OPS(ab8500_gpadc_runtime_suspend, ab8500_gpadc_runtime_resume, ab8500_gpadc_runtime_idle) + SET_SYSTEM_SLEEP_PM_OPS(ab8500_gpadc_suspend, + ab8500_gpadc_resume) + }; static struct platform_driver ab8500_gpadc_driver = {