#ifndef _PRUSS_DRIVER_H_
#define _PRUSS_DRIVER_H_
#include <linux/mutex.h>
#include <linux/remoteproc/pruss.h>
#include <linux/types.h>
#include <linux/err.h>
enum pruss_gp_mux_sel { … };
enum pruss_gpi_mode { … };
enum pru_type { … };
enum pruss_mem { … };
struct pruss_mem_region { … };
struct pruss { … };
#if IS_ENABLED(CONFIG_TI_PRUSS)
struct pruss *pruss_get(struct rproc *rproc);
void pruss_put(struct pruss *pruss);
int pruss_request_mem_region(struct pruss *pruss, enum pruss_mem mem_id,
struct pruss_mem_region *region);
int pruss_release_mem_region(struct pruss *pruss,
struct pruss_mem_region *region);
int pruss_cfg_get_gpmux(struct pruss *pruss, enum pruss_pru_id pru_id, u8 *mux);
int pruss_cfg_set_gpmux(struct pruss *pruss, enum pruss_pru_id pru_id, u8 mux);
int pruss_cfg_gpimode(struct pruss *pruss, enum pruss_pru_id pru_id,
enum pruss_gpi_mode mode);
int pruss_cfg_miirt_enable(struct pruss *pruss, bool enable);
int pruss_cfg_xfr_enable(struct pruss *pruss, enum pru_type pru_type,
bool enable);
#else
static inline struct pruss *pruss_get(struct rproc *rproc)
{
return ERR_PTR(-EOPNOTSUPP);
}
static inline void pruss_put(struct pruss *pruss) { }
static inline int pruss_request_mem_region(struct pruss *pruss,
enum pruss_mem mem_id,
struct pruss_mem_region *region)
{
return -EOPNOTSUPP;
}
static inline int pruss_release_mem_region(struct pruss *pruss,
struct pruss_mem_region *region)
{
return -EOPNOTSUPP;
}
static inline int pruss_cfg_get_gpmux(struct pruss *pruss,
enum pruss_pru_id pru_id, u8 *mux)
{
return ERR_PTR(-EOPNOTSUPP);
}
static inline int pruss_cfg_set_gpmux(struct pruss *pruss,
enum pruss_pru_id pru_id, u8 mux)
{
return ERR_PTR(-EOPNOTSUPP);
}
static inline int pruss_cfg_gpimode(struct pruss *pruss,
enum pruss_pru_id pru_id,
enum pruss_gpi_mode mode)
{
return ERR_PTR(-EOPNOTSUPP);
}
static inline int pruss_cfg_miirt_enable(struct pruss *pruss, bool enable)
{
return ERR_PTR(-EOPNOTSUPP);
}
static inline int pruss_cfg_xfr_enable(struct pruss *pruss,
enum pru_type pru_type,
bool enable);
{
return ERR_PTR(-EOPNOTSUPP);
}
#endif
#endif