1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __QCOM_SMEM_STATE__
3 #define __QCOM_SMEM_STATE__
8 struct qcom_smem_state;
10 struct qcom_smem_state_ops {
11 int (*update_bits)(void *, u32, u32);
14 #ifdef CONFIG_QCOM_SMEM_STATE
16 struct qcom_smem_state *qcom_smem_state_get(struct device *dev, const char *con_id, unsigned *bit);
17 struct qcom_smem_state *devm_qcom_smem_state_get(struct device *dev, const char *con_id, unsigned *bit);
18 void qcom_smem_state_put(struct qcom_smem_state *);
20 int qcom_smem_state_update_bits(struct qcom_smem_state *state, u32 mask, u32 value);
22 struct qcom_smem_state *qcom_smem_state_register(struct device_node *of_node, const struct qcom_smem_state_ops *ops, void *data);
23 void qcom_smem_state_unregister(struct qcom_smem_state *state);
27 static inline struct qcom_smem_state *qcom_smem_state_get(struct device *dev,
28 const char *con_id, unsigned *bit)
30 return ERR_PTR(-EINVAL);
33 static inline struct qcom_smem_state *devm_qcom_smem_state_get(struct device *dev,
37 return ERR_PTR(-EINVAL);
40 static inline void qcom_smem_state_put(struct qcom_smem_state *state)
44 static inline int qcom_smem_state_update_bits(struct qcom_smem_state *state,
50 static inline struct qcom_smem_state *qcom_smem_state_register(struct device_node *of_node,
51 const struct qcom_smem_state_ops *ops, void *data)
53 return ERR_PTR(-EINVAL);
56 static inline void qcom_smem_state_unregister(struct qcom_smem_state *state)