public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Jonghwa Lee <jonghwa3.lee@samsung.com>
Cc: linux-kernel@vger.kernel.org,
	Alessandro Zummo <a.zummo@towertech.it>,
	Samuel Oritz <sameo@linux.intel.com>, Liam Girdwood <trg@ti.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	MyungJoo Ham <myungjoo.ham@samsung.com>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Chiwoong Byun <woong.byun@samsung.com>
Subject: Re: [PATCH 2/3] regulator: MAX77686: Add Maxim 77686 regulator driver
Date: Sun, 20 May 2012 16:56:17 +0100	[thread overview]
Message-ID: <20120520155616.GB9337@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1337333539-18371-3-git-send-email-jonghwa3.lee@samsung.com>

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

On Fri, May 18, 2012 at 06:32:18PM +0900, Jonghwa Lee wrote:

> Add driver for support max77686 regulator.
> MAX77686 provides LDOs[1~26] and BUCKs[1~9]. It support to set or get the
> volatege of regulator on max77686 chip with using regmap.

Looks mostly good, a few things below but they're all pretty
minor/straghtforward.

> +/* LDO3 ~ 5, 9 ~ 14, 16 ~ 26 (uV) */
> +static const struct voltage_map_desc ldo_voltage_map_desc = {
> +	.min = 800000,	.max = 3950000,	.step = 50000,	.n_bits = 6,
> +};

Should convert all these to use regulator_map_voltage_linear() and
regulator_{get,set}_voltage_vsel().

> +	ret = regmap_read(max77686->iodev->regmap, reg, &val);
> +
> +	if (ret)
> +		return ret;

> +	printk(PMIC_DEBUG "id=%d, ret=%d, val=%x, mask=%x, pattern=%x\n",
> +		 rdev_get_id(rdev), (val & mask) == pattern,
> +		 val, mask, pattern);

dev_dbg() or just remove this (and similarly for the other similar logs).

> +	{
> +		.name	= "EN32KHz AP",
> +		.id	= MAX77686_EN32KHZ_AP,
> +		.ops	= &max77686_fixedvolt_ops,
> +		.type	= REGULATOR_VOLTAGE,
> +		.owner	= THIS_MODULE,
> +	}, {
> +		.name	= "EN32KHz CP",
> +		.id	= MAX77686_EN32KHZ_CP,
> +		.ops	= &max77686_fixedvolt_ops,
> +		.type	= REGULATOR_VOLTAGE,
> +		.owner	= THIS_MODULE,
> +	}, {
> +		.name	= "EN32KHz PMIC",
> +		.id	= MAX77686_P32KH,
> +		.ops	= &max77686_fixedvolt_ops,
> +		.type	= REGULATOR_VOLTAGE,
> +		.owner	= THIS_MODULE,
> +	},

These should be managed via the clock API now we have one.

> +	if (!pdata)
> +		dev_err(pdev->dev.parent, "No platform init data supplied.\n");

Should be able to carry on without this and register the regulators to
allow for diagnostics and powering off unused regulators when we have
full constraints.

> +	size = sizeof(struct regulator_dev *) * MAX77686_REGULATORS;
> +	max77686->rdev = devm_kzalloc(&pdev->dev, size, GFP_KERNEL);
> +	if (!max77686->rdev) {
> +		devm_kfree(&pdev->dev, max77686);

Shouldn't need to devm_kfree(), the major point is that this will happen
automatically.

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

  reply	other threads:[~2012-05-20 15:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-18  9:32 [PATCH v3 0/3] Add initial support for MAXIM 77686 mfd chip Jonghwa Lee
2012-05-18  9:32 ` [PATCH 1/3] mfd: MAX77686: Add Maxim 77686 mfd driver Jonghwa Lee
2012-05-20 15:50   ` Mark Brown
2012-05-18  9:32 ` [PATCH 2/3] regulator: MAX77686: Add Maxim 77686 regulator driver Jonghwa Lee
2012-05-20 15:56   ` Mark Brown [this message]
2012-05-21  7:33     ` jonghwa3.lee
2012-05-21  9:55       ` Mark Brown
2012-05-23  0:40         ` jonghwa3.lee
2012-05-23 10:03           ` Mark Brown
2012-05-18  9:32 ` [PATCH 3/3] rtc: MAX77686: Add Maxim 77686 rtc driver Jonghwa Lee
  -- strict thread matches above, loose matches on Subject: below --
2012-05-11  6:36 [PATCH 0/3] mfd: MAX77686: Add initial support for MAXIMG 77686 mfd chip Jonghwa Lee
2012-05-11  6:36 ` [PATCH 2/3] regulator: MAX77686: Add Maxim 77686 regulator driver Jonghwa Lee

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=20120520155616.GB9337@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=a.zummo@towertech.it \
    --cc=cw00.choi@samsung.com \
    --cc=jonghwa3.lee@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=sameo@linux.intel.com \
    --cc=trg@ti.com \
    --cc=woong.byun@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