Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp269225pxt; Fri, 6 Aug 2021 01:19:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaJGrwWjPW0HLy5sNdZDHpUHkUPZlUSJJOTgaHjMcc9iWHh/Jv7ZzTm+kIZ6CslLaR70g1 X-Received: by 2002:a17:906:e13:: with SMTP id l19mr8737540eji.63.1628237982486; Fri, 06 Aug 2021 01:19:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628237982; cv=none; d=google.com; s=arc-20160816; b=PsxCs/o03m8Jry26Fruk7raXO6/60on0SvRv8Wz29Ngcdd0AMVNWa/SDCf7jpyc8Li bPKIMxbhxKKvBWN+jygXfseSg5MIbMTVCVYWz5q8phxgzT/K2hU1trcCSrLcwtjo8C+s rsOQW6COPN8kTXVxCG6HkScYc9qpZ4v3/lfl8r14wvGPAR3pqXfAHr0PqaG3LX3BYjva kgFg3pnRH2EramTIW8ezpbVAQQWTNfeP0w5eIwq7LTl024fjrPwzOmm7Q2s8C71a7vzU wuh4cxxAb5qRe+KJ9vTYmAiJH7gaQoUaciPfMttn7g4zyAw/N95Yyh1P/TOFFOovzM8x Qj4A== 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=UYdBTK9saJsvrpAoKqcOkpViw8ckdZPmYWvXafzSdY8=; b=bN6lT2gvg5jUCIMORBHXwWWwCxlod5LeI8qdImApo7hLJajNPZeHol5DW2AeAwoNpy XsuGea3cpEyTb61vJvFyfFJtgZJGE3ScM0+c7llmHlSV5tu4qHpu4k7PNLU35oh9fate 957mPheOGEJ5CDQnF+8a7F8ztLTSsP8nXUalDBsNaeWD/ShNwKDlu+uUgGriHErQ1dcm mOG/jKBXJcrG/0t+IWVidFHFufJCNzUaVOytN8C3kX9F7xoYrNSssym5L8LAZGsPKQJ8 HM4g+X3MMylyO4t692uIA/k4DcRatNvOFYRpLy/rUcXBcr91GqzrdRwqIBWNB/sTc9sl EcPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pFpqrEOg; 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 i1si8138834edj.267.2021.08.06.01.19.17; Fri, 06 Aug 2021 01:19:42 -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=pFpqrEOg; 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 S243524AbhHFIPQ (ORCPT + 99 others); Fri, 6 Aug 2021 04:15:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:44478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243659AbhHFIPF (ORCPT ); Fri, 6 Aug 2021 04:15:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9F58C60238; Fri, 6 Aug 2021 08:14:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628237689; bh=As6bvw8NATi8NkV1UwYAGMDuPYyWxXWl8+Dt7lXldyM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pFpqrEOg1G1EDKPd54pScmfburDGD7HB/exQSIYg0A49tXn6mial3Fl7/T33eFbUu siPL1cmbJZUMYiWLaBO20vcUWdFAhzcfkB8QW2z2cU+45IBDkvT7q4pf/F4AjYB/9H UcMHyuEL894YMi9ko/yWPAVxyvurmFn7zcrePRyo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Axel Lin , ChiYuan Huang , Mark Brown , Sasha Levin Subject: [PATCH 4.4 2/6] regulator: rt5033: Fix n_voltages settings for BUCK and LDO Date: Fri, 6 Aug 2021 10:14:34 +0200 Message-Id: <20210806081109.017640610@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210806081108.939164003@linuxfoundation.org> References: <20210806081108.939164003@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: Axel Lin [ Upstream commit 6549c46af8551b346bcc0b9043f93848319acd5c ] For linear regulators, the n_voltages should be (max - min) / step + 1. Buck voltage from 1v to 3V, per step 100mV, and vout mask is 0x1f. If value is from 20 to 31, the voltage will all be fixed to 3V. And LDO also, just vout range is different from 1.2v to 3v, step is the same. If value is from 18 to 31, the voltage will also be fixed to 3v. Signed-off-by: Axel Lin Reviewed-by: ChiYuan Huang Link: https://lore.kernel.org/r/20210627080418.1718127-1-axel.lin@ingics.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- include/linux/mfd/rt5033-private.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/mfd/rt5033-private.h b/include/linux/mfd/rt5033-private.h index 1b63fc2f42d1..52d53d134f72 100644 --- a/include/linux/mfd/rt5033-private.h +++ b/include/linux/mfd/rt5033-private.h @@ -203,13 +203,13 @@ enum rt5033_reg { #define RT5033_REGULATOR_BUCK_VOLTAGE_MIN 1000000U #define RT5033_REGULATOR_BUCK_VOLTAGE_MAX 3000000U #define RT5033_REGULATOR_BUCK_VOLTAGE_STEP 100000U -#define RT5033_REGULATOR_BUCK_VOLTAGE_STEP_NUM 32 +#define RT5033_REGULATOR_BUCK_VOLTAGE_STEP_NUM 21 /* RT5033 regulator LDO output voltage uV */ #define RT5033_REGULATOR_LDO_VOLTAGE_MIN 1200000U #define RT5033_REGULATOR_LDO_VOLTAGE_MAX 3000000U #define RT5033_REGULATOR_LDO_VOLTAGE_STEP 100000U -#define RT5033_REGULATOR_LDO_VOLTAGE_STEP_NUM 32 +#define RT5033_REGULATOR_LDO_VOLTAGE_STEP_NUM 19 /* RT5033 regulator SAFE LDO output voltage uV */ #define RT5033_REGULATOR_SAFE_LDO_VOLTAGE 4900000U -- 2.30.2