Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3572064pxk; Mon, 21 Sep 2020 18:19:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQi+nyjNWaZsEadycEEarQB9+MRrivaishJmJFuFFptiQl+yFzdNaTISEY9PBcruGaVi4n X-Received: by 2002:a17:906:e103:: with SMTP id gj3mr2278844ejb.153.1600737555403; Mon, 21 Sep 2020 18:19:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600737555; cv=none; d=google.com; s=arc-20160816; b=wINnMPgS6eL0rMrhNblJkON5SrzrR6HWmYVspXdrgMNqTOiDefk7islo00Zjl+TBTp HLfLhq/TYkLwdZJJbVsqiw8Gs8oXwn8wcaeL7YwiH18fNRMTvGPHR3lca7W0qnXLJ9bn Ms06Op9tieKD6d1mpSYHTH5riVX0GrNmtp/dw3h4soHFlQB1yqhXyUNPbs93zMdLEPHa YPe9uViDD/T6wcoA/KItMSCj90sIrJlcv9PtBaYEv4KIm4guMPNnESaQiNkKgbSttpOd 1aIOKNqSiYKzlbV3gWtUzA/YljNvFdg5PRZYHd4W5koVfVy4f2b06cDjtyn/fTDYpvv5 msrw== 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=DsTBzQVhNY369Insfr5rXAu0ypsKEebbLr2rslQaLzY=; b=QbT9gC8v00/+gDe/J7pl8SvWYAgv4FQXJK0BuDihgJ46nSzWemMK/KBIba9D0LjA3F fl8WNVD4zxAL9PK1yuw58E3YMwmxwGOe0o8gFgoCznmt+YcAqk4uMRRwf8IVe9dRO44M P7/kjTDQ/cIGPQ8xicQQydl15urn1osdufwk1PoSTlqD/TjX9XqD4mglajFeA1RQGCTv 6JBvMk4IVFO23EFAJuGfwu7Qc2Nnu0ZVwZ0A2tlz48HgUXJw8xJxBIS+rGXh0BulI6ox AjZ2k0g2OsOqleHQYVk+ncONC+C5Plvo3o238QYtJRylSpk8rnycUNw57AI7snE9SArC /nBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qLAPqGaH; 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 lc20si4488536ejb.534.2020.09.21.18.18.51; Mon, 21 Sep 2020 18:19:15 -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=qLAPqGaH; 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 S1729044AbgIVAKH (ORCPT + 99 others); Mon, 21 Sep 2020 20:10:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729011AbgIVAKG (ORCPT ); Mon, 21 Sep 2020 20:10:06 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6C53C0613CF for ; Mon, 21 Sep 2020 17:10:05 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id y1so10444446pgk.8 for ; Mon, 21 Sep 2020 17:10:05 -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=DsTBzQVhNY369Insfr5rXAu0ypsKEebbLr2rslQaLzY=; b=qLAPqGaHTnCaB6cYxJdNHQJrH1Fc3RZ3EuL2TAqpYtuu4ulTy6Dgjy/8BLCYkaMHRv QYOIw9dtogpkvN9q+5t0WsMIGV/H5W/7qEft/xU8cs48tUiTzlEY7JnICqY/d8XZocrs kpbfzWtv44TKHxaRurzkZ53FrjpLo3llirw6COXZOm8kv6nXpq5Hr/YU7Z1KbFzZtFvL rsvpVuaflv8vR157l6TIL/dapxxb/msR2kVl5wu6tpMRofbZbiGQ1ODcNNoqYCwfD6+L wdX+FprrsbTddSMVdem6ahSWaySeDBeFCwwFJ8eYcc2jRBVJ/335leON/8WbsrAGwKUT RiVQ== 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=DsTBzQVhNY369Insfr5rXAu0ypsKEebbLr2rslQaLzY=; b=MsnDG8+cRfegKaCk4CvcE84nem4ZHeChNDzGe/P2N2N5NRUTAQPW1/o9KEZIbrYbFp qXX7gae57/YGhS7QmankCpyRvd02yyDo5mFc1maJAfotjJNm8CO0hjyW4d03a9dn9Vuj upE9ibZBIrjmlcbPZz+c8d+EpTIVymZqSUoeZ7qii8KXwJUDatShMvFFHr0heOBuW2eX dMSUxrXEFfWgSruY4hwy0Qqkbvbc93N773eOvGmmEu6QU0raaHe54YbrVhqSIFc0XOAl TJxf2275vfAKtfCI1nC7wtuJLWepcaPOl/7ZBI8w6oInnyy0H5xyYhifS4xbQCgRsWq6 3qGQ== X-Gm-Message-State: AOAM530e5ynSvxulAutI3wKVlgqEOqTEHsGoA69eomWyJz/FVg3/4ZOx naue8UJutdCiSIS4acC8wbIU2g== X-Received: by 2002:a17:902:758b:b029:d2:29fc:c841 with SMTP id j11-20020a170902758bb02900d229fcc841mr2220526pll.39.1600733405481; Mon, 21 Sep 2020 17:10:05 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id c9sm12807953pfn.78.2020.09.21.17.10.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2020 17:10:04 -0700 (PDT) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org, guennadi.liakhovetski@linux.intel.com Cc: loic.pallardy@st.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/10] rpmsg: virtio: Add rpmsg channel device ops Date: Mon, 21 Sep 2020 18:09:53 -0600 Message-Id: <20200922001000.899956-4-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200922001000.899956-1-mathieu.poirier@linaro.org> References: <20200922001000.899956-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 [Moved function declaration above struct virtio_rpmsg_ops] Signed-off-by: Mathieu Poirier --- drivers/rpmsg/virtio_rpmsg_bus.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index e8d55c8b9cbf..e87cf0b79542 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c @@ -181,6 +181,9 @@ 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, @@ -285,6 +288,25 @@ 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, @@ -377,6 +399,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