Skip to content

Commit d979aaa

Browse files
committed
ASoC: macaudio: Gate off experimental platforms
We know at least some machines can have their speakers blown, even with these limits, so let's play it safe for now and require that users both enable stuff in the DT *and* pass this flag. Signed-off-by: Hector Martin <marcan@marcan.st>
1 parent 64de7a7 commit d979aaa

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

sound/soc/apple/macaudio.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,11 @@ static int macaudio_j314_fixup_controls(struct snd_soc_card *card)
727727
struct macaudio_snd_data *ma = snd_soc_card_get_drvdata(card);
728728

729729
if (ma->has_speakers) {
730+
if (!please_blow_up_my_speakers) {
731+
dev_err(card->dev, "driver can't assure safety on this model, refusing probe\n");
732+
return -EINVAL;
733+
}
734+
730735
CHECK(snd_soc_set_enum_kctl, "* ASI1 Sel", "Left");
731736
CHECK(snd_soc_deactivate_kctl, "* ASI1 Sel", 0);
732737
CHECK(snd_soc_limit_volume, "* Amp Gain Volume", 9); // 15 set by macOS, this is 3 dB below
@@ -758,6 +763,11 @@ static int macaudio_j375_fixup_controls(struct snd_soc_card *card)
758763
struct macaudio_snd_data *ma = snd_soc_card_get_drvdata(card);
759764

760765
if (ma->has_speakers) {
766+
if (!please_blow_up_my_speakers) {
767+
dev_err(card->dev, "driver can't assure safety on this model, refusing probe\n");
768+
return -EINVAL;
769+
}
770+
761771
CHECK(snd_soc_limit_volume, "* Amp Gain Volume", 14); // 20 set by macOS, this is 3 dB below
762772
}
763773

@@ -769,6 +779,11 @@ static int macaudio_j493_fixup_controls(struct snd_soc_card *card)
769779
struct macaudio_snd_data *ma = snd_soc_card_get_drvdata(card);
770780

771781
if (ma->has_speakers) {
782+
if (!please_blow_up_my_speakers) {
783+
dev_err(card->dev, "driver can't assure safety on this model, refusing probe\n");
784+
return -EINVAL;
785+
}
786+
772787
CHECK(snd_soc_limit_volume, "* Amp Gain Volume", 9); // 15 set by macOS, this is 3 dB below
773788
}
774789

0 commit comments

Comments
 (0)