Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2828142pxb; Fri, 12 Feb 2021 02:20:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3AxjHGvxw46Brw2ggyyfDq9paN9DxRYt5RkPgmui+S8KPWDK+hZbeIGX/RIl60w5zGbWr X-Received: by 2002:a17:906:b217:: with SMTP id p23mr2379895ejz.126.1613125244985; Fri, 12 Feb 2021 02:20:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613125244; cv=none; d=google.com; s=arc-20160816; b=Wgt5kiTTOWUAzIvA8MIkRJ9zgSTswECpBt/d0iUbZ7qMAkGkHjO8qWTHnWg+mAzLG0 wMT+7wMBfEoBxreEJ3/G4H8elq/bIXNN98OtamJlojgVd/yGxJDmn2Kp18GEoWMUy9M7 8N81sCmO8kgtZBHtlS9VzZ6iWJ/zZ5dGUsyT0EsH4XCDOa2A26ovy+7nCiDk6dngT/k9 iAHZMV9+phsTMEixHKgUOKbatmlfyAqC1SBH6WHTAeOXTwB1oWENloNphViZSh7QLIhf nN60XlH33GrTlMo8hk0HWLEANZxJqsTYVgqJn5MugMiSPTL4xbNlXwA9VbvN6vcJ2F25 rIHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=rebxDmkF/bJ5PuPfNG00QmkBQPTqvxTA5NnjUFkl5Ao=; b=bY9FgpHTxf5ChMoOPCb0NqXIsXOsud6Aid/gSjRg2KtF864eRgLdDBr2vd5+HS/wgr NeKiu1eEl0BElFnD4XR7va2wEmfSizIhg+b0odALatrZHKvsXEY9LyevXhmLBLQFGZfl GNhyTxN1IvQ/J3jpHHcD34mT7SO4PmrA2xTHrD1uyDlUs4GxgYzKynSavOTJnoItHb67 IWVjGioXeBtJ/5d0AF19Nhhp9DqTMQR0Gz5NyGtFuW7xfOPWKtGFvik4MaJUiaVbxRyV WFjc6McUSf+kURBRr4sh9rqDbJ6t29JwvFp0XKYk2nEMhWc9WV3lYKp76ur03oNY4K/N JGYw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j19si6572590edw.550.2021.02.12.02.20.22; Fri, 12 Feb 2021 02:20:44 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230481AbhBLKTE (ORCPT + 99 others); Fri, 12 Feb 2021 05:19:04 -0500 Received: from mx0a-00128a01.pphosted.com ([148.163.135.77]:63242 "EHLO mx0a-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230295AbhBLKSy (ORCPT ); Fri, 12 Feb 2021 05:18:54 -0500 Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 11CAFOpp001736; Fri, 12 Feb 2021 05:18:02 -0500 Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com with ESMTP id 36hrw93ca5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Feb 2021 05:18:02 -0500 Received: from SCSQMBX10.ad.analog.com (SCSQMBX10.ad.analog.com [10.77.17.5]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 11CAI0hh025137 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 12 Feb 2021 05:18:01 -0500 Received: from SCSQMBX11.ad.analog.com (10.77.17.10) by SCSQMBX10.ad.analog.com (10.77.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.721.2; Fri, 12 Feb 2021 02:17:59 -0800 Received: from zeus.spd.analog.com (10.66.68.11) by SCSQMBX11.ad.analog.com (10.77.17.10) with Microsoft SMTP Server id 15.1.1779.2 via Frontend Transport; Fri, 12 Feb 2021 02:17:59 -0800 Received: from localhost.localdomain ([10.48.65.12]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 11CAHu5j029319; Fri, 12 Feb 2021 05:17:56 -0500 From: Alexandru Ardelean To: , CC: , , , , , Alexandru Ardelean Subject: [RFC PATCH 0/5] iio: buffer: add output buffer and cyclic mode Date: Fri, 12 Feb 2021 12:20:16 +0200 Message-ID: <20210212102021.47276-1-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.737 definitions=2021-02-12_03:2021-02-12,2021-02-12 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 spamscore=0 mlxlogscore=930 clxscore=1015 adultscore=0 priorityscore=1501 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102120077 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Largely, an adaptation of Lars' work, applied on the IIO multi-buffer support + high-speed/mmap support [1]. Found here: https://github.com/larsclausen/linux/commits/iio-high-speed-5.10 But this isn't tested. [1] Requires that these sets be applied (in this order): * https://lore.kernel.org/linux-iio/20210211122452.78106-1-alexandru.ardelean@analog.com/T/#t * https://lore.kernel.org/linux-iio/20210212101143.18993-1-alexandru.ardelean@analog.com/T/#t Some of the variation from the original work are: 1. It's applied on top of the multibuffer support; so the direction of the data is set per iio_buffer, and not iio_dev 2. Cyclic mode is a separate patch 3. devm_iio_dmaengine_buffer_alloc() requires the definition of 'enum iio_buffer_direction'; which means that 'linux/iio/buffer.h' needs to be included in buffer-dma.h; Lars tried to use a bool, but using the enum seems a bit more consistent and allows us to maybe go down the route of both I/O buffers (some day); not sure if that's sane or not (you never know) 4. Various re-formatting; and added some docstrings where I remembered to so so Lars-Peter Clausen (5): iio: Add output buffer support iio: kfifo-buffer: Add output buffer support iio: buffer-dma: Allow to provide custom buffer ops iio: buffer-dma: Add output buffer support iio: buffer-dma: add support for cyclic DMA transfers drivers/iio/adc/adi-axi-adc.c | 5 +- drivers/iio/buffer/industrialio-buffer-dma.c | 120 ++++++++++++++++-- .../buffer/industrialio-buffer-dmaengine.c | 57 +++++++-- drivers/iio/buffer/kfifo_buf.c | 50 ++++++++ drivers/iio/industrialio-buffer.c | 110 +++++++++++++++- include/linux/iio/buffer-dma.h | 11 +- include/linux/iio/buffer-dmaengine.h | 7 +- include/linux/iio/buffer.h | 7 + include/linux/iio/buffer_impl.h | 11 ++ include/uapi/linux/iio/buffer.h | 1 + 10 files changed, 348 insertions(+), 31 deletions(-) -- 2.17.1