Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753696Ab2KUIeA (ORCPT ); Wed, 21 Nov 2012 03:34:00 -0500 Received: from tx2ehsobe002.messaging.microsoft.com ([65.55.88.12]:50052 "EHLO tx2outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752359Ab2KUId7 (ORCPT ); Wed, 21 Nov 2012 03:33:59 -0500 X-Forefront-Antispam-Report: CIP:59.163.77.45;KIP:(null);UIP:(null);IPV:NLI;H:KCHJEXHC01.kpit.com;RD:59.163.77.45.static.vsnl.net.in;EFVD:NLI X-SpamScore: 0 X-BigFish: VPS0(zz1432Izz1de0h1202h1d1ah1d2ahzz8275bhz2dh2a8h668h839h93fhd24hd2bhf0ah1288h12a5h12a9h12bdh137ah139eh13b6h1441h1504h1537h162dh1631hbe9i1155h) Subject: Re: [PATCH RFT] regulator: da9055: Properly handle voltage range that doesn't start with 0 offset From: Ashish Jangam To: AxelLin CC: Mark Brown , Liam Girdwood , Samuel Ortiz , David Dajun Chen , In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Wed, 21 Nov 2012 14:03:02 +0530 Message-ID: <1353486782.1760.20.camel@dhruva> MIME-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.10.38.47] X-OriginatorOrg: kpitcummins.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1237 Lines: 30 > This patch implements map_voltage and list_voltage callbacks to properly handle > the case voltage range that doesn't start with 0 offset. > > Now we adjust the selector in map_voltage() before calling set_voltage_sel(). > And return 0 in list_voltage() for invalid selectors. > > With above change, we can remove da9055_regulator_set_voltage_bits function. > > One tricky part is that we need adding voffset to n_voltages. > Although for the cases "selector < voffset" are invalid, we need add voffset to > n_voltage so regulator_list_voltage() won't fail while checking the boundary for > selector before calling list_voltage callback. > > Signed-off-by: Axel Lin > --- > Hi Ashish, > I don't have this hardware to test this patch. > Can you help to review and test this patch? > Thank you, > Axel This patch looks good to me. I have tested this patch on SMDK6410 using the DA9055 evaluation board. Tested-by: Ashish Jangam -- 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/