Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1501445lqz; Mon, 1 Apr 2024 08:11:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXduk73v0RYaYbRiPMBLdmiXB+M6ttxoYB30AvGhe26WL6n+W3EOYygmho5TwLTMXrtm9Oawi+WP6JwlJ0F9BGMx3u+jEAuXxvcJv4hJw== X-Google-Smtp-Source: AGHT+IGSma4I9laSz7r+BSZQ0IdXtlWtUw7zUfjfsZOODX+2S4WAam8W4zQ7U+lKqM+OAkt5nB5y X-Received: by 2002:a17:90a:a597:b0:29b:f6c1:cf01 with SMTP id b23-20020a17090aa59700b0029bf6c1cf01mr7715223pjq.40.1711984261621; Mon, 01 Apr 2024 08:11:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711984261; cv=pass; d=google.com; s=arc-20160816; b=c6zrK99oUPitT+g3QTh6szyxKa2GfrzOWpZ1P6m/TK3OJO2GcFfcc6vTpfL4X/tjxf JBf+aIxASFpe7tZBJhEuQMy6uo/4OdzQZ+BL7qvrwyb97eBPO699mJOh//RQ9m7WgNNq sZkJVquBtmGlF56sm3IbB02zNitG9SWYVHLcSeSkkDFRp61pCd6PUbtuT/A/lAqM+5cD CDzjxrIHlsYj1aIxixryI5trLPx/AZBkZbGQfRosmT5zhdz/nV2brGrcfvsBO00OkH99 O9TwNec6kfSz192tAQh3zI79OnOdYw5blzpA9VJoOxzPfv5dRYgGIRXkhp9TwYlGqL3Y vobg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=VCN4Dn35gHbmBTnNSHlXPbf/TzT+K/B3YPGKqnaiA5A=; fh=LhdatDguh+IuN1lDyS6rzhx9ubttSYYZpDCGFgekH1E=; b=eNQ4qGzgZu56ySMWj3O4bIWMV35TwCO+f1NyP4vd9BTV//l9k7mJJhPUuZqwUXdEBd 3KXO4gXWYfNA3Z+B7IgXfGTEld9JSfH+fmNlKxlWyBxQMa9UoLcYI/29Uesg4QKWm616 z/9j8F9ayplpVk0BS+qK0fqxOA4GqWYvF9A96kk3iZJAH+gmQQNCWsYxSTaMMpahazgX qaJPlbeRfRlZ1HnOH01CYQkX0c1F0SkNSWcf9gsvtpEY8zwDxDPoj3fAaOqKCqs6D/QA mc2Hy+C9tVDyIjGTOmdww3N8xqGh6cDVGjyY6EUaW9j/qfjLMcGj/zspTOzan3VRDDD8 wxwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eILMBCMN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-126778-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-126778-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id a2-20020a17090a480200b002a0901f18c7si9458576pjh.138.2024.04.01.08.11.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 08:11:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-126778-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eILMBCMN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-126778-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-126778-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 36A34B21E19 for ; Mon, 1 Apr 2024 15:10:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9CA94482E4; Mon, 1 Apr 2024 15:10:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eILMBCMN" 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 77A744597C; Mon, 1 Apr 2024 15:10:17 +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=1711984217; cv=none; b=Qn6Yd3eRUlwyxuUOYjSeHDTAolOwcUuHHpZp9KzKpWDv9aRi0QgFw/jKxQ8HPkfs4f7GNNOjp+c6mlNPJ0kfBW4W/VsSJ0+PV3Z2DuwtIBGa4FiTJV0wQZGFRYa0GJGE8bjB2EvS191Mv3kMNs2ZniSvNy/ODM7lBUQVIHk1go4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711984217; c=relaxed/simple; bh=EPYzwoSlBrhWbb4NezRITDY2mYtpyHQZqs3oDoNIUH4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lHgNQmQeMWhMklLBecIpLlMhtC8zWucRk/Mfy+7TiV4owwKEBFfqbkXkXeS/YjCPt+7siJP7fqx5Wf1AobWUuPzkfcAF2xIan4QQRGES6qHuuRmqCBTkvpFpljIpl+5nyuQCDg3x44gL91AtbVcYzfM2h5/DEnopKOArpmruX9w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eILMBCMN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 21AABC433F1; Mon, 1 Apr 2024 15:10:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711984217; bh=EPYzwoSlBrhWbb4NezRITDY2mYtpyHQZqs3oDoNIUH4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=eILMBCMN6m8CFocOHSUI/Gr3DKl7XMR8dExHgWT8ygz9pCseIWyEY5Rpi4kuHgD0j P8wR69E2UjxXXzh+09p+2X/1UBfHEVGgbi92xT5wZWjLLQVQXcCHPANQJ46gP+CPQQ GFG6uJDEYJgEjFL/z9AxjiERPTPGFGt5eBuYzm3nR7WL/Hr5rLJG/saa3WEKAs1XpU 8aqODUV1XhaHRDKxlos+ItoUSVIcuCKVGuMGCpI0H0xmuOEs6I0grhuyGBu19au/Ok lIDZ18tUaJw5tOVOnQ43grwVXZgkJLc5Z6GoLLA3P7ndWCzyd2ggeOuTSbsfJTULKc TW6QirX16hnzg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FDDACD1294; Mon, 1 Apr 2024 15:10:17 +0000 (UTC) From: Dumitru Ceclan via B4 Relay Date: Mon, 01 Apr 2024 18:32:20 +0300 Subject: [PATCH 2/6] iio: adc: ad7173: fix buffers enablement for ad7176-2 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="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240401-ad4111-v1-2-34618a9cc502@analog.com> References: <20240401-ad4111-v1-0-34618a9cc502@analog.com> In-Reply-To: <20240401-ad4111-v1-0-34618a9cc502@analog.com> To: Ceclan Dumitru 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, Dumitru Ceclan X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1711985550; l=3146; i=dumitru.ceclan@analog.com; s=20240313; h=from:subject:message-id; bh=XBG3ZzeGtsb1s4sQXD5/rlIZvxQAdZt5Ft64/lEIcrg=; b=GIhyy5ER6B9DJE8fTnl0ZSa2qS3hR4RU3sEXbtJaqItmlVnIXjlgj0V9vagcODrEgKr67Uk+g cLBWvMoweiXDkkIua9dOLXVbIToruVYxFaA8JXsDO+fSrTxOkRkA+xh X-Developer-Key: i=dumitru.ceclan@analog.com; a=ed25519; pk=HdqMlVyrcazwoiai7oN6ghU+Bj1pusGUFRl30jhS7Bo= X-Endpoint-Received: by B4 Relay for dumitru.ceclan@analog.com/20240313 with auth_id=140 X-Original-From: Dumitru Ceclan Reply-To: dumitru.ceclan@analog.com 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 --- 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"); -- 2.43.0