Lines 216-221
static int pirq_ali_set(struct pci_dev *
Link Here
|
216 |
} |
216 |
} |
217 |
|
217 |
|
218 |
/* |
218 |
/* |
|
|
219 |
* ALI M1533/1543 can support either 4 or 8 PIRQ inputs. Trying to |
220 |
* route PIRQs 5..8 when using 4 PIRQ inputs results in screaming IRQs. |
221 |
* Of course, some BIOS versions have bogus PIRQ table entries. |
222 |
*/ |
223 |
static int pirq_ali_m1533_is_valid(struct pci_dev *router, int pirq) |
224 |
{ |
225 |
if ((pirq >= 5) && (pirq <= 8)) { |
226 |
u8 reg45; |
227 |
pci_read_config_byte(router, 0x45, ®45); |
228 |
if (!(reg45 & 0x80)) |
229 |
return 0; |
230 |
} |
231 |
return 1; |
232 |
} |
233 |
|
234 |
static int pirq_ali_m1533_get(struct pci_dev *router, struct pci_dev *dev, |
235 |
int pirq) |
236 |
{ |
237 |
if (!pirq_ali_m1533_is_valid(router, pirq)) |
238 |
return 0; |
239 |
return pirq_ali_get(router, dev, pirq); |
240 |
} |
241 |
|
242 |
static int pirq_ali_m1533_set(struct pci_dev *router, struct pci_dev *dev, |
243 |
int pirq, int irq) |
244 |
{ |
245 |
if (!pirq_ali_m1533_is_valid(router, pirq)) |
246 |
return 0; |
247 |
return pirq_ali_set(router, dev, pirq, irq); |
248 |
} |
249 |
|
250 |
/* |
219 |
* The Intel PIIX4 pirq rules are fairly simple: "pirq" is |
251 |
* The Intel PIIX4 pirq rules are fairly simple: "pirq" is |
220 |
* just a pointer to the config space. |
252 |
* just a pointer to the config space. |
221 |
*/ |
253 |
*/ |
Lines 681-686
static __init int ali_router_probe(struc
Link Here
|
681 |
switch(device) |
713 |
switch(device) |
682 |
{ |
714 |
{ |
683 |
case PCI_DEVICE_ID_AL_M1533: |
715 |
case PCI_DEVICE_ID_AL_M1533: |
|
|
716 |
printk(KERN_DEBUG "PCI: Using ALI M1533 IRQ Router\n"); |
717 |
r->name = "ALI M1533"; |
718 |
r->get = pirq_ali_m1533_get; |
719 |
r->set = pirq_ali_m1533_set; |
720 |
return 1; |
721 |
|
684 |
case PCI_DEVICE_ID_AL_M1563: |
722 |
case PCI_DEVICE_ID_AL_M1563: |
685 |
printk(KERN_DEBUG "PCI: Using ALI IRQ Router\n"); |
723 |
printk(KERN_DEBUG "PCI: Using ALI IRQ Router\n"); |
686 |
r->name = "ALI"; |
724 |
r->name = "ALI"; |