Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp916013lqt; Fri, 7 Jun 2024 02:34:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVe2YXQyJojJXqZRj7PP9RT+bzjIdXKBi/4TP/+q197vSL2g/6eJQsk+C7LfZpdgSbGYyqK6OVH2oIGUOjYzodBTxqacm3rMsD1ibVKUw== X-Google-Smtp-Source: AGHT+IEAu5L4m2m39SxbkmSOJbwdITnL3FWiN1+Ut5zhLxVTDTkCCQkZ8BBu5ZGHZy59aL91/ACa X-Received: by 2002:a05:6a20:2588:b0:1b1:d402:a93d with SMTP id adf61e73a8af0-1b2f9a54ba7mr2333776637.19.1717752862575; Fri, 07 Jun 2024 02:34:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717752862; cv=pass; d=google.com; s=arc-20160816; b=DGB9AqnDYC9NzaJeV3ZZbOLBQxfpNl16bMmovX2EykEh7oRiEVtDkPPHXDjvGVQLgn EDgOWkhD9rUz1Q8e24LpEqWmYGaYLvyVhBNEBczS9y9xMdqTUKZ52uhLifKPP0E+Jtfw OZe7q2e4L7plzSdLdhBoV7vVQx3U8s8Z3WAge11RHpUm4LGpSWI76z1O0Qh4KQREqVCL PHvtFUF4cdvy8NP0q0fV1On5oeG03pktyDI6/zhUXvM0Wl2DWahVLqFeOEd+HZZBNCCj mdrOAcFLootGsm3tRZSvu8JFKxRGiwU4pFtISs8owtllad+YYOLucmoiUdoKUgIlY5Rj ii8w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=nB/+fCK3GeBMDtioeB6krXVE/3ZywEfuJ+7MqX7PUjE=; fh=jM/6O9EOclASRbxF+ZVuzZBSEDaAGOsJlny0JZzUz38=; b=s5ld2dvO4k7XfuKZiSDTZqDXksm3VbNxWhEXziSVnzM4e/CwQxbYE1tgRJQWOwwszk I/rrblTVjxaGeoteICgDKwBsU+Xy4zbsBq/pekjn3v1bv1THWDMZDlD2+MBOCXNgPpAI lf26kDEKWNO/WCzDzESLD3ELV0ocYP8H4x3d8whSZHcaYlBoxesYJFdimbWEh7wc8E08 Sd/nfIZGn2SkF7cwrzAslSArWq+bCdgFmZ2in1n1ce53eTHBB+nj2t3zqa7Rjq6+d3RZ bwc+wBPA1jmZ0iLs52JsVzuaM9P+uAP2NTwW+9bJryr0j5KVbXtT6vh8p33DZhWJzxba +Q6g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Ey149o9j; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-205738-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205738-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd7f3059si27273965ad.470.2024.06.07.02.34.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 02:34:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205738-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Ey149o9j; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-205738-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205738-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 318E7288E27 for ; Fri, 7 Jun 2024 09:34:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 55FC315B98A; Fri, 7 Jun 2024 09:34:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ey149o9j" Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D785815AACA; Fri, 7 Jun 2024 09:34:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717752852; cv=none; b=qGoM43cQKucXu1ED7eqhwWOLC60L42bOXdp+xUH1unW6ZbudWfm/7qd4d1Q1OZLrA6PdfQy9eFHs2Z8rGNGI0Dgh2oMeONKhGp5lNkKK0ZjQrV47mksvgYTXuNADZ/FB5AM2Ruo24kBeniQRBSbfzQAtmp6k8wwfznUKInbQH8w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717752852; c=relaxed/simple; bh=KrThBVSstishmPXTlu9MOCAX708+VNDkBP9yf6xiwdk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=fGcg2qURj4sz7jP4Y7CGrku9qya2s7blSrkXQwv754qLYq/Il83Kk0S+chGjvLcJp4LoX9WLpJo71B5o30+k7d5PPtRy5pH6PpWqEmmoSlJkC+CeYvPxHutWHc4ak+kUTZAyNCrZTMGp1JgM0gTPckzO3vzwraEZdmCr9dOJivg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Ey149o9j; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a6ef46d25efso10247666b.0; Fri, 07 Jun 2024 02:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717752848; x=1718357648; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=nB/+fCK3GeBMDtioeB6krXVE/3ZywEfuJ+7MqX7PUjE=; b=Ey149o9j1sszBnWARxcrgS7w93oXXtw0yqG1QLPdGFAeY9sJivhOGnIS4AfCu0u8vJ 69Tjj6hEYaYSmQ14+CBTWAO5ONQdavMw8gomuF12CIEWxfc46WhZTRXnLXaOe96ti0WY mtvsDVUG5i5hwT29fD2cbk7Iu+xW9UY2KYPsnlR7Vpm6Aeyto638YNOiYs3DokoiwNje 2+pf6aOVGV97jKxFQLTK/ehwX3nhwAgxttjjeBSb3O3JFa2dM1CW0AkzOmMmpguPNaMO ROtXiH9yi12UvI9D+TihJb9UOwwwrpjTzEPf+72reKzKiRKal8+b54REOwa2ZdEu3MNZ 6TKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717752848; x=1718357648; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nB/+fCK3GeBMDtioeB6krXVE/3ZywEfuJ+7MqX7PUjE=; b=uIHVJxRL41IL5UegrlA1TF8fDuTL0u3blOMBtIzS9VUDrZlTPmF3Kl2TtvmrPTEr/Q bIwhZjlupy4gGzGZvsAa9EyY/zhgLXuclLMEc7sR460ZqQu88ZR5Ikt/3EUk9Xg1ffxS l4h3rn3iNBMa4w3TFg7ayEIeisGcGBUPSLXeVj+AN6Fum76xp0yUhgdp2qRrFcAygg0L 60sR43rIGf9FtVD18fW2rgXoxiDLpCtwSEFdPP3zrxaVp9iJQ60L/ihfx9Rmv+6cyY/U eV2pNeCLqM7RDux8/tm1EssAOXTNfWlCk46dgcfTzCSX/XhCkcCqY6KrCmB03LVpsYSC xEgQ== X-Forwarded-Encrypted: i=1; AJvYcCXh/KrdfGCxdxaBTEGe8ilA/MdEN0tZOr9ymiBo5I+T9yBDz24fKDILXhX3dlrdUkmg2dSSqcB6pHimEespnwZXMGu5Qxyqa/lcKiskibFDhajS0/SOcqJGpxT4XPAWblLPVxD5nbARilByKH13upAs8VbHm9JNNFyjzxm/uYQuf/rxTQ== X-Gm-Message-State: AOJu0YwaIrSnQa5SzPHg69E98zNrbf/5dHBztr7+fXhAL8Edgx3K6w79 ID/Awfat5FSqCV+8eRHzS19Z+5sYgI8ff2Ac1A55sjigNyhUWEIA X-Received: by 2002:a17:906:f802:b0:a61:c462:c612 with SMTP id a640c23a62f3a-a6cdaa0f583mr122676966b.53.1717752848019; Fri, 07 Jun 2024 02:34:08 -0700 (PDT) Received: from [192.168.0.220] ([83.103.132.21]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6c8070e39bsm214992766b.162.2024.06.07.02.34.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Jun 2024 02:34:07 -0700 (PDT) Message-ID: <849357a8-848e-4b9f-9683-1db2eeda39af@gmail.com> Date: Fri, 7 Jun 2024 12:34:06 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 6/9] iio: adc: ad7173: add support for special inputs To: =?UTF-8?Q?Nuno_S=C3=A1?= , dumitru.ceclan@analog.com Cc: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , David Lechner , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240606-ad4111-v6-0-573981fb3e2e@analog.com> <20240606-ad4111-v6-6-573981fb3e2e@analog.com> <822eec36a530f659e4924886ad8d2bf272accd59.camel@gmail.com> Content-Language: en-US From: "Ceclan, Dumitru" In-Reply-To: <822eec36a530f659e4924886ad8d2bf272accd59.camel@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 07/06/2024 12:06, Nuno Sá wrote: > On Thu, 2024-06-06 at 19:07 +0300, Dumitru Ceclan via B4 Relay wrote: >> From: Dumitru Ceclan >> >>  Add support for selecting REF+ and REF- inputs on all models. >>  Add support for selecting ((AVDD1 − AVSS)/5) inputs >>   on supported models. >> >> Signed-off-by: Dumitru Ceclan >> --- >>  drivers/iio/adc/ad7173.c | 29 +++++++++++++++++++++++++++-- >>  1 file changed, 27 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c >> index 4040edbd1c32..d16fa081a285 100644 >> --- a/drivers/iio/adc/ad7173.c >> +++ b/drivers/iio/adc/ad7173.c >> @@ -66,6 +66,13 @@ >>   FIELD_PREP(AD7173_CH_SETUP_AINNEG_MASK, neg)) >>  #define AD7173_AIN_TEMP_POS 17 >>  #define AD7173_AIN_TEMP_NEG 18 >> +#define AD7173_AIN_POW_MON_POS 19 >> +#define AD7173_AIN_POW_MON_NEG 20 >> +#define AD7173_AIN_REF_POS 21 >> +#define AD7173_AIN_REF_NEG 22 >> + >> +#define AD7173_IS_REF_INPUT(x) ((x) == AD7173_AIN_REF_POS || \ >> + (x) == AD7173_AIN_REF_NEG) >>   >>  #define AD7172_2_ID 0x00d0 >>  #define AD7175_ID 0x0cd0 >> @@ -146,6 +153,8 @@ struct ad7173_device_info { >>   unsigned int id; >>   char *name; >>   bool has_temp; >> + /* ((AVDD1 − AVSS)/5) */ >> + bool has_pow_supply_monitoring; >>   bool has_input_buf; >>   bool has_int_ref; >>   bool has_ref2; >> @@ -216,6 +225,7 @@ static const struct ad7173_device_info >> ad7173_device_info[] = { >>   .has_temp = true, >>   .has_input_buf = true, >>   .has_int_ref = true, >> + .has_pow_supply_monitoring = true, >>   .clock = 2 * HZ_PER_MHZ, >>   .sinc5_data_rates = ad7173_sinc5_data_rates, >>   .num_sinc5_data_rates = ARRAY_SIZE(ad7173_sinc5_data_rates), >> @@ -230,6 +240,7 @@ static const struct ad7173_device_info >> ad7173_device_info[] = { >>   .has_temp = false, >>   .has_input_buf = true, >>   .has_ref2 = true, >> + .has_pow_supply_monitoring = true, >>   .clock = 2 * HZ_PER_MHZ, >>   .sinc5_data_rates = ad7173_sinc5_data_rates, >>   .num_sinc5_data_rates = ARRAY_SIZE(ad7173_sinc5_data_rates), >> @@ -245,6 +256,7 @@ static const struct ad7173_device_info >> ad7173_device_info[] = { >>   .has_input_buf = true, >>   .has_int_ref = true, >>   .has_ref2 = true, >> + .has_pow_supply_monitoring = false, > > No need to set the 'false' cases... > > > - Nuno Sá This was suggested by David Lechner to ensure consistency with has_temp regarding another field, I considered that it would apply here as well. https://lore.kernel.org/all/CAMknhBGaJxXvsQ8cZkgDsKLVjOY5y2pzox-99hdOCrUaoZdsxg@mail.gmail.com/ This would also increase visibility towards what features does a specific model support as it is clearly stated with "= false" rather than looking for what fields are not set within the struct.