Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34828
b: refs/heads/master
c: 6bbe13e
h: refs/heads/master
v: v3
  • Loading branch information
Jaroslav Kysela committed Sep 23, 2006
1 parent 0c063c4 commit 0290876
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e0a5d82a966172c5f1dff6229d4a07be2222e8b3
refs/heads/master: 6bbe13ecbbce4415a5a7959b3bc35b18313025e0
32 changes: 19 additions & 13 deletions trunk/sound/pci/fm801.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ struct fm801 {
unsigned int multichannel: 1, /* multichannel support */
secondary: 1; /* secondary codec */
unsigned char secondary_addr; /* address of the secondary codec */
unsigned int tea575x_tuner; /* tuner flags */

unsigned short ply_ctrl; /* playback control */
unsigned short cap_ctrl; /* capture control */
Expand Down Expand Up @@ -1255,7 +1256,7 @@ static int snd_fm801_chip_init(struct fm801 *chip, int resume)
int id;
unsigned short cmdw;

if (tea575x_tuner & 0x0010)
if (chip->tea575x_tuner & 0x0010)
goto __ac97_ok;

/* codec cold reset + AC'97 warm reset */
Expand Down Expand Up @@ -1295,6 +1296,8 @@ static int snd_fm801_chip_init(struct fm801 *chip, int resume)
wait_for_codec(chip, 0, AC97_VENDOR_ID1, msecs_to_jiffies(750));
}

__ac97_ok:

/* init volume */
outw(0x0808, FM801_REG(chip, PCM_VOL));
outw(0x9f1f, FM801_REG(chip, FM_VOL));
Expand All @@ -1303,9 +1306,12 @@ static int snd_fm801_chip_init(struct fm801 *chip, int resume)
/* I2S control - I2S mode */
outw(0x0003, FM801_REG(chip, I2S_MODE));

/* interrupt setup - unmask MPU, PLAYBACK & CAPTURE */
/* interrupt setup */
cmdw = inw(FM801_REG(chip, IRQ_MASK));
cmdw &= ~0x0083;
if (chip->irq < 0)
cmdw |= 0x00c3; /* mask everything, no PCM nor MPU */
else
cmdw &= ~0x0083; /* unmask MPU, PLAYBACK & CAPTURE */
outw(cmdw, FM801_REG(chip, IRQ_MASK));

/* interrupt clear */
Expand Down Expand Up @@ -1370,20 +1376,23 @@ static int __devinit snd_fm801_create(struct snd_card *card,
chip->card = card;
chip->pci = pci;
chip->irq = -1;
chip->tea575x_tuner = tea575x_tuner;
if ((err = pci_request_regions(pci, "FM801")) < 0) {
kfree(chip);
pci_disable_device(pci);
return err;
}
chip->port = pci_resource_start(pci, 0);
if (request_irq(pci->irq, snd_fm801_interrupt, IRQF_DISABLED|IRQF_SHARED,
"FM801", chip)) {
snd_printk(KERN_ERR "unable to grab IRQ %d\n", chip->irq);
snd_fm801_free(chip);
return -EBUSY;
if ((tea575x_tuner & 0x0010) == 0) {
if (request_irq(pci->irq, snd_fm801_interrupt, IRQF_DISABLED|IRQF_SHARED,
"FM801", chip)) {
snd_printk(KERN_ERR "unable to grab IRQ %d\n", chip->irq);
snd_fm801_free(chip);
return -EBUSY;
}
chip->irq = pci->irq;
pci_set_master(pci);
}
chip->irq = pci->irq;
pci_set_master(pci);

pci_read_config_byte(pci, PCI_REVISION_ID, &rev);
if (rev >= 0xb1) /* FM801-AU */
Expand All @@ -1406,9 +1415,6 @@ static int __devinit snd_fm801_create(struct snd_card *card,
chip->tea.private_data = chip;
chip->tea.ops = &snd_fm801_tea_ops[(tea575x_tuner & 0x000f) - 1];
snd_tea575x_init(&chip->tea);

/* Mute FM tuner */
outw(0xf800, FM801_REG(chip, GPIO_CTRL));
}
#endif

Expand Down

0 comments on commit 0290876

Please sign in to comment.