Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp547559pxx; Wed, 28 Oct 2020 10:48:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwW/47imYSgzFYXG/v4RD5xz1Gid9SLRTyaXGJn+72a0KbdoNMfVt+fkXyfOTsrI1bicw9U X-Received: by 2002:aa7:ccd5:: with SMTP id y21mr6305edt.111.1603907313658; Wed, 28 Oct 2020 10:48:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603907313; cv=none; d=google.com; s=arc-20160816; b=vbbT41/QFW6Vr46tK3mYL8pg3ciGYUpqamB43InDXY+XYrAltEyQXFcCEdHiADxP8d 3oGm7dh/SVMJEyYXtJLYvbsgm8UGk+wznp2Xx8FILjCFWY4W+Ru+xni7JOntyfu6vb7c E06tfiAel/TEdxWzuDBBypVcQKnXIkimyNbZ0B/oPaBCfdrCd6T0Hcro4F5Wj7Yx73xO tK9sLj4MGMpFL2dWTdUYNqSmoAqEe5nZwR9Hg4x8vv+gCPylqaRU3/OUI4KDMRTJpOT4 i4XCSpGjqIshbh3HhF5dSDTAyOGxasoIVNaR/hQBAEXfimvF3O9pRRtrpj2gdM5eBEAL FWcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=807sOLdqwgnAyj71IoZ5gIos6+0azuDGDEd483PBBLI=; b=NA0G3VR0m8++gK5p3Dqu2FVlmsrxrTPFkoWAkpR2BaZ9g8E3vjbmhPR9GDe4OhDxTq vOzrzaV8RBMls+57axYS8raBy/BtCvhGb0umWheWIdEwAArf7NrFifuuV60IK3Mbvgpi TMey/7xDlWpTV0KuDlstuvmp4A8Exjy1QBqyYfbhQdXNaF93aFduPRSVHOyZ9sO/TefF 9zHnPb19QeM6T+qmiKVWVgvlimm0TJVdhQf5kx+7z4mWKFlisX90k9SQPETj9fAMRZLG vqHsD5VEsBx35SrRpXTtlefujuSKzYiyI6vvABymEy5cBMbivwWCXryQUOTx5hQq8cWm HheA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ma8MrtpK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i5si3856525ejx.656.2020.10.28.10.48.09; Wed, 28 Oct 2020 10:48:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ma8MrtpK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1822798AbgJ0Rwc (ORCPT + 99 others); Tue, 27 Oct 2020 13:52:32 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:40650 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1822778AbgJ0Rw2 (ORCPT ); Tue, 27 Oct 2020 13:52:28 -0400 Received: by mail-pf1-f195.google.com with SMTP id w21so1350408pfc.7 for ; Tue, 27 Oct 2020 10:52:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=807sOLdqwgnAyj71IoZ5gIos6+0azuDGDEd483PBBLI=; b=ma8MrtpKWnvLHz9JdBhZmp3Bb1x9dZ9VDEljydi7sbfA58vIxGmi/rJR7xGJh34A9t 2di7lSTtL/p3h3Y/vNXK0DfOBD5QUj6IG9C2+TINopx6/RGrbnl5/4WV+j7j854Gkwyb FOTbHpvQq/wJx0NGKTTbcpVF0N5s5omoG3hBW3EpDj3kmtqO0qmdE3CdgaFBFF32nDi+ wIXADSibPCcXIYrScuFOZa75PAQc6XD/zzEjawwyhJjiB5UOAWbu5RVzPOiiezftYU1j XOevQ22B+EjBFLiNhfVaQPU87ADom08sCBlAyB+pabn6BhRT1jSuag4YTUIhqC0YNc6k fjfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=807sOLdqwgnAyj71IoZ5gIos6+0azuDGDEd483PBBLI=; b=BZDaJnAiK547AiNKKl/BO3wb83o5P06gBbhW9zyWXg95MbEFjDY+MQZF2v1QlFd9/q jPrHfw84OLm/lu9Lr/x20kC5CJJZhwIbw9j9KD5i3fc4AM07Yq8JhIbpaLfrO15+t7Hn BYPnjiHGAd0hHjR7qp+ZG4KXjNWII+pNP//4Lci2ErA4YppV502yqblWiIjhmUW0EFtO K9WemFUNXnwyjm11hU0kDDf5D8AqG9eBeazSl79riSqpe1JSM5bl8TPEwxUWDOXGVGxu AsVkGqPfzRmf9N+yA2q7fXDtTmK2ZWKx1MgaYtR7bbwLw+gEXpYb23wGlw5l6FByEbo0 BgmA== X-Gm-Message-State: AOAM531ZwhR4ikdsITdbsS2ipwZaH9Xv92rHv0+6FpXjbVmCJDXfvDGH PnRZnSVo0OEBtqh7nkgWzdpblNkpSq4jvg== X-Received: by 2002:aa7:9192:0:b029:15c:ebd2:971c with SMTP id x18-20020aa791920000b029015cebd2971cmr3489331pfa.33.1603821147934; Tue, 27 Oct 2020 10:52:27 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id r8sm2761225pgl.57.2020.10.27.10.52.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 10:52:27 -0700 (PDT) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: guennadi.liakhovetski@linux.intel.com, arnaud.pouliquen@st.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 6/8] rpmsg: virtio: Add rpmsg channel device ops Date: Tue, 27 Oct 2020 11:52:16 -0600 Message-Id: <20201027175218.1033609-7-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201027175218.1033609-1-mathieu.poirier@linaro.org> References: <20201027175218.1033609-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaud Pouliquen Implement the create and release of the RPMsg channel for the RPMsg virtio bus. Signed-off-by: Arnaud Pouliquen Signed-off-by: Mathieu Poirier Reviewed-by: Guennadi Liakhovetski --- drivers/rpmsg/virtio_rpmsg_bus.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 01f05bc570a4..ff8afee807cc 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c @@ -151,6 +151,8 @@ static int virtio_rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst); static int virtio_rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst, void *data, int len); +static struct rpmsg_device * __rpmsg_create_channel(struct virtproc_info *vrp, + struct rpmsg_channel_info *chinfo); static const struct rpmsg_endpoint_ops virtio_endpoint_ops = { .destroy_ept = virtio_rpmsg_destroy_ept, @@ -255,6 +257,24 @@ static struct rpmsg_endpoint *__rpmsg_create_ept(struct virtproc_info *vrp, return NULL; } +static struct rpmsg_device *virtio_rpmsg_create_channel(struct rpmsg_device *rpdev, + struct rpmsg_channel_info *chinfo) +{ + struct virtio_rpmsg_channel *vch = to_virtio_rpmsg_channel(rpdev); + struct virtproc_info *vrp = vch->vrp; + + return __rpmsg_create_channel(vrp, chinfo); +} + +static int virtio_rpmsg_release_channel(struct rpmsg_device *rpdev, + struct rpmsg_channel_info *chinfo) +{ + struct virtio_rpmsg_channel *vch = to_virtio_rpmsg_channel(rpdev); + struct virtproc_info *vrp = vch->vrp; + + return rpmsg_unregister_device(&vrp->vdev->dev, chinfo); +} + static struct rpmsg_endpoint *virtio_rpmsg_create_ept(struct rpmsg_device *rpdev, rpmsg_rx_cb_t cb, void *priv, @@ -347,6 +367,8 @@ static int virtio_rpmsg_announce_destroy(struct rpmsg_device *rpdev) } static const struct rpmsg_device_ops virtio_rpmsg_ops = { + .create_channel = virtio_rpmsg_create_channel, + .release_channel = virtio_rpmsg_release_channel, .create_ept = virtio_rpmsg_create_ept, .announce_create = virtio_rpmsg_announce_create, .announce_destroy = virtio_rpmsg_announce_destroy, -- 2.25.1