Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2040610lqo; Sun, 19 May 2024 10:14:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUn+1FX+5nMx5JJ4VPACp0lrSB6Q6qe+c68ISr7trl0NsA51qEbXja1iu1PNVvrcda8LaxOWlQmPU7xfoTLmvBDVO9ehac+nJsEE6+tKw== X-Google-Smtp-Source: AGHT+IGw+EMRfsz+XfRssUBR8mUbk9+wEoaDhbZnLzGw0Hb3xnriq6P/HLfSf4qZBC22XtXkbGyt X-Received: by 2002:a05:620a:a96:b0:792:bfb8:848b with SMTP id af79cd13be357-792c759ae5amr3007466185a.27.1716138852335; Sun, 19 May 2024 10:14:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716138852; cv=pass; d=google.com; s=arc-20160816; b=0PMWFyaeyarBpBssuU5FaWS66XOCB5sdc4KIcN2cLAQFti4Buji0u+9pFKZbBzKX1K mM9H20UcWukk0BFAXRXZGTkMKSt/gtYWMWZLR4gnBL//jicdTIaCKF0te+VHzo0ShCwC zWhVL7R4739JQcalc++OpI/v26dYOXtRTIXgoOtqva20VcnnNEFaqef8VvOIr6j99DUk Gg9ZU8j3MCo3C3pMbrjDBPN2CYTP++ibACzacvdKWvfgPdOsFsxogYKa12xJWGo/Eksz IhFWwnKA0NnKbHm/qbRqfwW//M1gQoFLlRgwm8hxZcKgtuhn1I71akEgQoqUHET6FKPZ sQkg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=8BK1SjuQocPSil75i64/G9o37sQq6HtEXSWZ+6xDBWo=; fh=Z1yqB6kQLbNjYjFlAchr83Xu527pXgW6bvteIzypziA=; b=yoVOT4Y/5fMD4eYnZxYeLha6NycM1zOQOQ1WDwl7B2GnWqDeybIREMENBFBO4ziGgK 8Xx7Ts9bw7oe8vMfUo7NQY44gosGqft+kKfZc+bbGl3Bk/dxr9/600qNurKco8spgzXr BAOMYquJiCv4vGcfft1DgyhsU+Z/A/yWOovhdtT0PiVBUMtnaQzdmqOz9bB6QFcICe6N un/ptjX5nHdh7DBVXddxEYc1Pm/isgv/1YRSp6GPN0/J6tVCUgy7B4qmZOivaa+DGoXb ak6+lmQqTaAZEox8RbQ09EJ1Qa601eLW4cR4wRhxPwIRF1R5GyeagmTg0oqdrD1KVIgq IMZQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jzst70TO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-183167-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183167-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-792bf38dcebsi150527585a.779.2024.05.19.10.14.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 10:14:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183167-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jzst70TO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-183167-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183167-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 141401C20D5E for ; Sun, 19 May 2024 17:14:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C8724F201; Sun, 19 May 2024 17:14:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jzst70TO" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACEF94D108; Sun, 19 May 2024 17:14:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716138842; cv=none; b=Ktvw7jRp0c0I9VoKNlZKKxEXyzIqhI5MertgvKP1F/gv7efd6Dh+bqBrHqHMlXS7HwU4MRUrlorjke5nZPEy8Cs8IemNduaREemTSkW8/RxilDXXzmD+fQzHG9d9vJbjYf7rtseiJCMvjloWagA3GdmzdkM3hCkjnr+8+Of65QE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716138842; c=relaxed/simple; bh=rzQUip3ttnHtdiXBV8Xar/0z+hrxGmJ12YoZERJc1o8=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=S71iEg6/IZPb9MYbHGT7u3hAyWq12bUEzIgSuCXkTy2hgq9LQumKgg4r4wyVgK7KztnLHzz9zedf8JzfhSZKWwOpe+iU2Y+MAYKC2NQNNa9TGZ7Xho8gNTFjIbMuksYkt8qrUY5yk83svj7fGn7ocF/c22OeygThwR8R3+nzhLs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jzst70TO; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37739C32781; Sun, 19 May 2024 17:13:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716138842; bh=rzQUip3ttnHtdiXBV8Xar/0z+hrxGmJ12YoZERJc1o8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jzst70TOK9rMnMkhl4Baw4PRnR93itFBWpkQ1m7a2l+M+UGgahpjYyWc0h87VDjdk acfpcMYbFGKkXT3vQlOY3cQw6gNBuKZM93Wi9v/4I5tRo+F1+dVEiDOgemI7BTLxQ/ ttMwwsGHgkB/t6IWlv5yi3iIilWpnVHAb9Mx/YnIkrIvPfCJ4MF8DBkkIYiM0XuyKZ eTQGNAkUU06cqMk1xofz3kIpEdqhFpmSO69UK1kQH9uTRnK9xVKtGZ+DZ/10b/ip6o L2cl1mE3vS7XgAs1WZHgzCalGckiAPHmiDQBwxgKXetCiHZDxy78zez9sS8SnCeUfM fZoykaOLzSm7g== Date: Sun, 19 May 2024 18:13:49 +0100 From: Jonathan Cameron To: Dumitru Ceclan via B4 Relay Cc: dumitru.ceclan@analog.com, Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley , David Lechner , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Dumitru Ceclan Subject: Re: [PATCH v2 8/9] iio: adc: ad7173: Add support for AD411x devices Message-ID: <20240519181349.0209271c@jic23-huawei> In-Reply-To: <20240514-ad4111-v2-8-29be6a55efb5@analog.com> References: <20240514-ad4111-v2-0-29be6a55efb5@analog.com> <20240514-ad4111-v2-8-29be6a55efb5@analog.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.42; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 14 May 2024 10:22:53 +0300 Dumitru Ceclan via B4 Relay wrote: > From: Dumitru Ceclan > > Add support for AD4111/AD4112/AD4114/AD4115/AD4116. > > The AD411X family encompasses a series of low power, low noise, 24-bit, > sigma-delta analog-to-digital converters that offer a versatile range of > specifications. > > This family of ADCs integrates an analog front end suitable for processing > both fully differential and single-ended, bipolar voltage inputs > addressing a wide array of industrial and instrumentation requirements. > > - All ADCs have inputs with a precision voltage divider with a division > ratio of 10. > - AD4116 has 5 low level inputs without a voltage divider. > - AD4111 and AD4112 support current inputs (0 mA to 20 mA) using a 50ohm > shunt resistor. > > Signed-off-by: Dumitru Ceclan A couple of trivial things inline. Otherwise lgtm > @@ -1058,17 +1296,26 @@ static int ad7173_fw_parse_channel_config(struct iio_dev *indio_dev) > chan->scan_index = chan_index; > chan->channel = ain[0]; > chan->channel2 = ain[1]; > - chan->differential = true; > - > chan_st_priv->ain = AD7173_CH_ADDRESS(ain[0], ain[1]); > chan_st_priv->chan_reg = chan_index; > - chan_st_priv->cfg.input_buf = st->info->has_input_buf; > chan_st_priv->cfg.odr = 0; > - > chan_st_priv->cfg.bipolar = fwnode_property_read_bool(child, "bipolar"); > + > if (chan_st_priv->cfg.bipolar) > chan->info_mask_separate |= BIT(IIO_CHAN_INFO_OFFSET); > > + if (is_current_chan) > + chan->type = IIO_CURRENT; > + else > + chan_st_priv->cfg.input_buf = st->info->has_input_buf; > + > + ret = fwnode_property_match_property_string(child, > + "adi,channel-type", > + ad7173_channel_types, > + ARRAY_SIZE(ad7173_channel_types)); > + chan->differential = (ret < 0 || ret == AD7173_CHAN_DIFFERENTIAL) > + ? true : false; That's not a boolean. So better to set 1 or 0. > +MODULE_DESCRIPTION("Analog Devices AD717x and AD411x ADC driver"); I'm scared of wildcards even in descriptive fields as they often end up covering something unintended. I'd just go with 'and similar'. > MODULE_LICENSE("GPL"); >