Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37654
b: refs/heads/master
c: 1cfee2b
h: refs/heads/master
v: v3
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Oct 1, 2006
1 parent d3ccf1a commit f89d3fe
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 16 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: b2e9c7d07fcc8966d6aa50a77afa66c9919bd5a8
refs/heads/master: 1cfee2b3c21d71a8c20884dbb77ed343558db87f
44 changes: 29 additions & 15 deletions trunk/sound/oss/trident.c
Original file line number Diff line number Diff line change
Expand Up @@ -3269,8 +3269,8 @@ ali_setup_spdif_out(struct trident_card *card, int flag)
char temp;
struct pci_dev *pci_dev = NULL;

pci_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533,
pci_dev);
pci_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533,
pci_dev);
if (pci_dev == NULL)
return;
pci_read_config_byte(pci_dev, 0x61, &temp);
Expand All @@ -3284,6 +3284,8 @@ ali_setup_spdif_out(struct trident_card *card, int flag)
temp |= 0x10;
pci_write_config_byte(pci_dev, 0x7e, temp);

pci_dev_put(pci_dev);

ch = inb(TRID_REG(card, ALI_SCTRL));
outb(ch | ALI_SPDIF_OUT_ENABLE, TRID_REG(card, ALI_SCTRL));
ch = inb(TRID_REG(card, ALI_SPDIF_CTRL));
Expand Down Expand Up @@ -3490,23 +3492,28 @@ ali_close_multi_channels(void)
char temp = 0;
struct pci_dev *pci_dev = NULL;

pci_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533,
pci_dev);
pci_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533,
pci_dev);
if (pci_dev == NULL)
return -1;

pci_read_config_byte(pci_dev, 0x59, &temp);
temp &= ~0x80;
pci_write_config_byte(pci_dev, 0x59, temp);

pci_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101,
pci_dev);
pci_dev_put(pci_dev);

pci_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101,
NULL);
if (pci_dev == NULL)
return -1;

pci_read_config_byte(pci_dev, 0xB8, &temp);
temp &= ~0x20;
pci_write_config_byte(pci_dev, 0xB8, temp);

pci_dev_put(pci_dev);

return 0;
}

Expand All @@ -3517,21 +3524,26 @@ ali_setup_multi_channels(struct trident_card *card, int chan_nums)
char temp = 0;
struct pci_dev *pci_dev = NULL;

pci_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533,
pci_dev);
pci_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533,
pci_dev);
if (pci_dev == NULL)
return -1;
pci_read_config_byte(pci_dev, 0x59, &temp);
temp |= 0x80;
pci_write_config_byte(pci_dev, 0x59, temp);

pci_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101,
pci_dev);
pci_dev_put(pci_dev);

pci_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101,
NULL);
if (pci_dev == NULL)
return -1;
pci_read_config_byte(pci_dev, (int) 0xB8, &temp);
temp |= 0x20;
pci_write_config_byte(pci_dev, (int) 0xB8, (u8) temp);

pci_dev_put(pci_dev);

if (chan_nums == 6) {
dwValue = inl(TRID_REG(card, ALI_SCTRL)) | 0x000f0000;
outl(dwValue, TRID_REG(card, ALI_SCTRL));
Expand Down Expand Up @@ -4103,8 +4115,8 @@ ali_reset_5451(struct trident_card *card)
unsigned int dwVal;
unsigned short wCount, wReg;

pci_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533,
pci_dev);
pci_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533,
pci_dev);
if (pci_dev == NULL)
return -1;

Expand All @@ -4114,6 +4126,7 @@ ali_reset_5451(struct trident_card *card)
pci_read_config_dword(pci_dev, 0x7c, &dwVal);
pci_write_config_dword(pci_dev, 0x7c, dwVal & 0xf7ffffff);
udelay(5000);
pci_dev_put(pci_dev);

pci_dev = card->pci_dev;
if (pci_dev == NULL)
Expand Down Expand Up @@ -4393,7 +4406,7 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id)

init_timer(&card->timer);
card->iobase = iobase;
card->pci_dev = pci_dev;
card->pci_dev = pci_dev_get(pci_dev);
card->pci_id = pci_id->device;
card->revision = revision;
card->irq = pci_dev->irq;
Expand Down Expand Up @@ -4547,6 +4560,7 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id)
out_free_irq:
free_irq(card->irq, card);
out_proc_fs:
pci_dev_put(card->pci_dev);
if (res) {
remove_proc_entry("ALi5451", NULL);
res = NULL;
Expand Down Expand Up @@ -4597,9 +4611,9 @@ trident_remove(struct pci_dev *pci_dev)
}
unregister_sound_dsp(card->dev_audio);

kfree(card);

pci_set_drvdata(pci_dev, NULL);
pci_dev_put(card->pci_dev);
kfree(card);
}

MODULE_AUTHOR("Alan Cox, Aaron Holtzman, Ollie Lho, Ching Ling Lee, Muli Ben-Yehuda");
Expand Down

0 comments on commit f89d3fe

Please sign in to comment.