From patchwork Tue Dec 24 14:29:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 13920177 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8392EE77188 for ; Tue, 24 Dec 2024 14:33:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=i9GoekDoCU0xMxFyd9N4qiMFnHW9OjntIxlAzqCVuPI=; b=HVaXnRE4H447bGvtyph29vIPHJ oAwHkzHTDah0XffwCcqtxF4/MHY4/7VODTdff9Zz5/4Fqonu5/X9HNjWhZX+ADHX5FoVOOYU2BB20 QauB0geDMklfkATRL33rXBM3eFM94a+l0buMdbmfbf1zhj/43V+qrYF4wkaexbrcPHhZJcs6PHony 4Imptl6EhDM8Bt0ojZ5FVlAGKmasRS11ctkxDUICd25dAXbUEVxTmxX1FCsPFEaJ287s2ugF/BMr/ +sq3qXtF9Kjg+N9ZXzEyauUjCXTFE2u4zxdwMpOAES4D8fhSRRh/z4qZK+YapyCMLS5KXNijcd5GW p4AeBvqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tQ5y3-0000000C980-3qgL; Tue, 24 Dec 2024 14:33:03 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tQ5vi-0000000C8lJ-3vud; Tue, 24 Dec 2024 14:30:40 +0000 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-aa689a37dd4so672197066b.3; Tue, 24 Dec 2024 06:30:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20230601; t=1735050637; x=1735655437; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i9GoekDoCU0xMxFyd9N4qiMFnHW9OjntIxlAzqCVuPI=; b=EdNwKROOuR54zOIvatz6ksdNYOq4JQ/AgdyhGXyszsM8o1qJJhUpq+fUF+iw4NXmer pz418McbAlee3wg4Ncd6ZpUhkXYOg2sgIier3eK8XagzlGQ2NV34cZP7ZD/KoXMbx4XL fWIn5pz0/oym+uM0FF8XNXj5YPQZs4Y73aANnHmB9pDUe1uIOcozsy4QvCut3jBwtEpz N/rf8j/OpJFNj9XMvm91ab1SE/0x/2IYqHS2466A+L7zjc+Vdgh1yVrQgiERrMHKLJO7 CmR4wEK5L8nCXMhg+HHs/nemjLvAJDMfSRWf1xNVs+Rv2Dw/jQzB3PVoA2skJqoWH+vG uAAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735050637; x=1735655437; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i9GoekDoCU0xMxFyd9N4qiMFnHW9OjntIxlAzqCVuPI=; b=SgAT5d5TCsIWCiSWB9gOnX9Dj2IdSrVjvje8zXaQRGK3XmnYMCvG5tOiTGgOv/sUJc iKApb/YOr8zWPrg9mL13qOLNVaVABq/DpFmEYoooXTnDwHWbdUuz072Lp4vqrEaz15Nr KwcNenbTCH8OYeLa/YLN6F3GrSAsiwVD4jA5I5US9/zeecbOCmh9odTJ3ioV6o5PGFg+ hBU4qAJITOncUO7Rc8xzFznKeymBF3Hzy5mO4RxeVelIUHE0pvEO5jdzjy2yxht5jk3f OUNmIwMt2TeQsyPeUz6V1C716ZpVzynrbSuQZ6CY/lEJp/gno6Zu04MYJgigPHF6qBv/ LhNA== X-Forwarded-Encrypted: i=1; AJvYcCUdDD4R/pLf9RZhTYLgNAZl08YE9jynF2+Lzqxk0+CW88haAl8q2V55uzpnX3imuR0tBVL7k1fz/rXPZPsUM3xecw==@lists.infradead.org, AJvYcCXKJNca+EG+VtC09HZGACHDgmPpSQA8M/CJodWkUBwZktjalCRgP3ZXDXt1YB6X9EOo4erizY9vYW6I071z@lists.infradead.org X-Gm-Message-State: AOJu0YzrToWzkT2Pxom4nPT2A4024xbjfN/a2TqqXmSZ22R5/QM5A4E+ 6mJMYgd1vnxPyY2ECyJOp+OMvHSsrEE5Mk9ncJt4vT46+QMOIw3B X-Gm-Gg: ASbGnctwoLbim25YfD0029qy912S3eH3mjo49W0SPhfQnDIHthoDHuq11ZHxngPgjPn rRQXAEiwOabBaV6tXAW/W/queeKLQkuBhoDn154ah2rPzUmh+ropZ35CJAvnq//x3lt+LedN2Yz h9NC2TAVv/ylEGVpJv/mUI5Kmm0T6ckldJZvQSdOBX0LsJPzlLVrvECOSZOMXA2PHbM82lcRMAb FVocuJeR2gAvHtKRseQGP7RQve2Xb4wYTeUFoss4Xhwz/bCq5Cb5Zy/IheIla66uenCBWIF7dUp PWi4VV/JpqO5dImv/gT5CUKFoSrOyPdf4kyUbdiiEslSKDsgpALFKxCx3i5G/yEPKRbyj6qtuEk xV3210w0= X-Google-Smtp-Source: AGHT+IGhElsQeCU3jdwWZkcauyJOHjacVPTPXhTENgcdJxCU29OOCPEQW7SqtJztuYY6P3IG+jd58g== X-Received: by 2002:a17:907:2d2c:b0:aa6:8b38:52a3 with SMTP id a640c23a62f3a-aac33787557mr1286928066b.50.1735050636535; Tue, 24 Dec 2024 06:30:36 -0800 (PST) Received: from localhost.localdomain (dynamic-2a02-3100-a5d7-4700-0000-0000-0000-0e63.310.pool.telefonica.de. [2a02:3100:a5d7:4700::e63]) by smtp.googlemail.com with ESMTPSA id a640c23a62f3a-aac0eae74e4sm658827166b.91.2024.12.24.06.30.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 06:30:35 -0800 (PST) From: Martin Blumenstingl To: linux-iio@vger.kernel.org, linux-amlogic@lists.infradead.org Cc: jic23@kernel.org, lars@metafoo.de, gnstark@salutedevices.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, neil.armstrong@linaro.org, Martin Blumenstingl Subject: [PATCH v2 1/3] iio: adc: meson: fix voltage reference selection field name typo Date: Tue, 24 Dec 2024 15:29:39 +0100 Message-ID: <20241224142941.97759-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241224142941.97759-1-martin.blumenstingl@googlemail.com> References: <20241224142941.97759-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241224_063038_978267_CE89EB39 X-CRM114-Status: GOOD ( 12.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The field should be called "vref_voltage", without a typo in the word voltage. No functional changes intended. Signed-off-by: Martin Blumenstingl --- drivers/iio/adc/meson_saradc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c index 2d475b43e717..4cfbb3482a2e 100644 --- a/drivers/iio/adc/meson_saradc.c +++ b/drivers/iio/adc/meson_saradc.c @@ -327,7 +327,7 @@ struct meson_sar_adc_param { u8 vref_select; u8 cmv_select; u8 adc_eoc; - enum meson_sar_adc_vref_sel vref_volatge; + enum meson_sar_adc_vref_sel vref_voltage; }; struct meson_sar_adc_data { @@ -989,7 +989,7 @@ static int meson_sar_adc_init(struct iio_dev *indio_dev) } regval = FIELD_PREP(MESON_SAR_ADC_REG11_VREF_VOLTAGE, - priv->param->vref_volatge); + priv->param->vref_voltage); regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG11, MESON_SAR_ADC_REG11_VREF_VOLTAGE, regval); @@ -1212,7 +1212,7 @@ static const struct meson_sar_adc_param meson_sar_adc_gxbb_param = { .regmap_config = &meson_sar_adc_regmap_config_gxbb, .resolution = 10, .has_reg11 = true, - .vref_volatge = 1, + .vref_voltage = 1, .cmv_select = 1, }; @@ -1224,7 +1224,7 @@ static const struct meson_sar_adc_param meson_sar_adc_gxl_param = { .resolution = 12, .disable_ring_counter = 1, .has_reg11 = true, - .vref_volatge = 1, + .vref_voltage = 1, .cmv_select = 1, }; @@ -1236,7 +1236,7 @@ static const struct meson_sar_adc_param meson_sar_adc_axg_param = { .resolution = 12, .disable_ring_counter = 1, .has_reg11 = true, - .vref_volatge = 1, + .vref_voltage = 1, .has_vref_select = true, .vref_select = VREF_VDDA, .cmv_select = 1, From patchwork Tue Dec 24 14:29:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 13920186 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 506F0E77188 for ; Tue, 24 Dec 2024 14:35:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hdy6SZd8FG0XOydpfx03ysjyzRhbHoW5G6enWzLPqXA=; b=meqE5z8wzxSuViI6qAuMvcsmpk 3lMcDcOCOc+q02dIj/fo3KHuiCTw48kP/AX0auECxzONvO7J/Fknc0PWcK28IW9I3Nfv4kEu0TZx0 wLk/1WbDkQVHiUawKXryOSM02CtWEbUraThWrzFRRHdUW0nE9w+sAZAnOvBlmJV9LHH4FwmqmHOsN tb3ZPjliAnUgvzDwT8KXxYkkfuGhkQv3fG8g7saiktT+6tcYEto/LV5X8POSmuA09tETU4vvFsLCq Ehb7TGxLMQJKSTGR/Cl2j0qfCtmvGOwfCM9VgqMYg4TWWjzMyZnY70TIYHBh3GU51EEhegWOcsEGj /qxc87vQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tQ60P-0000000C9Qa-033D; Tue, 24 Dec 2024 14:35:29 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tQ5vm-0000000C8lu-0nwI; Tue, 24 Dec 2024 14:30:43 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-aab6fa3e20eso890055366b.2; Tue, 24 Dec 2024 06:30:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20230601; t=1735050640; x=1735655440; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hdy6SZd8FG0XOydpfx03ysjyzRhbHoW5G6enWzLPqXA=; b=frZvbvLyzi6PAVRt+NX0FWfPJRJzYOJT8slaMSrlA+kxG6u2CO1DBtvsjDV89vJeft LnFK6zZy7jJJdxd21OenDUFINrAq9gM8nqBSG+y+SOjmWSkTBA9IErSYwbdjurelTI7A 5XlEyLXcyo9SeK6rNmGNY3tahDnbgL5y+kBg924i6Z9RactEMUt/h5Pk1eyWx1jSYKM8 5Owjoc9Ns91vkN/mcCcw1/3s3LCn3oLZaZd3zcWmcowfofA+4lZRxn3IeER5EmA7VwbJ ixIL+7npB9y/XJEM+UqNXqb0DMkM2hDn3Wk17vrG4xLxrpdaeUOrPXQTDJG82hTDNx5J ujvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735050640; x=1735655440; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hdy6SZd8FG0XOydpfx03ysjyzRhbHoW5G6enWzLPqXA=; b=qNe4bHxvmOFdERSju4m3oSCza9s8MG1ZM6leC+ylkQTGfmBdSPb4fyeOPZF94f8W0a 2h4o8Cl+9zlKNTkhK/75nvOAr6k0w5HmRxSDPyoCCv22rq/gOQJf8daD0IAH0zi8nz5v zB1wQ1aMP2bE9V70EvdLppCcajwxlH8uDykyAgqaHrR6dCpZPnyXi8z9O70+T2YpM5Km TZDE0TuU1+6dvEHcfsJ053zGOAaLwkosEIvg5BPnd2W1V64Zogwgj0NvZ45QBpcW1D3P FL7Q9hUR9ZewF8odpH7vx89Mye6j6BPsJMAeknB0bB9bIfWWaLFM0sF4LpMaW55cfo9C P3dg== X-Forwarded-Encrypted: i=1; AJvYcCUkleLgQcSnnVqq65dzvBYKrF9fvKptTpgiX9loj+ItfV1el1LukJfcxtM+FZyM6DmIKRK09KlbHnoRpN+a@lists.infradead.org, AJvYcCXGuuoguhhmEChq736+eHEwryxjchK4RT4Cz44X84lbuQ7RNJyk4C2/zmfV0BUsDZJxRhLPM3ktz6e2+pYGQktFAQ==@lists.infradead.org X-Gm-Message-State: AOJu0YwYAiax46RfSIC7YmkhA9QBc1evc60aRnx3tnFLcKaxKGE5d9c4 9xJRjsQUU7pZ/8ZxbeOG+oXrWoNqkQgBkUOqZdrsbwoQDfDnQWae X-Gm-Gg: ASbGnctvhdMxU+pugaRDwB60bp8M4UtKRvgKTE19v6IpgD7zrwRZZq/xfAWmQuLCR3Y aXjHEx51hOBydSdbZ8kJpZ75WRJ9mTvQkSPFiDDKQz6GeHAT+AEDXypD/iSsibZrup3uUYFOBMB k9luafEUv7jRkm9MyH91+0Sf2mzXUAj8OWnhsn3RDwoYmIf3Q/3YEwVMIJU/bEwk8D515ph3x3E jQDCAn7U5mZXOmjhphQ0lSiTRbc0bUohG3YMjun4sXP++kDXa8tgBwMYoRIBUXqCyEUP9jfovzd IRons2yHyx/f9gsBGHWkuwdcxUSyoMQO+/kVj+13yP0ea+fp3xgcAUarIbo83VLnBXwzA23PXGq 3WVpBflI= X-Google-Smtp-Source: AGHT+IF+RA6pGEMNPeEIvtinon7wnHw8ZYLmyQnZK7PR3NdDBs1HQuAtj3EPBYyccO1+vDKHN6vReQ== X-Received: by 2002:a17:906:f59d:b0:aa6:9372:cac7 with SMTP id a640c23a62f3a-aac334c1628mr1727003066b.31.1735050638526; Tue, 24 Dec 2024 06:30:38 -0800 (PST) Received: from localhost.localdomain (dynamic-2a02-3100-a5d7-4700-0000-0000-0000-0e63.310.pool.telefonica.de. [2a02:3100:a5d7:4700::e63]) by smtp.googlemail.com with ESMTPSA id a640c23a62f3a-aac0eae74e4sm658827166b.91.2024.12.24.06.30.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 06:30:37 -0800 (PST) From: Martin Blumenstingl To: linux-iio@vger.kernel.org, linux-amlogic@lists.infradead.org Cc: jic23@kernel.org, lars@metafoo.de, gnstark@salutedevices.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, neil.armstrong@linaro.org, Martin Blumenstingl Subject: [PATCH v2 2/3] iio: adc: meson: use tabs instead of spaces for some REG11 bit fields Date: Tue, 24 Dec 2024 15:29:40 +0100 Message-ID: <20241224142941.97759-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241224142941.97759-1-martin.blumenstingl@googlemail.com> References: <20241224142941.97759-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241224_063042_245641_444E9EF2 X-CRM114-Status: GOOD ( 10.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This makes them consistent with the rest of the driver. No functional changes. Signed-off-by: Martin Blumenstingl --- drivers/iio/adc/meson_saradc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c index 4cfbb3482a2e..469af3c57066 100644 --- a/drivers/iio/adc/meson_saradc.c +++ b/drivers/iio/adc/meson_saradc.c @@ -155,10 +155,10 @@ */ #define MESON_SAR_ADC_REG11 0x2c #define MESON_SAR_ADC_REG11_BANDGAP_EN BIT(13) - #define MESON_SAR_ADC_REG11_CMV_SEL BIT(6) - #define MESON_SAR_ADC_REG11_VREF_VOLTAGE BIT(5) - #define MESON_SAR_ADC_REG11_EOC BIT(1) - #define MESON_SAR_ADC_REG11_VREF_SEL BIT(0) + #define MESON_SAR_ADC_REG11_CMV_SEL BIT(6) + #define MESON_SAR_ADC_REG11_VREF_VOLTAGE BIT(5) + #define MESON_SAR_ADC_REG11_EOC BIT(1) + #define MESON_SAR_ADC_REG11_VREF_SEL BIT(0) #define MESON_SAR_ADC_REG13 0x34 #define MESON_SAR_ADC_REG13_12BIT_CALIBRATION_MASK GENMASK(13, 8) From patchwork Tue Dec 24 14:29:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 13920185 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 682A3E77188 for ; Tue, 24 Dec 2024 14:34:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HtIDcdlTcL47l1JyKAXSQb+DUXo1fGrqYZ+NRkBcaJ4=; b=BACkNbhAlOIj+os6FJ3aiWjNPl aUa0nwQnxe3CEu78hBNy2Ma1vUkhHTlbkNk6waXMoiCQVsav5EuCPOp5KY0C6ZtKExO3J1VSrpehg HOVkX8WynmZGs5hIv2TRR3AhGCiQFIqOs/Hle1ukqsTav+WjWG6Mvx4qzRnMmZmCjIIByuHtIQaAZ lba7J+UaG7aVSPjoCaREfBTIDBL4ONdsADEyjY40G5qpm3QBUu3kYAe3Pg8GoEp+1+vVeRAC8ri7e yJF629h+5Xy49LZHovsiybo9YgRIKXrHmSFLjUAGM87CjMg13MOoaLHsgBUIW6baHewNoiayyN7qH QjTAtxLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tQ5zD-0000000C9Iw-44cs; Tue, 24 Dec 2024 14:34:15 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tQ5vm-0000000C8m0-0od2; Tue, 24 Dec 2024 14:30:43 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-aa66ead88b3so962205566b.0; Tue, 24 Dec 2024 06:30:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20230601; t=1735050641; x=1735655441; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HtIDcdlTcL47l1JyKAXSQb+DUXo1fGrqYZ+NRkBcaJ4=; b=Hkl6jOCOA64/UV0dsS+emcINp7q4MZkoktdoLYU6hjfAS1skQbe1b1KV9x5m2jVck6 hCKc+n7ilu/M0E8PCeqOleoFs68qIE3k2BAJVxbTgZjweJRw64QpbhPCVEQebJTG/SAH 3+FIfmDpydn95XzxxpbP4K8RUuVUVLZVvx0idvrgifb+b3vLzV6jP5MRDBWHummnZgw9 SlndcmROk7KyO1nTs7OnNCcBD8ACN1YjhDOulJ8wUm4Lmyat4vVEhneDn7TS38yw0wpq IhRG9HxoTORknsoajs6TtN1A+SOsm/cMilFduFQJMGywRFvCueuvdILKrhMdUXTY2NZI M5Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735050641; x=1735655441; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HtIDcdlTcL47l1JyKAXSQb+DUXo1fGrqYZ+NRkBcaJ4=; b=PTaRFuyu7ZSHwirKauBqN5y8nyQwhh18V/wa5ej0zOMpjsSp2NiCLlbWrG4nHIXZQl fHYlv/hqNP0V9x55Pl0LqedXG5IC6O6ZZjqJw4ZYvvlR7cKLpZNGCksD6h6Dz7uIwFG+ 6Ofq+I6lYxfutYs2ZXT649pEkp1EEbUP6gR5zuqGIVN84NTQ1yUyArh/I0IbYJ8lRmpE /rJJ/+HfClkdQioyKavNL/sxaukjgnB7ubVFa6gacbSNfFXPo4YvmhUoTaDDFhC5mHyr brhB9NNiJqpOjMUc6Rl3yNayuT2E+llqZKAzkN21XRA1V4tfObLcYqh7OWxj9j4BaV4S QsbA== X-Forwarded-Encrypted: i=1; AJvYcCVFkfmMiVNsmWXw8mXP3beiJ6tAki8Z8xeGL4pV2NhZsYbKMbFwu3UNHPuIMTdpm27ltkaIjF3XO3Ud+HEzaS9ltA==@lists.infradead.org, AJvYcCXE8a43b8hAG90oY+5oxMBW7BhUJjtdnI2EAa2Vf6QVW/wVlvgQI5MpifSynlSKKZcPnG3C41NPIb5ZFhI0@lists.infradead.org X-Gm-Message-State: AOJu0YxAsNxE11nkS6X/aEBF4ASts/kFBb1QqqEP9h21jc6goeVLO1MR +SeBCquK3fFepNTVa70CRMtMnuLMfHMp7LCM7X8TkvNIefwPZcok X-Gm-Gg: ASbGnctfusMn2smNlPdaMTItjTTqFZa054LhspXQBQjU34NQlDvTmjOIb2HwqPz9sM5 maTZA/7S1FcpzHWykOfDMoR9y7voezpxrzAcxryeutCZ3b7eUzH7n0+KdC6dYl+6BGPuJb4m78r bD97acpg3KFyfWnd885MYSNifUAn9B1vR59v6c4+XwU3mImRfaCVF0BDELUoIIc29gxbo3WJMFn nzlv8kuV67n7WcnBdIvq0il7OgEAaKvyJOcq3+9Zli/Ng4LSTOjNSjan2G+GIOuhNG5aM8akeNN IzpajH8OMBruWdh0s9PQ0zU2lGhbMFK2w+VapnAonqXaQW/HHcXtOJNuZ2rPDUrs0LQYchSsTKc AihBkCj8= X-Google-Smtp-Source: AGHT+IHbuxvtjRdu0Ntf+3XKJZS8NGXLreQtkLnmulcwU+OEWzchjnRtrfW5QBwUKRofxzAHfpMq/g== X-Received: by 2002:a17:907:944b:b0:aa6:73ae:b3b3 with SMTP id a640c23a62f3a-aac2d13c90fmr1732470866b.32.1735050640570; Tue, 24 Dec 2024 06:30:40 -0800 (PST) Received: from localhost.localdomain (dynamic-2a02-3100-a5d7-4700-0000-0000-0000-0e63.310.pool.telefonica.de. [2a02:3100:a5d7:4700::e63]) by smtp.googlemail.com with ESMTPSA id a640c23a62f3a-aac0eae74e4sm658827166b.91.2024.12.24.06.30.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 06:30:40 -0800 (PST) From: Martin Blumenstingl To: linux-iio@vger.kernel.org, linux-amlogic@lists.infradead.org Cc: jic23@kernel.org, lars@metafoo.de, gnstark@salutedevices.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, neil.armstrong@linaro.org, Martin Blumenstingl Subject: [PATCH v2 3/3] iio: adc: meson: simplify MESON_SAR_ADC_REG11 register access Date: Tue, 24 Dec 2024 15:29:41 +0100 Message-ID: <20241224142941.97759-4-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241224142941.97759-1-martin.blumenstingl@googlemail.com> References: <20241224142941.97759-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241224_063042_256827_601406CC X-CRM114-Status: GOOD ( 12.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Simply check the max_register value to decide whether MESON_SAR_ADC_REG11 is present on the current IP revision. This allows dropping two additional bool fields from struct meson_sar_adc_param which previously had to be manually kept in sync. No functional changes intended. Signed-off-by: Martin Blumenstingl --- drivers/iio/adc/meson_saradc.c | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c index 469af3c57066..997def4a4d2f 100644 --- a/drivers/iio/adc/meson_saradc.c +++ b/drivers/iio/adc/meson_saradc.c @@ -315,14 +315,12 @@ static const struct iio_chan_spec meson_sar_adc_and_temp_iio_channels[] = { struct meson_sar_adc_param { bool has_bl30_integration; unsigned long clock_rate; - u32 bandgap_reg; unsigned int resolution; const struct regmap_config *regmap_config; u8 temperature_trimming_bits; unsigned int temperature_multiplier; unsigned int temperature_divider; u8 disable_ring_counter; - bool has_reg11; bool has_vref_select; u8 vref_select; u8 cmv_select; @@ -976,7 +974,7 @@ static int meson_sar_adc_init(struct iio_dev *indio_dev) MESON_SAR_ADC_REG3_CTRL_CONT_RING_COUNTER_EN, regval); - if (priv->param->has_reg11) { + if (priv->param->regmap_config->max_register >= MESON_SAR_ADC_REG11) { regval = FIELD_PREP(MESON_SAR_ADC_REG11_EOC, priv->param->adc_eoc); regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG11, MESON_SAR_ADC_REG11_EOC, regval); @@ -1013,16 +1011,15 @@ static int meson_sar_adc_init(struct iio_dev *indio_dev) static void meson_sar_adc_set_bandgap(struct iio_dev *indio_dev, bool on_off) { struct meson_sar_adc_priv *priv = iio_priv(indio_dev); - const struct meson_sar_adc_param *param = priv->param; - u32 enable_mask; - if (param->bandgap_reg == MESON_SAR_ADC_REG11) - enable_mask = MESON_SAR_ADC_REG11_BANDGAP_EN; + if (priv->param->regmap_config->max_register >= MESON_SAR_ADC_REG11) + regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG11, + MESON_SAR_ADC_REG11_BANDGAP_EN, + on_off ? MESON_SAR_ADC_REG11_BANDGAP_EN : 0); else - enable_mask = MESON_SAR_ADC_DELTA_10_TS_VBG_EN; - - regmap_update_bits(priv->regmap, param->bandgap_reg, enable_mask, - on_off ? enable_mask : 0); + regmap_update_bits(priv->regmap, MESON_SAR_ADC_DELTA_10, + MESON_SAR_ADC_DELTA_10_TS_VBG_EN, + on_off ? MESON_SAR_ADC_DELTA_10_TS_VBG_EN : 0); } static int meson_sar_adc_hw_enable(struct iio_dev *indio_dev) @@ -1186,7 +1183,6 @@ static const struct iio_info meson_sar_adc_iio_info = { static const struct meson_sar_adc_param meson_sar_adc_meson8_param = { .has_bl30_integration = false, .clock_rate = 1150000, - .bandgap_reg = MESON_SAR_ADC_DELTA_10, .regmap_config = &meson_sar_adc_regmap_config_meson8, .resolution = 10, .temperature_trimming_bits = 4, @@ -1197,7 +1193,6 @@ static const struct meson_sar_adc_param meson_sar_adc_meson8_param = { static const struct meson_sar_adc_param meson_sar_adc_meson8b_param = { .has_bl30_integration = false, .clock_rate = 1150000, - .bandgap_reg = MESON_SAR_ADC_DELTA_10, .regmap_config = &meson_sar_adc_regmap_config_meson8, .resolution = 10, .temperature_trimming_bits = 5, @@ -1208,10 +1203,8 @@ static const struct meson_sar_adc_param meson_sar_adc_meson8b_param = { static const struct meson_sar_adc_param meson_sar_adc_gxbb_param = { .has_bl30_integration = true, .clock_rate = 1200000, - .bandgap_reg = MESON_SAR_ADC_REG11, .regmap_config = &meson_sar_adc_regmap_config_gxbb, .resolution = 10, - .has_reg11 = true, .vref_voltage = 1, .cmv_select = 1, }; @@ -1219,11 +1212,9 @@ static const struct meson_sar_adc_param meson_sar_adc_gxbb_param = { static const struct meson_sar_adc_param meson_sar_adc_gxl_param = { .has_bl30_integration = true, .clock_rate = 1200000, - .bandgap_reg = MESON_SAR_ADC_REG11, .regmap_config = &meson_sar_adc_regmap_config_gxbb, .resolution = 12, .disable_ring_counter = 1, - .has_reg11 = true, .vref_voltage = 1, .cmv_select = 1, }; @@ -1231,11 +1222,9 @@ static const struct meson_sar_adc_param meson_sar_adc_gxl_param = { static const struct meson_sar_adc_param meson_sar_adc_axg_param = { .has_bl30_integration = true, .clock_rate = 1200000, - .bandgap_reg = MESON_SAR_ADC_REG11, .regmap_config = &meson_sar_adc_regmap_config_gxbb, .resolution = 12, .disable_ring_counter = 1, - .has_reg11 = true, .vref_voltage = 1, .has_vref_select = true, .vref_select = VREF_VDDA, @@ -1245,11 +1234,9 @@ static const struct meson_sar_adc_param meson_sar_adc_axg_param = { static const struct meson_sar_adc_param meson_sar_adc_g12a_param = { .has_bl30_integration = false, .clock_rate = 1200000, - .bandgap_reg = MESON_SAR_ADC_REG11, .regmap_config = &meson_sar_adc_regmap_config_gxbb, .resolution = 12, .disable_ring_counter = 1, - .has_reg11 = true, .adc_eoc = 1, .has_vref_select = true, .vref_select = VREF_VDDA,