From mboxrd@z Thu Jan 1 00:00:00 1970 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 A6B22CCD19F for ; Tue, 21 Oct 2025 05:39:40 +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-Type: Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:To:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=2vOyU5LVAZQq/dslq1dz9Vv6cZ5N9rkyrrhiHUM7L/M=; b=Ilok5T8guqbHKf oCj8MsGcaqchhZ/vM69NUNzYF0QxMqhddciB9fOcVrS8BOKGAPQV5z02jm6Fy2YdIX8avE1MtObRR KHO/xS2jZ47IFiikkdZMzZHoz5u0BxZcUoEAmGMhiZvK3C81ixQoEJAcfnFdFhsxBAczOqiou4hz6 FFguCE/Xk2Du3glIW3HaIrFmdFM7QtE2/Ue8M2xcSJ5y2A1hxUWywdLIqfZTqLdMQOmCFpoY1jitU VEj0CGddWTx2eq2yFbzjrzf+R4MZV68V1XmtoAnIupN+B/D+hx7bTYTyFhnilHqCJKieFt1HADNiM 9fGftclO3ghA+p/swU+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vB55m-0000000FsMw-1hjD; Tue, 21 Oct 2025 05:39:30 +0000 Received: from mail.aspeedtech.com ([211.20.114.72] helo=TWMBX01.aspeed.com) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vB55j-0000000FsMJ-2U8f for linux-arm-kernel@lists.infradead.org; Tue, 21 Oct 2025 05:39:28 +0000 Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Tue, 21 Oct 2025 13:39:18 +0800 Received: from twmbx02.aspeed.com (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Tue, 21 Oct 2025 13:39:18 +0800 From: Billy Tsai To: , , , , , , , , , , Subject: [PATCH v1] iio: adc: clear reference voltage bits before configuring vref Date: Tue, 21 Oct 2025 13:39:18 +0800 Message-ID: <20251021053918.3008654-1-billy_tsai@aspeedtech.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251020_223927_649896_4CA6ECE7 X-CRM114-Status: UNSURE ( 7.95 ) X-CRM114-Notice: Please train this message. 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 Ensures the reference voltage bits are cleared in the ADC engine control register before configuring the voltage reference. This avoids potential misconfigurations caused by residual bits. Change-Id: I03c036436f376ced8a19fa5d407b7bbb377ae721 Signed-off-by: Billy Tsai --- drivers/iio/adc/aspeed_adc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/adc/aspeed_adc.c b/drivers/iio/adc/aspeed_adc.c index 1d5fd5f534b8..8ab29948214a 100644 --- a/drivers/iio/adc/aspeed_adc.c +++ b/drivers/iio/adc/aspeed_adc.c @@ -415,6 +415,7 @@ static int aspeed_adc_vref_config(struct iio_dev *indio_dev) } adc_engine_control_reg_val = readl(data->base + ASPEED_REG_ENGINE_CONTROL); + adc_engine_control_reg_val &= ~ASPEED_ADC_REF_VOLTAGE; ret = devm_regulator_get_enable_read_voltage(data->dev, "vref"); if (ret < 0 && ret != -ENODEV) -- 2.25.1