| .. | .. |
|---|
| 287 | 287 | u32 i; |
|---|
| 288 | 288 | u32 reg_en; |
|---|
| 289 | 289 | struct vepu_task *task = to_vepu_task(mpp_task); |
|---|
| 290 | + u32 timing_en = mpp->srv->timing_en; |
|---|
| 290 | 291 | |
|---|
| 291 | 292 | mpp_debug_enter(); |
|---|
| 292 | 293 | |
|---|
| .. | .. |
|---|
| 305 | 306 | |
|---|
| 306 | 307 | mpp_write_req(mpp, task->reg, s, e, reg_en); |
|---|
| 307 | 308 | } |
|---|
| 309 | + |
|---|
| 310 | + /* flush tlb before starting hardware */ |
|---|
| 311 | + mpp_iommu_flush_tlb(mpp->iommu_info); |
|---|
| 312 | + |
|---|
| 308 | 313 | /* init current task */ |
|---|
| 309 | 314 | mpp->cur_task = mpp_task; |
|---|
| 315 | + |
|---|
| 316 | + mpp_task_run_begin(mpp_task, timing_en, MPP_WORK_TIMEOUT_DELAY); |
|---|
| 317 | + |
|---|
| 310 | 318 | /* Last, flush the registers */ |
|---|
| 311 | 319 | wmb(); |
|---|
| 312 | 320 | mpp_write(mpp, VEPU2_REG_ENC_EN, |
|---|
| 313 | 321 | task->reg[reg_en] | VEPU2_ENC_START); |
|---|
| 322 | + |
|---|
| 323 | + mpp_task_run_end(mpp_task, timing_en); |
|---|
| 314 | 324 | |
|---|
| 315 | 325 | mpp_debug_leave(); |
|---|
| 316 | 326 | |
|---|
| .. | .. |
|---|
| 578 | 588 | enc->procfs = NULL; |
|---|
| 579 | 589 | return -EIO; |
|---|
| 580 | 590 | } |
|---|
| 591 | + |
|---|
| 592 | + /* for common mpp_dev options */ |
|---|
| 593 | + mpp_procfs_create_common(enc->procfs, mpp); |
|---|
| 594 | + |
|---|
| 581 | 595 | mpp_procfs_create_u32("aclk", 0644, |
|---|
| 582 | 596 | enc->procfs, &enc->aclk_info.debug_rate_hz); |
|---|
| 583 | 597 | mpp_procfs_create_u32("session_buffers", 0644, |
|---|
| .. | .. |
|---|
| 722 | 736 | { |
|---|
| 723 | 737 | struct vepu_dev *enc = to_vepu_dev(mpp); |
|---|
| 724 | 738 | |
|---|
| 739 | + mpp_write(mpp, VEPU2_REG_ENC_EN, 0); |
|---|
| 740 | + udelay(5); |
|---|
| 725 | 741 | if (enc->rst_a && enc->rst_h) { |
|---|
| 726 | 742 | /* Don't skip this or iommu won't work after reset */ |
|---|
| 727 | | - rockchip_pmu_idle_request(mpp->dev, true); |
|---|
| 743 | + mpp_pmu_idle_request(mpp, true); |
|---|
| 728 | 744 | mpp_safe_reset(enc->rst_a); |
|---|
| 729 | 745 | mpp_safe_reset(enc->rst_h); |
|---|
| 730 | 746 | udelay(5); |
|---|
| 731 | 747 | mpp_safe_unreset(enc->rst_a); |
|---|
| 732 | 748 | mpp_safe_unreset(enc->rst_h); |
|---|
| 733 | | - rockchip_pmu_idle_request(mpp->dev, false); |
|---|
| 749 | + mpp_pmu_idle_request(mpp, false); |
|---|
| 734 | 750 | } |
|---|
| 735 | 751 | mpp_write(mpp, VEPU2_REG_INT, VEPU2_INT_CLEAR); |
|---|
| 736 | 752 | |
|---|