public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 2.4.30 PicoPower IRQ router
@ 2005-04-25  7:36 Sune Mølgaard
  2005-04-26 15:40 ` Alessandro Amici
  0 siblings, 1 reply; 8+ messages in thread
From: Sune Mølgaard @ 2005-04-25  7:36 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 263 bytes --]

The following patch fixes Picopower PT86C523 (found in e.g. Dell 
Latitude XPI P150CD and, so I've heard, IBM Thinkpad 760 series) getting 
irq 0, and thus not working with yenta.
Patch is made from recommendations from David Hinds.

Best regards,

Sune Mølgaard

[-- Attachment #2: linux-2.4.30-pico.patch --]
[-- Type: text/x-patch, Size: 1612 bytes --]

--- linux-2.4.30/arch/i386/kernel/pci-irq.c	2005-04-04 03:42:19.000000000 +0200
+++ linux/arch/i386/kernel/pci-irq.c	2005-04-25 08:43:02.501678464 +0200
@@ -157,6 +157,25 @@
 }
 
 /*
+ * PicoPower PT86C523
+ */
+
+static int pirq_pico_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
+{
+  outb(0x10+((pirq-1)>>1), 0x24);
+  return ((pirq-1)&1) ? (inb(0x26)>>4) : (inb(0x26)&0xf);
+}
+
+static int pirq_pico_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) 
+{ 
+  outb(0x10+((pirq-1)>>1), 0x24);
+  unsigned int x;
+  x = inb(0x26); 
+  x = ((pirq-1)&1) ? ((x&0x0f)|(irq<<4)) : ((x&0xf0)|(irq)); 
+  outb(x,0x26); 
+} 
+
+/*
  * ALI pirq entries are damn ugly, and completely undocumented.
  * This has been figured out from pirq tables, and it's not a pretty
  * picture.
@@ -609,6 +628,23 @@
 
 #endif
 
+static __init int pico_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
+{
+  switch(device)
+  {
+    case 0x0002:
+      r->name = "PicoPower PT86C523";
+      r->get = pirq_pico_get;
+      r->set = pirq_pico_set;
+      return 1;
+
+    case 0x8002:
+      r->name = "PicoPower PT86C523 rev. BB+";
+      r->get = pirq_pico_get;
+      r->set = pirq_pico_set;
+      return 1;
+  }
+}
 
 static __init int intel_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
 {
@@ -814,6 +850,7 @@
 }
 		
 static __initdata struct irq_router_handler pirq_routers[] = {
+        { 0x1066, pico_router_probe },
 	{ PCI_VENDOR_ID_INTEL, intel_router_probe },
 	{ PCI_VENDOR_ID_AL, ali_router_probe },
 	{ PCI_VENDOR_ID_ITE, ite_router_probe },

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-04-30 12:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-25  7:36 [PATCH] 2.4.30 PicoPower IRQ router Sune Mølgaard
2005-04-26 15:40 ` Alessandro Amici
2005-04-26 19:00   ` Sune Mølgaard
2005-04-27 11:28     ` Domen Puncer
2005-04-27 18:24       ` Sune Mølgaard
2005-04-27 21:00         ` Jesper Juhl
2005-04-28 10:36           ` Sune Mølgaard
2005-04-30 12:34           ` Sune Mølgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox