From: Vasily Khoruzhick <anarsoul@gmail.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel <alsa-devel@alsa-project.org>,
Philipp Zabel <philipp.zabel@gmail.com>,
Liam Girdwood <lrg@slimlogic.co.uk>
Subject: Re: [PATCH RFC 3/3] uda1380: make driver more powersave-friendly
Date: Sun, 27 Jun 2010 00:07:26 +0300 [thread overview]
Message-ID: <201006270007.34271.anarsoul@gmail.com> (raw)
In-Reply-To: <0FF1255A-5069-426F-9521-A8E0787081D8@opensource.wolfsonmicro.com>
[-- Attachment #1.1: Type: Text/Plain, Size: 2502 bytes --]
В сообщении от 26 июня 2010 23:45:12 автор Mark Brown написал:
> Please remember to CC Liam on ASoC patches.
Ok, I'll do
>
> > + for (reg = UDA1380_MVOL; reg < UDA1380_CACHEREGNUM; reg++)
> > + set_bit(reg - 0x10, &uda1380_cache_dirty);
>
> This seems odd, I'd expect the cache to be being marked as clean
> immediately after sync?
Nope, it is not. Only i2c and clock related regs of uda1380 can be modified
when there's no i2s clock, i.e. mixer regs should be updated right after i2s
clock was enabled, so we marking mixer-related regs cache as dirty, to make
sure they'll be updated when possible.
> > uda1380_write(codec, UDA1380_PM, R02_PON_BIAS | pm);
>
> Like I said previously you really should look at using DAPM here, this
> should make the code simpler and will let you
>
> You might also want to consider snd_soc_update_bits().
Hmm, uda134x driver does pretty same things as in my patch... And it seems
part of your sentence is lost :(
> > break;
> >
> > case SND_SOC_BIAS_STANDBY:
> > - uda1380_write(codec, UDA1380_PM, R02_PON_BIAS);
> > + if (codec->bias_level == SND_SOC_BIAS_OFF) {
> > + pdata->set_power(1);
> > + uda1380_reset(codec);
>
> The reset here seems unneeded and possibly wasteful if there is no power
> control on the system. It'd seem better to do something like just power up,
> flagging the cache as dirty if there was a callback. I'd strongly expect
> that if you are actually controlling power the device will be in the
> default state anyway.
Ok
> > + switch (pdata->dac_clk) {
> > + case UDA1380_DAC_CLK_SYSCLK:
> > + uda1380_write_reg_cache(codec, UDA1380_CLK, 0);
> > + break;
> > + case UDA1380_DAC_CLK_WSPLL:
> > + uda1380_write_reg_cache(codec, UDA1380_CLK,
> > + R00_DAC_CLK);
> > + break;
> > + }
>
> Why is this being managed every time the device is enabled? Surely the
> setting can be done once at startup.
Yep, just need to mark cache of this reg as dirty here...
> > - ret = uda1380_reset(codec);
> > - if (ret < 0) {
> > - dev_err(codec->dev, "Failed to issue reset\n");
> > - goto err_reset;
> > - }
> > -
>
> The reason for the reset at startup is that we don't know what state the
> device is in when Linux gets control.
It's softreset and it's performed by writing some value to some reg. i2c xfers
is not possible when codec is not enabled (it is not at this point)
Regards
Vasily
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2010-06-26 21:07 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-26 15:14 [PATCH RFC 0/3] asoc: uda1380 cleanup Vasily Khoruzhick
2010-06-26 15:14 ` [PATCH RFC 1/3] ASoC: uda1380: use callbacks instead of gpiolib Vasily Khoruzhick
2010-06-26 16:40 ` Mark Brown
2010-06-26 16:53 ` Vasily Khoruzhick
2010-06-26 20:09 ` Mark Brown
2010-06-26 20:53 ` Vasily Khoruzhick
2010-06-26 20:57 ` Mark Brown
2010-06-26 21:12 ` Vasily Khoruzhick
2010-06-27 10:21 ` Mark Brown
2010-06-28 12:00 ` Vasily Khoruzhick
2010-06-28 13:41 ` Mark Brown
2010-06-28 13:49 ` Vasily Khoruzhick
2010-06-28 13:50 ` Mark Brown
2010-06-28 14:05 ` Vasily Khoruzhick
2010-06-28 14:15 ` Mark Brown
2010-06-28 14:25 ` Vasily Khoruzhick
[not found] ` <AANLkTilfEIEBaHO8FupS9wU3FR3VGc_yUVNP8KPJ30jW@mail.gmail.com>
2010-06-28 14:32 ` Mark Brown
2010-06-26 15:14 ` [PATCH RFC 2/3] magician: pass .set_power callback to uda1380 pdata Vasily Khoruzhick
2010-06-26 15:14 ` [PATCH RFC 3/3] uda1380: make driver more powersave-friendly Vasily Khoruzhick
2010-06-26 20:45 ` Mark Brown
2010-06-26 21:07 ` Vasily Khoruzhick [this message]
2010-06-27 10:10 ` Mark Brown
2010-06-27 10:43 ` Vasily Khoruzhick
2010-06-27 20:55 ` Mark Brown
2010-06-27 21:15 ` Vasily Khoruzhick
2010-06-27 21:40 ` Mark Brown
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=201006270007.34271.anarsoul@gmail.com \
--to=anarsoul@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=lrg@slimlogic.co.uk \
--cc=philipp.zabel@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.