diff options
author | Jaroslav Kysela <perex@suse.cz> | 2006-07-04 07:39:55 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-09-23 04:37:21 -0400 |
commit | 6bbe13ecbbce4415a5a7959b3bc35b18313025e0 (patch) | |
tree | f0d962b368d769000776c799c43b810be5524ed5 | |
parent | e0a5d82a966172c5f1dff6229d4a07be2222e8b3 (diff) |
[ALSA] fm801: fixed broken previous patch for the FM tuner only code
- do not allocate and enable interrupt
- do not do the FM tuner mute (it should be handled more cleanly)
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r-- | sound/pci/fm801.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index a30257fa6dbc..88a3e9f3224a 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c | |||
@@ -160,6 +160,7 @@ struct fm801 { | |||
160 | unsigned int multichannel: 1, /* multichannel support */ | 160 | unsigned int multichannel: 1, /* multichannel support */ |
161 | secondary: 1; /* secondary codec */ | 161 | secondary: 1; /* secondary codec */ |
162 | unsigned char secondary_addr; /* address of the secondary codec */ | 162 | unsigned char secondary_addr; /* address of the secondary codec */ |
163 | unsigned int tea575x_tuner; /* tuner flags */ | ||
163 | 164 | ||
164 | unsigned short ply_ctrl; /* playback control */ | 165 | unsigned short ply_ctrl; /* playback control */ |
165 | unsigned short cap_ctrl; /* capture control */ | 166 | unsigned short cap_ctrl; /* capture control */ |
@@ -1255,7 +1256,7 @@ static int snd_fm801_chip_init(struct fm801 *chip, int resume) | |||
1255 | int id; | 1256 | int id; |
1256 | unsigned short cmdw; | 1257 | unsigned short cmdw; |
1257 | 1258 | ||
1258 | if (tea575x_tuner & 0x0010) | 1259 | if (chip->tea575x_tuner & 0x0010) |
1259 | goto __ac97_ok; | 1260 | goto __ac97_ok; |
1260 | 1261 | ||
1261 | /* codec cold reset + AC'97 warm reset */ | 1262 | /* codec cold reset + AC'97 warm reset */ |
@@ -1295,6 +1296,8 @@ static int snd_fm801_chip_init(struct fm801 *chip, int resume) | |||
1295 | wait_for_codec(chip, 0, AC97_VENDOR_ID1, msecs_to_jiffies(750)); | 1296 | wait_for_codec(chip, 0, AC97_VENDOR_ID1, msecs_to_jiffies(750)); |
1296 | } | 1297 | } |
1297 | 1298 | ||
1299 | __ac97_ok: | ||
1300 | |||
1298 | /* init volume */ | 1301 | /* init volume */ |
1299 | outw(0x0808, FM801_REG(chip, PCM_VOL)); | 1302 | outw(0x0808, FM801_REG(chip, PCM_VOL)); |
1300 | outw(0x9f1f, FM801_REG(chip, FM_VOL)); | 1303 | outw(0x9f1f, FM801_REG(chip, FM_VOL)); |
@@ -1303,9 +1306,12 @@ static int snd_fm801_chip_init(struct fm801 *chip, int resume) | |||
1303 | /* I2S control - I2S mode */ | 1306 | /* I2S control - I2S mode */ |
1304 | outw(0x0003, FM801_REG(chip, I2S_MODE)); | 1307 | outw(0x0003, FM801_REG(chip, I2S_MODE)); |
1305 | 1308 | ||
1306 | /* interrupt setup - unmask MPU, PLAYBACK & CAPTURE */ | 1309 | /* interrupt setup */ |
1307 | cmdw = inw(FM801_REG(chip, IRQ_MASK)); | 1310 | cmdw = inw(FM801_REG(chip, IRQ_MASK)); |
1308 | cmdw &= ~0x0083; | 1311 | if (chip->irq < 0) |
1312 | cmdw |= 0x00c3; /* mask everything, no PCM nor MPU */ | ||
1313 | else | ||
1314 | cmdw &= ~0x0083; /* unmask MPU, PLAYBACK & CAPTURE */ | ||
1309 | outw(cmdw, FM801_REG(chip, IRQ_MASK)); | 1315 | outw(cmdw, FM801_REG(chip, IRQ_MASK)); |
1310 | 1316 | ||
1311 | /* interrupt clear */ | 1317 | /* interrupt clear */ |
@@ -1370,20 +1376,23 @@ static int __devinit snd_fm801_create(struct snd_card *card, | |||
1370 | chip->card = card; | 1376 | chip->card = card; |
1371 | chip->pci = pci; | 1377 | chip->pci = pci; |
1372 | chip->irq = -1; | 1378 | chip->irq = -1; |
1379 | chip->tea575x_tuner = tea575x_tuner; | ||
1373 | if ((err = pci_request_regions(pci, "FM801")) < 0) { | 1380 | if ((err = pci_request_regions(pci, "FM801")) < 0) { |
1374 | kfree(chip); | 1381 | kfree(chip); |
1375 | pci_disable_device(pci); | 1382 | pci_disable_device(pci); |
1376 | return err; | 1383 | return err; |
1377 | } | 1384 | } |
1378 | chip->port = pci_resource_start(pci, 0); | 1385 | chip->port = pci_resource_start(pci, 0); |
1379 | if (request_irq(pci->irq, snd_fm801_interrupt, IRQF_DISABLED|IRQF_SHARED, | 1386 | if ((tea575x_tuner & 0x0010) == 0) { |
1380 | "FM801", chip)) { | 1387 | if (request_irq(pci->irq, snd_fm801_interrupt, IRQF_DISABLED|IRQF_SHARED, |
1381 | snd_printk(KERN_ERR "unable to grab IRQ %d\n", chip->irq); | 1388 | "FM801", chip)) { |
1382 | snd_fm801_free(chip); | 1389 | snd_printk(KERN_ERR "unable to grab IRQ %d\n", chip->irq); |
1383 | return -EBUSY; | 1390 | snd_fm801_free(chip); |
1391 | return -EBUSY; | ||
1392 | } | ||
1393 | chip->irq = pci->irq; | ||
1394 | pci_set_master(pci); | ||
1384 | } | 1395 | } |
1385 | chip->irq = pci->irq; | ||
1386 | pci_set_master(pci); | ||
1387 | 1396 | ||
1388 | pci_read_config_byte(pci, PCI_REVISION_ID, &rev); | 1397 | pci_read_config_byte(pci, PCI_REVISION_ID, &rev); |
1389 | if (rev >= 0xb1) /* FM801-AU */ | 1398 | if (rev >= 0xb1) /* FM801-AU */ |
@@ -1406,9 +1415,6 @@ static int __devinit snd_fm801_create(struct snd_card *card, | |||
1406 | chip->tea.private_data = chip; | 1415 | chip->tea.private_data = chip; |
1407 | chip->tea.ops = &snd_fm801_tea_ops[(tea575x_tuner & 0x000f) - 1]; | 1416 | chip->tea.ops = &snd_fm801_tea_ops[(tea575x_tuner & 0x000f) - 1]; |
1408 | snd_tea575x_init(&chip->tea); | 1417 | snd_tea575x_init(&chip->tea); |
1409 | |||
1410 | /* Mute FM tuner */ | ||
1411 | outw(0xf800, FM801_REG(chip, GPIO_CTRL)); | ||
1412 | } | 1418 | } |
1413 | #endif | 1419 | #endif |
1414 | 1420 | ||