Skip to content

Commit 68cc93b

Browse files
marcanjannau
authored andcommitted
macaudio: Turn please_blow_up_my_speakers into an int
1 enables new models, 2 further removes safeties. Mostly so that people who set it to 1 for early access and forget don't get stuck without safety nets. Signed-off-by: Hector Martin <marcan@marcan.st>
1 parent b28f941 commit 68cc93b

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

sound/soc/apple/macaudio.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ struct macaudio_snd_data {
137137

138138
};
139139

140-
static bool please_blow_up_my_speakers;
141-
module_param(please_blow_up_my_speakers, bool, 0644);
140+
static int please_blow_up_my_speakers;
141+
module_param(please_blow_up_my_speakers, int, 0644);
142142
MODULE_PARM_DESC(please_blow_up_my_speakers, "Allow unsafe or untested operating configurations");
143143

144144
SND_SOC_DAILINK_DEFS(primary,
@@ -1165,7 +1165,7 @@ static int macaudio_late_probe(struct snd_soc_card *card)
11651165
#define CHECK(call, pattern, value) \
11661166
{ \
11671167
int ret = call(card, pattern, value); \
1168-
if (ret < 1 && !please_blow_up_my_speakers) { \
1168+
if (ret < 1 && (please_blow_up_my_speakers < 2)) { \
11691169
dev_err(card->dev, "%s on '%s': %d\n", #call, pattern, ret); \
11701170
return ret; \
11711171
} \
@@ -1205,7 +1205,7 @@ static int macaudio_set_speaker(struct snd_soc_card *card, const char *prefix, b
12051205
CHECK_CONCAT(snd_soc_set_enum_kctl, "HPF Corner Frequency",
12061206
tweeter ? "800 Hz" : "2 Hz");
12071207

1208-
if (!please_blow_up_my_speakers)
1208+
if (please_blow_up_my_speakers < 2)
12091209
CHECK_CONCAT(snd_soc_deactivate_kctl, "HPF Corner Frequency", 0);
12101210

12111211
CHECK_CONCAT(snd_soc_set_enum_kctl, "OCE Handling", "Retry");
@@ -1215,7 +1215,7 @@ static int macaudio_set_speaker(struct snd_soc_card *card, const char *prefix, b
12151215
/* TODO: check */
12161216
CHECK_CONCAT(snd_soc_set_enum_kctl, "DAC Analog Gain Select", "8.4 V Span");
12171217

1218-
if (!please_blow_up_my_speakers)
1218+
if (please_blow_up_my_speakers < 2)
12191219
CHECK_CONCAT(snd_soc_deactivate_kctl, "DAC Analog Gain Select", 0);
12201220

12211221
/* TODO: HPF, needs new call to set */
@@ -1244,8 +1244,8 @@ static int macaudio_fixup_controls(struct snd_soc_card *card)
12441244

12451245
switch(ma->cfg->speakers) {
12461246
case SPKR_NONE:
1247-
WARN_ON(!please_blow_up_my_speakers);
1248-
return please_blow_up_my_speakers ? 0 : -EINVAL;
1247+
WARN_ON(please_blow_up_my_speakers < 2);
1248+
return please_blow_up_my_speakers >= 2 ? 0 : -EINVAL;
12491249
case SPKR_1W:
12501250
case SPKR_2W:
12511251
CHECK(macaudio_set_speaker, "* ", false);

0 commit comments

Comments
 (0)