Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58083
b: refs/heads/master
c: 172d049
h: refs/heads/master
i:
  58081: 2d982a2
  58079: 249547a
v: v3
  • Loading branch information
Bjorn Helgaas authored and Linus Torvalds committed Jun 28, 2007
1 parent f1c0bdc commit f7a868d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 19 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: 7c31d2f59c14191c3251f18ad1782fe6692f0c33
refs/heads/master: 172d0496cd22c98ee2e4238821fa309c01685f3a
66 changes: 48 additions & 18 deletions trunk/drivers/pnp/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,31 +107,61 @@ static void quirk_sb16audio_resources(struct pnp_dev *dev)
return;
}

static void quirk_smc_enable(struct pnp_dev *dev)
static int quirk_smc_fir_enabled(struct pnp_dev *dev)
{
unsigned int firbase;
unsigned long firbase;
u8 bank, high, low, chip;

if (!pnp_port_valid(dev, 1))
return 0;

firbase = pnp_port_start(dev, 1);

/* Select register bank 3 */
bank = inb(firbase + 7);
bank &= 0xf0;
bank |= 3;
outb(bank, firbase + 7);

high = inb(firbase + 0);
low = inb(firbase + 1);
chip = inb(firbase + 2);

/* This corresponds to the check in smsc_ircc_present() */
if (high == 0x10 && low == 0xb8 && (chip == 0xf1 || chip == 0xf2))
return 1;

return 0;
}

if (!dev->active || !pnp_port_valid(dev, 1))
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))
return;

/*
* On the HP/Compaq nw8240 (and probably other similar machines),
* there is an SMCF010 device with two I/O port regions:
*
* 0x3e8-0x3ef SIR
* 0x100-0x10f FIR
* Sometimes the BIOS claims the device is enabled, but it reports
* the wrong FIR resources or doesn't properly configure ISA or LPC
* bridges on the way to the device.
*
* _STA reports the device is enabled, but in fact, the BIOS
* neglects to enable the FIR range. Fortunately, it does fully
* enable the device if we call _SRS.
* HP nc6000 and nc8000/nw8000 laptops have known problems like
* this. Fortunately, they do fix things up if we auto-configure
* the device using its _PRS and _SRS methods.
*/
firbase = pnp_port_start(dev, 1);
if (inb(firbase + 0x7 /* IRCC_MASTER */) == 0xff) {
pnp_err("%s (%s) enabled but not responding, disabling and "
"re-enabling", dev->dev.bus_id, pnp_dev_name(dev));
pnp_disable_dev(dev);
pnp_activate_dev(dev);
}
dev_err(&dev->dev, "%s device not responding, auto-configuring "
"resources\n", dev->id->id);

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, "giving up; try \"smsc-ircc2.nopnp\"\n");
}


Expand Down

0 comments on commit f7a868d

Please sign in to comment.