From ab63e517483bd47fad1345db0f76e4451b832aa1 Mon Sep 17 00:00:00 2001 From: Umang Agrawal Date: Tue, 9 Oct 2018 11:30:45 +0530 Subject: [PATCH] ANDROID: GKI: power_supply: Add power supply type "Charge Pump" Introduce a new power supply type "Charge Pump" under the power_supply class. Also, add power supply properties corresponding to power supply type charge pump. Signed-off-by: Umang Agrawal Signed-off-by: Guru Das Srinagesh (cherry picked from commit cf749f200e1d9b665a1f4f699bcc2a008d2bb565) Signed-off-by: Mark Salyzyn Bug: 150789066 Change-Id: Ic2ae389601afba37a882d18d5fbb986f86fd3067 --- drivers/power/supply/power_supply_sysfs.c | 11 +++++++++++ include/linux/power_supply.h | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c index c8e9f642f9ac..bf1a41d02ecc 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -46,6 +46,7 @@ static const char * const power_supply_type_text[] = { "USB_PD", "USB_PD_DRP", "BrickID", "USB_HVDCP", "USB_HVDCP_3", "Wireless", "USB_FLOAT", "BMS", "Parallel", "Main", "Wipower", "USB_C_UFP", "USB_C_DFP", + "Charge_Pump", }; static const char * const power_supply_usb_type_text[] = { @@ -446,6 +447,16 @@ static struct device_attribute power_supply_attrs[] = { POWER_SUPPLY_ATTR(fcc_stepper_enable), POWER_SUPPLY_ATTR(toggle_stat), POWER_SUPPLY_ATTR(main_fcc_max), + /* Charge pump properties */ + POWER_SUPPLY_ATTR(cp_status1), + POWER_SUPPLY_ATTR(cp_status2), + POWER_SUPPLY_ATTR(cp_enable), + POWER_SUPPLY_ATTR(cp_switcher_en), + POWER_SUPPLY_ATTR(cp_die_temp), + POWER_SUPPLY_ATTR(cp_isns), + POWER_SUPPLY_ATTR(cp_toggle_switcher), + POWER_SUPPLY_ATTR(cp_irq_status), + POWER_SUPPLY_ATTR(cp_ilim), /* Local extensions of type int64_t */ POWER_SUPPLY_ATTR(charge_counter_ext), /* Properties of type `const char *' */ diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 1e04b07be99c..8210bab64394 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -313,6 +313,16 @@ enum power_supply_property { POWER_SUPPLY_PROP_FCC_STEPPER_ENABLE, POWER_SUPPLY_PROP_TOGGLE_STAT, POWER_SUPPLY_PROP_MAIN_FCC_MAX, + /* Charge pump properties */ + POWER_SUPPLY_PROP_CP_STATUS1, + POWER_SUPPLY_PROP_CP_STATUS2, + POWER_SUPPLY_PROP_CP_ENABLE, + POWER_SUPPLY_PROP_CP_SWITCHER_EN, + POWER_SUPPLY_PROP_CP_DIE_TEMP, + POWER_SUPPLY_PROP_CP_ISNS, + POWER_SUPPLY_PROP_CP_TOGGLE_SWITCHER, + POWER_SUPPLY_PROP_CP_IRQ_STATUS, + POWER_SUPPLY_PROP_CP_ILIM, /* Local extensions of type int64_t */ POWER_SUPPLY_PROP_CHARGE_COUNTER_EXT, /* Properties of type `const char *' */ @@ -346,6 +356,7 @@ enum power_supply_type { POWER_SUPPLY_TYPE_WIPOWER, /* Wipower */ POWER_SUPPLY_TYPE_UFP, /* Type-C UFP */ POWER_SUPPLY_TYPE_DFP, /* Type-C DFP */ + POWER_SUPPLY_TYPE_CHARGE_PUMP, /* Charge Pump */ }; enum power_supply_usb_type {