Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1017
b: refs/heads/master
c: c835a38
h: refs/heads/master
i:
  1015: a8c1674
v: v3
  • Loading branch information
Daniel Ritz authored and Linus Torvalds committed May 5, 2005
1 parent 1f62881 commit 2f288c9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 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: c35e66a4216c99fe94868ed3f714bd2708d0032a
refs/heads/master: c835a388968f5437491e3fe6e9b0332bc3c52e0e
40 changes: 30 additions & 10 deletions trunk/drivers/pcmcia/ti113x.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,33 +442,48 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket)
}


/* changes the irq of func1 to match that of func0 */
static int ti12xx_align_irqs(struct yenta_socket *socket, int *old_irq)
{
struct pci_dev *func0;

/* find func0 device */
func0 = pci_get_slot(socket->dev->bus, socket->dev->devfn & ~0x07);
if (!func0)
return 0;

if (old_irq)
*old_irq = socket->cb_irq;
socket->cb_irq = socket->dev->irq = func0->irq;

pci_dev_put(func0);

return 1;
}

/*
* ties INTA and INTB together. also changes the devices irq to that of
* the function 0 device. call from func1 only.
* returns 1 if INTRTIE changed, 0 otherwise.
*/
static int ti12xx_tie_interrupts(struct yenta_socket *socket, int *old_irq)
{
struct pci_dev *func0;
u32 sysctl;
int ret;

sysctl = config_readl(socket, TI113X_SYSTEM_CONTROL);
if (sysctl & TI122X_SCR_INTRTIE)
return 0;

/* find func0 device */
func0 = pci_get_slot(socket->dev->bus, socket->dev->devfn & ~0x07);
if (!func0)
/* align */
ret = ti12xx_align_irqs(socket, old_irq);
if (!ret)
return 0;

/* change the interrupt to match func0, tie 'em up */
*old_irq = socket->cb_irq;
socket->cb_irq = socket->dev->irq = func0->irq;
/* tie */
sysctl |= TI122X_SCR_INTRTIE;
config_writel(socket, TI113X_SYSTEM_CONTROL, sysctl);

pci_dev_put(func0);

return 1;
}

Expand All @@ -489,14 +504,19 @@ static void ti12xx_untie_interrupts(struct yenta_socket *socket, int old_irq)
*/
static void ti12xx_irqroute_func1(struct yenta_socket *socket)
{
u32 mfunc, mfunc_old, devctl;
u32 mfunc, mfunc_old, devctl, sysctl;
int pci_irq_status;

mfunc = mfunc_old = config_readl(socket, TI122X_MFUNC);
devctl = config_readb(socket, TI113X_DEVICE_CONTROL);
printk(KERN_INFO "Yenta TI: socket %s, mfunc 0x%08x, devctl 0x%02x\n",
pci_name(socket->dev), mfunc, devctl);

/* if IRQs are configured as tied, align irq of func1 with func0 */
sysctl = config_readl(socket, TI113X_SYSTEM_CONTROL);
if (sysctl & TI122X_SCR_INTRTIE)
ti12xx_align_irqs(socket, NULL);

/* make sure PCI interrupts are enabled before probing */
ti_init(socket);

Expand Down

0 comments on commit 2f288c9

Please sign in to comment.