Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58225
b: refs/heads/master
c: 41a5311
h: refs/heads/master
i:
  58223: 3b3e2bb
v: v3
  • Loading branch information
Bjorn Helgaas authored and Linus Torvalds committed Jul 6, 2007
1 parent 734b9d9 commit 2edce22
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 10 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: d57d973101e87b2e30ccfa899fe36c4b2e32d217
refs/heads/master: 41a5311465b9de6d18e78b733a2c6e1b33e89be8
63 changes: 54 additions & 9 deletions trunk/drivers/pnp/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,10 @@ static int quirk_smc_fir_enabled(struct pnp_dev *dev)

static void quirk_smc_enable(struct pnp_dev *dev)
{
/*
* If the BIOS left the device disabled, or it is enabled and
* responding correctly, we're in good shape.
*/
if (!dev->active || quirk_smc_fir_enabled(dev))
struct resource fir, sir, irq;

pnp_activate_dev(dev);
if (quirk_smc_fir_enabled(dev))
return;

/*
Expand All @@ -152,16 +151,62 @@ static void quirk_smc_enable(struct pnp_dev *dev)
* this. Fortunately, they do fix things up if we auto-configure
* the device using its _PRS and _SRS methods.
*/
dev_err(&dev->dev, "%s device not responding, auto-configuring "
"resources\n", dev->id->id);
dev_err(&dev->dev, "%s not responding at SIR 0x%lx, FIR 0x%lx; "
"auto-configuring\n", dev->id->id,
(unsigned long) pnp_port_start(dev, 0),
(unsigned long) pnp_port_start(dev, 1));

pnp_disable_dev(dev);
pnp_init_resource_table(&dev->res);
pnp_auto_config_dev(dev);
pnp_activate_dev(dev);
if (quirk_smc_fir_enabled(dev)) {
dev_err(&dev->dev, "responds at SIR 0x%lx, FIR 0x%lx\n",
(unsigned long) pnp_port_start(dev, 0),
(unsigned long) pnp_port_start(dev, 1));
return;
}

/*
* The Toshiba Portege 4000 _CRS reports the FIR region first,
* followed by the SIR region. The BIOS will configure the bridge,
* but only if we call _SRS with SIR first, then FIR. It also
* reports the IRQ as active high, when it is really active low.
*/
dev_err(&dev->dev, "not responding at SIR 0x%lx, FIR 0x%lx; "
"swapping SIR/FIR and reconfiguring\n",
(unsigned long) pnp_port_start(dev, 0),
(unsigned long) pnp_port_start(dev, 1));

/*
* Clear IORESOURCE_AUTO so pnp_activate_dev() doesn't reassign
* these resources any more.
*/
fir = dev->res.port_resource[0];
sir = dev->res.port_resource[1];
fir.flags &= ~IORESOURCE_AUTO;
sir.flags &= ~IORESOURCE_AUTO;

irq = dev->res.irq_resource[0];
irq.flags &= ~IORESOURCE_AUTO;
irq.flags &= ~IORESOURCE_BITS;
irq.flags |= IORESOURCE_IRQ_LOWEDGE;

pnp_disable_dev(dev);
dev->res.port_resource[0] = sir;
dev->res.port_resource[1] = fir;
dev->res.irq_resource[0] = irq;
pnp_activate_dev(dev);

if (quirk_smc_fir_enabled(dev)) {
dev_err(&dev->dev, "responds at SIR 0x%lx, FIR 0x%lx\n",
(unsigned long) pnp_port_start(dev, 0),
(unsigned long) pnp_port_start(dev, 1));
return;
}

if (!quirk_smc_fir_enabled(dev))
dev_err(&dev->dev, "giving up; try \"smsc-ircc2.nopnp\"\n");
dev_err(&dev->dev, "giving up; try \"smsc-ircc2.nopnp\" and "
"email bjorn.helgaas@hp.com\n");
}


Expand Down

0 comments on commit 2edce22

Please sign in to comment.