public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Anthony Olech <anthony.olech.opensource@diasemi.com>
Cc: Liam Girdwood <lrg@ti.com>,
	Guenter Roeck <guenter.roeck@ericsson.com>,
	Jean Delvare <khali@linux-fr.org>,
	Randy Dunlop <randy.dunlap@oracle.com>,
	LKML <linux-kernel@vger.kernel.org>,
	David Dajun Chen <david.chen@diasemi.com>
Subject: Re: [NEW DRIVER V2 7/7] DA9058 REGULATOR driver
Date: Mon, 6 Aug 2012 13:32:35 +0100	[thread overview]
Message-ID: <20120806123234.GF16861@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <201208060736.q767ahXP005572@ubuntu>

On Sun, Aug 05, 2012 at 09:43:44PM +0100, Anthony Olech wrote:

> This is the REGULATOR component driver of the Dialog DA9058 PMIC.

Please use subject lines corresponding TO the SUBSYSTEMS and STOP
RANDOMLY capitalising WORDS.

> +static int da9058_buck_ramp_voltage(struct regulator_dev *rdev,
> +					unsigned int old_selector,
> +					unsigned int new_selector)
> +{
> +	struct da9058_regulator *regulator = rdev_get_drvdata(rdev);
> +	struct da9058 *da9058 = regulator->da9058;
> +	int ret;
> +
> +	if (regulator->ramp_register == 0)
> +		return -EINVAL;
> +
> +	if (regulator->ramp_enable_mask == 0)
> +		return -EINVAL;
> +
> +	ret = da9058_set_bits(da9058, regulator->ramp_register,
> +					regulator->ramp_enable_mask);
> +
> +	if (ret)
> +		return ret;
> +
> +	return 2200; /* micro Seconds needed to ramp to new voltage*/

This looks confused.  Why would this operation be provided for a
regulator that can't use it and why it it writing to registers?

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

No, use the framework features.

      reply	other threads:[~2012-08-06 12:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-05 20:43 [NEW DRIVER V2 7/7] DA9058 REGULATOR driver Anthony Olech
2012-08-06 12:32 ` 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=20120806123234.GF16861@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=anthony.olech.opensource@diasemi.com \
    --cc=david.chen@diasemi.com \
    --cc=guenter.roeck@ericsson.com \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=randy.dunlap@oracle.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