summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/xilinx
diff options
context:
space:
mode:
authorRajan Vaja <rajan.vaja@xilinx.com>2020-04-24 22:58:05 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-28 15:46:54 +0200
commitfdd2ed88ca971376669bce145f1a1bcf028d775e (patch)
treee1bbaaeefb8b67772182647476617741068dd614 /drivers/firmware/xilinx
parentfirmware: xilinx: Add sysfs interface (diff)
downloadlinux-fdd2ed88ca971376669bce145f1a1bcf028d775e.tar.xz
linux-fdd2ed88ca971376669bce145f1a1bcf028d775e.zip
firmware: xilinx: Add system shutdown API interface
Add system shutdown API interface which asks firmware to perform system shutdown/restart. Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Jolly Shah <jolly.shah@xilinx.com> Link: https://lore.kernel.org/r/1587761887-4279-24-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/firmware/xilinx')
-rw-r--r--drivers/firmware/xilinx/zynqmp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
index 2fe4f57c005a..9ba376cfc81f 100644
--- a/drivers/firmware/xilinx/zynqmp.c
+++ b/drivers/firmware/xilinx/zynqmp.c
@@ -875,6 +875,19 @@ int zynqmp_pm_aes_engine(const u64 address, u32 *out)
}
EXPORT_SYMBOL_GPL(zynqmp_pm_aes_engine);
+/**
+ * zynqmp_pm_system_shutdown - PM call to request a system shutdown or restart
+ * @type: Shutdown or restart? 0 for shutdown, 1 for restart
+ * @subtype: Specifies which system should be restarted or shut down
+ *
+ * Return: Returns status, either success or error+reason
+ */
+int zynqmp_pm_system_shutdown(const u32 type, const u32 subtype)
+{
+ return zynqmp_pm_invoke_fn(PM_SYSTEM_SHUTDOWN, type, subtype,
+ 0, 0, NULL);
+}
+
static ssize_t ggs_show(struct device *device,
struct device_attribute *attr,
char *buf,