Commit c9ba374d authored by Andreas Mohr's avatar Andreas Mohr Committed by Takashi Iwai

ALSA: azt3328 - fix broken AZF_FMT_XLATE macro

Cleanly revert to non-macro implementation of
snd_azf3328_codec_setfmt(), to fix last-minute functionality breakage
induced by following checkpatch.pl recommendations without giving them
their due full share of thought ("revolting computer, ensuing PEBKAC").

I would like to thank Jiri Slaby for his very timely (in -rc1 even)
and unexpected (uncommon hardware) "recognition of the dangerous situation"
due to his very commendable static parser use. :)
Reported-by: default avatarJiri Slaby <jslaby@suse.cz>
Signed-off-by: default avatarAndreas Mohr <andi@lisas.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 233d84c4
...@@ -979,31 +979,25 @@ snd_azf3328_codec_setfmt(struct snd_azf3328_codec_data *codec, ...@@ -979,31 +979,25 @@ snd_azf3328_codec_setfmt(struct snd_azf3328_codec_data *codec,
snd_azf3328_dbgcallenter(); snd_azf3328_dbgcallenter();
switch (bitrate) { switch (bitrate) {
#define AZF_FMT_XLATE(in_freq, out_bits) \ case AZF_FREQ_4000: freq = SOUNDFORMAT_FREQ_SUSPECTED_4000; break;
do { \ case AZF_FREQ_4800: freq = SOUNDFORMAT_FREQ_SUSPECTED_4800; break;
case AZF_FREQ_ ## in_freq: \ case AZF_FREQ_5512:
freq = SOUNDFORMAT_FREQ_ ## out_bits; \ /* the AZF3328 names it "5510" for some strange reason */
break; \ freq = SOUNDFORMAT_FREQ_5510; break;
} while (0); case AZF_FREQ_6620: freq = SOUNDFORMAT_FREQ_6620; break;
AZF_FMT_XLATE(4000, SUSPECTED_4000) case AZF_FREQ_8000: freq = SOUNDFORMAT_FREQ_8000; break;
AZF_FMT_XLATE(4800, SUSPECTED_4800) case AZF_FREQ_9600: freq = SOUNDFORMAT_FREQ_9600; break;
/* the AZF3328 names it "5510" for some strange reason: */ case AZF_FREQ_11025: freq = SOUNDFORMAT_FREQ_11025; break;
AZF_FMT_XLATE(5512, 5510) case AZF_FREQ_13240: freq = SOUNDFORMAT_FREQ_SUSPECTED_13240; break;
AZF_FMT_XLATE(6620, 6620) case AZF_FREQ_16000: freq = SOUNDFORMAT_FREQ_16000; break;
AZF_FMT_XLATE(8000, 8000) case AZF_FREQ_22050: freq = SOUNDFORMAT_FREQ_22050; break;
AZF_FMT_XLATE(9600, 9600) case AZF_FREQ_32000: freq = SOUNDFORMAT_FREQ_32000; break;
AZF_FMT_XLATE(11025, 11025)
AZF_FMT_XLATE(13240, SUSPECTED_13240)
AZF_FMT_XLATE(16000, 16000)
AZF_FMT_XLATE(22050, 22050)
AZF_FMT_XLATE(32000, 32000)
default: default:
snd_printk(KERN_WARNING "unknown bitrate %d, assuming 44.1kHz!\n", bitrate); snd_printk(KERN_WARNING "unknown bitrate %d, assuming 44.1kHz!\n", bitrate);
/* fall-through */ /* fall-through */
AZF_FMT_XLATE(44100, 44100) case AZF_FREQ_44100: freq = SOUNDFORMAT_FREQ_44100; break;
AZF_FMT_XLATE(48000, 48000) case AZF_FREQ_48000: freq = SOUNDFORMAT_FREQ_48000; break;
AZF_FMT_XLATE(66200, SUSPECTED_66200) case AZF_FREQ_66200: freq = SOUNDFORMAT_FREQ_SUSPECTED_66200; break;
#undef AZF_FMT_XLATE
} }
/* val = 0xff07; 3m27.993s (65301Hz; -> 64000Hz???) hmm, 66120, 65967, 66123 */ /* val = 0xff07; 3m27.993s (65301Hz; -> 64000Hz???) hmm, 66120, 65967, 66123 */
/* val = 0xff09; 17m15.098s (13123,478Hz; -> 12000Hz???) hmm, 13237.2Hz? */ /* val = 0xff09; 17m15.098s (13123,478Hz; -> 12000Hz???) hmm, 13237.2Hz? */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment