Skip to content

Commit 5f120cc

Browse files
committed
ASoC: set bias_level at if
Merge series from Kuninori Morimoto <[email protected]>: ASoC has 2 functions to set bias level. (A) snd_soc_dapm_force_bias_level() (B) snd_soc_dapm_set_bias_level() (A) sets dapm->bias_level, but (B) is not. I think we should set it on both (A) and (B). I think it is miss or bug, but Samsung is the only vendor that feels a problem about this. I think this patch (= [1/5]) is correct approach, but some non-samsung vendor might get affect from this patch-set, so I added [RFC] on this patch-set. Furthermore, (B) cares both Card and Component, (A) cares Component only. I guess it is the reason why it is called as "force" bias_level function. (A) is used from each drivers, (B) is used from soc-dapm only. I'm not 100% sure though, except special cases, each driver should use (B), I guess ?
2 parents af241e3 + f00e062 commit 5f120cc

File tree

5 files changed

+4
-8
lines changed

5 files changed

+4
-8
lines changed

sound/soc/samsung/bells.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ static int bells_set_bias_level_post(struct snd_soc_card *card,
133133
break;
134134
}
135135

136-
dapm->bias_level = level;
137-
138136
return 0;
139137
}
140138

sound/soc/samsung/littlemill.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ static int littlemill_set_bias_level_post(struct snd_soc_card *card,
9595
break;
9696
}
9797

98-
dapm->bias_level = level;
99-
10098
return 0;
10199
}
102100

sound/soc/samsung/speyside.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ static int speyside_set_bias_level_post(struct snd_soc_card *card,
9090
break;
9191
}
9292

93-
card->dapm.bias_level = level;
94-
9593
return 0;
9694
}
9795

sound/soc/samsung/tobermory.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ static int tobermory_set_bias_level_post(struct snd_soc_card *card,
9191
break;
9292
}
9393

94-
dapm->bias_level = level;
95-
9694
return 0;
9795
}
9896

sound/soc/soc-dapm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,10 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm,
10301030
out:
10311031
trace_snd_soc_bias_level_done(dapm, level);
10321032

1033+
/* success */
1034+
if (ret == 0)
1035+
snd_soc_dapm_init_bias_level(dapm, level);
1036+
10331037
return ret;
10341038
}
10351039

0 commit comments

Comments
 (0)