From: Lars-Peter Clausen <lars@metafoo.de>
To: NeilBrown <neilb@suse.de>
Cc: Mark Brown <broonie@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
GTA04 owners <gta04-owner@goldelico.com>,
alsa-devel@alsa-project.org, Pawel Moll <pawel.moll@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Liam Girdwood <lgirdwood@gmail.com>,
linux-kernel@vger.kernel.org,
Peter Ujfalusi <peter.ujfalusi@ti.com>,
devicetree@vger.kernel.org, Rob Herring <robh+dt@kernel.org>
Subject: Re: [alsa-devel] [PATCH 1/3] ASoC: twl4030: don't report EBUSY if no change requested.
Date: Mon, 10 Nov 2014 22:49:35 +0100 [thread overview]
Message-ID: <546132EF.7070008@metafoo.de> (raw)
In-Reply-To: <20141111084537.1b4e726c@notabene.brown>
On 11/10/2014 10:45 PM, NeilBrown wrote:
> On Mon, 10 Nov 2014 08:07:50 +0100 Lars-Peter Clausen <lars@metafoo.de> wrote:
>
>> On 11/10/2014 01:45 AM, NeilBrown wrote:
>>> diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
>>> index b6b0cb399599..613b61cee081 100644
>>> --- a/sound/soc/codecs/twl4030.c
>>> +++ b/sound/soc/codecs/twl4030.c
>>> @@ -957,6 +957,16 @@ static int snd_soc_put_twl4030_opmode_enum_double(struct snd_kcontrol *kcontrol,
>>> {
>>> struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
>>> struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
>>> + struct snd_ctl_elem_value currentval;
>>>
>>
>> snd_ctl_elem_value is a bit to big to be put onto the kernel stack. Just
>> using twl4030_read() should be fine.
>
> That's a shame, it looked so neat....
>
> Using twl4030_read forces i2c access and misses out on the regmap caching.
>
> What do you think of this?
That looks good, but either snd_soc_kcontrol_component() instead of
snd_kcontrol_chip() or just snd_soc_read(codec, ...
>
> Thanks,
> NeilBrown
>
> diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
> index b6b0cb399599..bdb47a045aa5 100644
> --- a/sound/soc/codecs/twl4030.c
> +++ b/sound/soc/codecs/twl4030.c
> @@ -957,6 +957,18 @@ static int snd_soc_put_twl4030_opmode_enum_double(struct snd_kcontrol *kcontrol,
> {
> struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
> struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
> + const struct soc_enum *e = &twl4030_op_modes_enum;
> + unsigned int reg_val;
> + int ret;
> +
> + ret = snd_soc_component_read(snd_kcontrol_chip(kcontrol),
> + e->reg, ®_val);
> + if (ret)
> + return ret;
> + if (ucontrol->value.enumerated.item[0] ==
> + ((reg_val >> e->shift_l) & e->mask))
> + /* no change requested, so do nothing */
> + return 0;
>
> if (twl4030->configured) {
> dev_err(codec->dev,
>
next prev parent reply other threads:[~2014-11-10 21:49 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-08 0:38 [PATCH 0/3] ASoC: twl4030: support routine to external VOICE source NeilBrown
2014-11-08 0:38 ` [PATCH 1/3] ASoC: twl4030: don't report EBUSY if no change requested NeilBrown
2014-11-08 9:22 ` Mark Brown
2014-11-10 0:45 ` NeilBrown
2014-11-10 7:07 ` [alsa-devel] " Lars-Peter Clausen
2014-11-10 21:45 ` NeilBrown
2014-11-10 21:49 ` Lars-Peter Clausen [this message]
2014-11-08 0:38 ` [PATCH 2/3] ASoC: twl4030: allow voice port to be connected externally NeilBrown
2014-11-08 9:26 ` Mark Brown
2014-11-09 23:25 ` NeilBrown
2014-11-10 6:46 ` [Gta04-owner] " Dr. H. Nikolaus Schaller
2014-11-10 12:11 ` Mark Brown
2014-11-08 0:38 ` [PATCH 3/3] ASoC: twl4030: enable routing audio to 'voice' interface NeilBrown
2014-11-08 9:27 ` Mark Brown
2014-11-09 23:54 ` NeilBrown
2014-11-10 10:48 ` 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=546132EF.7070008@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gta04-owner@goldelico.com \
--cc=ijc+devicetree@hellion.org.uk \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=neilb@suse.de \
--cc=pawel.moll@arm.com \
--cc=peter.ujfalusi@ti.com \
--cc=robh+dt@kernel.org \
/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
Powered by JetHome