smem_state.h (1604B)
1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef __QCOM_SMEM_STATE__ 3#define __QCOM_SMEM_STATE__ 4 5#include <linux/err.h> 6 7struct device_node; 8struct qcom_smem_state; 9 10struct qcom_smem_state_ops { 11 int (*update_bits)(void *, u32, u32); 12}; 13 14#ifdef CONFIG_QCOM_SMEM_STATE 15 16struct qcom_smem_state *qcom_smem_state_get(struct device *dev, const char *con_id, unsigned *bit); 17struct qcom_smem_state *devm_qcom_smem_state_get(struct device *dev, const char *con_id, unsigned *bit); 18void qcom_smem_state_put(struct qcom_smem_state *); 19 20int qcom_smem_state_update_bits(struct qcom_smem_state *state, u32 mask, u32 value); 21 22struct qcom_smem_state *qcom_smem_state_register(struct device_node *of_node, const struct qcom_smem_state_ops *ops, void *data); 23void qcom_smem_state_unregister(struct qcom_smem_state *state); 24 25#else 26 27static inline struct qcom_smem_state *qcom_smem_state_get(struct device *dev, 28 const char *con_id, unsigned *bit) 29{ 30 return ERR_PTR(-EINVAL); 31} 32 33static inline struct qcom_smem_state *devm_qcom_smem_state_get(struct device *dev, 34 const char *con_id, 35 unsigned *bit) 36{ 37 return ERR_PTR(-EINVAL); 38} 39 40static inline void qcom_smem_state_put(struct qcom_smem_state *state) 41{ 42} 43 44static inline int qcom_smem_state_update_bits(struct qcom_smem_state *state, 45 u32 mask, u32 value) 46{ 47 return -EINVAL; 48} 49 50static inline struct qcom_smem_state *qcom_smem_state_register(struct device_node *of_node, 51 const struct qcom_smem_state_ops *ops, void *data) 52{ 53 return ERR_PTR(-EINVAL); 54} 55 56static inline void qcom_smem_state_unregister(struct qcom_smem_state *state) 57{ 58} 59 60#endif 61 62#endif