Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp3037077rwb; Mon, 7 Aug 2023 07:22:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHx89AC6aSl/QsihsM+YURYuHD6IeHmLJfn9i5GEfcGjqrMyxnMuPJ2rdxCJ1k4lAvaq7O4 X-Received: by 2002:a2e:90d4:0:b0:2b9:45ad:88b1 with SMTP id o20-20020a2e90d4000000b002b945ad88b1mr6866501ljg.2.1691418121652; Mon, 07 Aug 2023 07:22:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691418121; cv=none; d=google.com; s=arc-20160816; b=D0zgTbxcoHij16AJobHfb0K4fNSA8KJoF3KKtNA3dFhERMNccmBlSYrGIHd7gCy4lM e59bWWpP2QfM2T3TTQgYMLs+4eQ2fR9wm/dedX7b2h0Olx92GUAbQk37XK0GgrZBkk2B b04ZQ5aun7WJx0WV+0wu3sXeJoqKEbOLiSxyf6nqZ8Xjm9iUb9EVI6p8/GcqbKJpO0Zz nXFf5pD1DKwMDF3GQxq/Z+4skk8Z+UuD036qIGdxgmJ7NmzhT3S66cXr9wl/gZdGGgJI /jAEZrqF23Jxf86OjibwhBfdPi9PAGW6BMorsZJQlSZwMUl2t8Z3FvcMFLh+TNW4hjFi Tzmw== 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=CjBcI7MOePyRNzsw/XKYD6tqM+t/1zi/Fz/Jzvd8lMc=; fh=QagBC1ic3VcVFskRmEqUJZ5VlGz5jYfCtms1OQ7G2VM=; b=N4pjHvKJW+Adhkm55CeQ9M657Ag3cpcf1lOOS7rfyQYTvVUFmREOI+MHm+66kK2Q0y 0Mfa+7ocSLmqnmhMpLGXeJ+3e8zWATyMAew9ecQ2p4q++lB2RdsXKh9pq9WZBS1M9bax KsKlGBffGXhJIal9DLUgYt2/G3ZkgkRP+KHWb229KzHFdxdkWZoAMbHSoj39gGaTw1mX NILSe0XykYtjfCMHkdH86X9Btlg5UdrPCL82/PTRrCR7/ZznlsUbsxv9mfU3CNdvYHtv hvXfy4zM7CZ/AXmH2yesFWp1GfvU4YKaNkkllm/MIz+gOQNxMWcVW0iKSwThPMwqevqs Wjkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=qpQpIBV9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id br13-20020a170906d14d00b0099caf73097esi4137494ejb.226.2023.08.07.07.21.36; Mon, 07 Aug 2023 07:22:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=qpQpIBV9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231578AbjHGMAe (ORCPT + 99 others); Mon, 7 Aug 2023 08:00:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231436AbjHGMAc (ORCPT ); Mon, 7 Aug 2023 08:00:32 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCC30E5A; Mon, 7 Aug 2023 05:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1691407288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CjBcI7MOePyRNzsw/XKYD6tqM+t/1zi/Fz/Jzvd8lMc=; b=qpQpIBV9gcJaLi7D/3d4QrQuOSYVMlgPvk68Fj4GQKkMmkBL8omXdJCzE5F4U+YrxwwntZ /NJfKOn0CfOyiXhwkaeqZR+kXwBB0g9P9PFxK4IiSsLqzX6h6BL4HAW3BgB9dEulvLyEH5 sKTlk51M3TdtW1wurLRJj9H9w7szE9U= From: Paul Cercueil To: Jonathan Cameron Cc: Lars-Peter Clausen , Michael Hennerich , =?UTF-8?q?Nuno=20S=C3=A1?= , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , Alexandru Ardelean Subject: [PATCH v4 6/6] iio: buffer-dmaengine: Enable write support Date: Mon, 7 Aug 2023 13:21:13 +0200 Message-Id: <20230807112113.47157-7-paul@crapouillou.net> In-Reply-To: <20230807112113.47157-1-paul@crapouillou.net> References: <20230807112113.47157-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam: Yes X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the iio_dma_buffer_write() and iio_dma_buffer_space_available() functions provided by the buffer-dma core, to enable write support in the buffer-dmaengine code. Signed-off-by: Paul Cercueil Reviewed-by: Alexandru Ardelean --- v4: .space_available is now set to iio_dma_buffer_usage (which is functionally the exact same). --- drivers/iio/buffer/industrialio-buffer-dmaengine.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iio/buffer/industrialio-buffer-dmaengine.c b/drivers/iio/buffer/industrialio-buffer-dmaengine.c index deae5a4ac03d..ef9d890ed3c9 100644 --- a/drivers/iio/buffer/industrialio-buffer-dmaengine.c +++ b/drivers/iio/buffer/industrialio-buffer-dmaengine.c @@ -123,12 +123,14 @@ static void iio_dmaengine_buffer_release(struct iio_buffer *buf) static const struct iio_buffer_access_funcs iio_dmaengine_buffer_ops = { .read = iio_dma_buffer_read, + .write = iio_dma_buffer_write, .set_bytes_per_datum = iio_dma_buffer_set_bytes_per_datum, .set_length = iio_dma_buffer_set_length, .request_update = iio_dma_buffer_request_update, .enable = iio_dma_buffer_enable, .disable = iio_dma_buffer_disable, .data_available = iio_dma_buffer_usage, + .space_available = iio_dma_buffer_usage, .release = iio_dmaengine_buffer_release, .modes = INDIO_BUFFER_HARDWARE, -- 2.40.1