Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2035932ima; Thu, 25 Oct 2018 08:37:08 -0700 (PDT) X-Google-Smtp-Source: AJdET5dJhODJoeq1zmP+rprXGpKI51oYeJeBWKZjtvjvCAONpOMnvC2EVdAhl4JmIuJq7qad5qcC X-Received: by 2002:a63:84c7:: with SMTP id k190mr1905020pgd.333.1540481828186; Thu, 25 Oct 2018 08:37:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540481828; cv=none; d=google.com; s=arc-20160816; b=DaN4oPSHVEmWM2rUT6culUm4hnxrK31e3OHOqiRyoc6N0WBzdBqwNj3p+2yZbkNNaj XO/z4GnO28D2wsdnRcKi9m5+Nqrhz6jC9qJIuKPlmPzTfu9aM6aaZgUDnqpXf33KxwNR SeoyiWjyLJgbk3mtq4URMqixBHNaO2q5bd+7qGnlZ2Ue0qXKwueu0zFJIzBa9OEFRHtx Iv4+tO52wyGwKwMkw6VW8+Ovqu6t7xLBZ6vY+rA/DEO/cPGwAPZoHz/6bnfFnP0J3cXT LtD0QyP1FlDctgsCACvKKG4wC0oS05Wt+gXAEWTK5wHZfgqf0mJTsTR6svE55KpLn2ao ARsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=p6bQrmQjSVekXDuvCpePfTHWvPN5CVZyJngm/D+XFoc=; b=osgXCGd7b8HQQiSEIcK2l4CS6fwLGQ2D8gl1DhEaM6DhyCOrzbTCSROAnIxdd3o8sz V9uQYkByqT7XeAX/KJR6DQ7lv5fgjywq9JjmR6tnHTYWEBHkCNC95gbUxNj9+taRXI4d ORydQz95l1jNsYFOs1oQ6NHylpxiKiOtqVTpZivQQgMAbc41cGykR78kGXuqoFN2+1jK 4/uZV8sZNyoc6+cEwSbK877u1MNgpX7yYvYtRA81Nb2OMxZtAYp8Q66AEMwmTW23NGvU 9IcsaveIaKzPftavVy6r4DNrzpXWW9z3xSWQj8g/bsC7wSxx7VKGSyVqS1etNgnK1aLw WlLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i9-v6si7817352plt.111.2018.10.25.08.36.51; Thu, 25 Oct 2018 08:37:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727659AbeJZAJ3 (ORCPT + 99 others); Thu, 25 Oct 2018 20:09:29 -0400 Received: from mr40.theemaillaundry.net ([109.169.43.35]:33206 "EHLO mr40.theemaillaundry.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727236AbeJZAJ2 (ORCPT ); Thu, 25 Oct 2018 20:09:28 -0400 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, -- 2.7.4 ------ This email has been scanned for spam and malware by The Email Laundry.