Loading drivers/media/platform/msm/npu/npu_dev.c +24 −13 Original line number Diff line number Diff line Loading @@ -106,8 +106,8 @@ static int npu_of_parse_pwrlevels(struct npu_device *npu_dev, static int npu_pwrctrl_init(struct npu_device *npu_dev); static int npu_probe(struct platform_device *pdev); static int npu_remove(struct platform_device *pdev); static int npu_suspend(struct platform_device *dev, pm_message_t state); static int npu_resume(struct platform_device *dev); static int npu_pm_suspend(struct device *dev); static int npu_pm_resume(struct device *dev); static int __init npu_init(void); static void __exit npu_exit(void); Loading Loading @@ -185,17 +185,17 @@ static const struct of_device_id npu_dt_match[] = { {} }; static const struct dev_pm_ops npu_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(npu_pm_suspend, npu_pm_resume) }; static struct platform_driver npu_driver = { .probe = npu_probe, .remove = npu_remove, #if defined(CONFIG_PM) .suspend = npu_suspend, .resume = npu_resume, #endif .driver = { .name = "msm_npu", .of_match_table = npu_dt_match, .pm = NULL, .pm = &npu_pm_ops, }, }; Loading Loading @@ -2209,7 +2209,7 @@ static int npu_probe(struct platform_device *pdev) npu_dev->pdev = pdev; mutex_init(&npu_dev->dev_lock); platform_set_drvdata(pdev, npu_dev); dev_set_drvdata(&pdev->dev, npu_dev); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core"); if (!res) { Loading Loading @@ -2434,6 +2434,7 @@ static int npu_probe(struct platform_device *pdev) unregister_chrdev_region(npu_dev->dev_num, 1); npu_mbox_deinit(npu_dev); error_get_dev_num: dev_set_drvdata(&pdev->dev, NULL); return rc; } Loading @@ -2451,7 +2452,7 @@ static int npu_remove(struct platform_device *pdev) device_destroy(npu_dev->class, npu_dev->dev_num); class_destroy(npu_dev->class); unregister_chrdev_region(npu_dev->dev_num, 1); platform_set_drvdata(pdev, NULL); dev_set_drvdata(&pdev->dev, NULL); npu_mbox_deinit(npu_dev); msm_bus_scale_unregister_client(npu_dev->bwctrl.bus_client); Loading @@ -2464,17 +2465,27 @@ static int npu_remove(struct platform_device *pdev) * Suspend/Resume * ------------------------------------------------------------------------- */ #if defined(CONFIG_PM) static int npu_suspend(struct platform_device *dev, pm_message_t state) static int npu_pm_suspend(struct device *dev) { struct npu_device *npu_dev; npu_dev = dev_get_drvdata(dev); if (!npu_dev) { NPU_ERR("invalid NPU dev\n"); return -EINVAL; } NPU_DBG("suspend npu\n"); npu_host_suspend(npu_dev); return 0; } static int npu_resume(struct platform_device *dev) static int npu_pm_resume(struct device *dev) { NPU_DBG("resume npu\n"); return 0; } #endif /* ------------------------------------------------------------------------- * Module Entry Points Loading drivers/media/platform/msm/npu/npu_mgr.c +7 −0 Original line number Diff line number Diff line Loading @@ -2837,3 +2837,10 @@ int32_t npu_host_get_perf_mode(struct npu_client *client, uint32_t network_hdl) return param_val; } void npu_host_suspend(struct npu_device *npu_dev) { struct npu_host_ctx *host_ctx = &npu_dev->host_ctx; flush_delayed_work(&host_ctx->disable_fw_work); } drivers/media/platform/msm/npu/npu_mgr.h +1 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,7 @@ int npu_host_update_power(struct npu_device *npu_dev); int32_t npu_host_set_perf_mode(struct npu_client *client, uint32_t network_hdl, uint32_t perf_mode); int32_t npu_host_get_perf_mode(struct npu_client *client, uint32_t network_hdl); void npu_host_suspend(struct npu_device *npu_dev); void npu_dump_debug_info(struct npu_device *npu_dev); void npu_dump_ipc_packet(struct npu_device *npu_dev, void *cmd_ptr); Loading Loading
drivers/media/platform/msm/npu/npu_dev.c +24 −13 Original line number Diff line number Diff line Loading @@ -106,8 +106,8 @@ static int npu_of_parse_pwrlevels(struct npu_device *npu_dev, static int npu_pwrctrl_init(struct npu_device *npu_dev); static int npu_probe(struct platform_device *pdev); static int npu_remove(struct platform_device *pdev); static int npu_suspend(struct platform_device *dev, pm_message_t state); static int npu_resume(struct platform_device *dev); static int npu_pm_suspend(struct device *dev); static int npu_pm_resume(struct device *dev); static int __init npu_init(void); static void __exit npu_exit(void); Loading Loading @@ -185,17 +185,17 @@ static const struct of_device_id npu_dt_match[] = { {} }; static const struct dev_pm_ops npu_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(npu_pm_suspend, npu_pm_resume) }; static struct platform_driver npu_driver = { .probe = npu_probe, .remove = npu_remove, #if defined(CONFIG_PM) .suspend = npu_suspend, .resume = npu_resume, #endif .driver = { .name = "msm_npu", .of_match_table = npu_dt_match, .pm = NULL, .pm = &npu_pm_ops, }, }; Loading Loading @@ -2209,7 +2209,7 @@ static int npu_probe(struct platform_device *pdev) npu_dev->pdev = pdev; mutex_init(&npu_dev->dev_lock); platform_set_drvdata(pdev, npu_dev); dev_set_drvdata(&pdev->dev, npu_dev); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core"); if (!res) { Loading Loading @@ -2434,6 +2434,7 @@ static int npu_probe(struct platform_device *pdev) unregister_chrdev_region(npu_dev->dev_num, 1); npu_mbox_deinit(npu_dev); error_get_dev_num: dev_set_drvdata(&pdev->dev, NULL); return rc; } Loading @@ -2451,7 +2452,7 @@ static int npu_remove(struct platform_device *pdev) device_destroy(npu_dev->class, npu_dev->dev_num); class_destroy(npu_dev->class); unregister_chrdev_region(npu_dev->dev_num, 1); platform_set_drvdata(pdev, NULL); dev_set_drvdata(&pdev->dev, NULL); npu_mbox_deinit(npu_dev); msm_bus_scale_unregister_client(npu_dev->bwctrl.bus_client); Loading @@ -2464,17 +2465,27 @@ static int npu_remove(struct platform_device *pdev) * Suspend/Resume * ------------------------------------------------------------------------- */ #if defined(CONFIG_PM) static int npu_suspend(struct platform_device *dev, pm_message_t state) static int npu_pm_suspend(struct device *dev) { struct npu_device *npu_dev; npu_dev = dev_get_drvdata(dev); if (!npu_dev) { NPU_ERR("invalid NPU dev\n"); return -EINVAL; } NPU_DBG("suspend npu\n"); npu_host_suspend(npu_dev); return 0; } static int npu_resume(struct platform_device *dev) static int npu_pm_resume(struct device *dev) { NPU_DBG("resume npu\n"); return 0; } #endif /* ------------------------------------------------------------------------- * Module Entry Points Loading
drivers/media/platform/msm/npu/npu_mgr.c +7 −0 Original line number Diff line number Diff line Loading @@ -2837,3 +2837,10 @@ int32_t npu_host_get_perf_mode(struct npu_client *client, uint32_t network_hdl) return param_val; } void npu_host_suspend(struct npu_device *npu_dev) { struct npu_host_ctx *host_ctx = &npu_dev->host_ctx; flush_delayed_work(&host_ctx->disable_fw_work); }
drivers/media/platform/msm/npu/npu_mgr.h +1 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,7 @@ int npu_host_update_power(struct npu_device *npu_dev); int32_t npu_host_set_perf_mode(struct npu_client *client, uint32_t network_hdl, uint32_t perf_mode); int32_t npu_host_get_perf_mode(struct npu_client *client, uint32_t network_hdl); void npu_host_suspend(struct npu_device *npu_dev); void npu_dump_debug_info(struct npu_device *npu_dev); void npu_dump_ipc_packet(struct npu_device *npu_dev, void *cmd_ptr); Loading