Use direct function call instead of using eemi ops for set_requirement.
Unified · Split
| @@ -778,13 +778,14 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_release_node); · 777 unmodified lines | ||
| 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 |
| @@ -811,7 +812,6 @@ static int zynqmp_pm_aes_engine(const u64 address, u32 *out) · 20 unmodified lines | ||
| 811 | 812 | } |
| 812 | 813 | |
| 813 | 814 | static const struct zynqmp_eemi_ops eemi_ops = { |
| 814 | − .set_requirement = zynqmp_pm_set_requirement, | |
| 815 | 815 | .fpga_load = zynqmp_pm_fpga_load, |
| 816 | 816 | .fpga_get_status = zynqmp_pm_fpga_get_status, |
| 817 | 817 | .aes = zynqmp_pm_aes_engine, |
| @@ -23,8 +23,6 @@ · 22 unmodified lines | ||
| 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 | /** |
| @@ -76,11 +74,8 @@ static int zynqmp_gpd_power_on(struct generic_pm_domain *domain) · 45 unmodified lines | ||
| 76 | 74 | int ret; |
| 77 | 75 | struct zynqmp_pm_domain *pd; |
| 78 | 76 | |
| 79 | − if (!eemi_ops->set_requirement) | |
| 80 | − return -ENXIO; | |
| 81 | − | |
| 82 | 77 | pd = container_of(domain, struct zynqmp_pm_domain, gpd); |
| 83 | − ret = eemi_ops->set_requirement(pd->node_id, | |
| 78 | + ret = zynqmp_pm_set_requirement(pd->node_id, | |
| 84 | 79 | ZYNQMP_PM_CAPABILITY_ACCESS, |
| 85 | 80 | ZYNQMP_PM_MAX_QOS, |
| 86 | 81 | ZYNQMP_PM_REQUEST_ACK_BLOCKING); |
| @@ -111,9 +106,6 @@ static int zynqmp_gpd_power_off(struct generic_pm_domain *domain) · 24 unmodified lines | ||
| 111 | 106 | u32 capabilities = min_capability; |
| 112 | 107 | bool may_wakeup; |
| 113 | 108 | |
| 114 | − if (!eemi_ops->set_requirement) | |
| 115 | − return -ENXIO; | |
| 116 | − | |
| 117 | 109 | pd = container_of(domain, struct zynqmp_pm_domain, gpd); |
| 118 | 110 | |
| 119 | 111 | /* If domain is already released there is nothing to be done */ |
| @@ -134,7 +126,7 @@ static int zynqmp_gpd_power_off(struct generic_pm_domain *domain) · 14 unmodified lines | ||
| 134 | 126 | } |
| 135 | 127 | } |
| 136 | 128 | |
| 137 | − ret = eemi_ops->set_requirement(pd->node_id, capabilities, 0, | |
| 129 | + ret = zynqmp_pm_set_requirement(pd->node_id, capabilities, 0, | |
| 138 | 130 | ZYNQMP_PM_REQUEST_ACK_NO); |
| 139 | 131 | /** |
| 140 | 132 | * If powering down of any node inside this domain fails, |
| @@ -260,10 +252,6 @@ static int zynqmp_gpd_probe(struct platform_device *pdev) · 119 unmodified lines | ||
| 260 | 252 | struct zynqmp_pm_domain *pd; |
| 261 | 253 | struct device *dev = &pdev->dev; |
| 262 | 254 | |
| 263 | − eemi_ops = zynqmp_pm_get_eemi_ops(); | |
| 264 | − if (IS_ERR(eemi_ops)) | |
| 265 | − return PTR_ERR(eemi_ops); | |
| 266 | − | |
| 267 | 255 | pd = devm_kcalloc(dev, ZYNQMP_NUM_DOMAINS, sizeof(*pd), GFP_KERNEL); |
| 268 | 256 | if (!pd) |
| 269 | 257 | return -ENOMEM; |
| @@ -296,10 +296,6 @@ struct zynqmp_pm_query_data { · 295 unmodified lines | ||
| 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 | |
| @@ -334,6 +330,9 @@ int zynqmp_pm_set_suspend_mode(u32 mode); · 28 unmodified lines | ||
| 334 | 330 | int zynqmp_pm_request_node(const u32 node, const u32 capabilities, |
| 335 | 331 | const u32 qos, const enum zynqmp_pm_request_ack ack); |
| 336 | 332 | int zynqmp_pm_release_node(const u32 node); |
| 333 | +int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, | |
| 334 | + const u32 qos, | |
| 335 | + const enum zynqmp_pm_request_ack ack); | |
| 337 | 336 | #else |
| 338 | 337 | static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void) |
| 339 | 338 | { |
| @@ -440,6 +439,13 @@ static inline int zynqmp_pm_release_node(const u32 node) · 100 unmodified lines | ||
| 440 | 439 | { |
| 441 | 440 | return -ENODEV; |
| 442 | 441 | } |
| 442 | +static inline int zynqmp_pm_set_requirement(const u32 node, | |
| 443 | + const u32 capabilities, | |
| 444 | + const u32 qos, | |
| 445 | + const enum zynqmp_pm_request_ack ack) | |
| 446 | +{ | |
| 447 | + return -ENODEV; | |
| 448 | +} | |
| 443 | 449 | #endif |
| 444 | 450 | |
| 445 | 451 | #endif /* __FIRMWARE_ZYNQMP_H__ */ |