History

firmware: xilinx: Remove eemi ops for set_requirement

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

Rajan Vaja committed 6 years ago

Commit cbbbda71 parent 07fb1a43 files · +16 −22Browse files

Unified · Split

3 files
  1. drivers/firmware/xilinx/zynqmp.c +4 −4
  2. drivers/soc/xilinx/zynqmp_pm_domains.c +2 −14
  3. include/linux/firmware/xlnx-zynqmp.h +10 −4
drivers/firmware/xilinx/zynqmp.c+4−4
@@ -778,13 +778,14 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_release_node); · 777 unmodified lines
778778 *
779779 * Return: Returns status, either success or error+reason
780780 */
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)
784784 {
785785 return zynqmp_pm_invoke_fn(PM_SET_REQUIREMENT, node, capabilities,
786786 qos, ack, NULL);
787787 }
788+EXPORT_SYMBOL_GPL(zynqmp_pm_set_requirement);
788789
789790 /**
790791 * 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
811812 }
812813
813814 static const struct zynqmp_eemi_ops eemi_ops = {
814− .set_requirement = zynqmp_pm_set_requirement,
815815 .fpga_load = zynqmp_pm_fpga_load,
816816 .fpga_get_status = zynqmp_pm_fpga_get_status,
817817 .aes = zynqmp_pm_aes_engine,
drivers/soc/xilinx/zynqmp_pm_domains.c+2−14
@@ -23,8 +23,6 @@ · 22 unmodified lines
2323 /* Flag stating if PM nodes mapped to the PM domain has been requested */
2424 #define ZYNQMP_PM_DOMAIN_REQUESTED BIT(0)
2525
26−static const struct zynqmp_eemi_ops *eemi_ops;
27−
2826 static int min_capability;
2927
3028 /**
@@ -76,11 +74,8 @@ static int zynqmp_gpd_power_on(struct generic_pm_domain *domain) · 45 unmodified lines
7674 int ret;
7775 struct zynqmp_pm_domain *pd;
7876
79− if (!eemi_ops->set_requirement)
80− return -ENXIO;
81−
8277 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,
8479 ZYNQMP_PM_CAPABILITY_ACCESS,
8580 ZYNQMP_PM_MAX_QOS,
8681 ZYNQMP_PM_REQUEST_ACK_BLOCKING);
@@ -111,9 +106,6 @@ static int zynqmp_gpd_power_off(struct generic_pm_domain *domain) · 24 unmodified lines
111106 u32 capabilities = min_capability;
112107 bool may_wakeup;
113108
114− if (!eemi_ops->set_requirement)
115− return -ENXIO;
116−
117109 pd = container_of(domain, struct zynqmp_pm_domain, gpd);
118110
119111 /* 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
134126 }
135127 }
136128
137− ret = eemi_ops->set_requirement(pd->node_id, capabilities, 0,
129+ ret = zynqmp_pm_set_requirement(pd->node_id, capabilities, 0,
138130 ZYNQMP_PM_REQUEST_ACK_NO);
139131 /**
140132 * 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
260252 struct zynqmp_pm_domain *pd;
261253 struct device *dev = &pdev->dev;
262254
263− eemi_ops = zynqmp_pm_get_eemi_ops();
264− if (IS_ERR(eemi_ops))
265− return PTR_ERR(eemi_ops);
266−
267255 pd = devm_kcalloc(dev, ZYNQMP_NUM_DOMAINS, sizeof(*pd), GFP_KERNEL);
268256 if (!pd)
269257 return -ENOMEM;
include/linux/firmware/xlnx-zynqmp.h+10−4
@@ -296,10 +296,6 @@ struct zynqmp_pm_query_data { · 295 unmodified lines
296296 struct zynqmp_eemi_ops {
297297 int (*fpga_load)(const u64 address, const u32 size, const u32 flags);
298298 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);
303299 int (*aes)(const u64 address, u32 *out);
304300 };
305301
@@ -334,6 +330,9 @@ int zynqmp_pm_set_suspend_mode(u32 mode); · 28 unmodified lines
334330 int zynqmp_pm_request_node(const u32 node, const u32 capabilities,
335331 const u32 qos, const enum zynqmp_pm_request_ack ack);
336332 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);
337336 #else
338337 static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
339338 {
@@ -440,6 +439,13 @@ static inline int zynqmp_pm_release_node(const u32 node) · 100 unmodified lines
440439 {
441440 return -ENODEV;
442441 }
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+}
443449 #endif
444450
445451 #endif /* __FIRMWARE_ZYNQMP_H__ */