Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5586478img; Wed, 27 Mar 2019 11:11:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxaTkIHaNzoumfwveZ8XU8FjpCGsuVFI9sNYepz+NWQEoAAxbhiNa8r/hMnUOk8ytcmYAB X-Received: by 2002:a65:64c8:: with SMTP id t8mr7855123pgv.248.1553710290576; Wed, 27 Mar 2019 11:11:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553710290; cv=none; d=google.com; s=arc-20160816; b=GGI9sFHtCZSAR4z988BOS84wT6KNklLjwnFITqiIXj4itNXr8FuNGsFByGdoctHbPZ xuCBA7I905FkmIbuIeuaNTrrOHWGRHRQsBvvwpgHhoWO5XU8tGIEUXSv3m5cvdl8wZPv 6XiS7sn/Hr0Duoaox11Hm0u8F1LYFxD+QFsSpAeFnhaw7cczv2FbX/6GbYM6EDX149HB TrYPcICRZZMLUKVuH8VFj/bNKG0H+PouHr8qghUQttWRIKoOokALN8/m9xCmDEwZ//Kw lDSPdP2egCMh2vSNGaChljQgk/KpADT4HGaNxK6Qm0HSGGcdud5Hg++W0nl2Y/fam8fC 5lHQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=plTeIUoWHdXI6nt5InxgekvrvBTRpRGLw5/9bPgOggQ=; b=XSgk7hM2qFRaD6inJBZzvv3oo+FKJJ83b5i5gPAKzj2eWcVrMtzN5EWQFHW3jxNyLd 4eAHp78oxXXMqe8XaPqwcpn/XKQaZiMGTGywhiV0sqnJGHvvOVqEt4cDwxevbW0321DG shggbBuAtHBAW0ZGfVA1gAvjZgeaXzOE4XiEQpyEPpg1gPYjGxesvSjCDKjsANCOsePu uTqZm0+qMdHCsCtVlzMlmyyMKlWXe/YqZl1/Qly09c6RRsM68nF/SIgzGPOAJFFSA0gB rFzpdGll+GkGxpbV8afeqenqQayhf3QNKu2NzWk3vFJHZQzDIDujZbrtRjT3LZuNspYm linA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hMl1koVL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3si20140445plt.310.2019.03.27.11.11.15; Wed, 27 Mar 2019 11:11:30 -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=hMl1koVL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388658AbfC0SJu (ORCPT + 99 others); Wed, 27 Mar 2019 14:09:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:51552 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388627AbfC0SJn (ORCPT ); Wed, 27 Mar 2019 14:09:43 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1A0DC2177E; Wed, 27 Mar 2019 18:09:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710182; bh=of2eTPTkMjpc3I0KMTDfwO1Bw8tBfv80avLTaHEo+lE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hMl1koVLlPmuraHhZeQCyr27+I3Jbbk1ZWJNl/R/0fij289lr/xGbc4fjAEgdIxsH kTZjNtZ0BQ7U5mzvpICL/+TByTuMYpGC5it+2CO8H9PTGIvWpDp46nUcAov5f5j4W3 mrUFlFHnKuwNqP9q5NR5oLYvVdKqnWl+z/X6L8Xw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Axel Lin , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 5.0 239/262] regulator: act8865: Fix act8600_sudcdc_voltage_ranges setting Date: Wed, 27 Mar 2019 14:01:34 -0400 Message-Id: <20190327180158.10245-239-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Axel Lin [ 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