File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -865,6 +865,20 @@ static int hidma_probe(struct platform_device *pdev)
865865 return rc ;
866866}
867867
868+ static void hidma_shutdown (struct platform_device * pdev )
869+ {
870+ struct hidma_dev * dmadev = platform_get_drvdata (pdev );
871+
872+ dev_info (dmadev -> ddev .dev , "HI-DMA engine shutdown\n" );
873+
874+ pm_runtime_get_sync (dmadev -> ddev .dev );
875+ if (hidma_ll_disable (dmadev -> lldev ))
876+ dev_warn (dmadev -> ddev .dev , "channel did not stop\n" );
877+ pm_runtime_mark_last_busy (dmadev -> ddev .dev );
878+ pm_runtime_put_autosuspend (dmadev -> ddev .dev );
879+
880+ }
881+
868882static int hidma_remove (struct platform_device * pdev )
869883{
870884 struct hidma_dev * dmadev = platform_get_drvdata (pdev );
@@ -908,6 +922,7 @@ MODULE_DEVICE_TABLE(of, hidma_match);
908922static struct platform_driver hidma_driver = {
909923 .probe = hidma_probe ,
910924 .remove = hidma_remove ,
925+ .shutdown = hidma_shutdown ,
911926 .driver = {
912927 .name = "hidma" ,
913928 .of_match_table = hidma_match ,
Original file line number Diff line number Diff line change @@ -499,6 +499,9 @@ int hidma_ll_enable(struct hidma_lldev *lldev)
499499 lldev -> trch_state = HIDMA_CH_ENABLED ;
500500 lldev -> evch_state = HIDMA_CH_ENABLED ;
501501
502+ /* enable irqs */
503+ writel (ENABLE_IRQS , lldev -> evca + HIDMA_EVCA_IRQ_EN_REG );
504+
502505 return 0 ;
503506}
504507
@@ -596,6 +599,9 @@ int hidma_ll_disable(struct hidma_lldev *lldev)
596599
597600 lldev -> trch_state = HIDMA_CH_SUSPENDED ;
598601 lldev -> evch_state = HIDMA_CH_SUSPENDED ;
602+
603+ /* disable interrupts */
604+ writel (0 , lldev -> evca + HIDMA_EVCA_IRQ_EN_REG );
599605 return 0 ;
600606}
601607
You can’t perform that action at this time.
0 commit comments