[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHbNUh2QHv8n7Y19qfO7BagX5AWe0i17MjDvr7yOpHf6YNGW4A@mail.gmail.com>
Date: Fri, 23 May 2014 11:05:17 +0530
From: Tushar Behera <tushar.behera@...aro.org>
To: Mark Brown <broonie@...nel.org>
Cc: Linux-ALSA <alsa-devel@...a-project.org>,
lkml <linux-kernel@...r.kernel.org>,
devicetree <devicetree@...r.kernel.org>,
Takashi Iwai <tiwai@...e.de>, Jaroslav Kysela <perex@...ex.cz>,
Doug Anderson <dianders@...omium.org>,
"jerry.wong" <jerry.wong@...imintegrated.com>
Subject: Re: [PATCH 1/2] ASoC: max98090: Add master clock handling
On 22 May 2014 16:00, Mark Brown <broonie@...nel.org> wrote:
> On Thu, May 22, 2014 at 02:47:07PM +0530, Tushar Behera wrote:
>
>> + max98090->mclk = devm_clk_get(codec->dev, "mclk");
>> + if (!IS_ERR(max98090->mclk))
>> + clk_prepare_enable(max98090->mclk);
>> +
>
> Ths doesn't handle deferred probe, we need to at least return an error
> if we get -EPROBE_DEFER.
>
Ok.
> It'd also be better to move the enabling to set_bias_level() if possible
> (I don't know if the clock is needed for register access) though less
> essential.
I tested with moving clk_enable/clk_disable calls to set_bias_level():
SND_SOC_BIAS_PREPARE. That works well for me. Does it look okay?
@@ -1801,6 +1801,25 @@ static int max98090_set_bias_level(struct
snd_soc_codec *codec,
break;
case SND_SOC_BIAS_PREPARE:
+ /*
+ * SND_SOC_BIAS_PREPARE is called while preparing for a
+ * transition to ON or away from ON. If current bias_level
+ * is SND_SOC_BIAS_ON, then it is preparing for a transition
+ * away from ON. Disable the clock in that case, otherwise
+ * enable it.
+ */
+ if (!IS_ERR(max98090->mclk)) {
+ if (codec->dapm.bias_level == SND_SOC_BIAS_ON)
+ clk_disable(max98090->mclk);
+ else
+ clk_enable(max98090->mclk);
+ }
break;
--
Tushar Behera
--
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