2015-09-25 08:25:01 +07:00
|
|
|
#ifndef __QCOM_SMEM_STATE__
|
|
|
|
#define __QCOM_SMEM_STATE__
|
|
|
|
|
2017-01-11 21:32:17 +07:00
|
|
|
#include <linux/err.h>
|
2015-12-24 15:28:38 +07:00
|
|
|
|
|
|
|
struct device_node;
|
2015-09-25 08:25:01 +07:00
|
|
|
struct qcom_smem_state;
|
|
|
|
|
|
|
|
struct qcom_smem_state_ops {
|
|
|
|
int (*update_bits)(void *, u32, u32);
|
|
|
|
};
|
|
|
|
|
2015-12-24 15:28:38 +07:00
|
|
|
#ifdef CONFIG_QCOM_SMEM_STATE
|
|
|
|
|
2015-09-25 08:25:01 +07:00
|
|
|
struct qcom_smem_state *qcom_smem_state_get(struct device *dev, const char *con_id, unsigned *bit);
|
|
|
|
void qcom_smem_state_put(struct qcom_smem_state *);
|
|
|
|
|
|
|
|
int qcom_smem_state_update_bits(struct qcom_smem_state *state, u32 mask, u32 value);
|
|
|
|
|
|
|
|
struct qcom_smem_state *qcom_smem_state_register(struct device_node *of_node, const struct qcom_smem_state_ops *ops, void *data);
|
|
|
|
void qcom_smem_state_unregister(struct qcom_smem_state *state);
|
|
|
|
|
2015-12-24 15:28:38 +07:00
|
|
|
#else
|
|
|
|
|
|
|
|
static inline struct qcom_smem_state *qcom_smem_state_get(struct device *dev,
|
|
|
|
const char *con_id, unsigned *bit)
|
|
|
|
{
|
|
|
|
return ERR_PTR(-EINVAL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void qcom_smem_state_put(struct qcom_smem_state *state)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int qcom_smem_state_update_bits(struct qcom_smem_state *state,
|
|
|
|
u32 mask, u32 value)
|
|
|
|
{
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline struct qcom_smem_state *qcom_smem_state_register(struct device_node *of_node,
|
|
|
|
const struct qcom_smem_state_ops *ops, void *data)
|
|
|
|
{
|
|
|
|
return ERR_PTR(-EINVAL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void qcom_smem_state_unregister(struct qcom_smem_state *state)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2015-09-25 08:25:01 +07:00
|
|
|
#endif
|