sx933x: calibrate on phone present

Limit the recalibration on phone power supply
events to present changed.

Change-Id: I6c6a49820ef93c3062c13c56aa3322b495ea40b4
Signed-off-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-on: https://gerrit.mot.com/1279109
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Ryan Lattrel 2018-12-05 16:27:39 -06:00
commit 53d25de060
2 changed files with 12 additions and 1 deletions

View file

@ -831,7 +831,15 @@ static int ps_notify_callback(struct notifier_block *self,
&& psy && psy->desc->get_property && psy->desc->name &&
!strncmp(psy->desc->name, "phone", sizeof("phone")) && data) {
LOG_INFO("phone ps notification: event = %lu\n", event);
schedule_work(&data->ps_notify_work);
retval = ps_get_state(psy, &present);
if (retval)
return retval;
if (data->phone_is_present != present) {
data->phone_is_present = present;
schedule_work(&data->ps_notify_work);
}
}
#endif

View file

@ -700,6 +700,9 @@ struct sx933x_platform_data
struct work_struct ps_notify_work;
struct notifier_block ps_notif;
bool ps_is_present;
#ifdef CONFIG_CAPSENSE_ATTACH_CAL
bool phone_is_present;
#endif
#endif
pbuttonInformation_t pbuttonInformation;