// SPDX-License-Identifier: GPL-2.0-or-later /* * Eurobraille/Iris power off support. * * Eurobraille's Iris machine is a PC with no APM or ACPI support. * It is shutdown by a special I/O sequence which this module provides. * * Copyright (C) Shérab <Sebastien.Hinderer@ens-lyon.org>
*/
/* * Before installing the power_off handler, try to make sure the OS is * running on an Iris. Since Iris does not support DMI, this is done * by reading its input port and seeing whether the read value is * meaningful.
*/ staticint iris_probe(struct platform_device *pdev)
{ unsignedchar status = inb(IRIS_GIO_INPUT); if (status == IRIS_GIO_NODEV) {
printk(KERN_ERR "This machine does not seem to be an Iris. " "Power off handler not installed.\n"); return -ENODEV;
}
old_pm_power_off = pm_power_off;
pm_power_off = &iris_power_off;
printk(KERN_INFO "Iris power_off handler installed.\n"); return 0;
}
staticint iris_init(void)
{ int ret; if (force != 1) {
printk(KERN_ERR "The force parameter has not been set to 1." " The Iris poweroff handler will not be installed.\n"); return -ENODEV;
}
ret = platform_driver_register(&iris_driver); if (ret < 0) {
printk(KERN_ERR "Failed to register iris platform driver: %d\n",
ret); return ret;
}
iris_device = platform_device_register_simple("iris", (-1),
iris_resources, ARRAY_SIZE(iris_resources)); if (IS_ERR(iris_device)) {
printk(KERN_ERR "Failed to register iris platform device\n");
platform_driver_unregister(&iris_driver); return PTR_ERR(iris_device);
} return 0;
}
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.