Loading drivers/power/qcom-charger/smb-lib.c +18 −0 Original line number Diff line number Diff line Loading @@ -1749,6 +1749,22 @@ int smblib_set_prop_pd_active(struct smb_charger *chg, return rc; } /************************ * PARALLEL PSY GETTERS * ************************/ int smblib_get_prop_slave_current_now(struct smb_charger *chg, union power_supply_propval *pval) { if (IS_ERR_OR_NULL(chg->iio.batt_i_chan)) chg->iio.batt_i_chan = iio_channel_get(chg->dev, "batt_i"); if (IS_ERR(chg->iio.batt_i_chan)) return PTR_ERR(chg->iio.batt_i_chan); return iio_read_channel_processed(chg->iio.batt_i_chan, &pval->intval); } /********************** * INTERRUPT HANDLERS * **********************/ Loading Loading @@ -2440,6 +2456,8 @@ static void smblib_iio_deinit(struct smb_charger *chg) iio_channel_release(chg->iio.usbin_i_chan); if (!IS_ERR_OR_NULL(chg->iio.usbin_v_chan)) iio_channel_release(chg->iio.usbin_v_chan); if (!IS_ERR_OR_NULL(chg->iio.batt_i_chan)) iio_channel_release(chg->iio.batt_i_chan); } int smblib_init(struct smb_charger *chg) Loading drivers/power/qcom-charger/smb-lib.h +4 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,7 @@ struct smb_iio { struct iio_channel *temp_max_chan; struct iio_channel *usbin_i_chan; struct iio_channel *usbin_v_chan; struct iio_channel *batt_i_chan; }; struct smb_charger { Loading Loading @@ -301,6 +302,9 @@ int smblib_set_prop_typec_power_role(struct smb_charger *chg, int smblib_set_prop_pd_active(struct smb_charger *chg, const union power_supply_propval *val); int smblib_get_prop_slave_current_now(struct smb_charger *chg, union power_supply_propval *val); int smblib_init(struct smb_charger *chg); int smblib_deinit(struct smb_charger *chg); #endif /* __SMB2_CHARGER_H */ Loading drivers/power/qcom-charger/smb138x-charger.c +4 −0 Original line number Diff line number Diff line Loading @@ -395,6 +395,7 @@ 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_CURRENT_NOW, POWER_SUPPLY_PROP_CHARGER_TEMP, POWER_SUPPLY_PROP_CHARGER_TEMP_MAX, }; Loading Loading @@ -431,6 +432,9 @@ 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_CURRENT_NOW: rc = smblib_get_prop_slave_current_now(chg, val); break; case POWER_SUPPLY_PROP_CHARGER_TEMP: rc = smblib_get_prop_charger_temp(chg, val); break; Loading Loading
drivers/power/qcom-charger/smb-lib.c +18 −0 Original line number Diff line number Diff line Loading @@ -1749,6 +1749,22 @@ int smblib_set_prop_pd_active(struct smb_charger *chg, return rc; } /************************ * PARALLEL PSY GETTERS * ************************/ int smblib_get_prop_slave_current_now(struct smb_charger *chg, union power_supply_propval *pval) { if (IS_ERR_OR_NULL(chg->iio.batt_i_chan)) chg->iio.batt_i_chan = iio_channel_get(chg->dev, "batt_i"); if (IS_ERR(chg->iio.batt_i_chan)) return PTR_ERR(chg->iio.batt_i_chan); return iio_read_channel_processed(chg->iio.batt_i_chan, &pval->intval); } /********************** * INTERRUPT HANDLERS * **********************/ Loading Loading @@ -2440,6 +2456,8 @@ static void smblib_iio_deinit(struct smb_charger *chg) iio_channel_release(chg->iio.usbin_i_chan); if (!IS_ERR_OR_NULL(chg->iio.usbin_v_chan)) iio_channel_release(chg->iio.usbin_v_chan); if (!IS_ERR_OR_NULL(chg->iio.batt_i_chan)) iio_channel_release(chg->iio.batt_i_chan); } int smblib_init(struct smb_charger *chg) Loading
drivers/power/qcom-charger/smb-lib.h +4 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,7 @@ struct smb_iio { struct iio_channel *temp_max_chan; struct iio_channel *usbin_i_chan; struct iio_channel *usbin_v_chan; struct iio_channel *batt_i_chan; }; struct smb_charger { Loading Loading @@ -301,6 +302,9 @@ int smblib_set_prop_typec_power_role(struct smb_charger *chg, int smblib_set_prop_pd_active(struct smb_charger *chg, const union power_supply_propval *val); int smblib_get_prop_slave_current_now(struct smb_charger *chg, union power_supply_propval *val); int smblib_init(struct smb_charger *chg); int smblib_deinit(struct smb_charger *chg); #endif /* __SMB2_CHARGER_H */ Loading
drivers/power/qcom-charger/smb138x-charger.c +4 −0 Original line number Diff line number Diff line Loading @@ -395,6 +395,7 @@ 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_CURRENT_NOW, POWER_SUPPLY_PROP_CHARGER_TEMP, POWER_SUPPLY_PROP_CHARGER_TEMP_MAX, }; Loading Loading @@ -431,6 +432,9 @@ 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_CURRENT_NOW: rc = smblib_get_prop_slave_current_now(chg, val); break; case POWER_SUPPLY_PROP_CHARGER_TEMP: rc = smblib_get_prop_charger_temp(chg, val); break; Loading