← Back to team overview

touch-packages team mailing list archive

[Bug 1359530] Re: Device trying to suspend when screen is turned off by proximity sensor (during a call)

 

Actually in Android the system will try to invoke the early_suspend during a phone call. but it can not go to the deep sleep because of the wakelock. so I suggest that the psensor driver should be added the wakelock to prevent the issue.
Please add and check the follows:

--- a/mediatek/custom/common/kernel/alsps/tmd2772_auto/tmd2772.c
+++ b/mediatek/custom/common/kernel/alsps/tmd2772_auto/tmd2772.c
@@ -64,6 +64,7 @@ static u8  offset_data=0;
 #define PRO_OFFSET 1
 static u16 tmp_data=0;
 #define OFFDATA_DEFAULT 1
+struct wake_lock psensor_lock;
 //end
 /******************************************************************************
  * extern functions
@@ -2417,6 +2418,7 @@ int TMD2772_ps_operate(void* self, uint32_t command, void* buff_in, int size_in,
 					tmd2772_ps_calibrate_call(obj->client);
 					TMD2772_init_client(obj->client);
 					#endif
+					wake_lock(&psensor_lock);
 					if((err = TMD2772_enable_ps(obj->client, 1)))
 					{
 						APS_ERR("enable ps fail: %d\n", err); 
@@ -2437,6 +2439,7 @@ int TMD2772_ps_operate(void* self, uint32_t command, void* buff_in, int size_in,
 				}
 				else
 				{
+				    wake_unlock(&psensor_lock);
 					if((err = TMD2772_enable_ps(obj->client, 0)))
 					{
 						APS_ERR("disable ps fail: %d\n", err); 
@@ -2819,7 +2822,7 @@ static int TMD2772_i2c_probe(struct i2c_client *client, const struct i2c_device_
 
 	mutex_init(&mutex);
 	TMD2772_i2c_client = client;
-	
+	wake_lock_init(&psensor_lock,WAKE_LOCK_SUSPEND,"psensor wakelock");
 	if(1 == obj->hw->polling_mode_ps)
 		//if (1)
 		{

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to powerd in Ubuntu.
https://bugs.launchpad.net/bugs/1359530

Title:
  Device trying to suspend when screen is turned off by proximity sensor
  (during a call)

Status in PowerD:
  Invalid
Status in Unity System Compositor:
  Invalid
Status in “powerd” package in Ubuntu:
  Invalid
Status in “unity-system-compositor” package in Ubuntu:
  Invalid

Bug description:
  phablet@ubuntu-phablet:~$ system-image-cli -i
  current build number: 202
  device name: krillin
  channel: ubuntu-touch/utopic-proposed
  last update: 2014-08-21 03:59:43
  version version: 202
  version ubuntu: 20140821
  version device: 20140811.1

  Device tries to suspend when the screen is turned off by the proximity
  sensor (when a voicecall is in place).

  Looking at powerd, there's no active suspend blocker when the
  proximity sensor disables the screen, forcing powerd to go in suspend
  state.

  The device shouldn't try to suspend when a voicecall is active (or
  when the proximity sensor is the one turning the screen off).

  When the call starts:
  powerd-cli: Running as user is not fully supported.
  System State Requests:
    Name: com.canonical.Unity.Screen, Owner: :1.18, State: 1

  After putting my hand on top of the device (to trigger the proximity sensor):
  phablet@ubuntu-phablet:~$ powerd-cli list
  powerd-cli: Running as user is not fully supported.
  System State Requests:
    None

To manage notifications about this bug go to:
https://bugs.launchpad.net/powerd/+bug/1359530/+subscriptions


References