Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp728716img; Thu, 28 Feb 2019 07:01:02 -0800 (PST) X-Google-Smtp-Source: AHgI3IYF46HNIQsB5ff1LwVTT4fl+gBFeOVeWbC61jW+QGJFiZhhQuffz3uDku00QAJJbJIdQNIO X-Received: by 2002:a63:7503:: with SMTP id q3mr8316723pgc.98.1551366062281; Thu, 28 Feb 2019 07:01:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551366062; cv=none; d=google.com; s=arc-20160816; b=xtPH9gAD/8HM+7ZZ4Bf1n2uc41Wjw0+eFrSsfhFQgRhY/LI/ZZB6j30qCIyP89qqgB V5n89F/2nPTd2Gf2JvcjkClm1bROlWvrhBb2dWp2t4OBduKL5tzpZ43fzIFU+en4kPq7 fzZYhzyKWfKcQLLVyfowcjyGwl2Z12gUayAdlAffcvXdEeXKG+rWoyfYSc3SKS3jnlrH JQJGXJmb+Cjh7ssNECRizGUrMir/qZdDqeZVEpdB7ZTI0tzea0j/qnAmxgolYErOmNvS FiU3MLoJuBtJEgHXKXT5Ow1cgWZA89DLrn7Kpvo37myNzLOsA4xNuKEwXyuUzg+qNTGv agkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JlOPTet1jflBzo+5BdxF8+Muf08K1vBJXDoi85DvXoE=; b=cPP/WkOM0LLOAFaIMTIcIfn9ttXpRkuDFAyqTh5eo1E1rzw8YCBDOxQRg7YoKRKaZy JkpuIqrI/sReKHVSJrQE+ej+JtsOip1irF622fer6cyIXxEAl7q79SjFNwriIjb/AWGn 3P0I7h3RPMMoMExa1D4Btw3XyZgOamPqRg+D2mNLltKXIZSkBUOpS6dwXDjO8fg3vfpM y2JFV3k4pjYAPwEHvoYvjWtTTFqUlf9OFAGMsK9wrz+7XR8K7PQJNX5JlGm1F3A0ihIl ylfGGWnsnih/WC6kfz8idfkQcMQnSmfPb51Pz4kswm4j0W5lv4FDdSJQNgNVPHOQu3Wk gosA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=D1at2AIp; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3si18428267pld.325.2019.02.28.07.00.46; Thu, 28 Feb 2019 07:01:02 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=D1at2AIp; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732809AbfB1OZD (ORCPT + 99 others); Thu, 28 Feb 2019 09:25:03 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:46762 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726027AbfB1OZC (ORCPT ); Thu, 28 Feb 2019 09:25:02 -0500 Received: by mail-qt1-f193.google.com with SMTP id z25so23591916qti.13; Thu, 28 Feb 2019 06:25:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JlOPTet1jflBzo+5BdxF8+Muf08K1vBJXDoi85DvXoE=; b=D1at2AIpfc4kQH9PDPQ7Hu+KVHj75AmMkEbR48B5PmKzB21NL+YaM/YbuU1NgyXguE MpacssVkC+snup9EkdUDD59MyG/u6NQfg8Tc3xMw2u10WC4jb/lnhrBuVIPBCj9QN5jW L7DK8cp58FC0QDc4p0gsuhOZU4hwvj/wie0rIolWWFo9yL/4+v7+bdi+x4iIJKiR1NYp Rnzrr9XE7nltNUiZjJ84wV4VF+lN3V0x5MUZ3yPudPlxdB0szmop3brD2qBevAFj5xkm fCvas5JWXMGI8TG/e9SAL9sjtwPD2kBIEP0IA/Dllz0+PT0UXN/qVmlvvUlfNRy5/shA yhgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=JlOPTet1jflBzo+5BdxF8+Muf08K1vBJXDoi85DvXoE=; b=K+I47oz2jTTD+t9ARSdpUxjBsxXplaEWLhTLMI2OSY/j0KbOEzp91RRyOb32Tb/Ahd 399JFoUD9c2OOyl5+m+QkTf63tDlZ9QradeBUv7m0jlyfdwsTDuu8Q5RatbVDJScNYdX qiaQM2WlgmWjdkCP3Be0j8/m1wKEg6xQfRCH9KHHcAL30ElMw7nTeU5tyvNU3E14mrVy XJz12xrxiMHV/sfRlWVe3Qf0Y5/j/gKy3YobDsxyLCcS6QU87XSd/XgIYoZdgDNiftk4 pB8755NCtMAl9Tw2uPo/V+1hKKPwP8OeLauwhHZz/B9O/Veu5wAQUVrtnn0qMCjDNEz3 MZ7Q== X-Gm-Message-State: AHQUAuZ0670Vt8rVPACX4wghKzWnLDVNLPloUUgR3KMasb5/bWTwtIra GsbHkrEfPQzOsuXf6H0fDxA= X-Received: by 2002:ac8:3474:: with SMTP id v49mr6334393qtb.132.1551363901206; Thu, 28 Feb 2019 06:25:01 -0800 (PST) Received: from renatolg ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id e4sm10608705qta.84.2019.02.28.06.24.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Feb 2019 06:25:00 -0800 (PST) Date: Thu, 28 Feb 2019 11:24:55 -0300 From: Renato Lui Geh To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, 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 Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-usp@googlegroups.com, devicetree@vger.kernel.org Subject: [PATCH v4 4/9] staging:iio:ad7780: add chip ID values and mask Message-ID: <90c573cd53bb54d49de6ac270bcff66880ccfeb5.1551358569.git.renatogeh@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ad7780 supports both the ad778x and ad717x families. Each chip has a corresponding ID. This patch provides a mask for extracting ID values from the status bits and also macros for the correct values for the ad7170, ad7171, ad7780 and ad7781. Signed-off-by: Renato Lui Geh --- drivers/staging/iio/adc/ad7780.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c index 56c49e28f432..ad7617a3a141 100644 --- a/drivers/staging/iio/adc/ad7780.c +++ b/drivers/staging/iio/adc/ad7780.c @@ -26,10 +26,14 @@ #define AD7780_RDY BIT(7) #define AD7780_FILTER BIT(6) #define AD7780_ERR BIT(5) -#define AD7780_ID1 BIT(4) -#define AD7780_ID0 BIT(3) #define AD7780_GAIN BIT(2) +#define AD7170_ID 0 +#define AD7171_ID 1 +#define AD7780_ID 1 +#define AD7781_ID 0 + +#define AD7780_ID_MASK (BIT(3) | BIT(4)) #define AD7780_PATTERN_GOOD 1 #define AD7780_PATTERN_MASK GENMASK(1, 0) -- 2.21.0