From fc208fe769a43a45630ade9c8f1cd1a8987b6a1e Mon Sep 17 00:00:00 2001 From: itsshashanksp <9945shashank@gmail.com> Date: Wed, 3 Jul 2024 13:43:52 +0530 Subject: [PATCH] power: supply: qcom: Make batterydata profile devices specific Signed-off-by: Shashank Patil <9945shashank@gmail.com> --- drivers/power/supply/qcom/qpnp-qg.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/power/supply/qcom/qpnp-qg.c b/drivers/power/supply/qcom/qpnp-qg.c index 3f23be0dfd66..d1410237b5e6 100644 --- a/drivers/power/supply/qcom/qpnp-qg.c +++ b/drivers/power/supply/qcom/qpnp-qg.c @@ -3622,16 +3622,19 @@ static int qg_load_battery_profile(struct qpnp_qg *chip) return rc; } #endif + +#ifdef CONFIG_K6_CHARGE pr_err("is_batt_vendor_swd is %d\n", is_batt_vendor_swd); profile_node = of_batterydata_get_best_profile(chip->batt_node, chip->batt_id_ohm / 1000, "K6_sunwoda_5020mah"); - +#else rc = of_property_read_string(profile_node, "qcom,battery-type", &chip->bp.batt_type_str); if (rc < 0) { pr_err("Failed to detect battery type rc:%d\n", rc); return rc; } +#endif #ifdef CONFIG_BATT_VERIFY_BY_DS28E16 if (!chip->dt.qg_page0_unused) {