Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 255b5158 authored by Sridhar Arra's avatar Sridhar Arra
Browse files

rpmsg: qcom_smd: Add announce_create ops



Adding the rpmsg announce_create ops, which gets called right
after the rpmsg device gets probed.

Change-Id: I5b22c95b691cbccdcc045092dd1d6e09b895c64b
Signed-off-by: default avatarSridhar Arra <sarra@codeaurora.org>
parent 3b7d1918
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -169,9 +169,9 @@ struct qcom_smd_endpoint {
	struct qcom_smd_channel *qsch;
};

#define to_smd_device(_rpdev)	container_of(_rpdev, struct qcom_smd_device, rpdev)
#define to_smd_device(r)        container_of(r, struct qcom_smd_device, rpdev)
#define to_smd_edge(d)		container_of(d, struct qcom_smd_edge, dev)
#define to_smd_endpoint(ept)	container_of(ept, struct qcom_smd_endpoint, ept)
#define to_smd_endpoint(e)	container_of(e, struct qcom_smd_endpoint, ept)

/**
 * struct qcom_smd_channel - smd channel struct
@@ -1021,9 +1021,26 @@ static struct device_node *qcom_smd_match_channel(struct device_node *edge_node,

	return NULL;
}
static int qcom_smd_announce_create(struct rpmsg_device *rpdev)
{
	struct qcom_smd_endpoint *qept = to_smd_endpoint(rpdev->ept);
	struct qcom_smd_channel *channel = qept->qsch;
	unsigned long flags;
	bool kick_state;

	spin_lock_irqsave(&channel->recv_lock, flags);
	kick_state = qcom_smd_channel_intr(channel);
	spin_unlock_irqrestore(&channel->recv_lock, flags);

	if (kick_state)
		schedule_work(&channel->edge->state_work);

	return 0;
}

static const struct rpmsg_device_ops qcom_smd_device_ops = {
	.create_ept = qcom_smd_create_ept,
	.announce_create = qcom_smd_announce_create,
};

static const struct rpmsg_endpoint_ops qcom_smd_endpoint_ops = {