Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795060512; b=VjyDolxd48XA3whIGJch4upyf8KTITae4kkqQzwfNVdDMGNunUKDn47v1KZ3t29MtfZQ J6lSEr+WXy2t/EgmU7MZFPpbxIDYkooxj2dyZCY6y7C9TT2qTwQxPAv/P09Vz7m28XCW4 z1VPLec780VVrVAYrC4T97CE8cPxbmFZ+of2UxU+4INH9HJdRy2x9fuJcjWi9wYfZ5OMa EqLYruc0pGq9CRJ2X1sz0NgccQhyiobw8QElj06LUvzJ5nPi8iTsSgufysq2roMMP9ipF YsTOTxabPMa4uHeGz6xf8FsOtX27JhD6eL94e50Lje8fiphTzQLAjWaHZk/RWzcWamg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795060512; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=Nzk93j4tgxNf/R+fn3RM2F33Rg4uVLgcfoqNvtEVFaw=; b=Qr3xWohjekqoZsR9v6YguQjvC5OC8mGGDA8jyM+AmuL1SihPKtByUHPil+9CYQk1edH5 6XkOU2+a//m2z8CtUACSufRe5Mj1kZwQWm7ehD2zHASBK+8c+zfvs3LSSSWWU1ZISPmgT UP1QeppmU8uSEsU61dF1MGdIsYemVW98h0J48260Bjotdpjg7swbWwr439+FGwbP8WS64 A0fAgVkxElFxMfawzCXKbugwpz+/1X3KldFLY7Oe/9Jb+LMdRVgu3tOQxp8YE0c68ArYN WaiPpDbg6DxIMRpxKiY93dCNZbjp/jq1jFbsn/LDBqPNk0WsgAXVtQClXfiE+NjxZJA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=XbBx1PA3; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A74ED606A326; Thu, 19 Nov 2026 03:55:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=XbBx1PA3 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0611F1F000C4; Thu, 19 Nov 2026 03:55:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795060512; bh=Nzk93j4tgxNf/R+fn3RM2F33Rg4uVLgcfoqNvtEVFaw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=XbBx1PA32P8rqbKwpjXr+nB/zyzc7DbtsMxQrzDc91lmCfXWR/FTd+PRfrf+n/EVO wC5QgdFkCkVr9JYFOm49j7ZjKg3h8jW+0WGvqhnBrGWjzo2H+NgGIfQVdA5Zwutmwg OiRVrshZ21s2fQoy11XOt+1dc3wfH2ue/PMwHnzQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Linus Walleij , Mark Brown , Sasha Levin Subject: [PATCH 5.10 1224/1848] regulator: ab8500: Test dedicated enable bits only Date: Wed, 18 Nov 2026 15:54:22 +0100 Message-ID: <20261118150011.172031371@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118145911.150052362@linuxfoundation.org> References: <20261118145911.150052362@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Linus Walleij [ Upstream commit a5ee78846015512b4d3d32f8aa463024a23234ce ] Some regulator control registers have independent enable and low-power bits. is_enabled() currently tests their combined update mask, so an off regulator with its low-power bit set is incorrectly reported as enabled. Add an optional enable mask and use it for VINTCORE, AB8500 TVOUT, AB8505 ADC, and AB8505 VAUX5/6. Regulators whose two-bit field encodes the complete operating state continue to test the full update mask. References: AB8500 User Manual, UM0836 Rev 3, p. 214; AB8505 User Manual, DM00046744 Rev 3, pp. 171-172 and 223 Fixes: 65e03ed2d0cd ("regulators: Fixed errors in ab8500 register mapping") Assisted-by: LLM Signed-off-by: Linus Walleij Link: https://patch.msgid.link/20260901-ux500-dts-snowball-regulator-v2-5-fe88b01829bf@kernel.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/ab8500.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index ba39ff87339cd..43720f51e3076 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -48,6 +48,7 @@ struct ab8500_shared_mode { * @update_bank: bank to control on/off * @update_reg: register to control on/off * @update_mask: mask to enable/disable and set mode of regulator + * @enable_mask: optional mask for an enable bit separate from the mode bit * @update_val: bits holding the regulator current mode * @update_val_idle: bits to enable the regulator in idle (low power) mode * @update_val_normal: bits to enable the regulator in normal (high power) mode @@ -69,6 +70,7 @@ struct ab8500_regulator_info { u8 update_bank; u8 update_reg; u8 update_mask; + u8 enable_mask; u8 update_val; u8 update_val_idle; u8 update_val_normal; @@ -263,6 +265,7 @@ static int ab8500_regulator_is_enabled(struct regulator_dev *rdev) { int ret; struct ab8500_regulator_info *info = rdev_get_drvdata(rdev); + u8 enable_mask; u8 regval; if (info == NULL) { @@ -278,13 +281,15 @@ static int ab8500_regulator_is_enabled(struct regulator_dev *rdev) return ret; } + enable_mask = info->enable_mask ? info->enable_mask : info->update_mask; + dev_vdbg(rdev_get_dev(rdev), "%s-is_enabled (bank, reg, mask, value): 0x%x, 0x%x, 0x%x," " 0x%x\n", info->desc.name, info->update_bank, info->update_reg, - info->update_mask, regval); + enable_mask, regval); - if (regval & info->update_mask) + if (regval & enable_mask) return 1; else return 0; @@ -719,6 +724,7 @@ static struct ab8500_regulator_info .update_bank = 0x03, .update_reg = 0x80, .update_mask = 0x44, + .enable_mask = 0x04, .update_val = 0x44, .update_val_idle = 0x44, .update_val_normal = 0x04, @@ -747,6 +753,7 @@ static struct ab8500_regulator_info .update_bank = 0x03, .update_reg = 0x80, .update_mask = 0x82, + .enable_mask = 0x02, .update_val = 0x02, .update_val_idle = 0x82, .update_val_normal = 0x02, @@ -956,6 +963,7 @@ static struct ab8500_regulator_info .update_bank = 0x01, .update_reg = 0x55, .update_mask = 0x18, + .enable_mask = 0x10, .update_val = 0x10, .update_val_idle = 0x18, .update_val_normal = 0x10, @@ -978,6 +986,7 @@ static struct ab8500_regulator_info .update_bank = 0x01, .update_reg = 0x56, .update_mask = 0x18, + .enable_mask = 0x10, .update_val = 0x10, .update_val_idle = 0x18, .update_val_normal = 0x10, @@ -999,6 +1008,7 @@ static struct ab8500_regulator_info .update_bank = 0x03, .update_reg = 0x80, .update_mask = 0x44, + .enable_mask = 0x04, .update_val = 0x04, .update_val_idle = 0x44, .update_val_normal = 0x04, @@ -1027,6 +1037,7 @@ static struct ab8500_regulator_info .update_bank = 0x03, .update_reg = 0x80, .update_mask = 0x82, + .enable_mask = 0x02, .update_val = 0x02, .update_val_idle = 0x82, .update_val_normal = 0x02, -- 2.53.0