]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - include/linux/soc/qcom/smem_state.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[mirror_ubuntu-jammy-kernel.git] / include / linux / soc / qcom / smem_state.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
9460ae2f
BA
2#ifndef __QCOM_SMEM_STATE__
3#define __QCOM_SMEM_STATE__
4
6c0b2e83 5#include <linux/err.h>
e8b123e6
BA
6
7struct device_node;
9460ae2f
BA
8struct qcom_smem_state;
9
10struct qcom_smem_state_ops {
11 int (*update_bits)(void *, u32, u32);
12};
13
e8b123e6
BA
14#ifdef CONFIG_QCOM_SMEM_STATE
15
9460ae2f
BA
16struct qcom_smem_state *qcom_smem_state_get(struct device *dev, const char *con_id, unsigned *bit);
17void qcom_smem_state_put(struct qcom_smem_state *);
18
19int qcom_smem_state_update_bits(struct qcom_smem_state *state, u32 mask, u32 value);
20
21struct qcom_smem_state *qcom_smem_state_register(struct device_node *of_node, const struct qcom_smem_state_ops *ops, void *data);
22void qcom_smem_state_unregister(struct qcom_smem_state *state);
23
e8b123e6
BA
24#else
25
26static inline struct qcom_smem_state *qcom_smem_state_get(struct device *dev,
27 const char *con_id, unsigned *bit)
28{
29 return ERR_PTR(-EINVAL);
30}
31
32static inline void qcom_smem_state_put(struct qcom_smem_state *state)
33{
34}
35
36static inline int qcom_smem_state_update_bits(struct qcom_smem_state *state,
37 u32 mask, u32 value)
38{
39 return -EINVAL;
40}
41
42static inline struct qcom_smem_state *qcom_smem_state_register(struct device_node *of_node,
43 const struct qcom_smem_state_ops *ops, void *data)
44{
45 return ERR_PTR(-EINVAL);
46}
47
48static inline void qcom_smem_state_unregister(struct qcom_smem_state *state)
49{
50}
51
52#endif
53
9460ae2f 54#endif