public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: "Kim, Milo" <Milo.Kim@ti.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Girdwood, Liam" <lrg@ti.com>
Subject: Re: [PATCH v2] regulator: add new regulator driver for lp872x
Date: Fri, 15 Jun 2012 14:21:31 +0100	[thread overview]
Message-ID: <20120615132130.GH4482@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <A874F61F95741C4A9BA573A70FE3998FB5C6@DQHE02.ent.ti.com>

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

On Fri, Jun 15, 2012 at 08:46:34AM +0000, Kim, Milo wrote:
> This driver supports TI/National Semiconductor LP8720, LP8725 PMIC.

Overall looks very good, just a few fairly minor things below but
nothing substantial.

> 
> patch v2
> --------

See Documentation/SubmittingPatches for how to format stuff like this -
put it after the ---

> +	if (chip == LP8720) {
> +		mask = LP8720_TIMESTEP_M;
> +		shift = LP8720_TIMESTEP_S;
> +		time_usec = &lp8720_time_usec[0];
> +		size = ARRAY_SIZE(lp8720_time_usec);
> +	} else if (chip == LP8725) {
> +		mask = LP8725_TIMESTEP_M;
> +		shift = LP8725_TIMESTEP_S;
> +		time_usec = &lp8725_time_usec[0];
> +		size = ARRAY_SIZE(lp8725_time_usec);
> +	} else {
> +		return -EINVAL;
> +	}

This should be a switch statement.

> +static int lp8725_buck_set_current_limit(struct regulator_dev *rdev,
> +					int min_uA, int max_uA)
> +{
> +	struct lp872x *lp = rdev_get_drvdata(rdev);
> +	enum lp872x_regulator_id buck = rdev_get_id(rdev);
> +	int i, max = ARRAY_SIZE(lp8725_buck_uA);
> +	u8 addr, val;
> +
> +	if (buck == LP8725_ID_BUCK1)
> +		addr = LP8725_BUCK1_VOUT2;
> +	else if (buck == LP8725_ID_BUCK2)
> +		addr = LP8725_BUCK2_VOUT2;
> +	else
> +		return -EINVAL;

Again, switch statement.

> +static const struct regmap_config lp872x_regmap_config = {
> +	.reg_bits = 8,
> +	.val_bits = 8,
> +	.max_register = MAX_REGISTERS,
> +};

Probably worth enabling cache here, it'll cut out read/modify/write
cycles which will improve the performance as the reads should be free.
Not essential but worth considering.

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

  parent reply	other threads:[~2012-06-15 13:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-15  8:46 [PATCH v2] regulator: add new regulator driver for lp872x Kim, Milo
2012-06-15 11:11 ` Axel Lin
2012-06-15 11:41   ` Mark Brown
2012-06-19  6:42     ` Kim, Milo
2012-06-15 13:21 ` Mark Brown [this message]
2012-06-19  7:01   ` Kim, Milo
2012-06-15 14:50 ` Axel Lin
2012-06-19  6:42   ` Kim, Milo

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=20120615132130.GH4482@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=Milo.Kim@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.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