Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1021829yba; Thu, 4 Apr 2019 02:37:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSdtINpp8KtUahoUPHDXbweRuBnosH30Q3N20Mm/eHNz3P1ZzVBWItd6ShYWOcN4kLrw1X X-Received: by 2002:a63:2c06:: with SMTP id s6mr4807608pgs.245.1554370637366; Thu, 04 Apr 2019 02:37:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554370637; cv=none; d=google.com; s=arc-20160816; b=UOvNQn2gRsI18tV+JT8KWtq3GCMQmnUvFur2ElE7ug/h5/xaupsFd0G4ZXqsaTOE+C 7Mvv+rRjrwEYFDYoiLcYMnM+SGsXhZGSGEswEF/lmcydVapS8CE0yhnQC5xncCC4i8rF QB0k3DYsOeWRMr9xYGbIPmipcO8omtO4iqddHTwbta1jmG6jOrH9SSal364czgQNZQ5l cDMFRo/R9DF+BoTbaSGQh0Imo0teBDihvVptaoLkBRSFEfZ7Wo95WqJB8Cuc7C8kpW2u BuXwAyY5EZie01dgXgJg5DMK9eVC1c829jyialvP/1JlM5KR5k0d35bqVb4VZiSzT96X 9ntQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dPmxsHqfZa90dVbx8sBpuaBN9WhxtB7pCFS3JIBeWmM=; b=bOQ8w62oy0FtMiYaHxSTVDIHIO6NfNOXgta7NMlz3c4ZTi/spFbbHqqMvNKB8SC1WT YEjJnOLPyPeoiwMDU//Ru+2pi39oX5anFmzSu9iqL8yjBYsxGp6oeDRJvHrndUJ18qvl 24x9zsJDOOvE4dXcbu7fmFu+Yz+R2AHB8R04vbSSfKJLbiRhC4DGXy47NQASgUKl5z7z K0Rw6rUXASyEMaR56dQt3oO4bLjVL6CzK/u7IPLv+XR7ZHRdO474aZ90wsjq+OEQpfYI cThx+MpcwKa57pn8is5aJT5Q/SiMy+DT/5zzHxUUBZWDZ41xi4CULXixdD5JTFclbjve SCZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wgiR1Bem; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10si3273089plb.401.2019.04.04.02.37.02; Thu, 04 Apr 2019 02:37:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wgiR1Bem; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732441AbfDDJHL (ORCPT + 99 others); Thu, 4 Apr 2019 05:07:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:45926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732018AbfDDJHJ (ORCPT ); Thu, 4 Apr 2019 05:07:09 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3F58121741; Thu, 4 Apr 2019 09:07:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368828; bh=MxdPFrum6kfXbMjVKiJmR+20XRbvpVJBUmNxvqDgQ8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wgiR1BemESN9n0pfeOISBa4HWqavyt7a/MzhKGttEWg1olyX4suHfFCagYKlsmt/C G7lqMvTKiZ4xNV2NgyqvfQxOJ4vMjjD0uKWm2mfcQEP9VsS5rdNbHgEWEB4alJ+H4Z Rg6E8Y7/n94D8CNezhzgkBsI2/tE7khntpzE03Ws= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Axel Lin , Mark Brown , Sasha Levin Subject: [PATCH 4.19 169/187] regulator: act8865: Fix act8600_sudcdc_voltage_ranges setting Date: Thu, 4 Apr 2019 10:48:26 +0200 Message-Id: <20190404084611.053542538@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit f01a7beb6791f1c419424c1a6958b7d0a289c974 ] The act8600_sudcdc_voltage_ranges setting does not match the datasheet. The problems in below entry: REGULATOR_LINEAR_RANGE(19000000, 191, 255, 400000), 1. The off-by-one min_sel causes wrong volatage calculation. The min_sel should be 192. 2. According to the datasheet[1] Table 7. (on page 43): The selector 248 (0b11111000) ~ 255 (0b11111111) are 41.400V. Also fix off-by-one for ACT8600_SUDCDC_VOLTAGE_NUM. [1] https://active-semi.com/wp-content/uploads/ACT8600_Datasheet.pdf Fixes: df3a950e4e73 ("regulator: act8865: Add act8600 support") Signed-off-by: Axel Lin Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/act8865-regulator.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c index 21e20483bd91..e0239cf3f56d 100644 --- a/drivers/regulator/act8865-regulator.c +++ b/drivers/regulator/act8865-regulator.c @@ -131,7 +131,7 @@ * ACT8865 voltage number */ #define ACT8865_VOLTAGE_NUM 64 -#define ACT8600_SUDCDC_VOLTAGE_NUM 255 +#define ACT8600_SUDCDC_VOLTAGE_NUM 256 struct act8865 { struct regmap *regmap; @@ -222,7 +222,8 @@ static const struct regulator_linear_range act8600_sudcdc_voltage_ranges[] = { REGULATOR_LINEAR_RANGE(3000000, 0, 63, 0), REGULATOR_LINEAR_RANGE(3000000, 64, 159, 100000), REGULATOR_LINEAR_RANGE(12600000, 160, 191, 200000), - REGULATOR_LINEAR_RANGE(19000000, 191, 255, 400000), + REGULATOR_LINEAR_RANGE(19000000, 192, 247, 400000), + REGULATOR_LINEAR_RANGE(41400000, 248, 255, 0), }; static struct regulator_ops act8865_ops = { -- 2.19.1