Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2183894imd; Sun, 28 Oct 2018 04:57:02 -0700 (PDT) X-Google-Smtp-Source: AJdET5evDslOrAZbTtdBJ09GqbX0/DdhG6Ho1Lj53QDcmWfF4duX2jFHQaJoYx6A6wlneSkrEdl2 X-Received: by 2002:a65:594b:: with SMTP id g11-v6mr8063512pgu.229.1540727822176; Sun, 28 Oct 2018 04:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540727822; cv=none; d=google.com; s=arc-20160816; b=gjMsjiGkoVAvP0xDplF69dfYe7Wwz1fZ8XbTOkS4VnNjwmHOHTAQaigmxiV2h8tlwt RawoLa1Q/ifAHh70BfkB5W+FwyNwr1G62uSOZUclFqDwVFPLmSy5O1MUMzaVHSMq1fbJ iiByM0p4TEuKZCRCoNM9m5smVEd+dzOfZuN0HDHeYknsttX5VVRC/oHy49aCEtMW65CF ZlnyH5riQQT/0HhRBEDT86/fULbyyl8kVqnASgFJTauG5AtIsBnpcq0WUPHVmfCKus6q JnI+1pfuPrfyI15hADKFnEdC9l5sJB6kcfhqVa3CTZ147Q4K1gm3/qKii7keX84QsFi0 c7zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=R3oB+t4qIMt9Op+f3qwQSFhdAxSX9hThkpEkS5CFhpo=; b=IjE+fbzMMPqXHrOWWEsLte1AkHQiux8anBzxW+/CemIVxbKnDO4BG972kiToWBOf31 Mycq69zbq7baAmhJnBCvZa4XpVCaciKCMETNT1jZG+cKlmNZKlV+TeLFp1ccbe1CqkEq Fu1bD/hLIydZnBFf8ZuST3hEZs4uEQPMPWYVFDU1xJ19zqYfj+wu1ZL9GUaPyM/mVV+N xKbrrPcf84f8mx5Et7h3d4CCGbR+ul/oQaY9vfId0zLKTEel7+stjRp52gmRQDPXu9Ch ghmqe8tThv7cC+JjU+J67YWD2mKff7o6S82ZyzogZgJvN2M+3K0Xitad7hxfskAyTILv cTag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Sh+ZGZex; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v64-v6si21438602pfj.167.2018.10.28.04.56.46; Sun, 28 Oct 2018 04:57:02 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Sh+ZGZex; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727491AbeJ1Ukv (ORCPT + 99 others); Sun, 28 Oct 2018 16:40:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:42282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726354AbeJ1Ukv (ORCPT ); Sun, 28 Oct 2018 16:40:51 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9AD4020843; Sun, 28 Oct 2018 11:56:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540727784; bh=yuNPW34jwAChYch75QibdqWeU380QvUdmHRUGV+qvLs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Sh+ZGZexBp6h79mxwAb6NAjqbHmuqf7WsGB86lmGg1lnLQd/ttsliSoKYG3Iv0dJW 5G4ztYd6mLi2HHmXLWWdr20KxsnbKaJ1Plb4uRzYwKQLOtZdywBVdLiGcmazwHAxnS 1QZrA8X+OYKFvt9gO1vIuEiQICk6K8/r8k2RJE3E= Date: Sun, 28 Oct 2018 11:56:19 +0000 From: Jonathan Cameron To: Dan O'Donovan Cc: linux-kernel@vger.kernel.org, Andy Shevchenko , 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 Subject: Re: [PATCH v3 2/3] iio: adc128s052: add ACPI _HID AANT1280 Message-ID: <20181028115619.13550889@archlinux> In-Reply-To: <1540481742-23596-3-git-send-email-dan@emutex.com> References: <20180423213805.12591-1-javier@emutex.com> <1540481742-23596-1-git-send-email-dan@emutex.com> <1540481742-23596-3-git-send-email-dan@emutex.com> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Oct 2018 16:35:41 +0100 Dan O'Donovan wrote: > 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 Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > 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,