aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Marinushkin <[email protected]>2018-04-16 19:56:44 +0200
committerMark Brown <[email protected]>2018-04-16 19:26:32 +0100
commitfbeabd09236664f34ea3e4a9f7dcf5a0cdb7fc47 (patch)
tree076fe4bbf0cb52a4285d4010f2ed12f75186ba7a
parentd59fb2856223219ccaa73bd2e96021f02ea5c266 (diff)
ASoC: topology: Modify clock gating parameter parsing to switch
This improves the coding style of this piece of code. Signed-off-by: Kirill Marinushkin <[email protected]> Cc: Mark Brown <[email protected]> Cc: Pierre-Louis Bossart <[email protected]> Cc: Jaroslav Kysela <[email protected]> Cc: Takashi Iwai <[email protected]> Cc: Pan Xiuli <[email protected]> Cc: Liam Girdwood <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/soc/soc-topology.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index aab31144f683..ec2ef7629dbb 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -2007,11 +2007,19 @@ static void set_link_hw_format(struct snd_soc_dai_link *link,
link->dai_fmt = hw_config->fmt & SND_SOC_DAIFMT_FORMAT_MASK;
/* clock gating */
- if (hw_config->clock_gated == SND_SOC_TPLG_DAI_CLK_GATE_GATED)
+ switch (hw_config->clock_gated) {
+ case SND_SOC_TPLG_DAI_CLK_GATE_GATED:
link->dai_fmt |= SND_SOC_DAIFMT_GATED;
- else if (hw_config->clock_gated ==
- SND_SOC_TPLG_DAI_CLK_GATE_CONT)
+ break;
+
+ case SND_SOC_TPLG_DAI_CLK_GATE_CONT:
link->dai_fmt |= SND_SOC_DAIFMT_CONT;
+ break;
+
+ default:
+ /* ignore the value */
+ break;
+ }
/* clock signal polarity */
invert_bclk = hw_config->invert_bclk;