hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/video/rockchip/mpp/mpp_vdpp.c
....@@ -18,8 +18,6 @@
1818 #include <linux/uaccess.h>
1919 #include <linux/regmap.h>
2020 #include <linux/proc_fs.h>
21
-#include <linux/mfd/syscon.h>
22
-#include <linux/rockchip/cpu.h>
2321 #include <soc/rockchip/pm_domains.h>
2422
2523 #include "mpp_debug.h"
....@@ -91,7 +89,6 @@
9189 struct reset_control *rst_s;
9290 /* for zme */
9391 void __iomem *zme_base;
94
- struct regmap *grf;
9592 };
9693
9794 static struct vdpp_hw_info vdpp_v1_hw_info = {
....@@ -312,6 +309,7 @@
312309 struct vdpp_dev *vdpp = to_vdpp_dev(mpp);
313310 struct vdpp_task *task = to_vdpp_task(mpp_task);
314311 struct vdpp_hw_info *hw_info = vdpp->hw_info;
312
+ u32 timing_en = mpp->srv->timing_en;
315313
316314 mpp_debug_enter();
317315
....@@ -342,9 +340,13 @@
342340
343341 /* init current task */
344342 mpp->cur_task = mpp_task;
343
+
344
+ mpp_task_run_begin(mpp_task, timing_en, MPP_WORK_TIMEOUT_DELAY);
345345 /* Flush the register before the start the device */
346346 wmb();
347347 mpp_write(mpp, hw_info->start_base, task->reg[reg_en]);
348
+
349
+ mpp_task_run_end(mpp_task, timing_en);
348350
349351 mpp_debug_leave();
350352
....@@ -481,8 +483,6 @@
481483 {
482484 int ret;
483485 struct vdpp_dev *vdpp = to_vdpp_dev(mpp);
484
-
485
- mpp->grf_info = &mpp->srv->grf_infos[MPP_DRIVER_VDPP];
486486
487487 /* Get clock info from dtsi */
488488 ret = mpp_get_clk_info(mpp, &vdpp->aclk_info, "aclk");
....@@ -645,7 +645,6 @@
645645 /* ensure hardware is being off status */
646646 mpp_write(mpp, hw_info->start_base, 0);
647647
648
-
649648 return 0;
650649 }
651650
....@@ -704,6 +703,7 @@
704703 match = of_match_node(mpp_vdpp_dt_match, pdev->dev.of_node);
705704 if (match)
706705 mpp->var = (struct mpp_dev_var *)match->data;
706
+ mpp->core_id = -1;
707707 }
708708
709709 ret = mpp_dev_probe(mpp, pdev);
....@@ -772,53 +772,12 @@
772772 dev_err(dev, "wait total running time out\n");
773773 }
774774
775
-static int vdpp_runtime_suspend(struct device *dev)
776
-{
777
- struct mpp_dev *mpp = dev_get_drvdata(dev);
778
- struct mpp_grf_info *info = mpp->grf_info;
779
- struct mpp_taskqueue *queue = mpp->queue;
780
-
781
- if (cpu_is_rk3528() && info && info->mem_offset) {
782
- mutex_lock(&queue->ref_lock);
783
- if (!atomic_dec_if_positive(&queue->runtime_cnt)) {
784
- regmap_write(info->grf, info->mem_offset,
785
- info->val_mem_off);
786
- }
787
- mutex_unlock(&queue->ref_lock);
788
- }
789
-
790
- return 0;
791
-}
792
-
793
-static int vdpp_runtime_resume(struct device *dev)
794
-{
795
- struct mpp_dev *mpp = dev_get_drvdata(dev);
796
- struct mpp_grf_info *info = mpp->grf_info;
797
- struct mpp_taskqueue *queue = mpp->queue;
798
-
799
- if (cpu_is_rk3528() && info && info->mem_offset) {
800
- mutex_lock(&queue->ref_lock);
801
- regmap_write(info->grf, info->mem_offset,
802
- info->val_mem_on);
803
- atomic_inc(&queue->runtime_cnt);
804
- mutex_unlock(&queue->ref_lock);
805
- }
806
-
807
- return 0;
808
-}
809
-
810
-static const struct dev_pm_ops vdpp_pm_ops = {
811
- .runtime_suspend = vdpp_runtime_suspend,
812
- .runtime_resume = vdpp_runtime_resume,
813
-};
814
-
815775 struct platform_driver rockchip_vdpp_driver = {
816776 .probe = vdpp_probe,
817777 .remove = vdpp_remove,
818778 .shutdown = vdpp_shutdown,
819779 .driver = {
820780 .name = VDPP_DRIVER_NAME,
821
- .pm = &vdpp_pm_ops,
822781 .of_match_table = of_match_ptr(mpp_vdpp_dt_match),
823782 },
824783 };