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

Commit 2e8f6559 authored by Nicholas Troast's avatar Nicholas Troast
Browse files

smb138x-charger: expose charger temperature



Expose the charger temperature in both standalone and parallel mode via
the battery and parallel power supplies.

Change-Id: I43e73b3056386cf97b37652eeed3a4761e248711
Signed-off-by: default avatarNicholas Troast <ntroast@codeaurora.org>
parent 3dc7ca5e
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -52,6 +52,22 @@ Charger specific properties:
  Value type: <u32>
  Definition: Specifies the DC input current limit in micro-amps.

- io-channels
  Usage:      optional
  Value type: List of <phandle u32>
  Definition: List of phandle and IIO specifier pairs, one pair
		for each IIO input to the device. Note: if the
		IIO provider specifies '0' for #io-channel-cells,
		then only the phandle portion of the pair will appear.

- io-channel-names
  Usage:      optional
  Value type: List of <string>
  Definition: List of IIO input name strings sorted in the same
		order as the io-channels property. Consumer drivers
		will use io-channel-names to match IIO input names
		with IIO specifiers.

================================================
Second Level Nodes - SMB138X Charger Peripherals
================================================
+16 −0
Original line number Diff line number Diff line
@@ -267,6 +267,8 @@ static enum power_supply_property smb138x_batt_props[] = {
	POWER_SUPPLY_PROP_PRESENT,
	POWER_SUPPLY_PROP_CHARGE_TYPE,
	POWER_SUPPLY_PROP_CAPACITY,
	POWER_SUPPLY_PROP_CHARGER_TEMP,
	POWER_SUPPLY_PROP_CHARGER_TEMP_MAX,
};

static int smb138x_batt_get_prop(struct power_supply *psy,
@@ -296,6 +298,12 @@ static int smb138x_batt_get_prop(struct power_supply *psy,
	case POWER_SUPPLY_PROP_CAPACITY:
		rc = smblib_get_prop_batt_capacity(chg, val);
		break;
	case POWER_SUPPLY_PROP_CHARGER_TEMP:
		rc = smblib_get_prop_charger_temp(chg, val);
		break;
	case POWER_SUPPLY_PROP_CHARGER_TEMP_MAX:
		rc = smblib_get_prop_charger_temp_max(chg, val);
		break;
	default:
		pr_err("batt power supply get prop %d not supported\n",
			prop);
@@ -381,6 +389,8 @@ static enum power_supply_property smb138x_parallel_props[] = {
	POWER_SUPPLY_PROP_INPUT_SUSPEND,
	POWER_SUPPLY_PROP_VOLTAGE_MAX,
	POWER_SUPPLY_PROP_CURRENT_MAX,
	POWER_SUPPLY_PROP_CHARGER_TEMP,
	POWER_SUPPLY_PROP_CHARGER_TEMP_MAX,
};

static int smb138x_parallel_get_prop(struct power_supply *psy,
@@ -415,6 +425,12 @@ static int smb138x_parallel_get_prop(struct power_supply *psy,
		rc = smblib_get_charge_param(chg, &chg->param.fcc,
					     &val->intval);
		break;
	case POWER_SUPPLY_PROP_CHARGER_TEMP:
		rc = smblib_get_prop_charger_temp(chg, val);
		break;
	case POWER_SUPPLY_PROP_CHARGER_TEMP_MAX:
		rc = smblib_get_prop_charger_temp_max(chg, val);
		break;
	default:
		pr_err("parallel power supply get prop %d not supported\n",
			prop);