Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp631692imc; Sat, 16 Mar 2019 10:55:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqy9tuvZbFauzoMxphyeYok+p2jDeKvKw4+Fxxe+VCqHfFDmaT8445ja80kfRJyT+09IGsnw X-Received: by 2002:aa7:8012:: with SMTP id j18mr10782397pfi.42.1552758920965; Sat, 16 Mar 2019 10:55:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552758920; cv=none; d=google.com; s=arc-20160816; b=raatvNIb0x/BI2FaH9PMYW7SoALvzOav2gz4bXKEwGlytoMyNzkbgpMXnlwRgBkDFB s+W4qnsSPAR9S62IiwMQaYWDoyobVZCv8bJT/zXGxAt6M2L2UuAzGnJIsluxyo5jjw/X Vt5IkRTe1JG5vPA42tnLNWMyDmojXzzmTAyr5nxKPB49rRIs/wKspqkQZFTzgBPqsiS6 DM++7xPAOxPGWZA4k8WZbTsH5tQXzZXozO9XlIQ48fuUo0Pq63UxPoqJKn3O1gy88jMB r1/pha1aA4PWw4337nQMyJtidSluaIrgBMCLhwRlcRhfdsoRissgq1rkp9cFaGLZTA2y S/pg== 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=4qrY3e03Yu1pLYCKNZocnnvzrWViFPvj1bj+15RbkAc=; b=iz/Zdf9yNlBUs/6szT5U+xhnzGya+nkV8nRBX1a+yUb1Ks/bCGC1sG5rTuUtNDpfcj ruiDt/9ROaoDsz1XI4uhu0ACDQswVaL49rZAMb3Fz2DPjSBzquIMIITM9lY6shvyUomN 9uRAmmQk7Urmt0yOJLlj6EvCeMve0mqaI+9tqBNAP9Qog8DNz6b5+flRZQLCfgIsOYTT VJpd1gUwEsCAiuhYOKylOV0aOc4+TlW4Xf92aQ/tElkfuBDRVHEGSoPr3Ayj9a2bGHY9 m9EnYYsOKSUjzKxD6+kH9XTZenvhEiQVR9n9bnpY9ClmMWsYgvsAByvLzj14Tdxwy/oR 2Q4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qmbRlvzs; 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 k15si4765805pls.92.2019.03.16.10.55.05; Sat, 16 Mar 2019 10:55:20 -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=qmbRlvzs; 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 S1726740AbfCPRyb (ORCPT + 99 others); Sat, 16 Mar 2019 13:54:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:33898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726376AbfCPRya (ORCPT ); Sat, 16 Mar 2019 13:54:30 -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 767F9218D0; Sat, 16 Mar 2019 17:54:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552758869; bh=Gj9AY78cWuTyXg26uwiZXxzoOidrBYGmJghFNFXL9DM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qmbRlvzsZAdz50kkDc5x+vb6sVwSg2AKd9HssV4bc7PPF/x9AumErlKB1Si+XNEio tzC9Zies6b2jV/k7WNB0+rtGLQeeC1uadTNOVpF1s0qjEveOfuD134JDqHIlSvDhqv 8x73Hv6DwymZuCcS//5ZdXuLZr4iIskV8x8eCQVQ= Date: Sat, 16 Mar 2019 17:54:23 +0000 From: Jonathan Cameron To: Renato Lui Geh Cc: lars@metafoo.de, Michael.Hennerich@analog.com, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, stefan.popa@analog.com, alexandru.Ardelean@analog.com, giuliano.belinassi@usp.br, robh+dt@kernel.org, mark.rutland@arm.com, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-usp@googlegroups.com, devicetree@vger.kernel.org Subject: Re: [PATCH v5 03/11] staging: iio: ad7780: add gain reading to ad778x Message-ID: <20190316175423.26481b43@archlinux> In-Reply-To: References: X-Mailer: Claws Mail 3.17.3 (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 Fri, 15 Mar 2019 23:13:13 -0300 Renato Lui Geh wrote: > This patch adds a new functionality of reading gain values from the > ad778x chips. This value is stored in the chip's state struct and is > updated whenever a read or write call is performed on the driver. > > Signed-off-by: Renato Lui Geh Applied, thanks > --- > drivers/staging/iio/adc/ad7780.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c > index f4cd7bc3e02f..fbcc0d3345ca 100644 > --- a/drivers/staging/iio/adc/ad7780.c > +++ b/drivers/staging/iio/adc/ad7780.c > @@ -42,6 +42,8 @@ > #define AD7780_GAIN_MIDPOINT 64 > #define AD7780_FILTER_MIDPOINT 13350 > > +static const unsigned int ad778x_gain[2] = { 1, 128 }; > + > struct ad7780_chip_info { > struct iio_chan_spec channel; > unsigned int pattern_mask; > @@ -179,6 +181,9 @@ static int ad7780_postprocess_sample(struct ad_sigma_delta *sigma_delta, > ((raw_sample & chip_info->pattern_mask) != chip_info->pattern)) > return -EIO; > > + if (chip_info->is_ad778x) > + st->gain = ad778x_gain[raw_sample & AD7780_GAIN]; > + > return 0; > } >