From patchwork Fri Feb 16 14:10:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa via B4 Relay X-Patchwork-Id: 13560074 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C01EA12E1F4 for ; Fri, 16 Feb 2024 14:11:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708092689; cv=none; b=Vohb7LD3rSwr9WPh9njVY2sEkGvnq7DbYUPmPQM4WvQ3IcORc9qZ35LR7p34FdLfqRWwLllWm+VA5SMX4tFaTiMpjxSxevmyvurQYH6X+6n0COb7w+N8M8zWv3TaaKETzoCDAg2PFeNAAuZab6f1yOhYiBnfl1OE/s1qhJNzPuE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708092689; c=relaxed/simple; bh=EG20HCsns1ASyKJ4WWYbYFU9zLiRImH2DNuvQxu5Xa4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Vwp08+EkdzA68Fxclhgv4Y4kwwbor7zPpP5zC6TPpX3Z3NnU3F37+0wOJUX+k1QdxKvBKzoMaCqhqEQEIHw3nRSwe7rmi/EzjtMIA52hTDVkwu0foDeSbl85n98PSW/JAYsz1rycJHxPxnEW/LC625TMpUNywk40BV6UM6RC40A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=otV1+gJB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="otV1+gJB" Received: by smtp.kernel.org (Postfix) with ESMTPS id 69A88C43601; Fri, 16 Feb 2024 14:11:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708092689; bh=EG20HCsns1ASyKJ4WWYbYFU9zLiRImH2DNuvQxu5Xa4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=otV1+gJB552r5G5/TrOy3nz2VOZS31v0Zd3kNXteHeXuqu+ceR+M86xmhXO1zPDyg Ezx3bMAXthBtfTTENBGprlbr339eh60KorTMSnec5bxoeObWK5oYrCyqNP/dWpdc30 XWAdaFuOCy77fkLPBq/bDO5eLopw6ozK5XQ6FjxdJjodULFfjBOI8fSHayI+N1o7nB Y2DWQtJU7M962YcgP039DWci//WgyjywAr11OT7ivq6iCrQUkYb3xbzGG5iITUSr76 fQkzI4jerqifh6s2Y0hpbPUM1CYf1iVnwWfg5pUvzCw4bfbI7d6bH59xnVXqNUhEY+ TwG2xCZNhDqtw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53926C48BF8; Fri, 16 Feb 2024 14:11:29 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Fri, 16 Feb 2024 15:10:54 +0100 Subject: [PATCH RFC 5/8] iio: buffer-dmaengine: Enable write support Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240216-iio-backend-axi-dds-v1-5-22aed9fb07a1@analog.com> References: <20240216-iio-backend-axi-dds-v1-0-22aed9fb07a1@analog.com> In-Reply-To: <20240216-iio-backend-axi-dds-v1-0-22aed9fb07a1@analog.com> To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Olivier Moysan , Michael Hennerich , Paul Cercueil , Alexandru Ardelean X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708092664; l=1305; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=EuXm3wJiZVoFIehccCqYYu9vYz4WznwXf643rUy0LM4=; b=7cufpt+bWCqi4PSi62gexvonacFYiF9ykFxSuSjQjzJDaOXTm1hPQeY/R8fiT7CsTPS/hloDe BnTGHCE9fICD6Hqf8FtYAVwXQTt7oZv2z8JjWWqUKZzpF+tumPzVYhY X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: From: Paul Cercueil 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 --- 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 d9d72f7cba60..e151af7e8907 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,