Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08a831a6 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mdss: call suspend and resume panel events during runtime triggers"

parents b0dcc5a9 cae87ae8
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -2458,3 +2458,27 @@ int __init mdss_fb_init(void)
}

module_init(mdss_fb_init);

int mdss_fb_suspres_panel(struct device *dev, void *data)
{
	struct msm_fb_data_type *mfd;
	int rc;
	u32 event;

	if (!data) {
		pr_err("Device state not defined\n");
		return -EINVAL;
	}
	mfd = dev_get_drvdata(dev);
	if (!mfd)
		return 0;

	event = *((bool *) data) ? MDSS_EVENT_RESUME : MDSS_EVENT_SUSPEND;

	rc = mdss_fb_send_panel_event(mfd, event, NULL);
	if (rc)
		pr_warn("unable to %s fb%d (%d)\n",
			event == MDSS_EVENT_RESUME ? "resume" : "suspend",
			mfd->index, rc);
	return rc;
}
+1 −0
Original line number Diff line number Diff line
@@ -256,4 +256,5 @@ struct sync_fence *mdss_fb_sync_get_fence(struct sw_sync_timeline *timeline,
				const char *fence_name, int val);
int mdss_fb_register_mdp_instance(struct msm_mdp_interface *mdp);
int mdss_fb_dcm(struct msm_fb_data_type *mfd, int req_state);
int mdss_fb_suspres_panel(struct device *dev, void *data);
#endif /* MDSS_FB_H */
+4 −1
Original line number Diff line number Diff line
@@ -2578,11 +2578,12 @@ static int mdss_mdp_resume(struct platform_device *pdev)
static int mdss_mdp_runtime_resume(struct device *dev)
{
	struct mdss_data_type *mdata = dev_get_drvdata(dev);
	bool device_on = true;
	if (!mdata)
		return -ENODEV;

	dev_dbg(dev, "pm_runtime: resuming...\n");

	device_for_each_child(dev, &device_on, mdss_fb_suspres_panel);
	mdss_mdp_footswitch_ctrl(mdata, true);

	return 0;
@@ -2602,6 +2603,7 @@ static int mdss_mdp_runtime_idle(struct device *dev)
static int mdss_mdp_runtime_suspend(struct device *dev)
{
	struct mdss_data_type *mdata = dev_get_drvdata(dev);
	bool device_on = false;
	if (!mdata)
		return -ENODEV;
	dev_dbg(dev, "pm_runtime: suspending...\n");
@@ -2610,6 +2612,7 @@ static int mdss_mdp_runtime_suspend(struct device *dev)
		pr_err("MDP suspend failed\n");
		return -EBUSY;
	}
	device_for_each_child(dev, &device_on, mdss_fb_suspres_panel);
	mdss_mdp_footswitch_ctrl(mdata, false);

	return 0;