power: pmic-voter: Export Interfaces

Export some pmic-voter interfaces for dlkm usage as well
as create access functions that are exported for dlkm to
manipulate the struct.

Change-Id: I306c65c9890bd69dc49fcd722ac0981ddb908dc6
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1200744
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-by: Ling Jin <lingjin@motorola.com>
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1770243
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
This commit is contained in:
Kenny Kessler 2018-06-27 17:01:14 -05:00 • committed by Xiaojun Ji
commit 0637aeab60
2 changed files with 34 additions and 0 deletions

View file

@ -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;

View file

@ -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 */