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

Commit 99f5e59b authored by Sathish Ambley's avatar Sathish Ambley Committed by Gerrit - the friendly Code Review server
Browse files

msm: ADSPRPC: Remove references to SMD



SMD is being removed from defconfig of SDM660. All the references
to SMD like macros and header files are removed from fastrpc driver.

Change-Id: Iaa961e7faee4b59562fc92133c5154027c325f53
Acked-by: default avatarVishnu Karthik <vikarthi@qti.qualcomm.com>
Signed-off-by: default avatarSathish Ambley <sathishambley@codeaurora.org>
parent dd2d22f7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -607,7 +607,7 @@ source "drivers/char/xillybus/Kconfig"

config MSM_ADSPRPC
	tristate "QTI ADSP RPC driver"
	depends on MSM_SMD
	depends on MSM_GLINK
	help
	  Provides a communication mechanism that allows for clients to
	  make remote method invocations across processor boundary to
+15 −82
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@
#include <linux/hash.h>
#include <linux/msm_ion.h>
#include <soc/qcom/secure_buffer.h>
#include <soc/qcom/smd.h>
#include <soc/qcom/glink.h>
#include <soc/qcom/subsystem_notif.h>
#include <soc/qcom/subsystem_restart.h>
@@ -211,7 +210,6 @@ struct fastrpc_channel_ctx {
	struct completion work;
	struct notifier_block nb;
	struct kref kref;
	int channel;
	int sesscount;
	int ssrcount;
	void *handle;
@@ -235,7 +233,6 @@ struct fastrpc_apps {
	spinlock_t hlock;
	struct ion_client *client;
	struct device *dev;
	bool glink;
};

struct fastrpc_mmap {
@@ -296,21 +293,18 @@ static struct fastrpc_channel_ctx gcinfo[NUM_CHANNELS] = {
	{
		.name = "adsprpc-smd",
		.subsys = "adsp",
		.channel = SMD_APPS_QDSP,
		.link.link_info.edge = "lpass",
		.link.link_info.transport = "smem",
	},
	{
		.name = "mdsprpc-smd",
		.subsys = "modem",
		.channel = SMD_APPS_MODEM,
		.link.link_info.edge = "mpss",
		.link.link_info.transport = "smem",
	},
	{
		.name = "sdsprpc-smd",
		.subsys = "slpi",
		.channel = SMD_APPS_DSPS,
		.link.link_info.edge = "dsps",
		.link.link_info.transport = "smem",
		.vmid = VMID_SSC_Q6,
@@ -1353,7 +1347,7 @@ static int fastrpc_invoke_send(struct smq_invoke_ctx *ctx,
	struct smq_msg *msg = &ctx->msg;
	struct fastrpc_file *fl = ctx->fl;
	struct fastrpc_channel_ctx *channel_ctx = &fl->apps->channel[fl->cid];
	int err = 0, len;
	int err = 0;

	VERIFY(err, 0 != channel_ctx->chan);
	if (err)
@@ -1368,7 +1362,6 @@ static int fastrpc_invoke_send(struct smq_invoke_ctx *ctx,
	msg->invoke.page.addr = ctx->buf ? ctx->buf->phys : 0;
	msg->invoke.page.size = buf_page_size(ctx->used);

	if (fl->apps->glink) {
	if (fl->ssrcount != channel_ctx->ssrcount) {
		err = -ECONNRESET;
		goto bail;
@@ -1380,52 +1373,10 @@ static int fastrpc_invoke_send(struct smq_invoke_ctx *ctx,
	err = glink_tx(channel_ctx->chan,
		(void *)&fl->apps->channel[fl->cid], msg, sizeof(*msg),
		GLINK_TX_REQ_INTENT);
	} else {
		spin_lock(&fl->apps->hlock);
		len = smd_write((smd_channel_t *)
				channel_ctx->chan,
				msg, sizeof(*msg));
		spin_unlock(&fl->apps->hlock);
		VERIFY(err, len == sizeof(*msg));
	}
 bail:
	return err;
}

static void fastrpc_smd_read_handler(int cid)
{
	struct fastrpc_apps *me = &gfa;
	struct smq_invoke_rsp rsp = {0};
	int ret = 0;

	do {
		ret = smd_read_from_cb(me->channel[cid].chan, &rsp,
					sizeof(rsp));
		if (ret != sizeof(rsp))
			break;
		rsp.ctx = rsp.ctx & ~1;
		context_notify_user(uint64_to_ptr(rsp.ctx), rsp.retval);
	} while (ret == sizeof(rsp));
}

static void smd_event_handler(void *priv, unsigned event)
{
	struct fastrpc_apps *me = &gfa;
	int cid = (int)(uintptr_t)priv;

	switch (event) {
	case SMD_EVENT_OPEN:
		complete(&me->channel[cid].work);
		break;
	case SMD_EVENT_CLOSE:
		fastrpc_notify_drivers(me, cid);
		break;
	case SMD_EVENT_DATA:
		fastrpc_smd_read_handler(cid);
		break;
	}
}

static void fastrpc_init(struct fastrpc_apps *me)
{
	int i;
@@ -1888,11 +1839,7 @@ static void fastrpc_channel_close(struct kref *kref)

	ctx = container_of(kref, struct fastrpc_channel_ctx, kref);
	cid = ctx - &gcinfo[0];
	if (!me->glink) {
		smd_close(ctx->chan);
	} else {
	fastrpc_glink_close(ctx->chan, cid);
	}
	ctx->chan = 0;
	mutex_unlock(&me->smd_mutex);
	pr_info("'closed /dev/%s c %d %d'\n", gcinfo[cid].name,
@@ -2317,16 +2264,8 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp)
	fl->ssrcount = me->channel[cid].ssrcount;
	if ((kref_get_unless_zero(&me->channel[cid].kref) == 0) ||
	    (me->channel[cid].chan == 0)) {
		if (me->glink) {
		fastrpc_glink_register(cid, me);
		VERIFY(err, 0 == fastrpc_glink_open(cid));
		} else {
			VERIFY(err, !smd_named_open_on_edge(FASTRPC_SMD_GUID,
				    gcinfo[cid].channel,
				    (smd_channel_t **)&me->channel[cid].chan,
				    (void *)(uintptr_t)cid,
				    smd_event_handler));
		}
		if (err)
			goto bail;

@@ -2513,11 +2452,7 @@ static int fastrpc_restart_notifier_cb(struct notifier_block *nb,
		mutex_lock(&me->smd_mutex);
		ctx->ssrcount++;
		if (ctx->chan) {
			if (me->glink) {
			fastrpc_glink_close(ctx->chan, cid);
			} else {
				smd_close(ctx->chan);
			}
			ctx->chan = 0;
			pr_info("'restart notifier: closed /dev/%s c %d %d'\n",
				 gcinfo[cid].name, MAJOR(me->dev_no), cid);
@@ -2738,8 +2673,6 @@ static int fastrpc_probe(struct platform_device *pdev)
		return 0;
	}

	me->glink = of_property_read_bool(dev->of_node, "qcom,fastrpc-glink");

	VERIFY(err, !of_platform_populate(pdev->dev.of_node,
					  fastrpc_match_table,
					  NULL, &pdev->dev));