From patchwork Thu Oct 25 15:35:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan O'Donovan X-Patchwork-Id: 10656117 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 B74AC13A9 for ; Thu, 25 Oct 2018 15:51:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9970A2BF3E for ; Thu, 25 Oct 2018 15:51:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9601F2BEFB; Thu, 25 Oct 2018 15:51:05 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0C8B2BF46 for ; Thu, 25 Oct 2018 15:51:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727400AbeJZAYZ (ORCPT ); Thu, 25 Oct 2018 20:24:25 -0400 Received: from mr33.theemaillaundry.net ([176.9.125.106]:43288 "EHLO mr33.theemaillaundry.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727313AbeJZAYZ (ORCPT ); Thu, 25 Oct 2018 20:24:25 -0400 X-Greylist: delayed 558 seconds by postgrey-1.27 at vger.kernel.org; Thu, 25 Oct 2018 20:24:22 EDT Received: from localhost (localhost [127.0.0.1]) by mr33.theemaillaundry.net (Postfix) with ESMTP id 675FB51C1FF6; Thu, 25 Oct 2018 16:41:44 +0100 (IST) X-Amavis-Modified: Mail body modified (using disclaimer) - mr33.theemaillaundry.net X-Virus-Scanned: amavisd-new at theemaillaundry.net Received: from mr33.theemaillaundry.net ([127.0.0.1]) by localhost (mr33.theemaillaundry.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GwdVFCAvZcVR; Thu, 25 Oct 2018 16:41:43 +0100 (IST) Received: from statler.emutex.com (unknown [92.51.199.138]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mr33.theemaillaundry.net (Postfix) with ESMTPS id 9180C51C1D25; Thu, 25 Oct 2018 16:36:05 +0100 (IST) Received: from [10.10.68.81] (helo=dan-Latitude-E5450.emutex.com) by statler.emutex.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.84) (envelope-from ) id 1gFhg1-0008BR-TS; Thu, 25 Oct 2018 16:36:02 +0100 From: Dan O'Donovan To: linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, Rob Herring , Mark Rutland , devicetree@vger.kernel.org, Carlos Iglesias , Javier Arteaga , Dan O'Donovan Subject: [PATCH v3 1/3] iio: adc128s052: Add pin-compatible IDs Date: Thu, 25 Oct 2018 16:35:40 +0100 Message-Id: <1540481742-23596-2-git-send-email-dan@emutex.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1540481742-23596-1-git-send-email-dan@emutex.com> References: <20180423213805.12591-1-javier@emutex.com> <1540481742-23596-1-git-send-email-dan@emutex.com> Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Javier Arteaga The datasheets for ADC122S021 and ADC124S021 list two more pin-compatible alternatives for each device. Add their IDs as compatible strings. Suggested-by: Jonathan Cameron Signed-off-by: Javier Arteaga Signed-off-by: Dan O'Donovan Reviewed-by: Rob Herring --- .../devicetree/bindings/iio/adc/ti-adc128s052.txt | 9 ++++++++- drivers/iio/adc/ti-adc128s052.c | 16 ++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/ti-adc128s052.txt b/Documentation/devicetree/bindings/iio/adc/ti-adc128s052.txt index daa2b2c..c07ce1a 100644 --- a/Documentation/devicetree/bindings/iio/adc/ti-adc128s052.txt +++ b/Documentation/devicetree/bindings/iio/adc/ti-adc128s052.txt @@ -1,7 +1,14 @@ * Texas Instruments' ADC128S052, ADC122S021 and ADC124S021 ADC chip Required properties: - - compatible: Should be "ti,adc128s052", "ti,adc122s021" or "ti,adc124s021" + - compatible: Should be one of: + - "ti,adc128s052" + - "ti,adc122s021" + - "ti,adc122s051" + - "ti,adc122s101" + - "ti,adc124s021" + - "ti,adc124s051" + - "ti,adc124s101" - reg: spi chip select number for the device - vref-supply: The regulator supply for ADC reference voltage diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c index 7cf39b3..e6716c3 100644 --- a/drivers/iio/adc/ti-adc128s052.c +++ b/drivers/iio/adc/ti-adc128s052.c @@ -186,15 +186,23 @@ static int adc128_remove(struct spi_device *spi) static const struct of_device_id adc128_of_match[] = { { .compatible = "ti,adc128s052", }, { .compatible = "ti,adc122s021", }, + { .compatible = "ti,adc122s051", }, + { .compatible = "ti,adc122s101", }, { .compatible = "ti,adc124s021", }, - { /* sentinel */ }, + { .compatible = "ti,adc124s051", }, + { .compatible = "ti,adc124s101", }, + { } }; MODULE_DEVICE_TABLE(of, adc128_of_match); static const struct spi_device_id adc128_id[] = { - { "adc128s052", 0}, /* index into adc128_config */ - { "adc122s021", 1}, - { "adc124s021", 2}, + { "adc128s052", 0 }, /* index into adc128_config */ + { "adc122s021", 1 }, + { "adc122s051", 1 }, + { "adc122s101", 1 }, + { "adc124s021", 2 }, + { "adc124s051", 2 }, + { "adc124s101", 2 }, { } }; MODULE_DEVICE_TABLE(spi, adc128_id); From patchwork Thu Oct 25 15:35:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan O'Donovan X-Patchwork-Id: 10656099 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 F31C414BB for ; Thu, 25 Oct 2018 15:45:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E28AC2BDDD for ; Thu, 25 Oct 2018 15:45:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D624B2BDE2; Thu, 25 Oct 2018 15:45:06 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B18AB2BDDD for ; Thu, 25 Oct 2018 15:45:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727433AbeJZASY (ORCPT ); Thu, 25 Oct 2018 20:18:24 -0400 Received: from mr41.theemaillaundry.net ([109.169.43.45]:42866 "EHLO mr41.theemaillaundry.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727350AbeJZASY (ORCPT ); Thu, 25 Oct 2018 20:18:24 -0400 X-Greylist: delayed 537 seconds by postgrey-1.27 at vger.kernel.org; Thu, 25 Oct 2018 20:18:22 EDT Received: from mr40.theemaillaundry.net (mr40.theemaillaundry.net [109.169.43.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mr41.theemaillaundry.net (Postfix) with ESMTPS id D323021CB3; Thu, 25 Oct 2018 16:36:11 +0100 (IST) Received: from mr30.theemaillaundry.net (mr30.theemaillaundry.net [78.46.72.43]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mr40.theemaillaundry.net (Postfix) with ESMTPS id 278614054A; Thu, 25 Oct 2018 16:36:09 +0100 (IST) Received: from localhost (localhost [127.0.0.1]) by mr30.theemaillaundry.net (Postfix) with ESMTP id 902C0241A68; Thu, 25 Oct 2018 16:36:07 +0100 (IST) X-Amavis-Modified: Mail body modified (using disclaimer) - mr30.theemaillaundry.net X-Virus-Scanned: amavisd-new at theemaillaundry.net Received: from mr30.theemaillaundry.net ([127.0.0.1]) by localhost (mr30.theemaillaundry.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NZOzfhK2yXq2; Thu, 25 Oct 2018 16:36:06 +0100 (IST) Received: from statler.emutex.com (unknown [92.51.199.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mr30.theemaillaundry.net (Postfix) with ESMTPS id DE5902418D6; Thu, 25 Oct 2018 16:36:05 +0100 (IST) Received: from [10.10.68.81] (helo=dan-Latitude-E5450.emutex.com) by statler.emutex.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.84) (envelope-from ) id 1gFhg2-0008BR-7J; Thu, 25 Oct 2018 16:36:02 +0100 From: Dan O'Donovan To: linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, Rob Herring , Mark Rutland , devicetree@vger.kernel.org, Carlos Iglesias , Nicola Lunghi , Javier Arteaga , Dan O'Donovan Subject: [PATCH v3 2/3] iio: adc128s052: add ACPI _HID AANT1280 Date: Thu, 25 Oct 2018 16:35:41 +0100 Message-Id: <1540481742-23596-3-git-send-email-dan@emutex.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1540481742-23596-1-git-send-email-dan@emutex.com> References: <20180423213805.12591-1-javier@emutex.com> <1540481742-23596-1-git-send-email-dan@emutex.com> Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Nicola Lunghi ACPI _HID AANT1280 matches an ADC124S101 present on E3940 SKUs of the UP Squared board. Add it to the driver. Signed-off-by: Nicola Lunghi [javier@emutex.com: fix up commit message and one checkpatch warning] Signed-off-by: Javier Arteaga Signed-off-by: Dan O'Donovan --- drivers/iio/adc/ti-adc128s052.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c index e6716c3..c2d1453 100644 --- a/drivers/iio/adc/ti-adc128s052.c +++ b/drivers/iio/adc/ti-adc128s052.c @@ -12,10 +12,12 @@ * published by the Free Software Foundation. */ +#include #include #include #include #include +#include #include struct adc128_configuration { @@ -135,10 +137,15 @@ static const struct iio_info adc128_info = { static int adc128_probe(struct spi_device *spi) { struct iio_dev *indio_dev; + unsigned int config; struct adc128 *adc; - int config = spi_get_device_id(spi)->driver_data; int ret; + if (dev_fwnode(&spi->dev)) + config = (unsigned long) device_get_match_data(&spi->dev); + else + config = spi_get_device_id(spi)->driver_data; + indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*adc)); if (!indio_dev) return -ENOMEM; @@ -207,10 +214,19 @@ static const struct spi_device_id adc128_id[] = { }; MODULE_DEVICE_TABLE(spi, adc128_id); +#ifdef CONFIG_ACPI +static const struct acpi_device_id adc128_acpi_match[] = { + { "AANT1280", 2 }, /* ADC124S021 compatible ACPI ID */ + { } +}; +MODULE_DEVICE_TABLE(acpi, adc128_acpi_match); +#endif + static struct spi_driver adc128_driver = { .driver = { .name = "adc128s052", .of_match_table = of_match_ptr(adc128_of_match), + .acpi_match_table = ACPI_PTR(adc128_acpi_match), }, .probe = adc128_probe, .remove = adc128_remove, From patchwork Thu Oct 25 15:35:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan O'Donovan X-Patchwork-Id: 10656097 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 AC82114BB for ; Thu, 25 Oct 2018 15:45:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9909B2BDDB for ; Thu, 25 Oct 2018 15:45:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A71E2BDE0; Thu, 25 Oct 2018 15:45:05 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD6932BDDB for ; Thu, 25 Oct 2018 15:45:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727417AbeJZASY (ORCPT ); Thu, 25 Oct 2018 20:18:24 -0400 Received: from mr41.theemaillaundry.net ([109.169.43.45]:42870 "EHLO mr41.theemaillaundry.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727356AbeJZASX (ORCPT ); Thu, 25 Oct 2018 20:18:23 -0400 Received: from mr40.theemaillaundry.net (mr40.theemaillaundry.net [109.169.43.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mr41.theemaillaundry.net (Postfix) with ESMTPS id DD25221CE4; Thu, 25 Oct 2018 16:36:17 +0100 (IST) Received: from mr301.theemaillaundry.net (mr301.theemaillaundry.net [109.169.43.93]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mr40.theemaillaundry.net (Postfix) with ESMTPS id D4C304054A; Thu, 25 Oct 2018 16:36:16 +0100 (IST) Received: from localhost (localhost [127.0.0.1]) by mr301.theemaillaundry.net (Postfix) with ESMTP id 5994580A63; Thu, 25 Oct 2018 16:36:14 +0100 (IST) X-Amavis-Modified: Mail body modified (using disclaimer) - mr301.theemaillaundry.net X-Virus-Scanned: amavisd-new at theemaillaundry.net Received: from mr301.theemaillaundry.net ([127.0.0.1]) by localhost (mr301.theemaillaundry.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KnTFKyCGk_sv; Thu, 25 Oct 2018 16:36:06 +0100 (IST) Received: from statler.emutex.com (unknown [92.51.199.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mr301.theemaillaundry.net (Postfix) with ESMTPS id 4DC6081047; Thu, 25 Oct 2018 16:36:06 +0100 (IST) Received: from [10.10.68.81] (helo=dan-Latitude-E5450.emutex.com) by statler.emutex.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.84) (envelope-from ) id 1gFhg2-0008BR-FH; Thu, 25 Oct 2018 16:36:02 +0100 From: Dan O'Donovan To: linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, Rob Herring , Mark Rutland , devicetree@vger.kernel.org, Carlos Iglesias , Dan O'Donovan Subject: [PATCH v3 3/3] iio: adc128s052: use SPDX-License-Identifier Date: Thu, 25 Oct 2018 16:35:42 +0100 Message-Id: <1540481742-23596-4-git-send-email-dan@emutex.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1540481742-23596-1-git-send-email-dan@emutex.com> References: <20180423213805.12591-1-javier@emutex.com> <1540481742-23596-1-git-send-email-dan@emutex.com> Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This updates the ti-adc128s052.c file to use SPDX-License-Identifier instead of more verbose license text. Signed-off-by: Dan O'Donovan --- drivers/iio/adc/ti-adc128s052.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c index c2d1453..7d2861f 100644 --- a/drivers/iio/adc/ti-adc128s052.c +++ b/drivers/iio/adc/ti-adc128s052.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2014 Angelo Compagnucci * @@ -6,10 +7,6 @@ * http://www.ti.com/lit/ds/symlink/adc128s052.pdf * http://www.ti.com/lit/ds/symlink/adc122s021.pdf * http://www.ti.com/lit/ds/symlink/adc124s021.pdf - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include