diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-03-21 21:30:27 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-03-21 21:30:26 -0700 |
| commit | c65465727b39511c26ff33d03ed35a5e4dee6bc4 (patch) | |
| tree | f010953237871599da1b34fa8a595b5fa4fb89f0 /include/linux | |
| parent | 05291016841f7ed5fa1409830fff8dda46c3e448 (diff) | |
| parent | 5e34bc8d01718770752d74c2907142682b664da9 (diff) | |
Merge "pmic-voter: move to common header location"
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/pmic-voter.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/include/linux/pmic-voter.h b/include/linux/pmic-voter.h new file mode 100644 index 000000000000..f202bf704055 --- /dev/null +++ b/include/linux/pmic-voter.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2015-2016 The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __PMIC_VOTER_H +#define __PMIC_VOTER_H + +#include <linux/mutex.h> + +struct votable; + +enum votable_type { + VOTE_MIN, + VOTE_MAX, + VOTE_SET_ANY, + NUM_VOTABLE_TYPES, +}; + +bool is_client_vote_enabled(struct votable *votable, const char *client_str); +bool is_client_vote_enabled_locked(struct votable *votable, + const char *client_str); +int get_client_vote(struct votable *votable, const char *client_str); +int get_client_vote_locked(struct votable *votable, const char *client_str); +int get_effective_result(struct votable *votable); +int get_effective_result_locked(struct votable *votable); +const char *get_effective_client(struct votable *votable); +const char *get_effective_client_locked(struct votable *votable); +int vote(struct votable *votable, const char *client_str, bool state, int val); +int rerun_election(struct votable *votable); +struct votable *find_votable(const char *name); +struct votable *create_votable(const char *name, + int votable_type, + int (*callback)(struct votable *votable, + void *data, + int effective_result, + const char *effective_client), + void *data); +void destroy_votable(struct votable *votable); +void lock_votable(struct votable *votable); +void unlock_votable(struct votable *votable); + +#endif /* __PMIC_VOTER_H */ |
