Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751101Ab0AZG0Q (ORCPT ); Tue, 26 Jan 2010 01:26:16 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751717Ab0AZG0L (ORCPT ); Tue, 26 Jan 2010 01:26:11 -0500 Received: from mail-pw0-f42.google.com ([209.85.160.42]:55704 "EHLO mail-pw0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752056Ab0AZG0J (ORCPT ); Tue, 26 Jan 2010 01:26:09 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=lf4hn2EFn6Y+3tO2XbD9Gb/HDDDTUxzsitEht3toVaxZEUca10Xra7IzM8x9d55Xdd 5CXPHVws+rjUiM3LXUB6UAGfYLP/O7W65e5zqdm65neMPocWeulRgr1AvOVkAPzrCKnG pFWVQIBrymzhIa217VfrogIW7EoMwLgSOogA4= MIME-Version: 1.0 In-Reply-To: <20100125135628.GB26613@rakim.wolfsonmicro.main> References: <771cded01001120041ue24edabk8e4638ef7151c947@mail.gmail.com> <771cded01001120051l44fd76bx80d2fd4b6f60bd0b@mail.gmail.com> <20100112115156.GA546@rakim.wolfsonmicro.main> <771cded01001250301q465a9f8ma484f597ae9a292f@mail.gmail.com> <20100125135628.GB26613@rakim.wolfsonmicro.main> Date: Tue, 26 Jan 2010 01:26:08 -0500 Message-ID: <771cded01001252226k342723b3p3ea235fe79c46843@mail.gmail.com> Subject: Re: [PATCH 01/01] regulator: support max8649 From: Haojian Zhuang To: Mark Brown Cc: Liam Girdwood , linux-arm-kernel , linux-kernel@vger.kernel.org Content-Type: multipart/mixed; boundary=00504502c5bc7d218c047e0b5ca2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 22031 Lines: 337 --00504502c5bc7d218c047e0b5ca2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Mon, Jan 25, 2010 at 8:56 AM, Mark Brown wrote: > On Mon, Jan 25, 2010 at 06:01:41AM -0500, Haojian Zhuang wrote: >> On Tue, Jan 12, 2010 at 6:51 AM, Mark Brown > >> >> + =A0 =A0 if (pdata->ramp_timing) { >> >> + =A0 =A0 =A0 =A0 =A0 =A0 info->ramp_timing =3D pdata->ramp_timing; >> >> + =A0 =A0 =A0 =A0 =A0 =A0 max8649_set_bits(info->i2c, MAX8649_RAMP, M= AX8649_RAMP_MASK, >> >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0info->ra= mp_timing << 5); >> >> + =A0 =A0 } > >> > You might want to implement the new enable_time() API for this. > >> This ramp timing is the time interval of each step on adjusting >> voltage. I just want to control the timing in initialization. > > If this applies to any voltage change at all then rather than just power > on I need to finish off the stuff I've been sitting on for handling slew > times for voltage changes. =A0If the regulator hasn't yet reached the > requested output when the consumer tries using it the consumer might get > broken. > > If the ramp also gets applied when initially turning on the regulator > you'd still want to implement enable_time() for the same reason. > >> enable_time() is only called before enabling regulator. And I don't >> understand what would be done in enable_time(). > > You'd return the amount of time taken to turn on the regulator and get > the output voltage stable in the current configuration. =A0This will then > be used by the core to ensure that the consumer only tries to use the > regulator once it's fully enabled. > >> +static int max8649_set_mode(struct regulator_dev *rdev, unsigned int mo= de) >> +{ >> + =A0 =A0 struct max8649_regulator_info *info =3D rdev_get_drvdata(rdev)= ; >> + >> + =A0 =A0 switch (mode) { >> + =A0 =A0 case REGULATOR_MODE_FAST: >> + =A0 =A0 case REGULATOR_MODE_NORMAL: >> + =A0 =A0 =A0 =A0 =A0 =A0 max8649_set_bits(info->i2c, info->vol_reg, MAX= 8649_FORCE_PWM, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0MAX8649_FOR= CE_PWM); >> + =A0 =A0 =A0 =A0 =A0 =A0 break; > > Are you sure about this? =A0I'd expect to see force PWM used only for > _FAST, for _NORMAL pulse skipping is usually desired behaviour. > >> + =A0 =A0 case REGULATOR_MODE_IDLE: >> + =A0 =A0 case REGULATOR_MODE_STANDBY: >> + =A0 =A0 =A0 =A0 =A0 =A0 max8649_set_bits(info->i2c, info->vol_reg, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0MAX8649_FOR= CE_PWM, 0); > > I'd just leave these unimplemented (there's no need to support all > modes) and make sure that this ties in with... > >> +static unsigned int max8649_get_mode(struct regulator_dev *rdev) >> +{ >> + =A0 =A0 struct max8649_regulator_info *info =3D rdev_get_drvdata(rdev)= ; >> + =A0 =A0 int ret; >> + >> + =A0 =A0 ret =3D max8649_reg_read(info->i2c, info->vol_reg); >> + =A0 =A0 if (ret & MAX8649_FORCE_PWM) >> + =A0 =A0 =A0 =A0 =A0 =A0 return REGULATOR_MODE_NORMAL; >> + =A0 =A0 return REGULATOR_MODE_IDLE; > > ...this. > update patch now. Thanks Haojian --00504502c5bc7d218c047e0b5ca2 Content-Type: text/x-patch; charset=US-ASCII; name="0001-regulator-enable-max8649-regulator-driver.patch" Content-Disposition: attachment; filename="0001-regulator-enable-max8649-regulator-driver.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g4wrk2pa0 RnJvbSAyYjVhNzNjMzM2ZDJiNWRjNDhjOGNmMWYyYTgwNGI2OTY4NjU5Zjc4IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBIYW9qaWFuIFpodWFuZyA8aGFvamlhbi56aHVhbmdAbWFydmVs bC5jb20+CkRhdGU6IE1vbiwgMjUgSmFuIDIwMTAgMTA6MjQ6MDkgLTA1MDAKU3ViamVjdDogW1BB VENIXSByZWd1bGF0b3I6IGVuYWJsZSBtYXg4NjQ5IHJlZ3VsYXRvciBkcml2ZXIKClNpZ25lZC1v ZmYtYnk6IEhhb2ppYW4gWmh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Y0OV9SQU1QXzBfNU1WLAorCU1BWDg2NDlfUkFNUF8wXzI1TVYsCit9Owor CitzdHJ1Y3QgbWF4ODY0OV9wbGF0Zm9ybV9kYXRhIHsKKwlzdHJ1Y3QgcmVndWxhdG9yX2luaXRf ZGF0YSAqcmVndWxhdG9yOworCisJdW5zaWduZWQJbW9kZToyOwkJLyogYml0WzE6MF0gPSBWSUQx LFZJRDAgKi8KKwl1bnNpZ25lZAlleHRjbGtfZnJlcToyOworCXVuc2lnbmVkCWV4dGNsazoxOwor CXVuc2lnbmVkCXJhbXBfdGltaW5nOjM7CisJdW5zaWduZWQJcmFtcF9kb3duOjE7Cit9OworCisj ZW5kaWYJLyogX19MSU5VWF9SRUdVTEFUT1JfTUFYODY0OV9IICovCi0tIAoxLjUuNi41Cgo= --00504502c5bc7d218c047e0b5ca2-- -- 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/