hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/video/rockchip/mpp/mpp_jpgdec.c
....@@ -264,7 +264,6 @@
264264
265265 mpp_write_req(mpp, task->reg, s, e, reg_en);
266266 }
267
-
268267 /* flush tlb before starting hardware */
269268 mpp_iommu_flush_tlb(mpp->iommu_info);
270269
....@@ -559,7 +558,7 @@
559558 };
560559
561560 static const struct mpp_dev_var jpgdec_v1_data = {
562
- .device_type = MPP_DEVICE_JPGDEC,
561
+ .device_type = MPP_DEVICE_RKJPEGD,
563562 .hw_info = &jpgdec_v1_hw_info,
564563 .trans_info = jpgdec_v1_trans,
565564 .hw_ops = &jpgdec_v1_hw_ops,
....@@ -586,9 +585,9 @@
586585 dec = devm_kzalloc(dev, sizeof(struct jpgdec_dev), GFP_KERNEL);
587586 if (!dec)
588587 return -ENOMEM;
589
- platform_set_drvdata(pdev, dec);
590
-
591588 mpp = &dec->mpp;
589
+ platform_set_drvdata(pdev, mpp);
590
+
592591 if (pdev->dev.of_node) {
593592 match = of_match_node(mpp_jpgdec_dt_match, pdev->dev.of_node);
594593 if (match)
....@@ -623,37 +622,19 @@
623622 static int jpgdec_remove(struct platform_device *pdev)
624623 {
625624 struct device *dev = &pdev->dev;
626
- struct jpgdec_dev *dec = platform_get_drvdata(pdev);
625
+ struct mpp_dev *mpp = dev_get_drvdata(dev);
627626
628627 dev_info(dev, "remove device\n");
629
- mpp_dev_remove(&dec->mpp);
630
- jpgdec_procfs_remove(&dec->mpp);
628
+ mpp_dev_remove(mpp);
629
+ jpgdec_procfs_remove(mpp);
631630
632631 return 0;
633
-}
634
-
635
-static void jpgdec_shutdown(struct platform_device *pdev)
636
-{
637
- int ret;
638
- int val;
639
- struct device *dev = &pdev->dev;
640
- struct jpgdec_dev *dec = platform_get_drvdata(pdev);
641
- struct mpp_dev *mpp = &dec->mpp;
642
-
643
- dev_info(dev, "shutdown device\n");
644
-
645
- atomic_inc(&mpp->srv->shutdown_request);
646
- ret = readx_poll_timeout(atomic_read,
647
- &mpp->task_count,
648
- val, val == 0, 20000, 200000);
649
- if (ret == -ETIMEDOUT)
650
- dev_err(dev, "wait total running time out\n");
651632 }
652633
653634 struct platform_driver rockchip_jpgdec_driver = {
654635 .probe = jpgdec_probe,
655636 .remove = jpgdec_remove,
656
- .shutdown = jpgdec_shutdown,
637
+ .shutdown = mpp_dev_shutdown,
657638 .driver = {
658639 .name = JPGDEC_DRIVER_NAME,
659640 .of_match_table = of_match_ptr(mpp_jpgdec_dt_match),