From patchwork Thu Mar 28 13:22:29 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: 13608533 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 C6FC680BE3; Thu, 28 Mar 2024 13:22:31 +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=1711632151; cv=none; b=Ox/zSJT0Js16I63VrcSNKAP9LNL8kqrHFgTU4rF5ylT5peXpp9IgXHXwGN+gOLQdirvpyhh4fcmhfrkVhMOLn4GYns8lh9eMe4dde08ELyXJPkY6cPz8zQ3uh9Mh8ePdY3CJWa1yetrmDeYnISUrTo/SCZTp3tmWHWWD5GK/bss= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711632151; c=relaxed/simple; bh=5NCTwqp0/VL05f5aoUnTF7pYtP3n/rPaf1XK2xqJjGM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dSK3QYZcmrLFnBH4oStVL6a3rUagBz8Bd04ShUHDuvicTx43ic0feKOSNNVyoaebWeL8TuHTUFXAHZ1BOr2nP4OeeI/jg8Ad4mtF1reR8ZFiVzDTG8OVRJD84zamox9kZ3Mkl71MMWhx+hfUd6GVw77jXciYxslKeUgdcW7by+M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PYSjdgag; 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="PYSjdgag" Received: by smtp.kernel.org (Postfix) with ESMTPS id 4A81DC43601; Thu, 28 Mar 2024 13:22:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711632151; bh=5NCTwqp0/VL05f5aoUnTF7pYtP3n/rPaf1XK2xqJjGM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=PYSjdgaghJ/HsWcaHxjfxyp7a0u3GHpFnasPbqr0Kbp29pPsilVbn9BIwiLUnpslL Cl2kRfKxBwvA3X9jwzZ8RCEpuUOhOTWMx7EQ9sf+USknbuxTfJQPtUZReAIILythcj 7BG4KaJ1HZVRuh2/UeAYgzSS2fvG2OiCiAY2FeHUXoy6BGz9shpbDCEvc3r5K8Mpio zVC2pHWwAIjl1Ciz4hrORsNKiEyyeuSnC5tqJkZwVtIeBJ9qjSW9l1Xrr6ZIfjvwMR nOZ/rT3sgNSuk6FPvQYvMKpdVvDVdwBcRXkeVv/Fm81bTvqgT5lDLieY9WAgcFKoXL uxGvslQlE5kkQ== 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 415F4C54E67; Thu, 28 Mar 2024 13:22:31 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 28 Mar 2024 14:22:29 +0100 Subject: [PATCH 05/10] 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: <20240328-iio-backend-axi-dac-v1-5-afc808b3fde3@analog.com> References: <20240328-iio-backend-axi-dac-v1-0-afc808b3fde3@analog.com> In-Reply-To: <20240328-iio-backend-axi-dac-v1-0-afc808b3fde3@analog.com> To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Dragos Bogdan , Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Olivier Moysan , Paul Cercueil , Alexandru Ardelean , Nuno Sa X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1711632149; l=1350; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=fAbl1tHATN4k7f5YdDrD3IPPBFiik7XcUZ987EP1q04=; b=5T0qqbYggFoRGj5numeuSXuEjERRT8gvitBj7MBegHH0651jwhxZ8K8Uq5eMnUQJ8xpyk4KJD RmjyfQZZywKDUgmD+85d8rhnz9974hCEZKnpG2thnfd24wF65X6LF19 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: nuno.sa@analog.com 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 Signed-off-by: Nuno Sa --- 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,