Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4535251ybf; Wed, 4 Mar 2020 05:59:03 -0800 (PST) X-Google-Smtp-Source: ADFU+vvWOH8ib52i8ucInQLvZwhg30nCPrkrnZyrrfaHiIbfLeak9EKMbqAFDUKsYwsH8e7j4XfK X-Received: by 2002:a05:6808:a0c:: with SMTP id n12mr1734228oij.101.1583330343730; Wed, 04 Mar 2020 05:59:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583330343; cv=none; d=google.com; s=arc-20160816; b=Dj2YhCB1ft71BNRW3UZq8np2Emah55sW3IzJ6QPCOM218iWCU2z2ofPc+y+mbTItcZ 5BtOQXhH8bTUjF6KjzHMSvBpijLN5zxtuGmbwEa/XnEpWMtVfH4TuZnz0AZD2Uqotfci Zdzq4WtqraxkhgQ7xND1d7t8LLNDPz3gUv0DRlx6JxhB/kdofUFaqF0nbVVa2eS/nnOX vxAxtX3fSA/SK2HwjtiOA52vJ+8loMtbqyWYUb5D5IUxDHQwTWK5ZqRA6GXmTJaazG9p fKQj0w9Bo3ukgxfO2/sPdbXz7iHx760Zf04mg5H6woBozl2eLeVZ7a0krYfmL6PTcS3Z ItDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:in-reply-to:subject:cc:to:from :date; bh=FaM8zxILATSnhpJSKPX4+1xGX0tE7NFmVHiC2DueRNU=; b=yAInTyZzNioK+RXpcU7oxLMFM9b8ArM9QXRmfxGW9kWXhvL0ADUSUe5AMd0jOIFwa6 mOFSrHg8vbZuquOqVh0YwaKyIWHGB8vSJHK/L53JIlzM3KpPgytmQxuaCZwH/kiVbMVA 16tUP6U/EiL8IBpCmoYL9FMuc45cadJBkNgg2zJWvO8nFMuUsXgopsm2zMeATaRB0LOH V62TmYh0jOZOJDEQ3UYrrw1pJCgwdJVic+PAumKQbHBejCg+KAyl2tcFktO+dYGNOErY h03W7N5p9Vqh0w7NnVk9UXkbm5yeSGTu916dfjX/iCH7/47KHhWYvd6EtNbIVrhxwKw6 FzOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 12si1155001oir.69.2020.03.04.05.58.51; Wed, 04 Mar 2020 05:59:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387910AbgCDN5m (ORCPT + 99 others); Wed, 4 Mar 2020 08:57:42 -0500 Received: from foss.arm.com ([217.140.110.172]:34506 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728432AbgCDN5m (ORCPT ); Wed, 4 Mar 2020 08:57:42 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3FFEA31B; Wed, 4 Mar 2020 05:57:41 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B61B03F6CF; Wed, 4 Mar 2020 05:57:40 -0800 (PST) Date: Wed, 04 Mar 2020 13:57:39 +0000 From: Mark Brown To: Fabrice Gasnier Cc: alexandre.torgue@st.com, broonie@kernel.org, fabrice.gasnier@st.com, lgirdwood@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Mark Brown , mcoquelin.stm32@gmail.com Subject: Applied "regulator: stm32-vrefbuf: fix a possible overshoot when re-enabling" to the regulator tree In-Reply-To: <1583312132-20932-1-git-send-email-fabrice.gasnier@st.com> Message-Id: X-Patchwork-Hint: ignore Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch regulator: stm32-vrefbuf: fix a possible overshoot when re-enabling has been applied to the regulator tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 02fbabd5f4ed182d2c616e49309f5a3efd9ec671 Mon Sep 17 00:00:00 2001 From: Fabrice Gasnier Date: Wed, 4 Mar 2020 09:55:32 +0100 Subject: [PATCH] regulator: stm32-vrefbuf: fix a possible overshoot when re-enabling There maybe an overshoot, when disabling, then re-enabling vrefbuf too quickly. VREFBUF is used by ADC/DAC on some boards. When re-enabling too quickly, an overshoot on the reference voltage make the conversions inaccurate for a short period of time. - Don't put the VREFBUF in HiZ when disabling, to force an active discharge. - Enforce a 1ms OFF/ON delay Fixes: 0cdbf481e927 ("regulator: Add support for stm32-vrefbuf") Signed-off-by: Fabrice Gasnier Message-Id: <1583312132-20932-1-git-send-email-fabrice.gasnier@st.com> Signed-off-by: Mark Brown --- drivers/regulator/stm32-vrefbuf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/stm32-vrefbuf.c b/drivers/regulator/stm32-vrefbuf.c index bdfaf7edb75a..992bc18101ef 100644 --- a/drivers/regulator/stm32-vrefbuf.c +++ b/drivers/regulator/stm32-vrefbuf.c @@ -88,7 +88,7 @@ static int stm32_vrefbuf_disable(struct regulator_dev *rdev) } val = readl_relaxed(priv->base + STM32_VREFBUF_CSR); - val = (val & ~STM32_ENVR) | STM32_HIZ; + val &= ~STM32_ENVR; writel_relaxed(val, priv->base + STM32_VREFBUF_CSR); pm_runtime_mark_last_busy(priv->dev); @@ -175,6 +175,7 @@ static const struct regulator_desc stm32_vrefbuf_regu = { .volt_table = stm32_vrefbuf_voltages, .n_voltages = ARRAY_SIZE(stm32_vrefbuf_voltages), .ops = &stm32_vrefbuf_volt_ops, + .off_on_delay = 1000, .type = REGULATOR_VOLTAGE, .owner = THIS_MODULE, }; -- 2.20.1