From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>,
Liam Girdwood <lrg@slimlogic.co.uk>
Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen <lars@metafoo.de>,
linux-kernel@vger.kernel.org
Subject: [PATCH 3/7] ASoC: codecs: lm4857: Use dev_pm_ops
Date: Mon, 7 Feb 2011 00:04:19 +0100 [thread overview]
Message-ID: <1297033463-14577-3-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1297033463-14577-1-git-send-email-lars@metafoo.de>
Use dev_pm_ops instead of legacy I2C power management hooks.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
sound/soc/codecs/lm4857.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/lm4857.c b/sound/soc/codecs/lm4857.c
index 2d726c0..76cdb3f 100644
--- a/sound/soc/codecs/lm4857.c
+++ b/sound/soc/codecs/lm4857.c
@@ -175,9 +175,9 @@ static void lm4857_shutdown(struct i2c_client *client)
lm4857_write_regs();
}
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
-static int lm4857_suspend(struct i2c_client *client, pm_message_t state)
+static int lm4857_suspend(struct device *dev)
{
lm4857.state = lm4857.regs[LM4857_CTRL] & 0xF;
@@ -187,7 +187,7 @@ static int lm4857_suspend(struct i2c_client *client, pm_message_t state)
return 0;
}
-static int lm4857_resume(struct i2c_client *dev)
+static int lm4857_resume(struct device *dev)
{
if (lm4857.state) {
lm4857.regs[LM4857_CTRL] |= (lm4857.state & 0x0F);
@@ -196,9 +196,11 @@ static int lm4857_resume(struct i2c_client *dev)
return 0;
}
+static SIMPLE_DEV_PM_OPS(lm4857_pm_ops, lm4857_suspend, lm4857_resume);
+#define LM4857_PM_OPS (&lm4857_pm_ops)
+
#else
-#define lm4857_suspend NULL
-#define lm4857_resume NULL
+#define LM4857_PM_OPS NULL
#endif
static const struct i2c_device_id lm4857_i2c_id[] = {
@@ -210,11 +212,10 @@ static struct i2c_driver lm4857_i2c_driver = {
.driver = {
.name = "LM4857 I2C Amp",
.owner = THIS_MODULE,
+ .pm = LM4857_PM_OPS,
},
.probe = lm4857_probe,
.remove = __devexit_p(lm4857_remove),
- .suspend = lm4857_suspend,
- .resume = lm4857_resume,
.shutdown = lm4857_shutdown,
.id_table = lm4857_i2c_id,
};
--
1.7.2.3
next prev parent reply other threads:[~2011-02-06 23:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-06 23:04 [PATCH 1/7] ASoC: neo1973_wm8753: Remove scenario management code Lars-Peter Clausen
2011-02-06 23:04 ` [PATCH 2/7] ASoC: neo1973_wm8753: Move lm4857 specefic code to its own module Lars-Peter Clausen
2011-02-07 11:50 ` Mark Brown
2011-02-06 23:04 ` Lars-Peter Clausen [this message]
2011-02-06 23:04 ` [PATCH 4/7] ASoC: neo1973_gta02_wm8753: Remove lm4853_{set,get}_state Lars-Peter Clausen
2011-02-06 23:04 ` [PATCH 5/7] ASoC: Samsung: neo1973: Use gpio_request_array to request gpios Lars-Peter Clausen
2011-02-06 23:04 ` [PATCH 6/7] ASoC: Samsung: neo1973_gta02: Fix bluetooth DAI registration Lars-Peter Clausen
2011-02-07 11:59 ` Mark Brown
2011-02-07 16:53 ` Lars-Peter Clausen
2011-02-07 17:02 ` Mark Brown
2011-02-07 17:37 ` Lars-Peter Clausen
2011-02-07 17:49 ` Mark Brown
2011-02-07 18:09 ` Lars-Peter Clausen
2011-02-07 18:17 ` Mark Brown
2011-02-07 22:55 ` Adding bluetooth PCM interface support to ASoC (Was: Re: [PATCH 6/7] ASoC: Samsung: neo1973_gta02: Fix bluetooth DAI registration) Lars-Peter Clausen
2011-02-08 13:08 ` Mark Brown
2011-02-06 23:04 ` [PATCH 7/7] ASoC: Samsung: Merge neo1937 and neo1973_gta02 sound board driver Lars-Peter Clausen
2011-02-07 2:25 ` [alsa-devel] [PATCH 1/7] ASoC: neo1973_wm8753: Remove scenario management code Jassi Brar
2011-02-07 11:42 ` Mark Brown
2011-02-07 17:01 ` Lars-Peter Clausen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1297033463-14577-3-git-send-email-lars@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).