r3167 - trunk/src/target/kernel/patches

laforge at sita.openmoko.org laforge at sita.openmoko.org
Mon Oct 15 10:48:13 CEST 2007


Author: laforge
Date: 2007-10-15 10:48:09 +0200 (Mon, 15 Oct 2007)
New Revision: 3167

Added:
   trunk/src/target/kernel/patches/asoc-neo1973_wm8753-power.patch
Log:
This patch fixes the current leak caused by not shutting down the audio
amplifier during suspend/resume and after power-down.  See bug
http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=781


Added: trunk/src/target/kernel/patches/asoc-neo1973_wm8753-power.patch
===================================================================
--- trunk/src/target/kernel/patches/asoc-neo1973_wm8753-power.patch	2007-10-15 07:03:50 UTC (rev 3166)
+++ trunk/src/target/kernel/patches/asoc-neo1973_wm8753-power.patch	2007-10-15 08:48:09 UTC (rev 3167)
@@ -0,0 +1,50 @@
+Index: linux-2.6.22.5-moko/sound/soc/s3c24xx/neo1973_wm8753.c
+===================================================================
+--- linux-2.6.22.5-moko.orig/sound/soc/s3c24xx/neo1973_wm8753.c
++++ linux-2.6.22.5-moko/sound/soc/s3c24xx/neo1973_wm8753.c
+@@ -615,6 +615,35 @@
+ 	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 = {
+@@ -622,6 +651,9 @@
+ 		.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,





More information about the commitlog mailing list