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

firmware: xilinx: Remove eemi ops for set_requirement

Use direct function call instead of using eemi ops for
set_requirement.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Jolly Shah <jolly.shah@xilinx.com>
Link: https://lore.kernel.org/r/1587761887-4279-19-git-send-email-jolly.shah@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Rajan Vaja and committed by
Greg Kroah-Hartman
cbbbda71 07fb1a46

+16 -22
+4 -4
drivers/firmware/xilinx/zynqmp.c
··· 778 778 * 779 779 * Return: Returns status, either success or error+reason 780 780 */ 781 - static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, 782 - const u32 qos, 783 - const enum zynqmp_pm_request_ack ack) 781 + int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, 782 + const u32 qos, 783 + const enum zynqmp_pm_request_ack ack) 784 784 { 785 785 return zynqmp_pm_invoke_fn(PM_SET_REQUIREMENT, node, capabilities, 786 786 qos, ack, NULL); 787 787 } 788 + EXPORT_SYMBOL_GPL(zynqmp_pm_set_requirement); 788 789 789 790 /** 790 791 * zynqmp_pm_aes - Access AES hardware to encrypt/decrypt the data using ··· 812 811 } 813 812 814 813 static const struct zynqmp_eemi_ops eemi_ops = { 815 - .set_requirement = zynqmp_pm_set_requirement, 816 814 .fpga_load = zynqmp_pm_fpga_load, 817 815 .fpga_get_status = zynqmp_pm_fpga_get_status, 818 816 .aes = zynqmp_pm_aes_engine,
+2 -14
drivers/soc/xilinx/zynqmp_pm_domains.c
··· 23 23 /* Flag stating if PM nodes mapped to the PM domain has been requested */ 24 24 #define ZYNQMP_PM_DOMAIN_REQUESTED BIT(0) 25 25 26 - static const struct zynqmp_eemi_ops *eemi_ops; 27 - 28 26 static int min_capability; 29 27 30 28 /** ··· 74 76 int ret; 75 77 struct zynqmp_pm_domain *pd; 76 78 77 - if (!eemi_ops->set_requirement) 78 - return -ENXIO; 79 - 80 79 pd = container_of(domain, struct zynqmp_pm_domain, gpd); 81 - ret = eemi_ops->set_requirement(pd->node_id, 80 + ret = zynqmp_pm_set_requirement(pd->node_id, 82 81 ZYNQMP_PM_CAPABILITY_ACCESS, 83 82 ZYNQMP_PM_MAX_QOS, 84 83 ZYNQMP_PM_REQUEST_ACK_BLOCKING); ··· 106 111 u32 capabilities = min_capability; 107 112 bool may_wakeup; 108 113 109 - if (!eemi_ops->set_requirement) 110 - return -ENXIO; 111 - 112 114 pd = container_of(domain, struct zynqmp_pm_domain, gpd); 113 115 114 116 /* If domain is already released there is nothing to be done */ ··· 126 134 } 127 135 } 128 136 129 - ret = eemi_ops->set_requirement(pd->node_id, capabilities, 0, 137 + ret = zynqmp_pm_set_requirement(pd->node_id, capabilities, 0, 130 138 ZYNQMP_PM_REQUEST_ACK_NO); 131 139 /** 132 140 * If powering down of any node inside this domain fails, ··· 251 259 struct generic_pm_domain **domains; 252 260 struct zynqmp_pm_domain *pd; 253 261 struct device *dev = &pdev->dev; 254 - 255 - eemi_ops = zynqmp_pm_get_eemi_ops(); 256 - if (IS_ERR(eemi_ops)) 257 - return PTR_ERR(eemi_ops); 258 262 259 263 pd = devm_kcalloc(dev, ZYNQMP_NUM_DOMAINS, sizeof(*pd), GFP_KERNEL); 260 264 if (!pd)
+10 -4
include/linux/firmware/xlnx-zynqmp.h
··· 296 296 struct zynqmp_eemi_ops { 297 297 int (*fpga_load)(const u64 address, const u32 size, const u32 flags); 298 298 int (*fpga_get_status)(u32 *value); 299 - int (*set_requirement)(const u32 node, 300 - const u32 capabilities, 301 - const u32 qos, 302 - const enum zynqmp_pm_request_ack ack); 303 299 int (*aes)(const u64 address, u32 *out); 304 300 }; 305 301 ··· 330 334 int zynqmp_pm_request_node(const u32 node, const u32 capabilities, 331 335 const u32 qos, const enum zynqmp_pm_request_ack ack); 332 336 int zynqmp_pm_release_node(const u32 node); 337 + int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, 338 + const u32 qos, 339 + const enum zynqmp_pm_request_ack ack); 333 340 #else 334 341 static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void) 335 342 { ··· 436 437 return -ENODEV; 437 438 } 438 439 static inline int zynqmp_pm_release_node(const u32 node) 440 + { 441 + return -ENODEV; 442 + } 443 + static inline int zynqmp_pm_set_requirement(const u32 node, 444 + const u32 capabilities, 445 + const u32 qos, 446 + const enum zynqmp_pm_request_ack ack) 439 447 { 440 448 return -ENODEV; 441 449 }