diff --git a/drivers/power/supply/qcom/fg-core.h b/drivers/power/supply/qcom/fg-core.h index 58fed6c31c3d..0ad368d7591e 100644 --- a/drivers/power/supply/qcom/fg-core.h +++ b/drivers/power/supply/qcom/fg-core.h @@ -357,11 +357,6 @@ static const struct fg_pt fg_tsmc_osc_table[] = { { 90, 444992 }, }; -struct fg_saved_data { - union power_supply_propval val; - unsigned long last_req_expires; -}; - struct fg_chip { struct device *dev; struct pmic_revid_data *pmic_rev_id; @@ -433,7 +428,6 @@ struct fg_chip { struct delayed_work sram_dump_work; struct fg_circ_buf ibatt_circ_buf; struct fg_circ_buf vbatt_circ_buf; - struct fg_saved_data saved_data[POWER_SUPPLY_PROP_MAX]; }; /* Debugfs data structures are below */ diff --git a/drivers/power/supply/qcom/qpnp-fg-gen3.c b/drivers/power/supply/qcom/qpnp-fg-gen3.c index ef9519b76d91..a7f544c1a257 100644 --- a/drivers/power/supply/qcom/qpnp-fg-gen3.c +++ b/drivers/power/supply/qcom/qpnp-fg-gen3.c @@ -410,8 +410,6 @@ module_param_named( static int fg_restart; static bool fg_sram_dump; -#define FG_RATE_LIM_MS (2 * MSEC_PER_SEC) - /* All getters HERE */ #define VOLTAGE_15BIT_MASK GENMASK(14, 0) @@ -1330,15 +1328,6 @@ static bool batt_psy_initialized(struct fg_chip *chip) return true; } -static bool usb_psy_initialized(struct fg_chip *chip) -{ - if (chip->usb_psy) - return true; - - chip->usb_psy = power_supply_get_by_name("usb"); - return chip->usb_psy; -} - static bool is_parallel_charger_available(struct fg_chip *chip) { if (!chip->parallel_psy) @@ -3361,36 +3350,8 @@ static int fg_psy_get_property(struct power_supply *psy, union power_supply_propval *pval) { struct fg_chip *chip = power_supply_get_drvdata(psy); - struct fg_saved_data *sd = chip->saved_data + psp; - union power_supply_propval typec_sts = { .intval = -1 }; int rc = 0; - switch (psp) { - case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN: - case POWER_SUPPLY_PROP_RESISTANCE_ID: - case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN: - case POWER_SUPPLY_PROP_CYCLE_COUNT_ID: - case POWER_SUPPLY_PROP_CHARGE_NOW: - case POWER_SUPPLY_PROP_CHARGE_FULL: - case POWER_SUPPLY_PROP_SOC_REPORTING_READY: - /* These props don't require a fg query; don't ratelimit them */ - break; - default: - if (!sd->last_req_expires) - break; - - if (usb_psy_initialized(chip)) - power_supply_get_property(chip->usb_psy, - POWER_SUPPLY_PROP_TYPEC_MODE, &typec_sts); - - if (typec_sts.intval == POWER_SUPPLY_TYPEC_NONE && - time_before(jiffies, sd->last_req_expires)) { - *pval = sd->val; - return 0; - } - break; - } - switch (psp) { case POWER_SUPPLY_PROP_CAPACITY: rc = fg_get_prop_capacity(chip, &pval->intval); @@ -3479,9 +3440,6 @@ static int fg_psy_get_property(struct power_supply *psy, if (rc < 0) return -ENODATA; - sd->val = *pval; - sd->last_req_expires = jiffies + msecs_to_jiffies(FG_RATE_LIM_MS); - return 0; } diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 68e9350f1561..44ad159cc648 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -263,7 +263,6 @@ enum power_supply_property { POWER_SUPPLY_PROP_MANUFACTURER, POWER_SUPPLY_PROP_SERIAL_NUMBER, POWER_SUPPLY_PROP_BATTERY_TYPE, - POWER_SUPPLY_PROP_MAX }; enum power_supply_type {