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

Commit f419890f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "smb138x: support ship mode"

parents 4a493082 6eb36495
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -992,6 +992,9 @@ static int smb2_batt_set_prop(struct power_supply *psy,
		/* Not in ship mode as long as the device is active */
		if (!val->intval)
			break;
		if (chg->pl.psy)
			power_supply_set_property(chg->pl.psy,
				POWER_SUPPLY_PROP_SET_SHIP_MODE, val);
		rc = smblib_set_prop_ship_mode(chg, val);
		break;
	case POWER_SUPPLY_PROP_RERUN_AICL:
+22 −0
Original line number Diff line number Diff line
@@ -312,6 +312,7 @@ static enum power_supply_property smb138x_batt_props[] = {
	POWER_SUPPLY_PROP_CAPACITY,
	POWER_SUPPLY_PROP_CHARGER_TEMP,
	POWER_SUPPLY_PROP_CHARGER_TEMP_MAX,
	POWER_SUPPLY_PROP_SET_SHIP_MODE,
};

static int smb138x_batt_get_prop(struct power_supply *psy,
@@ -347,6 +348,10 @@ static int smb138x_batt_get_prop(struct power_supply *psy,
	case POWER_SUPPLY_PROP_CHARGER_TEMP_MAX:
		rc = smblib_get_prop_charger_temp_max(chg, val);
		break;
	case POWER_SUPPLY_PROP_SET_SHIP_MODE:
		/* Not in ship mode as long as device is active */
		val->intval = 0;
		break;
	default:
		pr_err("batt power supply get prop %d not supported\n", prop);
		return -EINVAL;
@@ -375,6 +380,12 @@ static int smb138x_batt_set_prop(struct power_supply *psy,
	case POWER_SUPPLY_PROP_CAPACITY:
		rc = smblib_set_prop_batt_capacity(chg, val);
		break;
	case POWER_SUPPLY_PROP_SET_SHIP_MODE:
		/* Not in ship mode as long as the device is active */
		if (!val->intval)
			break;
		rc = smblib_set_prop_ship_mode(chg, val);
		break;
	default:
		pr_err("batt power supply set prop %d not supported\n", prop);
		return -EINVAL;
@@ -494,6 +505,7 @@ static enum power_supply_property smb138x_parallel_props[] = {
	POWER_SUPPLY_PROP_MODEL_NAME,
	POWER_SUPPLY_PROP_PARALLEL_MODE,
	POWER_SUPPLY_PROP_CONNECTOR_HEALTH,
	POWER_SUPPLY_PROP_SET_SHIP_MODE,
};

static int smb138x_parallel_get_prop(struct power_supply *psy,
@@ -549,6 +561,10 @@ static int smb138x_parallel_get_prop(struct power_supply *psy,
	case POWER_SUPPLY_PROP_CONNECTOR_HEALTH:
		val->intval = smb138x_get_prop_connector_health(chip);
		break;
	case POWER_SUPPLY_PROP_SET_SHIP_MODE:
		/* Not in ship mode as long as device is active */
		val->intval = 0;
		break;
	default:
		pr_err("parallel power supply get prop %d not supported\n",
			prop);
@@ -609,6 +625,12 @@ static int smb138x_parallel_set_prop(struct power_supply *psy,
		rc = smblib_set_charge_param(chg, &chg->param.freq_buck,
					     val->intval);
		break;
	case POWER_SUPPLY_PROP_SET_SHIP_MODE:
		/* Not in ship mode as long as the device is active */
		if (!val->intval)
			break;
		rc = smblib_set_prop_ship_mode(chg, val);
		break;
	default:
		pr_err("parallel power supply set prop %d not supported\n",
			prop);