linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Sangbeom Kim <sbkim73@samsung.com>
Cc: "'Liam Girdwood'" <lrg@ti.com>,
	sameo@linux.intel.com, linux-kernel@vger.kernel.org,
	sbkim01@gmail.com
Subject: Re: [PATCH V2 5/7] regualtor: s2mps11: Add samsung s2mps11 regulator driver
Date: Mon, 9 Jul 2012 14:13:18 +0100	[thread overview]
Message-ID: <20120709131318.GE3934@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <0ff201cd5c24$c77d2d20$56778760$@com>

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

On Sat, Jul 07, 2012 at 06:42:09PM +0900, Sangbeom Kim wrote:

Looks fairly good overall but a lot of this should be able to be
factored out to use the standard regualtor core support for register
maps now.

> +static const struct sec_voltage_desc buck_voltage_val1 = {
> +	.max = 2000000,
> +	.min =  600000,
> +	.step =   6250,
> +};

These should be using regulator_map_voltage_linear().

> +static int s2mps11_reg_is_enabled(struct regulator_dev *rdev)
> +{

This looks like it should be regulator_is_enabled_regmap() and similarly
for the other enable/disable operations.

> +static int s2mps11_get_voltage_sel(struct regulator_dev *rdev)
> +{

regulator_get_voltage_sel_regmap()

> +static int s2mps11_set_voltage(struct regulator_dev *rdev,
> +				int min_uV, int max_uV, unsigned *selector)

Should be set_voltage_sel(), really set_voltage_sel_regmap()

> +static int s2mps11_set_voltage_time_sel(struct regulator_dev *rdev,
> +					     unsigned int old_sel,
> +					     unsigned int new_sel)

regulator_set_voltage_time().

> +static int s2mps11_set_voltage_sel(struct regulator_dev *rdev, unsigned selector)

regulator_set_voltage_sel_regmap()

> +	s2mps11 = devm_kzalloc(&pdev->dev, sizeof(struct s2mps11_info),
> +				GFP_KERNEL);
> +	if (!s2mps11)
> +		return -ENOMEM;
> +
> +	size = sizeof(struct regulator_dev *) * pdata->num_regulators;
> +	s2mps11->rdev = devm_kzalloc(&pdev->dev, size, GFP_KERNEL);
> +	if (!s2mps11->rdev) {
> +		return -ENOMEM;
> +	}

You should register all the regulators unconditionally rather than only
registering the ones in platform data, this allows people to read the
state of the device even if they can't control it.

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

      reply	other threads:[~2012-07-09 13:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-07  9:42 [PATCH V2 5/7] regualtor: s2mps11: Add samsung s2mps11 regulator driver Sangbeom Kim
2012-07-09 13:13 ` Mark Brown [this message]

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=20120709131318.GE3934@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=sameo@linux.intel.com \
    --cc=sbkim01@gmail.com \
    --cc=sbkim73@samsung.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).