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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BC67AC43334 for ; Tue, 28 Jun 2022 14:07:13 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A378A844DA; Tue, 28 Jun 2022 16:07:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZVSJxmNB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 49878844A5; Tue, 28 Jun 2022 16:07:07 +0200 (CEST) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EB390844C3 for ; Tue, 28 Jun 2022 16:07:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heiko.thiery@gmail.com Received: by mail-ed1-x52a.google.com with SMTP id z7so17711505edm.13 for ; Tue, 28 Jun 2022 07:07:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=F7jz4JrNGgKt2MxJMy3CMa2HojtIWpX7wOcwDBTYRo0=; b=ZVSJxmNBxmEQNSNElcCibMLTgmmUdN8DhZPItvzNetL1N7+C8PLh6GbJdvwuJAwlNV jdc80j5DIDDL+5jxNwI+RgzLMY8BPTBn4GXfeDlhv12CLaf+wpdbVnMJRRSByqFbt4U7 R+lmiXe0ZV06YzfDyyq4xvkiqnpKwKi3zZvgyQwNWi1YiSrG94y/GoxC1kJfQhODdWPT HZyPnB7d4ru2PxiMc3AV6NYEybiBfKYOvyqEQgZS1NjfQ6gHDIt1olQ8eWr1vCv47paE BenD7TCbw7RTrW1ZeJ0jDZGx1xwY2V+pUb8bRmPxl7Zu47Rssycmx+v9GrKrzrU1UQuz KO5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F7jz4JrNGgKt2MxJMy3CMa2HojtIWpX7wOcwDBTYRo0=; b=jzrrzPJM8wTDlMAx0OEraKEEHW/4ik0nRP34fy0Qv7jPxNnFnSW0Fx81dY9PzR9dpn HzXMGUid4lDYX1q3x7KjeRxklZiu/FXRKX+MAAuswQk0wZxK5KiYU5FJrxM1vDcAie4d VxRpo6HX7In3plRTNLy2aMnURZGdlNWdt8kdVY+6vIkFzMEkt5HfjZrnrKm2imx+8cfq 6/peDBTO76mdyxKLEiaeCczCFd1Uf+R5Ox2XJG3qB9xwuTNZV6PttN6PibVEoAJfxk10 rY9kJM/vutQbwhqlZIC77YVNU/DKMQGNtUqz5g+UVXplK6HQUBoPVUKhcQkrqw+TojOH Xn0Q== X-Gm-Message-State: AJIora9njtjErJwRZyq3Tsdj/bJRikBQ2zwAXolAfprxVl4W92VZZggn sPnMePwo6r2URTN3Zluf101mMX/iOW1Lng== X-Google-Smtp-Source: AGRyM1uFneDl2bFwXLKsrDoPvI4skdoqlnNWvpoGvz/woqdpKWpmII7jLShO9QjQBgC9pVEPDwHLBA== X-Received: by 2002:a05:6402:388c:b0:435:548c:177e with SMTP id fd12-20020a056402388c00b00435548c177emr23431393edb.231.1656425222038; Tue, 28 Jun 2022 07:07:02 -0700 (PDT) Received: from hthiery.fritz.box ([2a02:810b:5a40:2a43:8e16:45ff:fe22:ad85]) by smtp.gmail.com with ESMTPSA id a9-20020a170906244900b00722e50dab2csm6424252ejb.109.2022.06.28.07.07.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 07:07:01 -0700 (PDT) From: Heiko Thiery To: u-boot@lists.denx.de Cc: Jaehoon Chung , Andre Przywara , Samuel Holland , Simon Glass , Kever Yang , Quentin Schulz , Lukasz Majewski , Stephan Gerhold , Fabio Estevam , Marek Vasut , Heiko Thiery , Frieder Schrempf Subject: [PATCH 2/2] pmic: pca9450: clear PRESET_EN bit for BUCK1/2/3 voltage settings Date: Tue, 28 Jun 2022 16:06:24 +0200 Message-Id: <20220628140621.254550-3-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220628140621.254550-1-heiko.thiery@gmail.com> References: <20220628140621.254550-1-heiko.thiery@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean The regulator driver uses the DVS registers PCA9450_REG_BUCKxOUT_DVS0 to set the voltage for the buck regulators 1, 2 and 3. This has no effect as the PRESET_EN bit is set by default and therefore the preset values are used instead, which are set to 850 mV. This is a port of the same change in the Linux kernel: 98b94b6e38ca0 ("regulator: pca9450: Clear PRESET_EN bit to fix BUCK1/2/3 voltage setting") Cc: Frieder Schrempf Signed-off-by: Heiko Thiery --- drivers/power/pmic/pca9450.c | 6 ++++++ include/power/pca9450.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/drivers/power/pmic/pca9450.c b/drivers/power/pmic/pca9450.c index fecab0496f..1c59362ab4 100644 --- a/drivers/power/pmic/pca9450.c +++ b/drivers/power/pmic/pca9450.c @@ -94,6 +94,12 @@ static int pca9450_probe(struct udevice *dev) priv->regmap = syscon_node_to_regmap(dev_ofnode(dev)); + /* Clear PRESET_EN bit in BUCK123_DVS to use DVS registers */ + if (CONFIG_IS_ENABLED(DM_REGULATOR_PCA9450)) { + ret = regmap_update_bits(priv->regmap, PCA9450_BUCK123_DVS, + BUCK123_PRESET_EN, 0); + } + if (dev_read_bool(dev, "nxp,wdog_b-warm-reset")) reset_ctrl = WDOG_B_CFG_WARM; else diff --git a/include/power/pca9450.h b/include/power/pca9450.h index bf9be7d6bb..60e37c671a 100644 --- a/include/power/pca9450.h +++ b/include/power/pca9450.h @@ -67,6 +67,9 @@ enum { #define PCA9450_LDO34_MASK 0x1f #define PCA9450_LDO5_MASK 0x0f +/* PCA9450_REG_BUCK123_PRESET_EN bit */ +#define BUCK123_PRESET_EN 0x80 + /* PCA9450_REG_RESET_CTRL bits */ #define WDOG_B_CFG_MASK 0xC0 #define WDOG_B_CFG_NONE 0x00 -- 2.30.2