ASoC: Indentation fix for null loop operation
Subsystems (5)
PATCH 1/6 ASoC: Indentation fix for null loop operation
More with the legibility.
--- sound/soc/soc-dapm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/soc-dapm.c +1 -1
@@ -209,7 +209,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w,int val, item, bitmask;for (bitmask =1 ; bitmask < e->max; bitmask <<=1 ) - ; + ; val =snd_soc_read (w->codec, e->reg); item = (val >> e->shift_l) & (bitmask -1 );
Signature · 1 line
1.7.5.3
PATCH 2/6 ASoC: Remove trace for DAPM bias level logging
It's redundant now thanks to the use of the generic trace infrastructure.
--- sound/soc/soc-dapm.c | 18 ------------------ 1 files changed, 0 insertions(+), 18 deletions(-)
sound/soc/soc-dapm.c +0 -18
@@ -139,24 +139,6 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm,struct snd_soc_card *card = dapm->card;int ret =0 ; -switch (level) { -case SND_SOC_BIAS_ON : -dev_dbg (dapm->dev,"Setting full bias\n" ); -break ; -case SND_SOC_BIAS_PREPARE : -dev_dbg (dapm->dev,"Setting bias prepare\n" ); -break ; -case SND_SOC_BIAS_STANDBY : -dev_dbg (dapm->dev,"Setting standby bias\n" ); -break ; -case SND_SOC_BIAS_OFF : -dev_dbg (dapm->dev,"Setting bias off\n" ); -break ; -default : -dev_err (dapm->dev,"Setting invalid bias %d\n" , level); -return -EINVAL ; - } -trace_snd_soc_bias_level_start (card, level);if (card && card->set_bias_level)
Signature · 1 line
1.7.5.3
PATCH 3/6 ASoC: Simplify logic in snd_soc_dapm_set_bias_level()
In reply to Mark BrownNo functional changes but much less indentation.
--- sound/soc/soc-dapm.c | 24 +++++++++++++----------- 1 files changed, 13 insertions(+), 11 deletions(-)
sound/soc/soc-dapm.c +12 -10
@@ -143,17 +143,19 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm,if (card && card->set_bias_level) ret = card->set_bias_level (card, level); -if (ret ==0 ) { -if (dapm->codec && dapm->codec->driver->set_bias_level) - ret = dapm->codec->driver->set_bias_level (dapm->codec, level); -else - dapm->bias_level = level; - } -if (ret ==0 ) { -if (card && card->set_bias_level_post) - ret = card->set_bias_level_post (card, level); - } +if (ret !=0 ) + goto out; + +if (dapm->codec && dapm->codec->driver->set_bias_level) + ret = dapm->codec->driver->set_bias_level (dapm->codec, level); +else + dapm->bias_level = level; +if (ret !=0 ) + goto out; +if (card && card->set_bias_level_post) + ret = card->set_bias_level_post (card, level); +out:trace_snd_soc_bias_level_done (card, level);return ret;
Signature · 1 line
1.7.5.3
PATCH 4/6 ASoC: Add context parameter to card DAPM callbacks
In reply to Mark BrownThe card callback will get called for each DAPM context in the card so it can be useful for it to know which device is currently undergoing a transition.
--- include/sound/soc.h | 2 ++ sound/soc/atmel/sam9g20_wm8731.c | 1 + sound/soc/omap/ams-delta.c | 3 ++- sound/soc/samsung/speyside.c | 4 ++++ sound/soc/soc-dapm.c | 4 ++-- 5 files changed, 11 insertions(+), 3 deletions(-)
include/sound/soc.h +2 -0
@@ -726,8 +726,10 @@ struct snd_soc_card {/* callbacks */ int (*set_bias_level)(struct snd_soc_card *, +struct snd_soc_dapm_context *dapm,enum snd_soc_bias_level level);int (*set_bias_level_post)(struct snd_soc_card *, +struct snd_soc_dapm_context *dapm,enum snd_soc_bias_level level);long pmdown_time;
sound/soc/atmel/sam9g20_wm8731.c +1 -0
@@ -92,6 +92,7 @@ static struct snd_soc_ops at91sam9g20ek_ops = { };static int at91sam9g20ek_set_bias_level (struct snd_soc_card *card, +struct snd_soc_dapm_context *dapm,enum snd_soc_bias_level level) {static int mclk_on;
sound/soc/omap/ams-delta.c +2 -1
@@ -427,7 +427,8 @@ static struct snd_soc_ops ams_delta_ops = {/* Board specific codec bias level control */ static int ams_delta_set_bias_level (struct snd_soc_card *card, -enum snd_soc_bias_level level) +struct snd_soc_dapm_context *dapm, +enum snd_soc_bias_level level) {struct snd_soc_codec *codec = card->rtd->codec;
sound/soc/samsung/speyside.c +4 -0
@@ -20,11 +20,15 @@#define WM8915_HPSEL_GPIO 214static int speyside_set_bias_level (struct snd_soc_card *card, +struct snd_soc_dapm_context *dapm,enum snd_soc_bias_level level) {struct snd_soc_dai *codec_dai = card->rtd[0 ].codec_dai;int ret; +if (dapm->dev != codec_dai->dev) +return 0 ; +switch (level) {case SND_SOC_BIAS_STANDBY : ret = snd_soc_dai_set_sysclk(codec_dai, WM8915_SYSCLK_MCLK2,
sound/soc/soc-dapm.c +2 -2
@@ -142,7 +142,7 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm,trace_snd_soc_bias_level_start (card, level);if (card && card->set_bias_level) - ret = card->set_bias_level (card, level); + ret = card->set_bias_level (card, dapm, level);if (ret !=0 ) goto out;
@@ -154,7 +154,7 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm, goto out;if (card && card->set_bias_level_post) - ret = card->set_bias_level_post (card, level); + ret = card->set_bias_level_post (card, dapm, level); out:trace_snd_soc_bias_level_done (card, level);
Signature · 1 line
1.7.5.3
PATCH 5/6 ASoC: Only provide a default bias level update for CODEC contexts
In reply to Mark BrownThis allows the card driver to use the bias level variable more easily in multi component systems.
--- sound/soc/soc-dapm.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-)
sound/soc/soc-dapm.c +7 -4
@@ -146,10 +146,13 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm,if (ret !=0 ) goto out; -if (dapm->codec && dapm->codec->driver->set_bias_level) - ret = dapm->codec->driver->set_bias_level (dapm->codec, level); -else - dapm->bias_level = level; +if (dapm->codec) { +if (dapm->codec->driver->set_bias_level) + ret = dapm->codec->driver->set_bias_level (dapm->codec, + level); +else + dapm->bias_level = level; + }if (ret !=0 ) goto out;
Signature · 1 line
1.7.5.3
PATCH 6/6 ASoC: Manage Speyside system clocking only in bias management
In reply to Mark BrownNow that the CODEC driver supports it defer configuration of the system clock until bias management which is a much more idiomatic place to do system power control and makes things a lot more happy when we're using both interfaces.
--- sound/soc/samsung/speyside.c | 50 +++++++++++++++++++++++++++++++++-------- 1 files changed, 40 insertions(+), 10 deletions(-)
sound/soc/samsung/speyside.c +40 -10
@@ -42,11 +42,51 @@ static int speyside_set_bias_level(struct snd_soc_card *card,pr_err ("Failed to stop FLL\n" );return ret; } +break ; + +default : +break ; + } + +return 0 ; +} + +static int speyside_set_bias_level_post (struct snd_soc_card *card, +struct snd_soc_dapm_context *dapm, +enum snd_soc_bias_level level) +{ +struct snd_soc_dai *codec_dai = card->rtd[0 ].codec_dai; +int ret; + +if (dapm->dev != codec_dai->dev) +return 0 ; + +switch (level) { +case SND_SOC_BIAS_PREPARE : +if (card->dapm.bias_level ==SND_SOC_BIAS_STANDBY ) { + ret =snd_soc_dai_set_pll (codec_dai,0 , +WM8915_FLL_MCLK2 , +32768 ,48000 *256 ); +if (ret <0 ) { +pr_err ("Failed to start FLL\n" ); +return ret; + } + + ret =snd_soc_dai_set_sysclk (codec_dai, +WM8915_SYSCLK_FLL , +48000 *256 , +SND_SOC_CLOCK_IN ); +if (ret <0 ) +return ret; + } +break ;default :break ; } + card->dapm.bias_level = level; +return 0 ; }
@@ -70,16 +110,6 @@ static int speyside_hw_params(struct snd_pcm_substream *substream,if (ret <0 )return ret; - ret =snd_soc_dai_set_pll (codec_dai,0 ,WM8915_FLL_MCLK2 , -32768 ,256 *48000 ); -if (ret <0 ) -return ret; - - ret =snd_soc_dai_set_sysclk (codec_dai,WM8915_SYSCLK_FLL , -256 *48000 ,SND_SOC_CLOCK_IN ); -if (ret <0 ) -return ret; -return 0 ; }
Signature · 1 line
1.7.5.3
Quoted 12 lines · Mark Brown
More with the legibility.
Signed-off-by Mark Brown <[email protected]>--- sound/soc/soc-dapm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)sound/soc/soc-dapm.c +0
-0
sound/soc/soc-dapm.c static void dapm_set_path_status(struct snd_soc_dapm_widget *w, · line 215
Quoted 8 lines
sound/soc/soc-dapm.c +1
-1@@ -209,7 +209,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w,int val, item, bitmask;for (bitmask =1 ; bitmask < e->max; bitmask <<=1 ) - ; + ; val =snd_soc_read (w->codec, e->reg); item = (val >> e->shift_l) & (bitmask -1 );
All