diff --git a/drivers/power/mmi-smbcharger-iio/mmi-smbcharger-iio.c b/drivers/power/mmi-smbcharger-iio/mmi-smbcharger-iio.c index e486da482535..877a1a943e36 100755 --- a/drivers/power/mmi-smbcharger-iio/mmi-smbcharger-iio.c +++ b/drivers/power/mmi-smbcharger-iio/mmi-smbcharger-iio.c @@ -16,7 +16,12 @@ #include #include #include +#include +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 61)) +#include +#else #include +#endif #include #include #include @@ -33,6 +38,22 @@ #define MODULE_LOG "SMBMMI" +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 61)) +#define get_effective_result(votable) \ + mmi_get_effective_result(votable) + +#define vote(votable, client_str, enabled, val) \ + mmi_vote(votable, client_str, enabled, val) + +#define find_votable(name) mmi_find_votable(name) + +#define pmic_vote_force_val_set(votable, val) \ + mmi_pmic_vote_force_val_set(votable, val) + +#define pmic_vote_force_active_set(votable, val) \ + mmi_pmic_vote_force_active_set(votable, val) +#endif + #define mmi_err(chg, fmt, ...) \ do { \ pr_err("%s: %s: %s: " fmt, chg->name, \ diff --git a/drivers/power/qpnp_adaptive_charge/qpnp_adaptive_charge.c b/drivers/power/qpnp_adaptive_charge/qpnp_adaptive_charge.c index 677dd1ac9f36..cc735b8271f4 100755 --- a/drivers/power/qpnp_adaptive_charge/qpnp_adaptive_charge.c +++ b/drivers/power/qpnp_adaptive_charge/qpnp_adaptive_charge.c @@ -27,11 +27,23 @@ */ #define pr_fmt(fmt) "qpnp_adap_chg-[%s]: " fmt, __func__ #include +#include +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 61)) +#include +#else #include +#endif #include #include #include +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 61)) +#define vote(votable, client_str, enabled, val) \ + mmi_vote(votable, client_str, enabled, val) + +#define find_votable(name) mmi_find_votable(name) +#endif + static struct adap_chg_data { struct power_supply *batt_psy; struct power_supply *dc_psy;