Export some pmic-voter interfaces for dlkm usage as well as create access functions that are exported for dlkm to manipulate the struct. ported from https://gerrit.mot.com/1200744 Change-Id: I073a4e976f8cd184fa20b262eba9bc962a4a1bb2 Signed-off-by: zhaoxp3 <zhaoxp3@motorola.com> Reviewed-on: https://gerrit.mot.com/1499583 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Wang Wang <wangwang1@lenovo.com> Submit-Approved: Jira Key
53 lines
1.8 KiB
C
53 lines
1.8 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/*
|
|
* Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
|
|
*/
|
|
|
|
#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);
|
|
bool is_override_vote_enabled(struct votable *votable);
|
|
bool is_override_vote_enabled_locked(struct votable *votable);
|
|
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 vote_override(struct votable *votable, const char *override_client,
|
|
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);
|
|
|
|
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 */
|