Loading drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_dev.c +59 −0 Original line number Diff line number Diff line Loading @@ -745,6 +745,64 @@ static const struct of_device_id cam_req_mgr_dt_match[] = { }; MODULE_DEVICE_TABLE(of, cam_dt_match); static int cam_pm_suspend(struct device *pdev) { struct v4l2_event event; event.id = V4L_EVENT_CAM_REQ_MGR_S2R_SUSPEND; event.type = V4L_EVENT_CAM_REQ_MGR_EVENT; CAM_DBG(CAM_CRM, "Queue S2R suspend event"); v4l2_event_queue(g_dev.video, &event); return 0; } static int cam_pm_resume(struct device *pdev) { struct v4l2_event event; event.id = V4L_EVENT_CAM_REQ_MGR_S2R_RESUME; event.type = V4L_EVENT_CAM_REQ_MGR_EVENT; CAM_DBG(CAM_CRM, "Queue S2R resume event"); v4l2_event_queue(g_dev.video, &event); return 0; } static int cam_pm_freeze(struct device *pdev) { CAM_DBG(CAM_CRM, "Freeze done for cam_req_mgr driver"); return 0; } static int cam_pm_restore(struct device *pdev) { struct v4l2_event event; event.id = V4L_EVENT_CAM_REQ_MGR_HIBERNATION_RESUME; event.type = V4L_EVENT_CAM_REQ_MGR_EVENT; CAM_DBG(CAM_CRM, "Queue hibernation restore event"); v4l2_event_queue(g_dev.video, &event); return 0; } static int cam_pm_thaw(struct device *pdev) { struct v4l2_event event; event.id = V4L_EVENT_CAM_REQ_MGR_HIBERNATION_SUSPEND; event.type = V4L_EVENT_CAM_REQ_MGR_EVENT; CAM_DBG(CAM_CRM, "Queue hibernation thaw event"); v4l2_event_queue(g_dev.video, &event); return 0; } static const struct dev_pm_ops cam_pm_ops = { .suspend = &cam_pm_suspend, .resume = &cam_pm_resume, .freeze = &cam_pm_freeze, .restore = &cam_pm_restore, .thaw = &cam_pm_thaw, }; static struct platform_driver cam_req_mgr_driver = { .probe = cam_req_mgr_probe, .remove = cam_req_mgr_remove, Loading @@ -753,6 +811,7 @@ static struct platform_driver cam_req_mgr_driver = { .owner = THIS_MODULE, .of_match_table = cam_req_mgr_dt_match, .suppress_bind_attrs = true, .pm = &cam_pm_ops, }, }; Loading include/uapi/media/cam_req_mgr.h +9 −3 Original line number Diff line number Diff line Loading @@ -47,6 +47,12 @@ #define V4L_EVENT_CAM_REQ_MGR_ERROR 1 #define V4L_EVENT_CAM_REQ_MGR_SOF_BOOT_TS 2 /* Suspend to RAM and Hibernation events */ #define V4L_EVENT_CAM_REQ_MGR_S2R_SUSPEND 10 #define V4L_EVENT_CAM_REQ_MGR_S2R_RESUME 11 #define V4L_EVENT_CAM_REQ_MGR_HIBERNATION_SUSPEND 12 #define V4L_EVENT_CAM_REQ_MGR_HIBERNATION_RESUME 13 /* SOF Event status */ #define CAM_REQ_MGR_SOF_EVENT_SUCCESS 0 #define CAM_REQ_MGR_SOF_EVENT_ERROR 1 Loading Loading
drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_dev.c +59 −0 Original line number Diff line number Diff line Loading @@ -745,6 +745,64 @@ static const struct of_device_id cam_req_mgr_dt_match[] = { }; MODULE_DEVICE_TABLE(of, cam_dt_match); static int cam_pm_suspend(struct device *pdev) { struct v4l2_event event; event.id = V4L_EVENT_CAM_REQ_MGR_S2R_SUSPEND; event.type = V4L_EVENT_CAM_REQ_MGR_EVENT; CAM_DBG(CAM_CRM, "Queue S2R suspend event"); v4l2_event_queue(g_dev.video, &event); return 0; } static int cam_pm_resume(struct device *pdev) { struct v4l2_event event; event.id = V4L_EVENT_CAM_REQ_MGR_S2R_RESUME; event.type = V4L_EVENT_CAM_REQ_MGR_EVENT; CAM_DBG(CAM_CRM, "Queue S2R resume event"); v4l2_event_queue(g_dev.video, &event); return 0; } static int cam_pm_freeze(struct device *pdev) { CAM_DBG(CAM_CRM, "Freeze done for cam_req_mgr driver"); return 0; } static int cam_pm_restore(struct device *pdev) { struct v4l2_event event; event.id = V4L_EVENT_CAM_REQ_MGR_HIBERNATION_RESUME; event.type = V4L_EVENT_CAM_REQ_MGR_EVENT; CAM_DBG(CAM_CRM, "Queue hibernation restore event"); v4l2_event_queue(g_dev.video, &event); return 0; } static int cam_pm_thaw(struct device *pdev) { struct v4l2_event event; event.id = V4L_EVENT_CAM_REQ_MGR_HIBERNATION_SUSPEND; event.type = V4L_EVENT_CAM_REQ_MGR_EVENT; CAM_DBG(CAM_CRM, "Queue hibernation thaw event"); v4l2_event_queue(g_dev.video, &event); return 0; } static const struct dev_pm_ops cam_pm_ops = { .suspend = &cam_pm_suspend, .resume = &cam_pm_resume, .freeze = &cam_pm_freeze, .restore = &cam_pm_restore, .thaw = &cam_pm_thaw, }; static struct platform_driver cam_req_mgr_driver = { .probe = cam_req_mgr_probe, .remove = cam_req_mgr_remove, Loading @@ -753,6 +811,7 @@ static struct platform_driver cam_req_mgr_driver = { .owner = THIS_MODULE, .of_match_table = cam_req_mgr_dt_match, .suppress_bind_attrs = true, .pm = &cam_pm_ops, }, }; Loading
include/uapi/media/cam_req_mgr.h +9 −3 Original line number Diff line number Diff line Loading @@ -47,6 +47,12 @@ #define V4L_EVENT_CAM_REQ_MGR_ERROR 1 #define V4L_EVENT_CAM_REQ_MGR_SOF_BOOT_TS 2 /* Suspend to RAM and Hibernation events */ #define V4L_EVENT_CAM_REQ_MGR_S2R_SUSPEND 10 #define V4L_EVENT_CAM_REQ_MGR_S2R_RESUME 11 #define V4L_EVENT_CAM_REQ_MGR_HIBERNATION_SUSPEND 12 #define V4L_EVENT_CAM_REQ_MGR_HIBERNATION_RESUME 13 /* SOF Event status */ #define CAM_REQ_MGR_SOF_EVENT_SUCCESS 0 #define CAM_REQ_MGR_SOF_EVENT_ERROR 1 Loading