diff options
-rw-r--r-- | sound/pci/fm801.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index 13868c985126..a30257fa6dbc 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * The driver for the ForteMedia FM801 based soundcards | 2 | * The driver for the ForteMedia FM801 based soundcards |
3 | * Copyright (c) by Jaroslav Kysela <perex@suse.cz> | 3 | * Copyright (c) by Jaroslav Kysela <perex@suse.cz> |
4 | * | 4 | * |
5 | * Support FM only card by Andy Shevchenko <andy@smile.org.ua> | ||
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
@@ -54,6 +55,7 @@ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card * | |||
54 | * 1 = MediaForte 256-PCS | 55 | * 1 = MediaForte 256-PCS |
55 | * 2 = MediaForte 256-PCPR | 56 | * 2 = MediaForte 256-PCPR |
56 | * 3 = MediaForte 64-PCR | 57 | * 3 = MediaForte 64-PCR |
58 | * 16 = setup tuner only (this is additional bit), i.e. SF-64-PCR FM card | ||
57 | * High 16-bits are video (radio) device number + 1 | 59 | * High 16-bits are video (radio) device number + 1 |
58 | */ | 60 | */ |
59 | static int tea575x_tuner[SNDRV_CARDS]; | 61 | static int tea575x_tuner[SNDRV_CARDS]; |
@@ -1253,6 +1255,9 @@ static int snd_fm801_chip_init(struct fm801 *chip, int resume) | |||
1253 | int id; | 1255 | int id; |
1254 | unsigned short cmdw; | 1256 | unsigned short cmdw; |
1255 | 1257 | ||
1258 | if (tea575x_tuner & 0x0010) | ||
1259 | goto __ac97_ok; | ||
1260 | |||
1256 | /* codec cold reset + AC'97 warm reset */ | 1261 | /* codec cold reset + AC'97 warm reset */ |
1257 | outw((1<<5) | (1<<6), FM801_REG(chip, CODEC_CTRL)); | 1262 | outw((1<<5) | (1<<6), FM801_REG(chip, CODEC_CTRL)); |
1258 | inw(FM801_REG(chip, CODEC_CTRL)); /* flush posting data */ | 1263 | inw(FM801_REG(chip, CODEC_CTRL)); /* flush posting data */ |
@@ -1394,13 +1399,16 @@ static int __devinit snd_fm801_create(struct snd_card *card, | |||
1394 | snd_card_set_dev(card, &pci->dev); | 1399 | snd_card_set_dev(card, &pci->dev); |
1395 | 1400 | ||
1396 | #ifdef TEA575X_RADIO | 1401 | #ifdef TEA575X_RADIO |
1397 | if (tea575x_tuner > 0 && (tea575x_tuner & 0xffff) < 4) { | 1402 | if (tea575x_tuner > 0 && (tea575x_tuner & 0x000f) < 4) { |
1398 | chip->tea.dev_nr = tea575x_tuner >> 16; | 1403 | chip->tea.dev_nr = tea575x_tuner >> 16; |
1399 | chip->tea.card = card; | 1404 | chip->tea.card = card; |
1400 | chip->tea.freq_fixup = 10700; | 1405 | chip->tea.freq_fixup = 10700; |
1401 | chip->tea.private_data = chip; | 1406 | chip->tea.private_data = chip; |
1402 | chip->tea.ops = &snd_fm801_tea_ops[(tea575x_tuner & 0xffff) - 1]; | 1407 | chip->tea.ops = &snd_fm801_tea_ops[(tea575x_tuner & 0x000f) - 1]; |
1403 | snd_tea575x_init(&chip->tea); | 1408 | snd_tea575x_init(&chip->tea); |
1409 | |||
1410 | /* Mute FM tuner */ | ||
1411 | outw(0xf800, FM801_REG(chip, GPIO_CTRL)); | ||
1404 | } | 1412 | } |
1405 | #endif | 1413 | #endif |
1406 | 1414 | ||
@@ -1439,6 +1447,9 @@ static int __devinit snd_card_fm801_probe(struct pci_dev *pci, | |||
1439 | sprintf(card->longname, "%s at 0x%lx, irq %i", | 1447 | sprintf(card->longname, "%s at 0x%lx, irq %i", |
1440 | card->shortname, chip->port, chip->irq); | 1448 | card->shortname, chip->port, chip->irq); |
1441 | 1449 | ||
1450 | if (tea575x_tuner[dev] & 0x0010) | ||
1451 | goto __fm801_tuner_only; | ||
1452 | |||
1442 | if ((err = snd_fm801_pcm(chip, 0, NULL)) < 0) { | 1453 | if ((err = snd_fm801_pcm(chip, 0, NULL)) < 0) { |
1443 | snd_card_free(card); | 1454 | snd_card_free(card); |
1444 | return err; | 1455 | return err; |
@@ -1465,6 +1476,7 @@ static int __devinit snd_card_fm801_probe(struct pci_dev *pci, | |||
1465 | return err; | 1476 | return err; |
1466 | } | 1477 | } |
1467 | 1478 | ||
1479 | __fm801_tuner_only: | ||
1468 | if ((err = snd_card_register(card)) < 0) { | 1480 | if ((err = snd_card_register(card)) < 0) { |
1469 | snd_card_free(card); | 1481 | snd_card_free(card); |
1470 | return err; | 1482 | return err; |