diff --git a/drivers/power/supply/qcom/pmic-voter.c b/drivers/power/supply/qcom/pmic-voter.c index b10c2a060b10..438ad026f30d 100644 --- a/drivers/power/supply/qcom/pmic-voter.c +++ b/drivers/power/supply/qcom/pmic-voter.c @@ -340,6 +340,7 @@ int get_effective_result(struct votable *votable) unlock_votable(votable); return value; } +EXPORT_SYMBOL(get_effective_result); /** * get_effective_client() - @@ -498,6 +499,7 @@ out: unlock_votable(votable); return rc; } +EXPORT_SYMBOL(vote); /** * vote_override() - @@ -571,6 +573,7 @@ int rerun_election(struct votable *votable) unlock_votable(votable); return rc; } +EXPORT_SYMBOL(rerun_election); struct votable *find_votable(const char *name) { @@ -599,6 +602,7 @@ out: else return NULL; } +EXPORT_SYMBOL(find_votable); static int force_active_get(void *data, u64 *val) { @@ -645,6 +649,32 @@ out: DEFINE_DEBUGFS_ATTRIBUTE(votable_force_ops, force_active_get, force_active_set, "%lld\n"); +int pmic_vote_force_val_set(struct votable *votable, u32 val) { + if(votable) { + votable->force_val = val; + return 0; + } + + return -EINVAL; +} +EXPORT_SYMBOL(pmic_vote_force_val_set); + +int pmic_vote_force_active_get(struct votable *votable, u64 *val) { + if(votable) + return force_active_get(votable, val); + + return -EINVAL; +} +EXPORT_SYMBOL(pmic_vote_force_active_get); + +int pmic_vote_force_active_set(struct votable *votable, u64 val) { + if(votable) + return force_active_set(votable, val); + + return -EINVAL; +} +EXPORT_SYMBOL(pmic_vote_force_active_set); + static int show_votable_clients(struct seq_file *m, void *data) { struct votable *votable = m->private; diff --git a/include/linux/pmic-voter.h b/include/linux/pmic-voter.h index d1202928ddd8..78239ca19927 100644 --- a/include/linux/pmic-voter.h +++ b/include/linux/pmic-voter.h @@ -44,4 +44,8 @@ void destroy_votable(struct votable *votable); void lock_votable(struct votable *votable); void unlock_votable(struct votable *votable); +int pmic_vote_force_val_set(struct votable *votable, u32 val); +int pmic_vote_force_active_get(struct votable *votable, u64 *val); +int pmic_vote_force_active_set(struct votable *votable, u64 val); + #endif /* __PMIC_VOTER_H */