sx933x: Add usb detect cal to odin

Add re-calibration on usb attach/remove feature
to odin and fix it for the 4.14 kernel.

Change-Id: Ib5afce222155e268bd9cf58026effca9dae8cd07
Signed-off-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-on: https://gerrit.mot.com/1267723
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-12 09:19:30 -06:00
commit 8ff2762f44
2 changed files with 8 additions and 0 deletions

View file

@ -6,6 +6,10 @@ ifneq (,$(filter river%,$(TARGET_PRODUCT)))
EXTRA_CFLAGS += -DCONFIG_CAPSENSE_USB_CAL
endif
ifneq (,$(filter odin%,$(TARGET_PRODUCT)))
EXTRA_CFLAGS += -DCONFIG_CAPSENSE_USB_CAL
endif
KBUILD_EXTRA_SYMBOLS += $(CURDIR)/$(KBUILD_EXTMOD)/../../sensors/Module.symvers
sx932x_sar-y := sx933x_sar.o

View file

@ -817,7 +817,11 @@ static int ps_notify_callback(struct notifier_block *self,
bool present;
int retval;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)
if (event == PSY_EVENT_PROP_CHANGED
#else
if ((event == PSY_EVENT_PROP_ADDED || event == PSY_EVENT_PROP_CHANGED)
#endif
&& psy && psy->desc->get_property && psy->desc->name &&
!strncmp(psy->desc->name, "usb", sizeof("usb")) && data) {
LOG_INFO("ps notification: event = %lu\n", event);