Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1347604pxf; Fri, 19 Mar 2021 05:23:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRx1AZdJqhqqxKKjswzw50+SMwTJnBNpe0FpDb6ItBIVnA5jdVVZqJ/csYaP56qLyL3XND X-Received: by 2002:a17:907:7355:: with SMTP id dq21mr3909592ejc.159.1616156603965; Fri, 19 Mar 2021 05:23:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616156603; cv=none; d=google.com; s=arc-20160816; b=XGRha4lsC18szq2pEFfuTmbT7uY08vVe96riph97GNeELjudhLYEkV3KlOlD0yhhHb pNroavG/MPwmpAEjFjE1yNBXaVIQxL4qba2IB9TsdKuNPzaijckjk5/dzvTXDH44tHh7 uIboZ4Qf2P8L684iPfcATn9TXHnj9TY8JgN5Ih90GoiYSqpqtqgSRATxSVexJviKRjAj 77558by9OSgWlheoCVDuYppCMLxW5VjqV57QrqXECcWthL8wWp7GFn75yBOiz+/IHWNo vJrkEW5TWUCpRnnfHE/OuOZ4T8TAzNWoLFBdoudQeLa8gJ9vUntyeEMsE39oA9WXdqGo wXuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BTWb116TLimFX38AC2GW7+SCB6leeun149syEYZoCSo=; b=dmRa8JAgc/mdSrokvYuTv/Sc+bCFuKSWdX69o6PzQPf83VSpzBEFIyXWeko9Xt89eq S16vOs7wYxGwhR4feo+KJyunpZ/I37Sz0HIMgv7drojtyYmiET6R14PuciLZkdP1e2t3 5UmGL/uVQOX7UBIHZxHaTh9wucM1dgrM7zewI1/DAhRM6Uvm+Sv8K5/zNAk4FRZ/7lcC 3JCVQ/rKVgMLLQo6+wt0lbm46bwYdM+uRfRzxXcpHmfv51vpDjq25G6kVKO0fzp2QWZs sy1ikrMcIMWmzT/bCXLKDcuG6l8Zqk/1jqDatpG+BbrgGU91rjsDT+tDesMlKfVblBiP njwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hH7EN3lG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do13si3974508ejc.87.2021.03.19.05.23.00; Fri, 19 Mar 2021 05:23:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hH7EN3lG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231535AbhCSMVh (ORCPT + 99 others); Fri, 19 Mar 2021 08:21:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:59546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231348AbhCSMVE (ORCPT ); Fri, 19 Mar 2021 08:21:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5A0B464F6A; Fri, 19 Mar 2021 12:21:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1616156463; bh=28dp9rm7vSOtIsRgIySR9/oKeFt137EmnXYVuUNsplc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hH7EN3lGUcSchIRSsX2LwlJljGCpFrGkY2w38cItvrOe564mCF43Td0yCmxufe08T wvEX3QMvPuzdY0qYI37SvqNtPpR0aVyAG7t97avXEfwwtqzddLUmSuwQwqD6DaMKTk bMnsZij4S1gtBruV7URaNgSO7OBJ1WOSuYB25qms= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Frieder Schrempf , Mark Brown , Sasha Levin Subject: [PATCH 5.11 16/31] regulator: pca9450: Clear PRESET_EN bit to fix BUCK1/2/3 voltage setting Date: Fri, 19 Mar 2021 13:19:10 +0100 Message-Id: <20210319121747.726323662@linuxfoundation.org> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210319121747.203523570@linuxfoundation.org> References: <20210319121747.203523570@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Frieder Schrempf [ Upstream commit 98b94b6e38ca0c4eeb29949c656f6a315000c23e ] The 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. To fix this we clear the PRESET_EN bit at time of initialization. Fixes: 0935ff5f1f0a ("regulator: pca9450: add pca9450 pmic driver") Cc: Signed-off-by: Frieder Schrempf Link: https://lore.kernel.org/r/20210222115229.166620-1-frieder.schrempf@kontron.de Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/pca9450-regulator.c | 8 ++++++++ include/linux/regulator/pca9450.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/drivers/regulator/pca9450-regulator.c b/drivers/regulator/pca9450-regulator.c index 833d398c6aa2..d38109cc3a01 100644 --- a/drivers/regulator/pca9450-regulator.c +++ b/drivers/regulator/pca9450-regulator.c @@ -797,6 +797,14 @@ static int pca9450_i2c_probe(struct i2c_client *i2c, return ret; } + /* Clear PRESET_EN bit in BUCK123_DVS to use DVS registers */ + ret = regmap_clear_bits(pca9450->regmap, PCA9450_REG_BUCK123_DVS, + BUCK123_PRESET_EN); + if (ret) { + dev_err(&i2c->dev, "Failed to clear PRESET_EN bit: %d\n", ret); + return ret; + } + /* Set reset behavior on assertion of WDOG_B signal */ ret = regmap_update_bits(pca9450->regmap, PCA9450_REG_RESET_CTRL, WDOG_B_CFG_MASK, WDOG_B_CFG_COLD_LDO12); diff --git a/include/linux/regulator/pca9450.h b/include/linux/regulator/pca9450.h index ccdb5320a240..71902f41c919 100644 --- a/include/linux/regulator/pca9450.h +++ b/include/linux/regulator/pca9450.h @@ -147,6 +147,9 @@ enum { #define BUCK6_FPWM 0x04 #define BUCK6_ENMODE_MASK 0x03 +/* PCA9450_REG_BUCK123_PRESET_EN bit */ +#define BUCK123_PRESET_EN 0x80 + /* PCA9450_BUCK1OUT_DVS0 bits */ #define BUCK1OUT_DVS0_MASK 0x7F #define BUCK1OUT_DVS0_DEFAULT 0x14 -- 2.30.1