Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

firmware: xilinx: add register notifier in zynqmp firmware

In zynqmp-firmware, register notifier is not supported, add support of
register notifier in zynqmp-firmware.

Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tejas Patel <tejas.patel@xilinx.com>
Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Link: https://lore.kernel.org/r/20211026042525.26612-2-abhyuday.godhasara@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Abhyuday Godhasara and committed by
Greg Kroah-Hartman
1881eadb fbf3443f

+33 -1
+23
drivers/firmware/xilinx/zynqmp.c
··· 1117 1117 EXPORT_SYMBOL_GPL(zynqmp_pm_aes_engine); 1118 1118 1119 1119 /** 1120 + * zynqmp_pm_register_notifier() - PM API for register a subsystem 1121 + * to be notified about specific 1122 + * event/error. 1123 + * @node: Node ID to which the event is related. 1124 + * @event: Event Mask of Error events for which wants to get notified. 1125 + * @wake: Wake subsystem upon capturing the event if value 1 1126 + * @enable: Enable the registration for value 1, disable for value 0 1127 + * 1128 + * This function is used to register/un-register for particular node-event 1129 + * combination in firmware. 1130 + * 1131 + * Return: Returns status, either success or error+reason 1132 + */ 1133 + 1134 + int zynqmp_pm_register_notifier(const u32 node, const u32 event, 1135 + const u32 wake, const u32 enable) 1136 + { 1137 + return zynqmp_pm_invoke_fn(PM_REGISTER_NOTIFIER, node, event, 1138 + wake, enable, NULL); 1139 + } 1140 + EXPORT_SYMBOL_GPL(zynqmp_pm_register_notifier); 1141 + 1142 + /** 1120 1143 * zynqmp_pm_system_shutdown - PM call to request a system shutdown or restart 1121 1144 * @type: Shutdown or restart? 0 for shutdown, 1 for restart 1122 1145 * @subtype: Specifies which system should be restarted or shut down
+10 -1
include/linux/firmware/xlnx-zynqmp.h
··· 2 2 /* 3 3 * Xilinx Zynq MPSoC Firmware layer 4 4 * 5 - * Copyright (C) 2014-2019 Xilinx 5 + * Copyright (C) 2014-2021 Xilinx 6 6 * 7 7 * Michal Simek <michal.simek@xilinx.com> 8 8 * Davorin Mista <davorin.mista@aggios.com> ··· 66 66 67 67 enum pm_api_id { 68 68 PM_GET_API_VERSION = 1, 69 + PM_REGISTER_NOTIFIER = 5, 69 70 PM_SYSTEM_SHUTDOWN = 12, 70 71 PM_REQUEST_NODE = 13, 71 72 PM_RELEASE_NODE = 14, ··· 428 427 int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param, 429 428 u32 value); 430 429 int zynqmp_pm_load_pdi(const u32 src, const u64 address); 430 + int zynqmp_pm_register_notifier(const u32 node, const u32 event, 431 + const u32 wake, const u32 enable); 431 432 #else 432 433 static inline int zynqmp_pm_get_api_version(u32 *version) 433 434 { ··· 658 655 } 659 656 660 657 static inline int zynqmp_pm_load_pdi(const u32 src, const u64 address) 658 + { 659 + return -ENODEV; 660 + } 661 + 662 + static inline int zynqmp_pm_register_notifier(const u32 node, const u32 event, 663 + const u32 wake, const u32 enable) 661 664 { 662 665 return -ENODEV; 663 666 }