Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp633105imc; Sat, 16 Mar 2019 10:58:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzODzzEQsH0JzWWIT+OvQ4XGPF2w8sDjMKu0B7Xhp6R30uwDImFXKTJ4UrlH+ZXzEPt9kpC X-Received: by 2002:aa7:9219:: with SMTP id 25mr10681057pfo.205.1552759091181; Sat, 16 Mar 2019 10:58:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552759091; cv=none; d=google.com; s=arc-20160816; b=eGGRPKbLzpP9u93gmCwMV3RuUVw7yS/0Cc2Tneq2N+bHH0AiQZuIjGHv2mEMv1l7k/ aN9DDqOsMPYOWLChbBAvk3dKFFhgMrXzz3LtTlI6XAcwDs+iMPgu981fce4o94Tprvtj 6y3E6vLDRFZGikugbInaBUUHMCbDzR88cNL0Vws+Wzn71W/XMbMnHpDwUXtl/Gpqa8T9 TEM1ZfLo0hroU1KE10UGnsDNDPnb/MJ+QSbj62Rh7DNMbwYa0CORLLdn+h25RM/fvrpN S6SUwjgaysqdU7m0QBk+vnpQhlyFw5vzQp3A9DcHkGW3JSB9dELtfc5zbaP9FQ10qxQD ZCPA== 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=2oEoPGrb3k26bB/Uid0QXLy2nFJITW3D20/aD3tnGJA=; b=Ll+6NFSoVVsJ1aB68NKWqCgzDKGmyt1SswLGqc8TEoQ5BR8V5u6e3L0NoOypV6p6Th v/TR3PfZ3v+4LijIDhL5+D1bULFs4MCMsscK0w8xkZyxDfw9WKWJJrHu7eXHaut9pHGJ 03SfKvWx5MukcDt1125qzlGh1k79EaiMdmOxz/FU4O3ymTJ419Vd2j2fJJH1432X2//K BCC8/QPpAHkVZyHoJ6U89InMUJf6pwzf6UmTCKQRCTC5CD85F3A8xTs8PPBH5bcPef12 Z4oIsCdQ6NQns8isYii3JY0qiFsvIaprqwvDueHrLGlq5AaGdUldu27bWHUMmF9T1Jb5 gWQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ggK6knhA; 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 q189si4890219pgq.240.2019.03.16.10.57.55; Sat, 16 Mar 2019 10:58:11 -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=ggK6knhA; 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 S1727171AbfCPR5P (ORCPT + 99 others); Sat, 16 Mar 2019 13:57:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:34216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726376AbfCPR5O (ORCPT ); Sat, 16 Mar 2019 13:57:14 -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 6806B218D0; Sat, 16 Mar 2019 17:57:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552759033; bh=Q91zTYYwbUuY05bfcjTEGeNsk7Tc5VfIN0iD5Epm2P0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ggK6knhAoRX33ZBPBIbCMh7tT3bP2LRyiNJ+Zpim0g9TPuamt8RpQ2pKuZw79VDk1 +wPPfy+IrRYwRLlL9yFGcVcKdRU8z2BUZGCCTU3fW3nr8BzDM4NrxaQKHRE723oOO+ yKMu7ZeyHF47VYhvCh5VN0GPRRxyoMYx1nkNF7YU= Date: Sat, 16 Mar 2019 17:57:06 +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 05/11] staging: iio: ad7780: set pattern values and masks directly Message-ID: <20190316175706.0012b9f0@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:14:14 -0300 Renato Lui Geh wrote: > The AD7780 driver contains status pattern bits designed for checking > whether serial transfers have been correctly performed. Pattern macros > were previously generated through bit fields. This patch sets good > pattern values directly and masks through GENMASK. > > Signed-off-by: Renato Lui Geh Applied, Thanks, Jonathan > --- > drivers/staging/iio/adc/ad7780.c | 20 +++++++++----------- > 1 file changed, 9 insertions(+), 11 deletions(-) > > diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c > index 8ff74427d975..94cb60c327d0 100644 > --- a/drivers/staging/iio/adc/ad7780.c > +++ b/drivers/staging/iio/adc/ad7780.c > @@ -17,6 +17,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -28,16 +29,13 @@ > #define AD7780_ID1 BIT(4) > #define AD7780_ID0 BIT(3) > #define AD7780_GAIN BIT(2) > -#define AD7780_PAT1 BIT(1) > -#define AD7780_PAT0 BIT(0) > > -#define AD7780_PATTERN (AD7780_PAT0) > -#define AD7780_PATTERN_MASK (AD7780_PAT0 | AD7780_PAT1) > > -#define AD7170_PAT2 BIT(2) > +#define AD7780_PATTERN_GOOD 1 > +#define AD7780_PATTERN_MASK GENMASK(1, 0) > > -#define AD7170_PATTERN (AD7780_PAT0 | AD7170_PAT2) > -#define AD7170_PATTERN_MASK (AD7780_PAT0 | AD7780_PAT1 | AD7170_PAT2) > +#define AD7170_PATTERN_GOOD 5 > +#define AD7170_PATTERN_MASK GENMASK(2, 0) > > #define AD7780_GAIN_MIDPOINT 64 > #define AD7780_FILTER_MIDPOINT 13350 > @@ -209,25 +207,25 @@ static const struct ad_sigma_delta_info ad7780_sigma_delta_info = { > static const struct ad7780_chip_info ad7780_chip_info_tbl[] = { > [ID_AD7170] = { > .channel = AD7170_CHANNEL(12, 24), > - .pattern = AD7170_PATTERN, > + .pattern = AD7170_PATTERN_GOOD, > .pattern_mask = AD7170_PATTERN_MASK, > .is_ad778x = false, > }, > [ID_AD7171] = { > .channel = AD7170_CHANNEL(16, 24), > - .pattern = AD7170_PATTERN, > + .pattern = AD7170_PATTERN_GOOD, > .pattern_mask = AD7170_PATTERN_MASK, > .is_ad778x = false, > }, > [ID_AD7780] = { > .channel = AD7780_CHANNEL(24, 32), > - .pattern = AD7780_PATTERN, > + .pattern = AD7780_PATTERN_GOOD, > .pattern_mask = AD7780_PATTERN_MASK, > .is_ad778x = true, > }, > [ID_AD7781] = { > .channel = AD7780_CHANNEL(20, 32), > - .pattern = AD7780_PATTERN, > + .pattern = AD7780_PATTERN_GOOD, > .pattern_mask = AD7780_PATTERN_MASK, > .is_ad778x = true, > },