staticvoid piix4_poweroff(void)
{ int spec_devid;
u16 sts;
/* Ensure the power button status is clear */ while (1) {
sts = inw(io_offset + PIIX4_FUNC3IO_PMSTS); if (!(sts & PIIX4_FUNC3IO_PMSTS_PWRBTN_STS)) break;
outw(sts, io_offset + PIIX4_FUNC3IO_PMSTS);
}
/* If the special cycle occurs too soon this doesn't work... */
mdelay(10);
/* * The PIIX4 will enter the suspend state only after seeing a special * cycle with the correct magic data on the PCI bus. Generate that * cycle now.
*/
spec_devid = PCI_DEVID(0, PCI_DEVFN(0x1f, 0x7));
pci_bus_write_config_dword(pm_dev->bus, spec_devid, 0,
PIIX4_SUSPEND_MAGIC);
/* Give the system some time to power down, then error */
mdelay(1000);
pr_emerg("Unable to poweroff system\n");
}
staticint piix4_poweroff_probe(struct pci_dev *dev, conststruct pci_device_id *id)
{ int res;
if (pm_dev) return -EINVAL;
/* Request access to the PIIX4 PM IO registers */
res = pci_request_region(dev, piix4_pm_io_region, "PIIX4 PM IO registers"); if (res) {
dev_err(&dev->dev, "failed to request PM IO registers: %d\n",
res); return res;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.