Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp330016pxu; Wed, 14 Oct 2020 02:26:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzemeQSJadrWZjQ1tmRKxTP7p8kvJbt1kwiT+sO/n0Si5fDxsYARxKbatKJ4K/SnFzHRDf2 X-Received: by 2002:a17:907:42fd:: with SMTP id oa21mr4209320ejb.247.1602667582141; Wed, 14 Oct 2020 02:26:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602667582; cv=none; d=google.com; s=arc-20160816; b=mwbi8FHpfF+SiKg9DL8pe9fjcDEX4W4csEiMjHinoqhllsWfxXGDwEAh1hAgdjMSQP e9hUZcLUNUmexKLYspZ55UuiPkvtuQj5xKGNH8qWl3+oLeU8wQdFRUtEtROTRVxVqFNf vxEJuGo22bobYW4zbkSQ7NRo7zcq1wUyhuAaoYSTwiHzGgL61/GWgUozuE2vUF9EO3KG 1lGn6CF0tJf6EcY+A0bolfNDAZvvs5ymnZJl/7gj+2WqNTtGqnYVxHRWnPcn53q1Skhz pb/91jYhEc//rM5ReKqw1ww7CASITDquBKwJcJIcz5GziVkdYOe5RTY1K/cnQH3xRNqn Uqpw== 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=ycxUYKRLNQGbeCvnapexQBRiRUEcK7gRrJqEvEJwNPU=; b=qtESzOpe8hws+3nTXvlkHaReowA5zQ7S8rvsqVZvoOnhM2OQui5N5xFAX2QSg8tdYz qQgT37szpFtsO1RDmyU/awV5Xhxn7OrqP2/1dJC1/7Al7fIWJK8JvIC7trjU+CvYzQvC 8+NGK3A86nAtc5WBUb8jS0XPxHqQqTEyAflG337HDV6QR4Cn5aL9HrLKrYlVYO8eFbUP gsibf0MFDSBKAC52WQxMmsc8OOlMb9IQZYR7jYWSajpwzzzMKUkxQLOoebXjTt348igf IrUpvxeS2zKafPMvDdnWYew28lgedCXaotwCx9g4mtZ4jmf6vQBWsV9QxhzMqK9x3eSu 8EOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DReAvGur; 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 oc24si1644870ejb.530.2020.10.14.02.26.00; Wed, 14 Oct 2020 02:26:22 -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=DReAvGur; 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 S1730101AbgJNJW2 (ORCPT + 99 others); Wed, 14 Oct 2020 05:22:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729955AbgJNJVv (ORCPT ); Wed, 14 Oct 2020 05:21:51 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F73CC08EA7B for ; Tue, 13 Oct 2020 16:25:30 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id e10so826046pfj.1 for ; Tue, 13 Oct 2020 16:25:30 -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=ycxUYKRLNQGbeCvnapexQBRiRUEcK7gRrJqEvEJwNPU=; b=DReAvGur7O904kV9bwo2L59Z3mvZRc0h595iFLuMXVnNIjg1reLDaqCfs1ExYnuL0a xzkyYZMfg3qkxDFHouotKCI/T+UEp/ihm12qm1sAtj/fTpzqId7uRrTPLxUUbWZ38517 kdlIyO1xazLS69mHFCgSkWzuN0L/Az+SXZWaECt3NlRNN7jPH5pN2YVo3/oiQ6xAdR3P lxMJnhTu4FYgdmfecWxDNAkdXxToBCSW+tT5OK7d148gbNeZe0zmnELBGHx8BskptLpS C2PBZY4tmJsGur/D6IqtnRi7fjyV3gFOMZAjEU7oqqi8URV1XsQHhkYRP0D96WqTN2AJ crHA== 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=ycxUYKRLNQGbeCvnapexQBRiRUEcK7gRrJqEvEJwNPU=; b=UycVGQxT9omyUVZt2bXUckgJyWTFtPgnrnNfPExWNIGLf2p/PunIchTh72PRTvsgKX SpVQrsq8VVJjIVQ2aU+Rbm/SoS+UgtAmABCwNN7N8dyOk5edWGbY0jcOVclf3lr8AXYR wxCtXTty21aCB7Niwo3EgkFFNZEOlxZG/B0QpFGzowE5Ac3A9zXXt8HgKf7zOHSQNY+N wJ3IYHwTmMG3zOnfZz7rg38hCZkS4I7jh3YYVoVgWqXyK2Ly65V7nJKEwlJCJINmq0sz xP0XuVmIEXZ/SrhwfaJiV+7oAQ5OvKDpGE2Pu2ZP99Wlo/t8dB9KU/9NafyeK4fE6lXY jwdg== X-Gm-Message-State: AOAM530pDhk1GEo3keawC1bu5rBLJvU49JIpS5+RfOPgcMDcbIM5RmsG n84q7WFEYCoqfiXpGPgJ/UhCtQ== X-Received: by 2002:a63:77c4:: with SMTP id s187mr1487622pgc.303.1602631529987; Tue, 13 Oct 2020 16:25:29 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id b8sm791871pfr.159.2020.10.13.16.25.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2020 16:25:29 -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 v2 7/9] rpmsg: virtio: Add rpmsg channel device ops Date: Tue, 13 Oct 2020 17:25:17 -0600 Message-Id: <20201013232519.1367542-8-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201013232519.1367542-1-mathieu.poirier@linaro.org> References: <20201013232519.1367542-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 --- 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 fca982b61c3b..1488b9ddc18d 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c @@ -122,6 +122,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, @@ -234,6 +236,24 @@ static bool virtio_rpmsg_is_little_endian(struct rpmsg_device *rpdev) return virtio_is_little_endian(vrp->vdev); } +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, @@ -327,6 +347,8 @@ static int virtio_rpmsg_announce_destroy(struct rpmsg_device *rpdev) static const struct rpmsg_device_ops virtio_rpmsg_ops = { .is_little_endian = virtio_rpmsg_is_little_endian, + .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