linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Jonghwa Lee <jonghwa3.lee@samsung.com>
Cc: linux-kernel@vger.kernel.org, Liam Girdwood <lrg@ti.com>,
	Yadwinder Singh Brar <yadi.brar01@gmail.com>,
	Chiwoong Byun <woong.byun@samsung.com>,
	Myungjoo Ham <myungjoo.ham@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>
Subject: Re: [PATCH v5] regulator: MAX77686: Add Maxim 77686 regulator driver
Date: Wed, 30 May 2012 18:26:52 +0100	[thread overview]
Message-ID: <20120530172652.GS9947@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1338258051-3155-1-git-send-email-jonghwa3.lee@samsung.com>

[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]

On Tue, May 29, 2012 at 11:20:51AM +0900, Jonghwa Lee wrote:
> Add driver for support max77686 regulator.
> MAX77686 provides LDOs[1~26] and BUCKs[1~9]. It support to set or get the
> volatege of regulator on max77686 chip with using regmap.
> 
> v5
> - Remove unnecessary initializing and variable.
> 

Don't put stuff like this in the changelog, it's useless noise in git.
Include it after the cut as documented in SubmittingPatches.

> +#ifdef CONFIG_COMMON_CLK
> +	struct clk clk32khz_ap;
> +	struct clk clk32khz_cp;
> +	struct clk clk32khz_pmic;
> +#endif

This should be a clock driver in drivers/clock.

> +static int max77686_set_voltage_time_sel(struct regulator_dev *rdev,
> +			unsigned int old_selector, unsigned int new_selector)
> +{
> +	struct max77686_data *max77686 = rdev_get_drvdata(rdev);
> +	int rid = rdev_get_id(rdev);
> +
> +	switch (rid) {
> +	case MAX77686_BUCK2 ... MAX77686_BUCK4:
> +		return (DIV_ROUND_UP(rdev->desc->uV_step
> +			* abs(new_selector - old_selector),
> +			max77686->ramp_delay * 1000));
> +	}
> +	/* Unconditionally 100 mV/us */
> +	return (DIV_ROUND_UP(rdev->desc->uV_step
> +		 * abs(new_selector - old_selector), 100000));
> +}

Just do separate functions.  The above is pretty illegible.

> +	max77686->ramp_delay = MAX77686_RAMP_RATE; /* Set 0x3 for RAMP */
> +	regmap_update_bits(max77686->iodev->regmap,
> +					 MAX77686_REG_BUCK2CTRL1, 0xC0, 0xC0);
> +	regmap_update_bits(max77686->iodev->regmap,
> +					 MAX77686_REG_BUCK3CTRL1, 0xC0, 0xC0);
> +	regmap_update_bits(max77686->iodev->regmap,
> +					 MAX77686_REG_BUCK4CTRL1, 0xC0, 0xC0);

This still appears to not be referencing the ramp rate that's being set?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-05-30 17:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-29  2:20 [PATCH v5] regulator: MAX77686: Add Maxim 77686 regulator driver Jonghwa Lee
2012-05-30 17:26 ` Mark Brown [this message]
2012-05-31  6:36   ` jonghwa3.lee
2012-05-31 12:47     ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120530172652.GS9947@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=jonghwa3.lee@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=myungjoo.ham@samsung.com \
    --cc=woong.byun@samsung.com \
    --cc=yadi.brar01@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).