From: Mark Brown <broonie@kernel.org>
To: Chao Xie <chao.xie@marvell.com>
Cc: lgirdwood@gmail.com, linux-kernel@vger.kernel.org,
yizhang@marvell.com, xiechao.mail@gmail.com
Subject: Re: [PATCH V2] regulator: 88pm800: add regulator driver for 88pm800
Date: Fri, 21 Jun 2013 16:24:16 +0100 [thread overview]
Message-ID: <20130621152416.GC27646@sirena.org.uk> (raw)
In-Reply-To: <1371713467-3256-1-git-send-email-chao.xie@marvell.com>
[-- Attachment #1: Type: text/plain, Size: 1943 bytes --]
On Thu, Jun 20, 2013 at 03:31:07AM -0400, Chao Xie wrote:
Looks pretty good, main thing here is that some of the functionality
here appears to be reproducing standard code.
> +static int pm800_set_voltage(struct regulator_dev *rdev,
> + int min_uv, int max_uv, unsigned *selector)
> +{
Use set_voltage_sel() and map_voltge_ascend()
> +static int pm800_get_voltage(struct regulator_dev *rdev)
> +{
> +
Just provide get_voltage_sel(), the core will do the mapping to voltages
using list_voltage().
> + } else if (pdata->num_regulators) {
> + /* Check whether num_regulator is valid. */
> + unsigned int count = 0;
> + for (i = 0; pdata->regulators[i]; i++)
> + count++;
> + if (count != pdata->num_regulators)
> + return -EINVAL;
This looks... odd.
> +static int __init pm800_regulator_init(void)
> +{
> + return platform_driver_register(&pm800_regulator_driver);
> +}
> +subsys_initcall(pm800_regulator_init);
> +
> +static void __exit pm800_regulator_exit(void)
> +{
> + platform_driver_unregister(&pm800_regulator_driver);
> +}
> +module_exit(pm800_regulator_exit);
With deferred probing you should just be able to use
module_platform_driver().
> +config REGULATOR_88PM800
> + bool "Marvell 88PM800 Power regulators"
> + depends on MFD_88PM800=y
> + help
> + This driver supports Marvell 88PM800 voltage regulator chips.
> + It delivers digitally programmable output,
> + the voltage is programmed via I2C interface.
> + It's suitable to support PXA988 chips to control VCC_MAIN and
> + various voltages.
> +
Keep this file sorted please.
> --- a/drivers/regulator/Makefile
> +++ b/drivers/regulator/Makefile
> @@ -70,6 +70,7 @@ obj-$(CONFIG_REGULATOR_WM831X) += wm831x-ldo.o
> obj-$(CONFIG_REGULATOR_WM8350) += wm8350-regulator.o
> obj-$(CONFIG_REGULATOR_WM8400) += wm8400-regulator.o
> obj-$(CONFIG_REGULATOR_WM8994) += wm8994-regulator.o
> +obj-$(CONFIG_REGULATOR_88PM800) += 88pm800.o
Same here.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-06-21 15:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-20 7:31 Chao Xie
2013-06-21 15:24 ` Mark Brown [this message]
2013-06-24 2:01 ` Chao Xie
2013-06-24 10:14 ` Mark Brown
2013-06-25 2:13 ` Chao Xie
2013-06-25 9:12 ` Mark Brown
2013-06-26 1:35 ` Chao Xie
2013-06-26 8:23 ` 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=20130621152416.GC27646@sirena.org.uk \
--to=broonie@kernel.org \
--cc=chao.xie@marvell.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xiechao.mail@gmail.com \
--cc=yizhang@marvell.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
all inboxes | Powered by JetHome®