soc: qcom: smd: Represent smd edges as devices

By representing each edge as its own device the channels are no longer
tied to being parented by the same smd device and as such an edge can
live as children of e.g. remoteproc instances.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
This commit is contained in:
Bjorn Andersson 2016-08-15 11:15:57 -07:00 committed by Andy Gross
parent 381a0b4ce4
commit da0573026c
2 changed files with 141 additions and 76 deletions

View file

@ -61,6 +61,10 @@ void qcom_smd_set_drvdata(struct qcom_smd_channel *channel, void *data);
int qcom_smd_send(struct qcom_smd_channel *channel, const void *data, int len);
struct qcom_smd_edge *qcom_smd_register_edge(struct device *parent,
struct device_node *node);
int qcom_smd_unregister_edge(struct qcom_smd_edge *edge);
#else
static inline int qcom_smd_driver_register(struct qcom_smd_driver *drv)
@ -111,6 +115,20 @@ static inline int qcom_smd_send(struct qcom_smd_channel *channel,
return -ENXIO;
}
static inline struct qcom_smd_edge *
qcom_smd_register_edge(struct device *parent,
struct device_node *node)
{
return ERR_PTR(-ENXIO);
}
static inline int qcom_smd_unregister_edge(struct qcom_smd_edge *edge)
{
/* This shouldn't be possible */
WARN_ON(1);
return -ENXIO;
}
#endif
#define module_qcom_smd_driver(__smd_driver) \