Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95415
b: refs/heads/master
c: fd403dc
h: refs/heads/master
i:
  95413: 958f5b0
  95411: 4798b27
  95407: 686c54c
v: v3
  • Loading branch information
Graeme Gregory authored and Takashi Iwai committed Apr 30, 2008
1 parent e1d9014 commit f4bf13e
Show file tree
Hide file tree
Showing 2 changed files with 33 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: 443590e6f1823cd4bc1199cc658074bc3e30acbf
refs/heads/master: fd403dc84f29aee613d13bde5656ba74cdee1e7b
32 changes: 32 additions & 0 deletions trunk/sound/soc/s3c24xx/neo1973_wm8753.c
Original file line number Diff line number Diff line change
Expand Up @@ -616,13 +616,45 @@ static int lm4857_i2c_attach(struct i2c_adapter *adap)
return i2c_probe(adap, &addr_data, lm4857_amp_probe);
}

static u8 lm4857_state;

static int lm4857_suspend(struct i2c_client *dev, pm_message_t state)
{
dev_dbg(&dev->dev, "lm4857_suspend\n");
lm4857_state = lm4857_regs[LM4857_CTRL] & 0xf;
if (lm4857_state) {
lm4857_regs[LM4857_CTRL] &= 0xf0;
lm4857_write_regs();
}
return 0;
}

static int lm4857_resume(struct i2c_client *dev)
{
if (lm4857_state) {
lm4857_regs[LM4857_CTRL] |= (lm4857_state & 0x0f);
lm4857_write_regs();
}
return 0;
}

static void lm4857_shutdown(struct i2c_client *dev)
{
dev_dbg(&dev->dev, "lm4857_shutdown\n");
lm4857_regs[LM4857_CTRL] &= 0xf0;
lm4857_write_regs();
}

/* corgi i2c codec control layer */
static struct i2c_driver lm4857_i2c_driver = {
.driver = {
.name = "LM4857 I2C Amp",
.owner = THIS_MODULE,
},
.id = I2C_DRIVERID_LM4857,
.suspend = lm4857_suspend,
.resume = lm4857_resume,
.shutdown = lm4857_shutdown,
.attach_adapter = lm4857_i2c_attach,
.detach_client = lm4857_i2c_detach,
.command = NULL,
Expand Down

0 comments on commit f4bf13e

Please sign in to comment.