Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2814091rwb; Mon, 15 Aug 2022 11:53:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR4pe1FW0NHonYme2JsiwwGLlgdYj+JLGLHmUaIsYo9g0IgKdg8gzjmfRmvQjAEu2eyUyktI X-Received: by 2002:a17:907:628c:b0:6ee:70cf:d59 with SMTP id nd12-20020a170907628c00b006ee70cf0d59mr11230145ejc.402.1660589600494; Mon, 15 Aug 2022 11:53:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660589600; cv=none; d=google.com; s=arc-20160816; b=J0aaPtQdeLeftqNo6a0bBMLIAhJmO6525ZWGrxX4adtx9TkddsfZNVkz3hNiaOKGFE R5eKjb+x8E93tGqfgSr/LWqUjMuoaqJwatossGXSxllzKoxlRwhWsnDZuKbrKsAlmVvb duhVPIiFGSlmiJNRDq2J3DHcq77yEzHG2ecWzv7We/VY1XIHL81qo1d5qS/I5j3bhLlx eqO3N74b57S7byi8R78fjnP275zbJmzD4JXe/9RrbQjH4KJgqjuumu7QBoYNjUg1tcMi oSYXhtgqlNc5283RlMDJtmWAm2KjXtthAbKzEe1DA9h56iVZgGDt7EEgZkEdgfZFp9GU 9gQA== 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=aUs7K9XMUtVCj/aHkepdZU1EhNOZOhMci35eEiG/0PU=; b=JfwaqNfHGMIZG9y0pcUGWX9Fg5ieUAkHNZfGfalcVwjp43FyyQZwkrD9SZjQriuiKP 5LnvYGo3tdyErHSHY4yLkLjwfD9L5g3DzvL6/aC1kXTbxh6XhLnedZiNGn0FIgsRZmFD puzJ3EPYcuhyuVhfXoEesVauxvDRVZWwNHyF1VGUzbZOrlHwDEzN2CeocFek7LtzAuJo kQi/aIlfmKdjsvAUrgLayQ1+tKrHaQwMDoj5n6jq/1K1AboZW7CZ9eyZ1mnMwyQyyUMR 71wf15LcKwCqdYnhVRmWdd9DJ43isUcAwHr08DhvD629283rd2PNBbAQ/c5blBiSz5vc Hayw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FSVH54mX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o6-20020a1709062e8600b007304fac484fsi7158374eji.466.2022.08.15.11.52.55; Mon, 15 Aug 2022 11:53:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FSVH54mX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S243343AbiHOSnt (ORCPT + 99 others); Mon, 15 Aug 2022 14:43:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243746AbiHOSlV (ORCPT ); Mon, 15 Aug 2022 14:41:21 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D0EE3F321; Mon, 15 Aug 2022 11:24:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id ADD4FB8107D; Mon, 15 Aug 2022 18:24:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F36FEC433C1; Mon, 15 Aug 2022 18:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660587893; bh=+g4G3oT1kbUpJNzmT4Ho/D7lCja7yauDPgdHOvtnxbg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FSVH54mX/4Gibzi7JTvltjZMF83768h0lYsyaXRCjN+glj0dtrhmqbivP+OoyNRFK Z37vdlHizTCtlK4NcKyS90HSDxI2dgrVxPd3iTzG5bgFE+6dcnAQB9f+c3BLtIzhnn sKsM2pkJLQqYNlY0qjdUtylJcdZo0FuRD/smI6go= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephan Gerhold , Mark Brown , Sasha Levin Subject: [PATCH 5.15 187/779] regulator: qcom_smd: Fix pm8916_pldo range Date: Mon, 15 Aug 2022 19:57:11 +0200 Message-Id: <20220815180345.252710227@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stephan Gerhold [ Upstream commit e8977917e116d1571dacb8e9864474551c1c12bd ] The PM8916 device specification [1] documents a programmable range of 1.75V to 3.337V with 12.5mV steps for the PMOS LDOs in PM8916. This range is also used when controlling the regulator directly using the qcom_spmi-regulator driver ("ult_pldo" there). However, for some reason the qcom_smd-regulator driver allows a much larger range for the same hardware component. This could be simply a typo, since the start of the range is essentially just missing a '1'. In practice this does not cause any major problems, since the driver just sends the actual voltage to the RPM firmware instead of making use of the incorrect voltage selector. Still, having the wrong range there is confusing and prevents the regulator core from validating requests correctly. [1]: https://developer.qualcomm.com/download/sd410/pm8916pm8916-1-power-management-ic-device-specification.pdf Fixes: 57d6567680ed ("regulator: qcom-smd: Add PM8916 support") Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20220623094614.1410180-2-stephan.gerhold@kernkonzept.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/qcom_smd-regulator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c index eb974b9c0b19..2fe13c765eff 100644 --- a/drivers/regulator/qcom_smd-regulator.c +++ b/drivers/regulator/qcom_smd-regulator.c @@ -357,10 +357,10 @@ static const struct regulator_desc pm8941_switch = { static const struct regulator_desc pm8916_pldo = { .linear_ranges = (struct linear_range[]) { - REGULATOR_LINEAR_RANGE(750000, 0, 208, 12500), + REGULATOR_LINEAR_RANGE(1750000, 0, 127, 12500), }, .n_linear_ranges = 1, - .n_voltages = 209, + .n_voltages = 128, .ops = &rpm_smps_ldo_ops, }; -- 2.35.1