Commit 5a0e5fa9 authored by Maciej W. Rozycki's avatar Maciej W. Rozycki Committed by Thomas Gleixner

x86/PCI: Disambiguate SiS85C503 PIRQ router code entities

In preparation to adding support for the SiS85C497 PIRQ router add `503' 
to the names of SiS85C503 PIRQ router code entities so that they clearly 
indicate which device they refer to.

Also restructure `sis_router_probe' such that new device IDs will be 
just new switch cases.

No functional change.
Signed-off-by: default avatarMaciej W. Rozycki <macro@orcam.me.uk>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/alpine.DEB.2.21.2203301610000.22465@angie.orcam.me.uk
parent d88a8b1c
...@@ -641,11 +641,12 @@ static int pirq_cyrix_set(struct pci_dev *router, struct pci_dev *dev, int pirq, ...@@ -641,11 +641,12 @@ static int pirq_cyrix_set(struct pci_dev *router, struct pci_dev *dev, int pirq,
* bit 6-4 are probably unused, not like 5595 * bit 6-4 are probably unused, not like 5595
*/ */
#define PIRQ_SIS_IRQ_MASK 0x0f #define PIRQ_SIS503_IRQ_MASK 0x0f
#define PIRQ_SIS_IRQ_DISABLE 0x80 #define PIRQ_SIS503_IRQ_DISABLE 0x80
#define PIRQ_SIS_USB_ENABLE 0x40 #define PIRQ_SIS503_USB_ENABLE 0x40
static int pirq_sis_get(struct pci_dev *router, struct pci_dev *dev, int pirq) static int pirq_sis503_get(struct pci_dev *router, struct pci_dev *dev,
int pirq)
{ {
u8 x; u8 x;
int reg; int reg;
...@@ -654,10 +655,11 @@ static int pirq_sis_get(struct pci_dev *router, struct pci_dev *dev, int pirq) ...@@ -654,10 +655,11 @@ static int pirq_sis_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
if (reg >= 0x01 && reg <= 0x04) if (reg >= 0x01 && reg <= 0x04)
reg += 0x40; reg += 0x40;
pci_read_config_byte(router, reg, &x); pci_read_config_byte(router, reg, &x);
return (x & PIRQ_SIS_IRQ_DISABLE) ? 0 : (x & PIRQ_SIS_IRQ_MASK); return (x & PIRQ_SIS503_IRQ_DISABLE) ? 0 : (x & PIRQ_SIS503_IRQ_MASK);
} }
static int pirq_sis_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) static int pirq_sis503_set(struct pci_dev *router, struct pci_dev *dev,
int pirq, int irq)
{ {
u8 x; u8 x;
int reg; int reg;
...@@ -666,8 +668,8 @@ static int pirq_sis_set(struct pci_dev *router, struct pci_dev *dev, int pirq, i ...@@ -666,8 +668,8 @@ static int pirq_sis_set(struct pci_dev *router, struct pci_dev *dev, int pirq, i
if (reg >= 0x01 && reg <= 0x04) if (reg >= 0x01 && reg <= 0x04)
reg += 0x40; reg += 0x40;
pci_read_config_byte(router, reg, &x); pci_read_config_byte(router, reg, &x);
x &= ~(PIRQ_SIS_IRQ_MASK | PIRQ_SIS_IRQ_DISABLE); x &= ~(PIRQ_SIS503_IRQ_MASK | PIRQ_SIS503_IRQ_DISABLE);
x |= irq ? irq: PIRQ_SIS_IRQ_DISABLE; x |= irq ? irq : PIRQ_SIS503_IRQ_DISABLE;
pci_write_config_byte(router, reg, x); pci_write_config_byte(router, reg, x);
return 1; return 1;
} }
...@@ -959,13 +961,14 @@ static __init int serverworks_router_probe(struct irq_router *r, ...@@ -959,13 +961,14 @@ static __init int serverworks_router_probe(struct irq_router *r,
static __init int sis_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) static __init int sis_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
{ {
if (device != PCI_DEVICE_ID_SI_503) switch (device) {
return 0; case PCI_DEVICE_ID_SI_503:
r->name = "SiS85C503";
r->name = "SIS"; r->get = pirq_sis503_get;
r->get = pirq_sis_get; r->set = pirq_sis503_set;
r->set = pirq_sis_set;
return 1; return 1;
}
return 0;
} }
static __init int cyrix_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) static __init int cyrix_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment