[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141108003803.6561.42934.stgit@notabene.brown>
Date: Sat, 08 Nov 2014 11:38:03 +1100
From: NeilBrown <neilb@...e.de>
To: Mark Rutland <mark.rutland@....com>,
Pawel Moll <pawel.moll@....com>,
Ian Campbell <ijc+devicetree@...lion.org.uk>,
Liam Girdwood <lgirdwood@...il.com>,
Rob Herring <robh+dt@...nel.org>,
Peter Ujfalusi <peter.ujfalusi@...com>,
Mark Brown <broonie@...nel.org>
Cc: GTA04 owners <gta04-owner@...delico.com>,
devicetree@...r.kernel.org, alsa-devel@...a-project.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/3] ASoC: twl4030: don't report EBUSY if no change
requested.
"mode" must not be changed when active.
However if a request is received to set the mode to what it currently
is, that is also rejected when active, which causes confusing
error messages.
So check first and if no change is actually requested, don't report
an error.
Signed-off-by: NeilBrown <neilb@...e.de>
---
sound/soc/codecs/twl4030.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index b6b0cb399599..c873f5887486 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -957,6 +957,12 @@ 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);
+ int val = ucontrol->value.integer.value[0];
+
+ if (!!(twl4030_read(codec, TWL4030_REG_CODEC_MODE)
+ & TWL4030_OPTION_1) == !!val)
+ /* No change */
+ return 0;
if (twl4030->configured) {
dev_err(codec->dev,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists