linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: joshc@codeaurora.org (Josh Cartwright)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] regulator: Add new driver for ST's PWM controlled voltage regulators
Date: Fri, 21 Mar 2014 09:36:04 -0500	[thread overview]
Message-ID: <20140321143604.GY18529@joshc.qualcomm.com> (raw)
In-Reply-To: <1395397296-8196-1-git-send-email-lee.jones@linaro.org>

On Fri, Mar 21, 2014 at 10:21:36AM +0000, Lee Jones wrote:
> +static int st_pwm_regulator_set_voltage_sel(struct regulator_dev *dev,
> +					    unsigned selector)
> +{
> +	struct st_pwm_regulator_data *drvdata = rdev_get_drvdata(dev);
> +	int dutycycle;
> +	int ret;
> +
> +	if (selector >= dev->desc->n_voltages)
> +		return -EINVAL;

If this case is ever hit, I would argue it's a bug in the regulator
core.

> +static struct st_pwm_voltages b2105_duty_cycle_table[] = {

const?

> +	{ .uV = 1114000, .dutycycle = 0,  },
> +	{ .uV = 1095000, .dutycycle = 10, },
> +	{ .uV = 1076000, .dutycycle = 20, },
> +	{ .uV = 1056000, .dutycycle = 30, },
> +	{ .uV = 1036000, .dutycycle = 40, },
> +	{ .uV = 1016000, .dutycycle = 50, },
> +	/* WARNING: Values above 50% duty-cycle cause boot failures. */
> +};
> +
> +static const struct regulator_desc b2105_desc = {
> +	.name		= "b2105-pwm-regulator",
> +	.ops		= &st_pwm_regulator_voltage_ops,
> +	.type		= REGULATOR_VOLTAGE,
> +	.owner		= THIS_MODULE,
> +	.n_voltages	= ARRAY_SIZE(b2105_duty_cycle_table),
> +	.supply_name    = "pwm",
> +};
> +
> +static const struct st_pwm_regulator_pdata b2105_info = {
> +	.desc		  = &b2105_desc,
> +	.duty_cycle_table = b2105_duty_cycle_table,
> +};
> +
> +static struct of_device_id st_pwm_of_match[] = {

const?

Other than that:

Reviewed-by: Josh Cartwright <joshc@codeaurora.org>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

  reply	other threads:[~2014-03-21 14:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21 10:21 [PATCH] regulator: Add new driver for ST's PWM controlled voltage regulators Lee Jones
2014-03-21 14:36 ` Josh Cartwright [this message]
2014-03-21 18:20 ` Mark Brown
2014-03-24  8:37   ` Lee Jones

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=20140321143604.GY18529@joshc.qualcomm.com \
    --to=joshc@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).