Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6166aaf0 authored by Ashish Chavan's avatar Ashish Chavan
Browse files

power: battery: Fix parallel charger iio-channel names



Get IIO failure may occur due to parallel charger's iio-channel
names conflicting with main-charger/qg channels. Fix this by adding
"pl_" prefix for all parallel charger's iio-channels name.

Change-Id: I20cb8f984b38d7053890380ea024a2ef15cf5789
Signed-off-by: default avatarAshish Chavan <ashichav@codeaurora.org>
parent c55c5408
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -148,6 +148,7 @@ enum {
	PARALLEL_OUTPUT_MODE,
};

/* CP Channels */
static const char * const bat_cp_ext_iio_chan[] = {
	[BAT_CP_PARALLEL_MODE] = "parallel_mode",
	[BAT_CP_PARALLEL_OUTPUT_MODE] = "parallel_output_mode",
@@ -155,17 +156,18 @@ static const char * const bat_cp_ext_iio_chan[] = {
	[BAT_CP_SWITCHER_EN] = "cp_switcher_en",
};

/* SMB1355 Channels */
static const char * const bat_smb_parallel_ext_iio_chan[] = {
	[BAT_SMB_PARALLEL_INPUT_SUSPEND] = "input_suspend",
	[BAT_SMB_PARALLEL_MODE] = "parallel_mode",
	[BAT_SMB_PARALLEL_BATFET_MODE] = "parallel_batfet_mode",
	[BAT_SMB_PARALLEL_MIN_ICL] = "min_icl",
	[BAT_SMB_PARALLEL_FCC_MAX] = "parallel_fcc_max",
	[BAT_SMB_PARALLEL_CURRENT_MAX] = "current_max",
	[BAT_SMB_PARALLEL_INPUT_SUSPEND] = "pl_input_suspend",
	[BAT_SMB_PARALLEL_MODE] = "pl_mode",
	[BAT_SMB_PARALLEL_BATFET_MODE] = "pl_batfet_mode",
	[BAT_SMB_PARALLEL_MIN_ICL] = "pl_min_icl",
	[BAT_SMB_PARALLEL_FCC_MAX] = "pl_fcc_max",
	[BAT_SMB_PARALLEL_CURRENT_MAX] = "pl_current_max",
	[BAT_SMB_PARALLEL_CONSTANT_CHARGE_CURRENT_MAX] =
			"constant_charge_current_max",
	[BAT_SMB_PARALLEL_VOLTAGE_MAX] = "voltage_max",
	[BAT_SMB_PARALLEL_CHARGE_TYPE] = "charge_type",
			"pl_constant_charge_current_max",
	[BAT_SMB_PARALLEL_VOLTAGE_MAX] = "pl_voltage_max",
	[BAT_SMB_PARALLEL_CHARGE_TYPE] = "pl_charge_type",
};

/*********
+7 −3
Original line number Diff line number Diff line
@@ -864,6 +864,8 @@ int smblib_set_aicl_cont_threshold(struct smb_chg_param *param,
/********************
 * HELPER FUNCTIONS *
 ********************/

/* CP channels */
static const char * const smblib_cp_ext_iio_chan[] = {
	[CP_PARALLEL_OUTPUT_MODE] = "parallel_output_mode",
	[CP_MASTER_ENABLE] = "cp_enable",
@@ -871,12 +873,14 @@ static const char * const smblib_cp_ext_iio_chan[] = {
	[CP_DIE_TEMP] = "cp_die_temp",
};

/* SMB1355 channels */
static const char * const smblib_parallel_ext_iio_chan[] = {
	[SMB_CHARGER_TEMP] = "charger_temp",
	[SMB_CHARGER_TEMP_MAX] = "charger_temp_max",
	[SMB_SET_SHIP_MODE] = "set_ship_mode",
	[SMB_CHARGER_TEMP] = "pl_charger_temp",
	[SMB_CHARGER_TEMP_MAX] = "pl_charger_temp_max",
	[SMB_SET_SHIP_MODE] = "pl_set_ship_mode",
};

/* QG/FG channels */
static const char * const smblib_qg_ext_iio_chan[] = {
	[SMB5_QG_DEBUG_BATTERY] = "debug_battery",
	[SMB5_QG_CAPACITY] = "capacity",