sx933x: add cal on phone attach

When the phone is attached or detached from the
mod recalibrate the capsensors.  This uses the
power supply device provided by the muc uart
driver.

Change-Id: Ic7002da8301ea3a3d9e3740c1532a0876d95a903
Signed-off-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-on: https://gerrit.mot.com/1269885
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-11-15 15:23:44 -06:00
commit 1261aea618
2 changed files with 11 additions and 1 deletions

View file

@ -7,7 +7,8 @@ EXTRA_CFLAGS += -DCONFIG_CAPSENSE_USB_CAL
endif
ifneq (,$(filter odin%,$(TARGET_PRODUCT)))
EXTRA_CFLAGS += -DCONFIG_CAPSENSE_USB_CAL
EXTRA_CFLAGS += -DCONFIG_CAPSENSE_USB_CAL \
-DCONFIG_CAPSENSE_ATTACH_CAL
endif
KBUILD_EXTRA_SYMBOLS += $(CURDIR)/$(KBUILD_EXTMOD)/../../sensors/Module.symvers

View file

@ -840,6 +840,15 @@ static int ps_notify_callback(struct notifier_block *self,
schedule_work(&data->ps_notify_work);
}
#ifdef CONFIG_CAPSENSE_ATTACH_CAL
if (event == PSY_EVENT_PROP_CHANGED
&& 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);
}
#endif
return 0;
}
#endif