From patchwork Wed Jan 10 11:13:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 10154909 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A2EDE60231 for ; Wed, 10 Jan 2018 11:15:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90070274D1 for ; Wed, 10 Jan 2018 11:15:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8300927C05; Wed, 10 Jan 2018 11:15:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D8980274D1 for ; Wed, 10 Jan 2018 11:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Message-Id:In-Reply-To:Subject:To:From:Reply-To :Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=49t5gDrNCTXKexCLyfT6AoUHDgZy7xX2CKu547o+d8E=; b=ssWLJxeQZvrgcx ZWeya6aLnx0+pj3s+BiQWzxdPlAs6w1TEzpyXLhT3IKHKLkbALu9RdOOvROVqdU9PqjU8YG+hQVVG wSv3riiTfeGlRoDsByOqBvo5HQFam2tpoDJ6rTGXeYpfkyvHcVg+UpRjvFpZeMtvH3eTB5/0u4DdV h/XRGVSu6wn6jrJoLoVoKKfezPgyP0wKU12bYZuqaeROpp0oPN2EAaPhBmcy2I54x3Jw4mZ2GLulr 2uEBPuA2AFIFVsMEIGolNcV2CjOyOZMIqTm8J2H4a0ZUr53KfO10DjhnSYU1NJ/bzIli9+viAEgiy HWTrmj6mtJfhnTWtEn6A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eZELV-0006oO-5n; Wed, 10 Jan 2018 11:15:01 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eZEL9-0006Vr-7x for linux-arm-kernel@bombadil.infradead.org; Wed, 10 Jan 2018 11:14:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Date:Message-Id:In-Reply-To:Subject:Cc: To:From:Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:References:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=xrTMm3/aKwmkpGqRZZuTfKNLDx3ts/E6DhO6aUsRt8U=; b=PC0wbZMDjpaIkD5dtU42rDJwTx /4muJ64rGPoNENJ9mB6MKheBATuz8qJMZoYhZnbNMwpNOvTVeVASxCH2I6CJmBqSBgoKGqtczWmvy 9ebEl5PDzYkjF1FJwrlK57gTq71YzayuBk6nbmjpu5Vshauve0amQm7YxkaWM709E6jgwzP6IOk82 Ld911zE/U42cmUTUJUFSrthWPb+YQG7sfZGBZfiYeqG+R47Ov4dtDF7txX7PybXZg7CeoWs6aeCPX X5NQKFiY+FN//Q/gvwrsfGUAVFZTPfrXten1lIhlL7HacOEZ6gKPubEbe1Hi5KB50Ighwmf9HQI59 bjcslZeg==; Received: from heliosphere.sirena.org.uk ([2a01:7e01::f03c:91ff:fed4:a3b6]) by merlin.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eZEL6-0007fx-5x for linux-arm-kernel@lists.infradead.org; Wed, 10 Jan 2018 11:14:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=xrTMm3/aKwmkpGqRZZuTfKNLDx3ts/E6DhO6aUsRt8U=; b=g1DlzFkBsY1P 4vWIkOrrO1Y7wNMmt5Hqv8eFQOSZgAbzEOVMuq1mo+kuqAa71+HQ16Ahol7qRO/Pxoc7yPQ3U2R+7 MB1r4kg9o6U0a+YuBtiX9+fZUIPTO0D8M2TRo/y8i7/ypYDXUKKuJmkq/YS5KmaBHsyyVOJ82Kp7D bnVLQ=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1eZEKC-0000lG-Ni; Wed, 10 Jan 2018 11:13:41 +0000 Received: from broonie by debutante with local (Exim 4.90) (envelope-from ) id 1eZEKB-00053k-9T; Wed, 10 Jan 2018 11:13:39 +0000 From: Mark Brown To: Arnaud Pouliquen Subject: Applied "docs: driver-api: add iio hw consumer section" to the asoc tree In-Reply-To: <1511881557-28596-3-git-send-email-arnaud.pouliquen@st.com> Message-Id: Date: Wed, 10 Jan 2018 11:13:39 +0000 X-Bad-Reply: In-Reply-To but no 'Re:' in Subject. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Lars-Peter Clausen , Alexandre Torgue , Liam Girdwood , linux-iio@vger.kernel.org, arnaud.pouliquen@st.com, Takashi Iwai , Rob Herring , Jaroslav Kysela , Maxime Coquelin , Mark Brown , linux-arm-kernel@lists.infradead.org, Peter Meerwald-Stadler , Hartmut Knaack , Jonathan Cameron MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The patch docs: driver-api: add iio hw consumer section has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 5b178943d64b85d78350ea9c86344c376d7bfe74 Mon Sep 17 00:00:00 2001 From: Arnaud Pouliquen Date: Wed, 10 Jan 2018 11:13:04 +0100 Subject: [PATCH] docs: driver-api: add iio hw consumer section This adds a section about the Hardware consumer API of the IIO subsystem to the driver API documentation. Signed-off-by: Arnaud Pouliquen Reviewed-by: Jonathan Cameron Signed-off-by: Mark Brown --- Documentation/driver-api/iio/hw-consumer.rst | 51 ++++++++++++++++++++++++++++ Documentation/driver-api/iio/index.rst | 1 + 2 files changed, 52 insertions(+) create mode 100644 Documentation/driver-api/iio/hw-consumer.rst diff --git a/Documentation/driver-api/iio/hw-consumer.rst b/Documentation/driver-api/iio/hw-consumer.rst new file mode 100644 index 000000000000..8facce6a6733 --- /dev/null +++ b/Documentation/driver-api/iio/hw-consumer.rst @@ -0,0 +1,51 @@ +=========== +HW consumer +=========== +An IIO device can be directly connected to another device in hardware. in this +case the buffers between IIO provider and IIO consumer are handled by hardware. +The Industrial I/O HW consumer offers a way to bond these IIO devices without +software buffer for data. The implementation can be found under +:file:`drivers/iio/buffer/hw-consumer.c` + + +* struct :c:type:`iio_hw_consumer` — Hardware consumer structure +* :c:func:`iio_hw_consumer_alloc` — Allocate IIO hardware consumer +* :c:func:`iio_hw_consumer_free` — Free IIO hardware consumer +* :c:func:`iio_hw_consumer_enable` — Enable IIO hardware consumer +* :c:func:`iio_hw_consumer_disable` — Disable IIO hardware consumer + + +HW consumer setup +================= + +As standard IIO device the implementation is based on IIO provider/consumer. +A typical IIO HW consumer setup looks like this:: + + static struct iio_hw_consumer *hwc; + + static const struct iio_info adc_info = { + .read_raw = adc_read_raw, + }; + + static int adc_read_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, int *val, + int *val2, long mask) + { + ret = iio_hw_consumer_enable(hwc); + + /* Acquire data */ + + ret = iio_hw_consumer_disable(hwc); + } + + static int adc_probe(struct platform_device *pdev) + { + hwc = devm_iio_hw_consumer_alloc(&iio->dev); + } + +More details +============ +.. kernel-doc:: include/linux/iio/hw-consumer.h +.. kernel-doc:: drivers/iio/buffer/industrialio-hw-consumer.c + :export: + diff --git a/Documentation/driver-api/iio/index.rst b/Documentation/driver-api/iio/index.rst index e5c3922d1b6f..7fba341bd8b2 100644 --- a/Documentation/driver-api/iio/index.rst +++ b/Documentation/driver-api/iio/index.rst @@ -15,3 +15,4 @@ Contents: buffers triggers triggered-buffers + hw-consumer