From patchwork Fri Feb 8 16:09:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 10803331 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D6528922 for ; Fri, 8 Feb 2019 16:10:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4DB52E993 for ; Fri, 8 Feb 2019 16:10:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B92D22EA32; Fri, 8 Feb 2019 16:10:31 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 6F34C2E993 for ; Fri, 8 Feb 2019 16:10:31 +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-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=w9AcBmpvE0MHritCv7v1f0K4FkyjlBXL+D1Y09JJo0M=; b=SoPrKOfh3nL9Zt I/VC0Tr9drt1bt3QOgjlC03fGJnTpEZoAi7vtv3GcE5CyaoVp3FFZvQVoLxatJn4u8/xv9P8VFPWa wTZCO5LCCznWuBfQF20dCQ4lSqOPPtAj+I3dDpE1edyvual3oaYeZGfT85zuEx9iy18isxZbQk72/ SeN8X0LKKcHfqC5MWSSS3C7O65pJPaKjxhP9zBBgUjqEt6frbU+gQ3xNcIHqBbC+Gn/QdVQ4gEiw0 FQ0OmkwO0cBFeeYIO/2c55iN78DqQBUGgbp6Obzs7i7GMehLfjbOMH+aJ2bzXvcUn2K9tDrBFE231 ZvMUv1+0xu2zDrffrUxw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gs8jU-0004LT-6F; Fri, 08 Feb 2019 16:10:28 +0000 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gs8jD-0003Jm-12 for linux-arm-kernel@lists.infradead.org; Fri, 08 Feb 2019 16:10:13 +0000 X-Originating-IP: 109.213.164.40 Received: from localhost (alyon-652-1-53-40.w109-213.abo.wanadoo.fr [109.213.164.40]) (Authenticated sender: gregory.clement@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id F38AFFF80C; Fri, 8 Feb 2019 16:09:58 +0000 (UTC) From: Gregory CLEMENT To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler Subject: [PATCH 1/5] dt-bindings: iio: adc: move lpc32xx-adc out of staging Date: Fri, 8 Feb 2019 17:09:40 +0100 Message-Id: <20190208160944.13281-2-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190208160944.13281-1-gregory.clement@bootlin.com> References: <20190208160944.13281-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190208_081011_216845_38AAC198 X-CRM114-Status: UNSURE ( 6.80 ) X-CRM114-Notice: Please train this message. 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: devicetree@vger.kernel.org, Gregory CLEMENT , Rob Herring , linux-arm-kernel@lists.infradead.org, Thomas Petazzoni 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 drivers has been moved out since 0097e20e7771 ("staging:iio:adc:lpc32xx Move out of staging.") in v4.10, so let's align the binding documentation. Signed-off-by: Gregory CLEMENT --- .../devicetree/bindings/{staging => }/iio/adc/lpc32xx-adc.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Documentation/devicetree/bindings/{staging => }/iio/adc/lpc32xx-adc.txt (100%) diff --git a/Documentation/devicetree/bindings/staging/iio/adc/lpc32xx-adc.txt b/Documentation/devicetree/bindings/iio/adc/lpc32xx-adc.txt similarity index 100% rename from Documentation/devicetree/bindings/staging/iio/adc/lpc32xx-adc.txt rename to Documentation/devicetree/bindings/iio/adc/lpc32xx-adc.txt From patchwork Fri Feb 8 16:09:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 10803333 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 332FA922 for ; Fri, 8 Feb 2019 16:10:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22C492E973 for ; Fri, 8 Feb 2019 16:10:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20BE72EA34; Fri, 8 Feb 2019 16:10:44 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 D1BAC2E973 for ; Fri, 8 Feb 2019 16:10:43 +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-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Q8DD5K6bD1BQq4UraqtuE+RrapzDXEuh6XLhimibB94=; b=TzlT4oEXWu3WFN MuBznHzSIJTrX6fUfqSKA/Totc4Pm5va521On6NITttpIHKDjKNPIYprU8M1CkcJQaBextYGjPM6M LOzf52AowSQsxe/ua/YM0MyCfA4SFhwCxYI1RsweZrLNJVyEr2QHJrkWjAa/JZD/LO+k/eGGIRRB2 VPDS0ngMRCsILMKgtAjCsquGuLKKP/9pcb7MCOXaUWN8/KOhRGidrsiAvijaRIqSKsnRtLJEy08Kr piJ291JXfnXJ/Zr3GsSzkGge4VgD1G39YZx34pLKS0Okk9A5RmjsrTBduBV3PkrZ88aajzDrqQYRP 5Lp2YINM8rIrDUpY1JPQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gs8jg-0004bB-PC; Fri, 08 Feb 2019 16:10:40 +0000 Received: from relay10.mail.gandi.net ([217.70.178.230]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gs8jD-0003nj-5s for linux-arm-kernel@lists.infradead.org; Fri, 08 Feb 2019 16:10:13 +0000 Received: from localhost (alyon-652-1-53-40.w109-213.abo.wanadoo.fr [109.213.164.40]) (Authenticated sender: gregory.clement@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id DDE9124001C; Fri, 8 Feb 2019 16:10:00 +0000 (UTC) From: Gregory CLEMENT To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler Subject: [PATCH 2/5] dt-bindings: iio: adc: lpc32xx-adc: Document vref-supply Date: Fri, 8 Feb 2019 17:09:41 +0100 Message-Id: <20190208160944.13281-3-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190208160944.13281-1-gregory.clement@bootlin.com> References: <20190208160944.13281-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190208_081011_483912_49191B4A X-CRM114-Status: UNSURE ( 8.82 ) X-CRM114-Notice: Please train this message. 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: devicetree@vger.kernel.org, Gregory CLEMENT , Rob Herring , linux-arm-kernel@lists.infradead.org, Thomas Petazzoni 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 As most of the other ADC the lpc32xx one use a vref-supply property: document it. Signed-off-by: Gregory CLEMENT Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/iio/adc/lpc32xx-adc.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/adc/lpc32xx-adc.txt b/Documentation/devicetree/bindings/iio/adc/lpc32xx-adc.txt index b3629d3a9adf..3a1bc669bd51 100644 --- a/Documentation/devicetree/bindings/iio/adc/lpc32xx-adc.txt +++ b/Documentation/devicetree/bindings/iio/adc/lpc32xx-adc.txt @@ -6,6 +6,10 @@ Required properties: region. - interrupts: The ADC interrupt +Optional: + - vref-supply: The regulator supply ADC reference voltage, optional + for legacy reason, but highly encouraging to us in new device tree + Example: adc@40048000 { @@ -13,4 +17,5 @@ Example: reg = <0x40048000 0x1000>; interrupt-parent = <&mic>; interrupts = <39 0>; + vref-supply = <&vcc>; }; From patchwork Fri Feb 8 16:09:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 10803335 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6CA421575 for ; Fri, 8 Feb 2019 16:11:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BA8D2EA60 for ; Fri, 8 Feb 2019 16:11:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FEAB2EA51; Fri, 8 Feb 2019 16:11:14 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 EABE12EA67 for ; Fri, 8 Feb 2019 16:11:13 +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-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OuuaioACiQ2/D/ZZDuEBgLyZ1YUWbH28DELx9lrdJx8=; b=sruVmoY4NudOFv m9BmDAyTaikJ3fLmuGBh0KM2cjkHevibJSZGL/lKNSYwrbscMQHpD4iMVgEfPwNIkT5AkFFWYEQey ij5suKA5tNTVxuNaH9AYQZz0bG1YaGiH5PXDJFkIIs14eFTZoDoVR0unP6mG4i0aBKmum7P9mu+fp eWlx3QjaLTb9SBWdZLUKmKIHCU1Kyj0Qr7U64mv+c2BLjksHSznw/0G9Di+wUJCgbtH8RAAIQRYfv Hz4CVEeDM+64T5cjEUgrL2Li2Q4Vb/1pyw4rUMg0LNfzLPtxOJN6sCql/WNdIWpgzKLpwOkzrQvNW vZTeuEHgyS0sRqPoqeZw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gs8k7-00055M-Uy; Fri, 08 Feb 2019 16:11:07 +0000 Received: from relay10.mail.gandi.net ([217.70.178.230]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gs8jD-0003o0-9M for linux-arm-kernel@lists.infradead.org; Fri, 08 Feb 2019 16:10:14 +0000 Received: from localhost (alyon-652-1-53-40.w109-213.abo.wanadoo.fr [109.213.164.40]) (Authenticated sender: gregory.clement@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id CEB34240016; Fri, 8 Feb 2019 16:10:02 +0000 (UTC) From: Gregory CLEMENT To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler Subject: [PATCH 3/5] iio:adc:lpc32xx use SPDX-License-Identifier Date: Fri, 8 Feb 2019 17:09:42 +0100 Message-Id: <20190208160944.13281-4-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190208160944.13281-1-gregory.clement@bootlin.com> References: <20190208160944.13281-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190208_081011_495563_A816C705 X-CRM114-Status: GOOD ( 10.73 ) 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: devicetree@vger.kernel.org, Gregory CLEMENT , Rob Herring , linux-arm-kernel@lists.infradead.org, Thomas Petazzoni 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 Convert the driver to SPDX license description which allow removing several lines in the file. Signed-off-by: Gregory CLEMENT --- drivers/iio/adc/lpc32xx_adc.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/iio/adc/lpc32xx_adc.c b/drivers/iio/adc/lpc32xx_adc.c index 20b36690fa4f..e361c1532a75 100644 --- a/drivers/iio/adc/lpc32xx_adc.c +++ b/drivers/iio/adc/lpc32xx_adc.c @@ -1,23 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * lpc32xx_adc.c - Support for ADC in LPC32XX * * 3-channel, 10-bit ADC * * Copyright (C) 2011, 2012 Roland Stigge - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include From patchwork Fri Feb 8 16:09:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 10803329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D42F51575 for ; Fri, 8 Feb 2019 16:10:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2CB42E962 for ; Fri, 8 Feb 2019 16:10:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B67E72E990; Fri, 8 Feb 2019 16:10:17 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 701182E974 for ; Fri, 8 Feb 2019 16:10:16 +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-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rpo3YaY6fmmQgm16OfKduCQIwM/93NZTNozZ+Ysp5bc=; b=XXQTpMpxtXC+4J 6H/EeOwMZG0/ysBvRlQqgf/XMER7dD0Nv5wINKtDyxUTnS0vywFsENC37qwGyOzc66EVZ1P2BrvE0 efK3FPmU98Hh2YWv2DMq7p0MBYrQpviVGMuSW59IErz+CeYVVGsb9HOSXGkm9TzJq9pK9sbDMlMlf oJ42+CTqjFT8kgij5W0bknR9YRpr8f1oCqe7QSJnHLa0ddQHL5EUzxTqEgfdc4PAK1zYmBfyUdRp/ l/HdPJ9UQTQ3cf6ATwLsshSTLJdt2eZWxMVf747x0W/eCNtRIg34LYpBbe54ZYTwQSc6rCND+BGZN 2Az89erfpt2t9cBd8M9g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gs8jH-0004BP-28; Fri, 08 Feb 2019 16:10:15 +0000 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gs8jC-0003SJ-Vd for linux-arm-kernel@lists.infradead.org; Fri, 08 Feb 2019 16:10:12 +0000 X-Originating-IP: 109.213.164.40 Received: from localhost (alyon-652-1-53-40.w109-213.abo.wanadoo.fr [109.213.164.40]) (Authenticated sender: gregory.clement@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id C747CFF803; Fri, 8 Feb 2019 16:10:04 +0000 (UTC) From: Gregory CLEMENT To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler Subject: [PATCH 4/5] iio:adc:lpc32xx Cleanup headers Date: Fri, 8 Feb 2019 17:09:43 +0100 Message-Id: <20190208160944.13281-5-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190208160944.13281-1-gregory.clement@bootlin.com> References: <20190208160944.13281-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190208_081011_162933_FF155148 X-CRM114-Status: UNSURE ( 7.81 ) X-CRM114-Notice: Please train this message. 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: devicetree@vger.kernel.org, Gregory CLEMENT , Rob Herring , linux-arm-kernel@lists.infradead.org, Thomas Petazzoni 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 A few headers was useless: remove them, and also sort them in alphabetic order. Signed-off-by: Gregory CLEMENT --- drivers/iio/adc/lpc32xx_adc.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/iio/adc/lpc32xx_adc.c b/drivers/iio/adc/lpc32xx_adc.c index e361c1532a75..f391c1e10136 100644 --- a/drivers/iio/adc/lpc32xx_adc.c +++ b/drivers/iio/adc/lpc32xx_adc.c @@ -7,20 +7,13 @@ * Copyright (C) 2011, 2012 Roland Stigge */ -#include -#include -#include -#include -#include -#include -#include #include -#include #include -#include - #include -#include +#include +#include +#include +#include /* * LPC32XX registers definitions From patchwork Fri Feb 8 16:09:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 10803337 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BF7371575 for ; Fri, 8 Feb 2019 16:11:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE4882EA41 for ; Fri, 8 Feb 2019 16:11:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1E912EA6B; Fri, 8 Feb 2019 16:11:26 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 2D8E12EA60 for ; Fri, 8 Feb 2019 16:11:26 +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-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yO6VYyIXDY2JsuVyaiDhSfAM9Qaqhn+rJunRY7sEmwU=; b=T5A35Sxm8V9p1o sZYd9r3YOMRSJO97wHCmy3hN1d2OgxMnhLirmHBfDjkE0rbL4xIizopmd0TPfjSSmQX/tmykM751V 6W8BtTASkE8HDGoQUFBSLkTsjohXHa5ZclVoj3TxvHopJbrZjPyeisXGJYVNbZCo9/qsCERpDYF7Q xXIfv+JEcTCMP0Uj869Z34KnvdTs5BV2t8Mz0TL0yAzrRrydIxeiHY0wa+x3fyqaEa+HhnNLNtStv R9yamC/RuTWA9rjuOTlObO/TvAdz445BYixn1hA0tCVVAqBi0D46e6lWiZU33MdogW13BceNhroJV QWlTzgD9GhzJ6u97gu5w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gs8kL-0005In-AC; Fri, 08 Feb 2019 16:11:21 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gs8jJ-0004Br-Rb for linux-arm-kernel@lists.infradead.org; Fri, 08 Feb 2019 16:10:20 +0000 X-Originating-IP: 109.213.164.40 Received: from localhost (alyon-652-1-53-40.w109-213.abo.wanadoo.fr [109.213.164.40]) (Authenticated sender: gregory.clement@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 130F2C0002; Fri, 8 Feb 2019 16:10:06 +0000 (UTC) From: Gregory CLEMENT To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler Subject: [PATCH 5/5] iio:adc:lpc32xx Add scale feature Date: Fri, 8 Feb 2019 17:09:44 +0100 Message-Id: <20190208160944.13281-6-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190208160944.13281-1-gregory.clement@bootlin.com> References: <20190208160944.13281-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190208_081018_291289_858F83B2 X-CRM114-Status: GOOD ( 16.65 ) 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: devicetree@vger.kernel.org, Gregory CLEMENT , Rob Herring , linux-arm-kernel@lists.infradead.org, Thomas Petazzoni 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 Until now this driver only exposed the raw value of the channels. With this patch, the scale value is also exposed. It depends of a regulator supply, and unlike most of the other driver, do not having this regulator won't prevent to use the driver. The reason for it is to allow to continue to use this driver with an old device tree. If there is no regulator supply then the scale won't be exposed. Signed-off-by: Gregory CLEMENT --- drivers/iio/adc/lpc32xx_adc.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/drivers/iio/adc/lpc32xx_adc.c b/drivers/iio/adc/lpc32xx_adc.c index f391c1e10136..e36ca307f065 100644 --- a/drivers/iio/adc/lpc32xx_adc.c +++ b/drivers/iio/adc/lpc32xx_adc.c @@ -14,6 +14,7 @@ #include #include #include +#include /* * LPC32XX registers definitions @@ -45,6 +46,7 @@ struct lpc32xx_adc_state { void __iomem *adc_base; struct clk *clk; struct completion completion; + struct regulator *vref; u32 value; }; @@ -57,7 +59,9 @@ static int lpc32xx_read_raw(struct iio_dev *indio_dev, { struct lpc32xx_adc_state *st = iio_priv(indio_dev); int ret; - if (mask == IIO_CHAN_INFO_RAW) { + + switch (mask) { + case IIO_CHAN_INFO_RAW: mutex_lock(&indio_dev->mlock); ret = clk_prepare_enable(st->clk); if (ret) { @@ -77,6 +81,12 @@ static int lpc32xx_read_raw(struct iio_dev *indio_dev, mutex_unlock(&indio_dev->mlock); return IIO_VAL_INT; + + case IIO_CHAN_INFO_SCALE: + *val = regulator_get_voltage(st->vref) / 1000; + *val2 = chan->scan_type.realbits; + + return IIO_VAL_FRACTIONAL_LOG2; } return -EINVAL; @@ -93,9 +103,10 @@ static const struct iio_info lpc32xx_adc_iio_info = { .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .address = LPC32XXAD_IN * _index, \ .scan_index = _index, \ + .scan_type.realbits = 10 \ } -static const struct iio_chan_spec lpc32xx_adc_iio_channels[] = { +static struct iio_chan_spec lpc32xx_adc_iio_channels[] = { LPC32XX_ADC_CHANNEL(0), LPC32XX_ADC_CHANNEL(1), LPC32XX_ADC_CHANNEL(2), @@ -119,7 +130,7 @@ static int lpc32xx_adc_probe(struct platform_device *pdev) struct resource *res; int retval = -ENODEV; struct iio_dev *iodev = NULL; - int irq; + int irq, i; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { @@ -159,6 +170,15 @@ static int lpc32xx_adc_probe(struct platform_device *pdev) return retval; } + st->vref = devm_regulator_get(&pdev->dev, "vref"); + if (IS_ERR(st->vref)) + dev_err(&pdev->dev, + "Missing vref regulator: No scaling available\n"); + else + for (i = 0; i < ARRAY_SIZE(lpc32xx_adc_iio_channels); i++) + lpc32xx_adc_iio_channels[i].info_mask_shared_by_type = + BIT(IIO_CHAN_INFO_SCALE); + platform_set_drvdata(pdev, iodev); init_completion(&st->completion); @@ -175,7 +195,6 @@ static int lpc32xx_adc_probe(struct platform_device *pdev) return retval; dev_info(&pdev->dev, "LPC32XX ADC driver loaded, IRQ %d\n", irq); - return 0; }