diff options
author | Bjorn Andersson <bjorn@kryo.se> | 2015-12-24 03:28:38 -0500 |
---|---|---|
committer | Andy Gross <andy.gross@linaro.org> | 2016-03-30 18:20:27 -0400 |
commit | e8b123e6008480b2b8d80dae060315d84b79f4bb (patch) | |
tree | 784bda311a1f5e3c4de7ece7e36eb2965b62f048 /include/linux/soc | |
parent | 39a3366a31386eb58f6e5857cd49cebad3253ab8 (diff) |
soc: qcom: smem_state: Add stubs for disabled smem_state
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
Diffstat (limited to 'include/linux/soc')
-rw-r--r-- | include/linux/soc/qcom/smem_state.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/linux/soc/qcom/smem_state.h b/include/linux/soc/qcom/smem_state.h index f35e1512fcaa..7b88697929e9 100644 --- a/include/linux/soc/qcom/smem_state.h +++ b/include/linux/soc/qcom/smem_state.h | |||
@@ -1,12 +1,17 @@ | |||
1 | #ifndef __QCOM_SMEM_STATE__ | 1 | #ifndef __QCOM_SMEM_STATE__ |
2 | #define __QCOM_SMEM_STATE__ | 2 | #define __QCOM_SMEM_STATE__ |
3 | 3 | ||
4 | #include <linux/errno.h> | ||
5 | |||
6 | struct device_node; | ||
4 | struct qcom_smem_state; | 7 | struct qcom_smem_state; |
5 | 8 | ||
6 | struct qcom_smem_state_ops { | 9 | struct qcom_smem_state_ops { |
7 | int (*update_bits)(void *, u32, u32); | 10 | int (*update_bits)(void *, u32, u32); |
8 | }; | 11 | }; |
9 | 12 | ||
13 | #ifdef CONFIG_QCOM_SMEM_STATE | ||
14 | |||
10 | struct qcom_smem_state *qcom_smem_state_get(struct device *dev, const char *con_id, unsigned *bit); | 15 | struct qcom_smem_state *qcom_smem_state_get(struct device *dev, const char *con_id, unsigned *bit); |
11 | void qcom_smem_state_put(struct qcom_smem_state *); | 16 | void qcom_smem_state_put(struct qcom_smem_state *); |
12 | 17 | ||
@@ -15,4 +20,34 @@ int qcom_smem_state_update_bits(struct qcom_smem_state *state, u32 mask, u32 val | |||
15 | struct qcom_smem_state *qcom_smem_state_register(struct device_node *of_node, const struct qcom_smem_state_ops *ops, void *data); | 20 | struct qcom_smem_state *qcom_smem_state_register(struct device_node *of_node, const struct qcom_smem_state_ops *ops, void *data); |
16 | void qcom_smem_state_unregister(struct qcom_smem_state *state); | 21 | void qcom_smem_state_unregister(struct qcom_smem_state *state); |
17 | 22 | ||
23 | #else | ||
24 | |||
25 | static inline struct qcom_smem_state *qcom_smem_state_get(struct device *dev, | ||
26 | const char *con_id, unsigned *bit) | ||
27 | { | ||
28 | return ERR_PTR(-EINVAL); | ||
29 | } | ||
30 | |||
31 | static inline void qcom_smem_state_put(struct qcom_smem_state *state) | ||
32 | { | ||
33 | } | ||
34 | |||
35 | static inline int qcom_smem_state_update_bits(struct qcom_smem_state *state, | ||
36 | u32 mask, u32 value) | ||
37 | { | ||
38 | return -EINVAL; | ||
39 | } | ||
40 | |||
41 | static inline struct qcom_smem_state *qcom_smem_state_register(struct device_node *of_node, | ||
42 | const struct qcom_smem_state_ops *ops, void *data) | ||
43 | { | ||
44 | return ERR_PTR(-EINVAL); | ||
45 | } | ||
46 | |||
47 | static inline void qcom_smem_state_unregister(struct qcom_smem_state *state) | ||
48 | { | ||
49 | } | ||
50 | |||
51 | #endif | ||
52 | |||
18 | #endif | 53 | #endif |