mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
soc: qcom: smd: Make callback pass channel reference
By passing the smd channel reference to the callback, rather than the smd device, we can open additional smd channels from sub-devices of smd devices. Also updates the two smd clients today found in mainline. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Andy Gross <andy.gross@linaro.org>
This commit is contained in:
parent
afd356dfb3
commit
b853cb9628
4 changed files with 33 additions and 13 deletions
|
@ -26,7 +26,7 @@ struct qcom_smd_device {
|
|||
struct qcom_smd_channel *channel;
|
||||
};
|
||||
|
||||
typedef int (*qcom_smd_cb_t)(struct qcom_smd_device *, const void *, size_t);
|
||||
typedef int (*qcom_smd_cb_t)(struct qcom_smd_channel *, const void *, size_t);
|
||||
|
||||
/**
|
||||
* struct qcom_smd_driver - smd driver struct
|
||||
|
@ -50,13 +50,16 @@ struct qcom_smd_driver {
|
|||
int qcom_smd_driver_register(struct qcom_smd_driver *drv);
|
||||
void qcom_smd_driver_unregister(struct qcom_smd_driver *drv);
|
||||
|
||||
void *qcom_smd_get_drvdata(struct qcom_smd_channel *channel);
|
||||
void qcom_smd_set_drvdata(struct qcom_smd_channel *channel, void *data);
|
||||
|
||||
#define module_qcom_smd_driver(__smd_driver) \
|
||||
module_driver(__smd_driver, qcom_smd_driver_register, \
|
||||
qcom_smd_driver_unregister)
|
||||
|
||||
int qcom_smd_send(struct qcom_smd_channel *channel, const void *data, int len);
|
||||
|
||||
struct qcom_smd_channel *qcom_smd_open_channel(struct qcom_smd_device *sdev,
|
||||
struct qcom_smd_channel *qcom_smd_open_channel(struct qcom_smd_channel *channel,
|
||||
const char *name,
|
||||
qcom_smd_cb_t cb);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue