Forráskód Böngészése

touch: pt: disable power off feature

enable touch to wake feature for all power modes.

Change-Id: Ic12fb06cb3d436d41f373f57eaee91c5f20a11eb
Signed-off-by: Srinu Gorle <[email protected]>
Signed-off-by: Anand Abhishek <[email protected]>
Anand Abhishek 2 éve
szülő
commit
9ec2c285b6
1 módosított fájl, 22 hozzáadás és 18 törlés
  1. 22 18
      pt/pt_core.c

+ 22 - 18
pt/pt_core.c

@@ -10834,21 +10834,27 @@ static int pt_core_suspend_(struct device *dev)
  ******************************************************************************/
 static int pt_core_suspend(struct device *dev)
 {
-		struct pt_core_data *cd = dev_get_drvdata(dev);
-		int rc = 0;
+	struct pt_core_data *cd = dev_get_drvdata(dev);
+	int rc = 0, status = 0;
 
-		if (cd->cpdata->flags & PT_CORE_FLAG_SKIP_SYS_SLEEP)
-			return 0;
+	if (cd->cpdata->flags & PT_CORE_FLAG_SKIP_SYS_SLEEP)
+		return 0;
 
-		cancel_work_sync(&cd->resume_offload_work);
-		cancel_work_sync(&cd->suspend_offload_work);
-		cancel_work_sync(&cd->resume_work);
-		cancel_work_sync(&cd->suspend_work);
+	pt_debug(cd->dev, DL_INFO, "%s start\n", __func__);
+	cancel_work_sync(&cd->resume_work);
+	cancel_work_sync(&cd->suspend_work);
 
-		rc = pt_core_suspend_(cd->dev);
-		pt_debug(cd->dev, DL_INFO, "%s Exit - rc = %d\n", __func__, rc);
+	rc = pt_core_easywake_on(cd);
+	if (rc < 0) {
+		pt_debug(cd->dev, DL_ERROR, "%s: Error on sleep\n", __func__);
+		return true;
+	}
+	cd->fb_state = FB_OFF;
 
-		return rc;
+	status = pt_enable_i2c_regulator(cd, false);
+	pt_debug(cd->dev, DL_INFO, "%s Exit - rc = %d\n", __func__, status);
+
+	return rc;
 }
 
 /*******************************************************************************
@@ -11016,17 +11022,15 @@ static void pt_resume_offload_work(struct work_struct *work)
 static int pt_core_resume(struct device *dev)
 {
 	struct pt_core_data *cd = dev_get_drvdata(dev);
-	int rc = 0;
+	int rc = 0, status = 0;
 	if (cd->cpdata->flags & PT_CORE_FLAG_SKIP_SYS_SLEEP)
 		return 0;
 
-	cancel_work_sync(&cd->resume_offload_work);
-	cancel_work_sync(&cd->suspend_offload_work);
-	cancel_work_sync(&cd->resume_work);
-	cancel_work_sync(&cd->suspend_work);
+	pt_debug(cd->dev, DL_INFO, "%s start\n", __func__);
+	status = pt_enable_i2c_regulator(cd, true);
+	pt_debug(cd->dev, DL_INFO, "%s i2c regulator rc %d\n", __func__, status);
 
-	queue_work(cd->pt_workqueue, &cd->resume_offload_work);
-	pt_debug(cd->dev, DL_INFO, "%s workqueued\n", __func__);
+	pt_debug(cd->dev, DL_INFO, "%s End\n", __func__);
 
 	return rc;
 }