Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp452047lqe; Sat, 6 Apr 2024 07:57:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVNtwU/SE71k3h4uQe+WZek2gCle+RFoCm49eB4Mxvy5PBCOo3ptLNZN5kjSgYb+FVqDF7XUbHIJza9K/XQcwCjpCWX3+CRx5twmOaLtA== X-Google-Smtp-Source: AGHT+IHNvW37pQO6xrCb+FfB6JkIv1toprqQcHGwkLq8A2zOjp7kl1MEoUgIb/w+Cin4pd3lkJUg X-Received: by 2002:a05:6358:2696:b0:183:b879:389d with SMTP id d22-20020a056358269600b00183b879389dmr4209489rwc.11.1712415428692; Sat, 06 Apr 2024 07:57:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712415428; cv=pass; d=google.com; s=arc-20160816; b=v+m77MvJJnOnc0XTV4njDtpF/EBHeZQtp/myGm68mGRnjs0Kd4Rgui80cpEa5DqrV7 dkQI5gXp0N3722q1Zky//+vLIhlx+Q/iMVf8RvdPZIL6Wu24iOzZYXhw/c5/VWAQcKK5 gPG6SiC37Cax7AhrTblLbFTCVw7UALq6r8OJUwexfopQa+Gkszenl+1SA6gGezATUF37 nVxZiKQ4HARDSVccWBTU7stPLpcJfIoLhc8wjhNZz8fmFVk4Doj3TCMWje48OL0XdSpS glAnfyZtQ517DGy+rHOB3GNH7lYn7K1Rs3Dyn/78FNZZHBojvLTbwL/oyn/UQAH+wgmr Vp8w== 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=prEpCt7FtHbP/bzsxT59RxF8WxiahtSOebthlM4ZquQ=; fh=Z1yqB6kQLbNjYjFlAchr83Xu527pXgW6bvteIzypziA=; b=gBcPZ2Rp4jpTTGwpTfMaRN+yg5bEceSEAfjBXCZe37zqfXxg6AGj0pXmwBvOovEecO goDaQ1dv8vkd9Kdk9IiwQ9wIMSCgCvIWMPu9hdbMwPn11+El3JCemOEeFbVsa3wXeSBA p7PS0m1lT6RfWicZHKuf5klL2CkhWJM4uRDFWFyy0Lyf2tw+26c8cNLEdu/jO2oZRo33 noBpV8xe2XS7ous5dyOJ9xpxnn/O5+caCITJdck4etfue4VEQjONRF0174oWALOZa8o2 Zib9YPdxyt9uDIafu16WrBscfkkboCFOVgf/llPzO1g0Jd+tEPKJ7zCWIeD6vHVRe5ao b4PA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t7Xaidty; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-133961-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133961-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j24-20020a63fc18000000b005dcbb9ebe61si3187398pgi.821.2024.04.06.07.57.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 07:57:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133961-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=@kernel.org header.s=k20201202 header.b=t7Xaidty; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-133961-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133961-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3BA48281817 for ; Sat, 6 Apr 2024 14:57:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 83A7B383BE; Sat, 6 Apr 2024 14:57:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="t7Xaidty" 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 9F94A38390; Sat, 6 Apr 2024 14:57:00 +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=1712415420; cv=none; b=rE5pdsT2nGGJeSRBPe9vcpHowsXVOnHhJUom5gRixR9DN0/6sT15rnVYgbEJwfrF+EwkcANk5ryXR3UcjmELWvIyzfq7ePfIcg50u2nxw53WMirMlEbYywZf82OkWpKx8iiemlNznAPWvJuxlhX2bi407P9AfK49klWdG5J8ieA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712415420; c=relaxed/simple; bh=H7r4BwHYdEAkivbchzdrbMt8uQAr7fq8c2kkzMTjysk=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Iy4QfkxgiYNPRsWE5xf/nspyIG8VsVkXUOEc/YKds07H5EZaWKQcPNeo47N6lASaM+/k5lt84SRM0aSzBgs5m8SCJHS+9bUWwPUSc9IWFwZjnvxyP/zXsT5gOh6Ff8PvycGHa8l96r5AXM8/mroI6WeKvrJztldMSJLB4TWQ4X8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=t7Xaidty; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 163CEC433F1; Sat, 6 Apr 2024 14:56:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712415420; bh=H7r4BwHYdEAkivbchzdrbMt8uQAr7fq8c2kkzMTjysk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=t7XaidtysS/mL4yRu/ZNJPnY2CXH2LEHOBo8qFRjr1egb4qlFtKO8rrd81+/2cXaA UrbiEdU9+EMPXyw2pqGWkHWtd8GETehuKheyXQQihZraZld8T7z6OXHV2III0aqaF0 +Ba5bv/mqOqL6Jq/IF+iKX3txDS11I8tLhzjQ+Qi5LHkTyV0kNtM4fk0BAPswBendF oFJF9eO27YWR/vkb51Q58Mkde3vZJcrUTSGnZ30L87EqjY0z64nuWzMjBebeYC+CsE XVTbdEmdJdBbi+p6evdJuZJMtDtHoaJphUDqFvkF9skddHdFm44CSsPeqyB3hUwatW Xk1ZwiQxwrRYA== Date: Sat, 6 Apr 2024 15:56:46 +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 2/6] iio: adc: ad7173: fix buffers enablement for ad7176-2 Message-ID: <20240406155646.694f710b@jic23-huawei> In-Reply-To: <20240401-ad4111-v1-2-34618a9cc502@analog.com> References: <20240401-ad4111-v1-0-34618a9cc502@analog.com> <20240401-ad4111-v1-2-34618a9cc502@analog.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; 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 Mon, 01 Apr 2024 18:32:20 +0300 Dumitru Ceclan via B4 Relay wrote: > From: Dumitru Ceclan > > AD7176-2 does not feature input buffers, enable buffers only on > supported models. > > Fixes: cff259bf7274 ("iio: adc: ad7173: fix buffers enablement for ad7176-2") > Signed-off-by: Dumitru Ceclan How bad is this? If you can find out if writing those bits does anything harmful (they are reserved and datasheet says should be written 0 I think) That will help people decide whether to backport the fix? > --- > drivers/iio/adc/ad7173.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c > index f6d29abe1d04..8a95b1391826 100644 > --- a/drivers/iio/adc/ad7173.c > +++ b/drivers/iio/adc/ad7173.c > @@ -145,6 +145,7 @@ struct ad7173_device_info { > unsigned int id; > char *name; > bool has_temp; > + bool has_input_buf; > bool has_int_ref; > bool has_ref2; > u8 num_gpios; > @@ -212,6 +213,7 @@ static const struct ad7173_device_info ad7173_device_info[] = { > .num_configs = 4, > .num_gpios = 2, > .has_temp = true, > + .has_input_buf = true, > .has_int_ref = true, > .clock = 2 * HZ_PER_MHZ, > .sinc5_data_rates = ad7173_sinc5_data_rates, > @@ -224,6 +226,7 @@ static const struct ad7173_device_info ad7173_device_info[] = { > .num_configs = 8, > .num_gpios = 4, > .has_temp = false, > + .has_input_buf = true, > .has_ref2 = true, > .clock = 2 * HZ_PER_MHZ, > .sinc5_data_rates = ad7173_sinc5_data_rates, > @@ -237,6 +240,7 @@ static const struct ad7173_device_info ad7173_device_info[] = { > .num_configs = 8, > .num_gpios = 4, > .has_temp = true, > + .has_input_buf = true, > .has_int_ref = true, > .has_ref2 = true, > .clock = 2 * HZ_PER_MHZ, > @@ -251,6 +255,7 @@ static const struct ad7173_device_info ad7173_device_info[] = { > .num_configs = 4, > .num_gpios = 2, > .has_temp = true, > + .has_input_buf = true, > .has_int_ref = true, > .clock = 16 * HZ_PER_MHZ, > .sinc5_data_rates = ad7175_sinc5_data_rates, > @@ -263,6 +268,7 @@ static const struct ad7173_device_info ad7173_device_info[] = { > .num_configs = 8, > .num_gpios = 4, > .has_temp = true, > + .has_input_buf = true, > .has_int_ref = true, > .has_ref2 = true, > .clock = 16 * HZ_PER_MHZ, > @@ -289,6 +295,7 @@ static const struct ad7173_device_info ad7173_device_info[] = { > .num_configs = 4, > .num_gpios = 2, > .has_temp = true, > + .has_input_buf = true, > .has_int_ref = true, > .clock = 16 * HZ_PER_MHZ, > .odr_start_value = AD7177_ODR_START_VALUE, > @@ -932,7 +939,7 @@ static int ad7173_fw_parse_channel_config(struct iio_dev *indio_dev) > AD7173_CH_ADDRESS(chan_arr[chan_index].channel, > chan_arr[chan_index].channel2); > chan_st_priv->cfg.bipolar = false; > - chan_st_priv->cfg.input_buf = true; > + chan_st_priv->cfg.input_buf = st->info->has_input_buf; > chan_st_priv->cfg.ref_sel = AD7173_SETUP_REF_SEL_INT_REF; > st->adc_mode |= AD7173_ADC_MODE_REF_EN; > > @@ -989,7 +996,7 @@ static int ad7173_fw_parse_channel_config(struct iio_dev *indio_dev) > > chan_st_priv->ain = AD7173_CH_ADDRESS(ain[0], ain[1]); > chan_st_priv->chan_reg = chan_index; > - chan_st_priv->cfg.input_buf = true; > + 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"); >