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 | * Return: Returns status, either success or error+reason | 779 | * Return: Returns status, either success or error+reason |
| 780 | */ | 780 | */ |
| 781 | static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, | 781 | int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, |
| 782 | const u32 qos, | 782 | const u32 qos, |
| 783 | const enum zynqmp_pm_request_ack ack) | 783 | const enum zynqmp_pm_request_ack ack) |
| 784 | { | 784 | { |
| 785 | return zynqmp_pm_invoke_fn(PM_SET_REQUIREMENT, node, capabilities, | 785 | return zynqmp_pm_invoke_fn(PM_SET_REQUIREMENT, node, capabilities, |
| 786 | qos, ack, NULL); | 786 | qos, ack, NULL); |
| 787 | } | 787 | } |
| 788 | EXPORT_SYMBOL_GPL(zynqmp_pm_set_requirement); | ||
| 788 | 789 | ||
| 789 | /** | 790 | /** |
| 790 | * zynqmp_pm_aes - Access AES hardware to encrypt/decrypt the data using | 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 | static const struct zynqmp_eemi_ops eemi_ops = { | 814 | static const struct zynqmp_eemi_ops eemi_ops = { |
| 814 | .set_requirement = zynqmp_pm_set_requirement, | ||
| 815 | .fpga_load = zynqmp_pm_fpga_load, | 815 | .fpga_load = zynqmp_pm_fpga_load, |
| 816 | .fpga_get_status = zynqmp_pm_fpga_get_status, | 816 | .fpga_get_status = zynqmp_pm_fpga_get_status, |
| 817 | .aes = zynqmp_pm_aes_engine, | 817 | .aes = zynqmp_pm_aes_engine, |
| @@ -23,8 +23,6 @@ · 22 unmodified lines | |||
| 23 | /* Flag stating if PM nodes mapped to the PM domain has been requested */ | 23 | /* Flag stating if PM nodes mapped to the PM domain has been requested */ |
| 24 | #define ZYNQMP_PM_DOMAIN_REQUESTED BIT(0) | 24 | #define ZYNQMP_PM_DOMAIN_REQUESTED BIT(0) |
| 25 | 25 | ||
| 26 | static const struct zynqmp_eemi_ops *eemi_ops; | ||
| 27 | |||
| 28 | static int min_capability; | 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 | int ret; | 74 | int ret; |
| 77 | struct zynqmp_pm_domain *pd; | 75 | struct zynqmp_pm_domain *pd; |
| 78 | 76 | ||
| 79 | if (!eemi_ops->set_requirement) | ||
| 80 | return -ENXIO; | ||
| 81 | |||
| 82 | pd = container_of(domain, struct zynqmp_pm_domain, gpd); | 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 | ZYNQMP_PM_CAPABILITY_ACCESS, | 79 | ZYNQMP_PM_CAPABILITY_ACCESS, |
| 85 | ZYNQMP_PM_MAX_QOS, | 80 | ZYNQMP_PM_MAX_QOS, |
| 86 | ZYNQMP_PM_REQUEST_ACK_BLOCKING); | 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 | u32 capabilities = min_capability; | 106 | u32 capabilities = min_capability; |
| 112 | bool may_wakeup; | 107 | bool may_wakeup; |
| 113 | 108 | ||
| 114 | if (!eemi_ops->set_requirement) | ||
| 115 | return -ENXIO; | ||
| 116 | |||
| 117 | pd = container_of(domain, struct zynqmp_pm_domain, gpd); | 109 | pd = container_of(domain, struct zynqmp_pm_domain, gpd); |
| 118 | 110 | ||
| 119 | /* If domain is already released there is nothing to be done */ | 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 | ZYNQMP_PM_REQUEST_ACK_NO); | 130 | ZYNQMP_PM_REQUEST_ACK_NO); |
| 139 | /** | 131 | /** |
| 140 | * If powering down of any node inside this domain fails, | 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 | struct zynqmp_pm_domain *pd; | 252 | struct zynqmp_pm_domain *pd; |
| 261 | struct device *dev = &pdev->dev; | 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 | pd = devm_kcalloc(dev, ZYNQMP_NUM_DOMAINS, sizeof(*pd), GFP_KERNEL); | 255 | pd = devm_kcalloc(dev, ZYNQMP_NUM_DOMAINS, sizeof(*pd), GFP_KERNEL); |
| 268 | if (!pd) | 256 | if (!pd) |
| 269 | return -ENOMEM; | 257 | return -ENOMEM; |
| @@ -296,10 +296,6 @@ struct zynqmp_pm_query_data { · 295 unmodified lines | |||
| 296 | struct zynqmp_eemi_ops { | 296 | struct zynqmp_eemi_ops { |
| 297 | int (*fpga_load)(const u64 address, const u32 size, const u32 flags); | 297 | int (*fpga_load)(const u64 address, const u32 size, const u32 flags); |
| 298 | int (*fpga_get_status)(u32 *value); | 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 | int (*aes)(const u64 address, u32 *out); | 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 | int zynqmp_pm_request_node(const u32 node, const u32 capabilities, | 330 | int zynqmp_pm_request_node(const u32 node, const u32 capabilities, |
| 335 | const u32 qos, const enum zynqmp_pm_request_ack ack); | 331 | const u32 qos, const enum zynqmp_pm_request_ack ack); |
| 336 | int zynqmp_pm_release_node(const u32 node); | 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 | #else | 336 | #else |
| 338 | static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void) | 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 | return -ENODEV; | 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 | #endif | 449 | #endif |
| 444 | 450 | ||
| 445 | #endif /* __FIRMWARE_ZYNQMP_H__ */ | 451 | #endif /* __FIRMWARE_ZYNQMP_H__ */ |