// SPDX-License-Identifier: GPL-2.0-only /* * Force-disables a regulator to power down a device * * Michael Klein <michael@fossekall.de> * * Copyright (C) 2020 Michael Klein * * Based on the gpio-poweroff driver.
*/ #include <linux/delay.h> #include <linux/module.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pm.h> #include <linux/reboot.h> #include <linux/regulator/consumer.h>
cpu_regulator = devm_regulator_get(&pdev->dev, "cpu"); if (IS_ERR(cpu_regulator)) return PTR_ERR(cpu_regulator);
/* Set this handler to low priority to not override an existing handler */ return devm_register_sys_off_handler(&pdev->dev,
SYS_OFF_MODE_POWER_OFF,
SYS_OFF_PRIO_LOW,
regulator_poweroff_do_poweroff,
cpu_regulator);
}
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.