On Mon, 18 Feb 2008, [EMAIL PROTECTED] wrote:

> void pnp_set_enable(device_t dev, int enable)
> {
> -     pnp_write_config(dev, 0x30, enable?0x1:0x0);
> +     u8 tmp, bitpos;
> +
> +     tmp = pnp_read_config(dev, 0x30);
> +     /* handle the virtual devices, which share same LDN register */
> +     bitpos = (dev->path.u.pnp.device >> 8) & 0x7;
> +
> +     if (enable) {
> +             tmp |= (1 << bitpos);
> +     } else {
> +             tmp &= ~(1 << bitpos);
> +     }
> +     pnp_write_config(dev, 0x30, tmp);
> }
>
> int pnp_read_enable(device_t dev)
> {
> -     return !!pnp_read_config(dev, 0x30);
> +     u8 tmp, bitpos;
> +     tmp = pnp_read_config(dev, 0x30);
> +     /* handle the virtual devices, which share same LDN register */
> +     bitpos = (dev->path.u.pnp.device >> 8) & 0x7;
> +     return !!(tmp & bitpos);

Hmm, shouldn't the last line test the bit at *position* bitpos:

+       return !!(tmp & (1 << bitpos));


/ulf

-- 
coreboot mailing list
[email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to