|
34 | 34 | #include <linux/of_irq.h> |
35 | 35 | #include <linux/platform_device.h> |
36 | 36 | #include <linux/pm_opp.h> |
| 37 | +#include <linux/pm_qos.h> |
37 | 38 | #include <linux/reboot.h> |
38 | 39 | #include <linux/regulator/consumer.h> |
39 | 40 | #include <linux/rockchip/rockchip_sip.h> |
@@ -808,6 +809,8 @@ struct rockchip_dmcfreq { |
808 | 809 | int (*set_auto_self_refresh)(u32 en); |
809 | 810 | }; |
810 | 811 |
|
| 812 | +static struct pm_qos_request pm_qos; |
| 813 | + |
811 | 814 | /* |
812 | 815 | * function: packaging de-skew setting to px30_ddr_dts_config_timing, |
813 | 816 | * px30_ddr_dts_config_timing will pass to trust firmware, and |
@@ -1606,8 +1609,18 @@ int rockchip_dmcfreq_wait_complete(void) |
1606 | 1609 | return 0; |
1607 | 1610 | } |
1608 | 1611 | wait_ctrl.wait_flag = -1; |
| 1612 | + |
| 1613 | + /* |
| 1614 | + * CPUs only enter WFI when idle to make sure that |
| 1615 | + * FIQn can quick response. |
| 1616 | + */ |
| 1617 | + pm_qos_update_request(&pm_qos, 0); |
| 1618 | + |
1609 | 1619 | wait_event_timeout(wait_ctrl.wait_wq, (wait_ctrl.wait_flag == 0), |
1610 | 1620 | msecs_to_jiffies(wait_ctrl.wait_time_out_ms)); |
| 1621 | + |
| 1622 | + pm_qos_update_request(&pm_qos, PM_QOS_DEFAULT_VALUE); |
| 1623 | + |
1611 | 1624 | return 0; |
1612 | 1625 | } |
1613 | 1626 |
|
@@ -2986,6 +2999,9 @@ static int rockchip_dmcfreq_probe(struct platform_device *pdev) |
2986 | 2999 | else |
2987 | 3000 | data->touchboostpulse_duration_val = 500 * USEC_PER_MSEC; |
2988 | 3001 |
|
| 3002 | + pm_qos_add_request(&pm_qos, PM_QOS_CPU_DMA_LATENCY, |
| 3003 | + PM_QOS_DEFAULT_VALUE); |
| 3004 | + |
2989 | 3005 | ret = devfreq_add_governor(&devfreq_dmc_ondemand); |
2990 | 3006 | if (ret) { |
2991 | 3007 | dev_err(dev, "Failed to add rockchip governor: %d\n", ret); |
|
0 commit comments