diff --git a/drivers/misc/aw9610x/Android.mk b/drivers/misc/aw9610x/Android.mk index ae9a0dcce2ec..f10972226216 100644 --- a/drivers/misc/aw9610x/Android.mk +++ b/drivers/misc/aw9610x/Android.mk @@ -1,8 +1,8 @@ DLKM_DIR := motorola/kernel/modules LOCAL_PATH := $(call my-dir) -ifeq ($(SX933X_USB_USE_ONLINE),true) - KBUILD_OPTIONS += CONFIG_SX933X_POWER_SUPPLY_ONLINE=y +ifeq ($(AW9610X_USB_USE_ONLINE),true) + KBUILD_OPTIONS += CONFIG_AW9610X_POWER_SUPPLY_ONLINE=y endif include $(CLEAR_VARS) diff --git a/drivers/misc/aw9610x/Kbuild b/drivers/misc/aw9610x/Kbuild index b0dd21f14f82..2493e45af5ff 100644 --- a/drivers/misc/aw9610x/Kbuild +++ b/drivers/misc/aw9610x/Kbuild @@ -8,7 +8,7 @@ KERNEL_PLATFORM_PATH = $(shell find $(ANDROID_BUILD_TOP) -maxdepth 1 -name "kern EXTRA_CFLAGS += -Wall EXTRA_CFLAGS += -I$(ANDROID_BUILD_TOP)/motorola/kernel/modules/include -ifneq ($(filter m y,$(CONFIG_SX933X_POWER_SUPPLY_ONLINE)),) +ifneq ($(filter m y,$(CONFIG_AW9610X_POWER_SUPPLY_ONLINE)),) EXTRA_CFLAGS += -DCONFIG_USE_POWER_SUPPLY_ONLINE endif diff --git a/drivers/misc/aw9610x/aw9610x_sar.c b/drivers/misc/aw9610x/aw9610x_sar.c index bee3adf8287c..f7fbb67c1f8d 100644 --- a/drivers/misc/aw9610x/aw9610x_sar.c +++ b/drivers/misc/aw9610x/aw9610x_sar.c @@ -42,12 +42,6 @@ #define AW9610X_I2C_NAME "aw9610x_sar" #define AW9610X_DRIVER_VERSION "v0.1.9" -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) -#define USB_POWER_SUPPLY_NAME "charger" -#else -#define USB_POWER_SUPPLY_NAME "usb" -#endif - #define AW_READ_CHIPID_RETRIES (5) #define AW_I2C_RETRIES (5) #define AW9610X_SCAN_DEFAULT_TIME (10000) @@ -1580,10 +1574,10 @@ static int ps_notify_callback(struct notifier_block *self, #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) if (event == PSY_EVENT_PROP_CHANGED #else - if ((event == PSY_EVENT_PROP_ADDED || event == PSY_EVENT_PROP_CHANGED)) + 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_POWER_SUPPLY_NAME, sizeof(USB_POWER_SUPPLY_NAME))){ + !strncmp(psy->desc->name, "usb", sizeof("usb"))){ LOG_INFO("ps notification: event = %lu\n", event); retval = ps_get_state(psy, &present); if (retval) { @@ -2135,7 +2129,7 @@ aw9610x_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) power_supply_unreg_notifier(&aw9610x->ps_notif); } - psy = power_supply_get_by_name(USB_POWER_SUPPLY_NAME); + psy = power_supply_get_by_name("usb"); if (psy) { ret = ps_get_state(psy, &aw9610x->ps_is_present); if (ret) {