lkml.org 
[lkml]   [2020]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ASoC: cs42l51: manage mclk shutdown delay
On Tue, Oct 20, 2020 at 11:04:57AM +0200, Olivier Moysan wrote:

> +static int mclk_event(struct snd_soc_dapm_widget *w,
> + struct snd_kcontrol *kcontrol, int event)
> +{
> + struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm);
> + struct cs42l51_private *cs42l51 = snd_soc_component_get_drvdata(comp);
> +
> + if (SND_SOC_DAPM_EVENT_ON(event))
> + return clk_prepare_enable(cs42l51->mclk_handle);
> +
> + /* Delay mclk shutdown to fulfill power-down sequence requirements */
> + msleep(20);
> + clk_disable_unprepare(cs42l51->mclk_handle);

Why not use a switch statement here? The control flow is a bit odd with
what's basically an if/else done with only one branch in the if - this
isn't idiomatic for DAPM stuff apart from anything else.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-10-20 14:19    [W:0.029 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site