[Gta04-owner] Another few milliamps.

NeilBrown neilb at suse.de
Sun Mar 18 23:26:49 CET 2012

On Sun, 18 Mar 2012 23:04:24 +0100 "Fred ." <frederi1 at gmail.com> wrote:

> Hi
> On Sun, Mar 18, 2012 at 10:56 PM, NeilBrown <neilb at suse.de> wrote:
> >
> > I recently turned the volume on my gta04 way up so that the alarm sound
> > would
> > be clearly audible from the other room.
> > I was subsequently surprised to notice that there was a faint white-noise
> > hum
> > coming from it while it was suspended.
> >
> > It seems that the audio codec is not being turned off - either when not in
> > use, or in suspend.
> >
> > I confirmed this with printks in twl4030_codec_enable() in
> > sound/soc/codecs/twl4030.c.
> >
> > I hacked that function to always disable - never enable - and measured the
> > suspend current.  It had dropped from about 46mA to about 42mA.
> >
> > So it seems we are wasting a few milliamps by leaving the codec on.
> >
> > The code looks correct: twl4030_soc_suspend() calls
> > twl4030_set_bias_level(SND_SOC_BIAS_OFF), and that calls
> > twl4030_codec_enable(0), which will power off the codec.
> >
> > But some how some part of that isn't happening.
> >
> > I won't have time to look more deeply into this for a while, but if someone
> > has time and wants to hunt around in the code - insert lots of printks
>  Is it possible to debug with a copy of the RAM saved by some u-boot
> command?
> I suppose the kernel is at least logging to RAM its last actions before
> shuting off...

There is no "shutting off" here that could be a problem.  We suspend, then
wake up from suspend, then we can use "dmesg" to look at all the messages
that have been printed.

And the codec should be turned off even when the device is awake as long as
no process is holding it open.  So you shouldn't even need to suspend.

So I'm not sure what problems you are seeing, but I don't think they exist.

What I would do is trace through the code, get a rough  idea of some things
that I think should be happening, then insert printks, reboot, play a sound,
then use "dmesg" to see what actually happened.  Then revise my understanding
an repeat.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: not available
URL: <http://lists.goldelico.com/pipermail/gta04-owner/attachments/20120319/0f2f83ee/attachment.bin>

More information about the Gta04-owner mailing list