rpmsg updates for v4.9
The bulk of these patches involve splitting the rpmsg implementation into a framework/API part and a virtio specific backend part. It then adds the Qualcomm Shared Memory Device (SMD) as an additional supported wire format. Also included is a set of code style cleanups that have been lingering for a while. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJX9XANAAoJEAsfOT8Nma3FwocP/1EMKjeyMOiyS/giPNye7EjQ 3EIms4Or6F4ULo+/mZTgyF69RGBirFgYm2GKs2GgFcAnf4bZRmXpPNYiuJZ8LGQe 9gep35eZ+vE+KArba26Sau1bjpPiWsokeJg7JPBj8KE3uR1lH3QTVjoHa3dPXRwa NrImfZw3P2/RTgtIoDJA6CoCT8cBIiitcA++1bNGhHTu7R5hkw25mse1OFJ8sb1l D3rsnmoTcXZqY2dDA9GYqy9/krBU69Xe7QJYCyjuNI0FHIqS60M/gTJS+v4fxJbX ueM7Qsimdbmcm/tINeT3RcyM0gUrGukDgrEhwg+Ipohhji9tf7AYx0hIJ11Ylzq+ m2orJ5xDRg3/mxFMFg4bqWXKt0uYUSBMiztAneCdOdTPR5DBpVB47/i+Nqq0t5fm Ql7Ev4G877A2cZp3O/xHahGCzk9xeAWnRonGeWGqIS0V2tCXWMuVtzwBB5oa0Pd0 nlb9JFnmb2lzU5ud/y681B7LdwDEjlW8o8u7JPOqEbXTVEjOebdy/nXpBCg7I9Ik NwQLOQ8B5eOGcrki7W7qodx8BCMyEFsHrRoozdvloXePCgwOuhA5s+Ai8VqJi9Yr 9xpQpd4QHtbYHXbyM4/Pn/93MTIclcHNdE8D2qJ4/nlVtbbjwQe8p2cT7THfXTK+ GVqj+PrmRoiVS9MQ0C+1 =3bKf -----END PGP SIGNATURE----- Merge tag 'rpmsg-v4.9' of git://github.com/andersson/remoteproc Pull rpmsg updates from Bjorn Andersson: "The bulk of these patches involve splitting the rpmsg implementation into a framework/API part and a virtio specific backend part. It then adds the Qualcomm Shared Memory Device (SMD) as an additional supported wire format. Also included is a set of code style cleanups that have been lingering for a while" * tag 'rpmsg-v4.9' of git://github.com/andersson/remoteproc: (26 commits) rpmsg: smd: fix dependency on QCOM_SMD=n rpmsg: Introduce Qualcomm SMD backend rpmsg: Allow callback to return errors rpmsg: Move virtio specifics from public header rpmsg: virtio: Hide vrp pointer from the public API rpmsg: Hide rpmsg indirection tables rpmsg: Split rpmsg core and virtio backend rpmsg: Split off generic tail of create_channel() rpmsg: Move helper for finding rpmsg devices to core rpmsg: Move endpoint related interface to rpmsg core rpmsg: Indirection table for rpmsg_endpoint operations rpmsg: Move rpmsg_device API to new file rpmsg: Introduce indirection table for rpmsg_device operations rpmsg: Clean up rpmsg device vs channel naming rpmsg: Make rpmsg_create_ept() take channel_info struct rpmsg: rpmsg_send() operations takes rpmsg_endpoint rpmsg: Name rpmsg devices based on channel id rpmsg: Enable matching devices with drivers based on DT rpmsg: Drop prototypes for non-existing functions samples/rpmsg: add support for multiple instances ...
This commit is contained in:
commit
521f397085
9 changed files with 2312 additions and 553 deletions
|
|
@ -24,38 +24,52 @@
|
|||
#define MSG "hello world!"
|
||||
#define MSG_LIMIT 100
|
||||
|
||||
static void rpmsg_sample_cb(struct rpmsg_channel *rpdev, void *data, int len,
|
||||
struct instance_data {
|
||||
int rx_count;
|
||||
};
|
||||
|
||||
static int rpmsg_sample_cb(struct rpmsg_device *rpdev, void *data, int len,
|
||||
void *priv, u32 src)
|
||||
{
|
||||
int ret;
|
||||
static int rx_count;
|
||||
struct instance_data *idata = dev_get_drvdata(&rpdev->dev);
|
||||
|
||||
dev_info(&rpdev->dev, "incoming msg %d (src: 0x%x)\n", ++rx_count, src);
|
||||
dev_info(&rpdev->dev, "incoming msg %d (src: 0x%x)\n",
|
||||
++idata->rx_count, src);
|
||||
|
||||
print_hex_dump(KERN_DEBUG, __func__, DUMP_PREFIX_NONE, 16, 1,
|
||||
data, len, true);
|
||||
|
||||
/* samples should not live forever */
|
||||
if (rx_count >= MSG_LIMIT) {
|
||||
if (idata->rx_count >= MSG_LIMIT) {
|
||||
dev_info(&rpdev->dev, "goodbye!\n");
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* send a new message now */
|
||||
ret = rpmsg_send(rpdev, MSG, strlen(MSG));
|
||||
ret = rpmsg_send(rpdev->ept, MSG, strlen(MSG));
|
||||
if (ret)
|
||||
dev_err(&rpdev->dev, "rpmsg_send failed: %d\n", ret);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rpmsg_sample_probe(struct rpmsg_channel *rpdev)
|
||||
static int rpmsg_sample_probe(struct rpmsg_device *rpdev)
|
||||
{
|
||||
int ret;
|
||||
struct instance_data *idata;
|
||||
|
||||
dev_info(&rpdev->dev, "new channel: 0x%x -> 0x%x!\n",
|
||||
rpdev->src, rpdev->dst);
|
||||
|
||||
idata = devm_kzalloc(&rpdev->dev, sizeof(*idata), GFP_KERNEL);
|
||||
if (!idata)
|
||||
return -ENOMEM;
|
||||
|
||||
dev_set_drvdata(&rpdev->dev, idata);
|
||||
|
||||
/* send a message to our remote processor */
|
||||
ret = rpmsg_send(rpdev, MSG, strlen(MSG));
|
||||
ret = rpmsg_send(rpdev->ept, MSG, strlen(MSG));
|
||||
if (ret) {
|
||||
dev_err(&rpdev->dev, "rpmsg_send failed: %d\n", ret);
|
||||
return ret;
|
||||
|
|
@ -64,7 +78,7 @@ static int rpmsg_sample_probe(struct rpmsg_channel *rpdev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void rpmsg_sample_remove(struct rpmsg_channel *rpdev)
|
||||
static void rpmsg_sample_remove(struct rpmsg_device *rpdev)
|
||||
{
|
||||
dev_info(&rpdev->dev, "rpmsg sample client driver is removed\n");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue