aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/oxygen/oxygen_lib.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /sound/pci/oxygen/oxygen_lib.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'sound/pci/oxygen/oxygen_lib.c')
-rw-r--r--sound/pci/oxygen/oxygen_lib.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/sound/pci/oxygen/oxygen_lib.c b/sound/pci/oxygen/oxygen_lib.c
index 9a8936e20744..fad03d64e3ad 100644
--- a/sound/pci/oxygen/oxygen_lib.c
+++ b/sound/pci/oxygen/oxygen_lib.c
@@ -21,6 +21,7 @@
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/mutex.h> 22#include <linux/mutex.h>
23#include <linux/pci.h> 23#include <linux/pci.h>
24#include <linux/slab.h>
24#include <sound/ac97_codec.h> 25#include <sound/ac97_codec.h>
25#include <sound/asoundef.h> 26#include <sound/asoundef.h>
26#include <sound/core.h> 27#include <sound/core.h>
@@ -278,7 +279,11 @@ oxygen_search_pci_id(struct oxygen *chip, const struct pci_device_id ids[])
278static void oxygen_restore_eeprom(struct oxygen *chip, 279static void oxygen_restore_eeprom(struct oxygen *chip,
279 const struct pci_device_id *id) 280 const struct pci_device_id *id)
280{ 281{
281 if (oxygen_read_eeprom(chip, 0) != OXYGEN_EEPROM_ID) { 282 u16 eeprom_id;
283
284 eeprom_id = oxygen_read_eeprom(chip, 0);
285 if (eeprom_id != OXYGEN_EEPROM_ID &&
286 (eeprom_id != 0xffff || id->subdevice != 0x8788)) {
282 /* 287 /*
283 * This function gets called only when a known card model has 288 * This function gets called only when a known card model has
284 * been detected, i.e., we know there is a valid subsystem 289 * been detected, i.e., we know there is a valid subsystem
@@ -303,6 +308,28 @@ static void oxygen_restore_eeprom(struct oxygen *chip,
303 } 308 }
304} 309}
305 310
311static void pci_bridge_magic(void)
312{
313 struct pci_dev *pci = NULL;
314 u32 tmp;
315
316 for (;;) {
317 /* If there is any Pericom PI7C9X110 PCI-E/PCI bridge ... */
318 pci = pci_get_device(0x12d8, 0xe110, pci);
319 if (!pci)
320 break;
321 /*
322 * ... configure its secondary internal arbiter to park to
323 * the secondary port, instead of to the last master.
324 */
325 if (!pci_read_config_dword(pci, 0x40, &tmp)) {
326 tmp |= 1;
327 pci_write_config_dword(pci, 0x40, tmp);
328 }
329 /* Why? Try asking C-Media. */
330 }
331}
332
306static void oxygen_init(struct oxygen *chip) 333static void oxygen_init(struct oxygen *chip)
307{ 334{
308 unsigned int i; 335 unsigned int i;
@@ -581,6 +608,7 @@ int oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
581 snd_card_set_dev(card, &pci->dev); 608 snd_card_set_dev(card, &pci->dev);
582 card->private_free = oxygen_card_free; 609 card->private_free = oxygen_card_free;
583 610
611 pci_bridge_magic();
584 oxygen_init(chip); 612 oxygen_init(chip);
585 chip->model.init(chip); 613 chip->model.init(chip);
586 614