Skip to content

Commit d93bb62

Browse files
committed
macaudio: Avoid matches against cs42l84's constrols
On systems with cs42l84 headset codec "* " can't be used as control name pattern since it would match "Jack HPF Corner Frequency". Its control is not an enum and thus will always return -EINVAL. Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 8fc4650 commit d93bb62

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

sound/soc/apple/macaudio.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,13 +1247,25 @@ static int macaudio_fixup_controls(struct snd_soc_card *card)
12471247
if (!ma->has_speakers)
12481248
return 0;
12491249

1250+
/*
1251+
* This needs some care to avoid matches against cs42l84's
1252+
* "Jack HPF Corner Frequency".
1253+
*/
12501254
switch(ma->cfg->speakers) {
12511255
case SPKR_NONE:
12521256
WARN_ON(please_blow_up_my_speakers < 2);
12531257
return please_blow_up_my_speakers >= 2 ? 0 : -EINVAL;
12541258
case SPKR_1W:
1259+
/* only 1W stereo system (J313) is uses cs42l83 */
1260+
if (ma->cfg->stereo) {
1261+
CHECK(macaudio_set_speaker, "* ", false, 0);
1262+
} else {
1263+
CHECK(macaudio_set_speaker, "", false, 0);
1264+
}
1265+
break;
12551266
case SPKR_2W:
1256-
CHECK(macaudio_set_speaker, "* ", false, 0);
1267+
CHECK(macaudio_set_speaker, "* Front ", false, 0);
1268+
CHECK(macaudio_set_speaker, "* Rear ", false, 0);
12571269
break;
12581270
case SPKR_1W1T:
12591271
CHECK(macaudio_set_speaker, "* Tweeter ", true, 0);

0 commit comments

Comments
 (0)