Commit 48bf4025 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Kamal Mostafa

ALSA: fm801: propagate TUNER_ONLY bit when autodetected

commit dbec6719 upstream.

The commit d7ba858a (ALSA: fm801: implement TEA575x tuner autodetection)
brings autodetection to the driver. However the autodetection algorithm misses
the TUNER_ONLY bit if it is supplied by the user.

Thus, user gets weird messages and no card registered.

 snd_fm801 0000:0d:01.0: detected TEA575x radio type SF64-PCR
 snd_fm801 0000:0d:01.0: AC'97 interface is busy (1)
 snd_fm801 0000:0d:01.0: AC'97 interface is busy (1)
...
 snd_fm801 0000:0d:01.0: AC'97 0 does not respond - RESET
 snd_fm801 0000:0d:01.0: AC'97 interface is busy (1)
 snd_fm801 0000:0d:01.0: AC'97 interface is busy (1)
 snd_fm801 0000:0d:01.0: AC'97 0 access is not valid [0x0], removing mixer.
 snd_fm801: probe of 0000:0d:01.0 failed with error -5

Do a copy of TUNER_ONLY bit to be applied after autodetection is done.

Fixes: d7ba858a (ALSA: fm801: implement TEA575x tuner autodetection)
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 86c8f6f2
...@@ -1280,6 +1280,8 @@ static int snd_fm801_create(struct snd_card *card, ...@@ -1280,6 +1280,8 @@ static int snd_fm801_create(struct snd_card *card,
return -ENODEV; return -ENODEV;
} }
} else if ((tea575x_tuner & TUNER_TYPE_MASK) == 0) { } else if ((tea575x_tuner & TUNER_TYPE_MASK) == 0) {
unsigned int tuner_only = tea575x_tuner & TUNER_ONLY;
/* autodetect tuner connection */ /* autodetect tuner connection */
for (tea575x_tuner = 1; tea575x_tuner <= 3; tea575x_tuner++) { for (tea575x_tuner = 1; tea575x_tuner <= 3; tea575x_tuner++) {
chip->tea575x_tuner = tea575x_tuner; chip->tea575x_tuner = tea575x_tuner;
...@@ -1294,6 +1296,8 @@ static int snd_fm801_create(struct snd_card *card, ...@@ -1294,6 +1296,8 @@ static int snd_fm801_create(struct snd_card *card,
dev_err(card->dev, "TEA575x radio not found\n"); dev_err(card->dev, "TEA575x radio not found\n");
chip->tea575x_tuner = TUNER_DISABLED; chip->tea575x_tuner = TUNER_DISABLED;
} }
chip->tea575x_tuner |= tuner_only;
} }
if (!(chip->tea575x_tuner & TUNER_DISABLED)) { if (!(chip->tea575x_tuner & TUNER_DISABLED)) {
strlcpy(chip->tea.card, get_tea575x_gpio(chip)->name, strlcpy(chip->tea.card, get_tea575x_gpio(chip)->name,
......
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