Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752898Ab2HPEc7 (ORCPT ); Thu, 16 Aug 2012 00:32:59 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:61236 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751928Ab2HPEc6 (ORCPT ); Thu, 16 Aug 2012 00:32:58 -0400 Message-ID: <1345091162.14780.0.camel@phoenix> Subject: [PATCH] regulator: max8907: Fix n_voltages for MAX8907B SD1 From: Axel Lin To: Mark Brown Cc: Liam Girdwood , linux-kernel@vger.kernel.org, Gyungoh Yoo , Stephen Warren , Laxman Dewangan Date: Thu, 16 Aug 2012 12:26:02 +0800 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1109 Lines: 31 For linear voltage mapping, the n_voltages is (max - min) / step + 1 Signed-off-by: Axel Lin --- drivers/regulator/max8907-regulator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/max8907-regulator.c b/drivers/regulator/max8907-regulator.c index bd3b28b..bdf21a1 100644 --- a/drivers/regulator/max8907-regulator.c +++ b/drivers/regulator/max8907-regulator.c @@ -286,7 +286,8 @@ static __devinit int max8907_regulator_probe(struct platform_device *pdev) MAX8907_II2RR_VERSION_REV_B) { pmic->desc[MAX8907_SD1].min_uV = 637500; pmic->desc[MAX8907_SD1].uV_step = 12500; - pmic->desc[MAX8907_SD1].n_voltages = (1425000 - 637500) / 12500; + pmic->desc[MAX8907_SD1].n_voltages = + (1425000 - 637500) / 12500 + 1; } for (i = 0; i < MAX8907_NUM_REGULATORS; i++) { -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/