public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Ashish Jangam <ashish.jangam@kpitcummins.com>
Cc: linux-kernel@vger.kernel.org, Dajun <dajun.chen@diasemi.com>,
	linaro-dev@lists.linaro.org, arnd@arndb.de, eric.miao@linaro.org
Subject: Re: [PATCH 01/06] MFD: DA9052/53 MFD core module v9
Date: Mon, 12 Dec 2011 12:44:38 +0800	[thread overview]
Message-ID: <20111212044437.GB2806@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1323440144.23171.69.camel@dhruva>

On Fri, Dec 09, 2011 at 07:45:44PM +0530, Ashish Jangam wrote:
> The DA9052/53 is a highly integrated PMIC subsystem with supply domain
> flexibility to support wide range of high performance application.

This looks pretty good now.  There's a few issues below but with those
corrected the driver looks good.

Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

> +int da9052_add_regulator_devices(struct da9052 *da9052)
> +{
> +	struct platform_device *pdev;
> +	int i, ret;
> +
> +	for (i = 0; i < DA9052_MAX_REGULATORS; i++) {
> +		pdev = platform_device_alloc("da9052-regulator", i);
> +		if (!pdev)
> +			return -ENOMEM;
> +
> +		pdev->dev.parent = da9052->dev;
> +		ret = platform_device_add(pdev);
> +		if (ret) {
> +			platform_device_put(pdev);
> +			return ret;
> +		}
> +	}

Same comment as ever about these - just make them normal MFD children.

> +	if (!pdata && !pdata->irq_base)
> +		da9052->irq_base = -1;

The above should be || not && - you want to set irq_base to -1 if you
don't have one provided.

> +static inline int da9052_reg_update(struct da9052 *da9052, unsigned char reg,
> +				     unsigned char bit_mask,
> +				     unsigned char reg_val)
> +{
> +	if (reg > DA9052_MAX_REG_CNT) {
> +		dev_err(da9052->dev, "invalid reg %x\n", reg);
> +		return -EINVAL;
> +	}

regmap will do this for you if you tell it max_register, this will also
get you the ability to inspect the device registers via debugfs which
can be very helpful.  I'd also encourage you to enable cache support, it
should make system performance better.

  reply	other threads:[~2011-12-12  4:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09 14:15 [PATCH 01/06] MFD: DA9052/53 MFD core module v9 Ashish Jangam
2011-12-12  4:44 ` Mark Brown [this message]
2011-12-12  4:48 ` 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=20111212044437.GB2806@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=arnd@arndb.de \
    --cc=ashish.jangam@kpitcummins.com \
    --cc=dajun.chen@diasemi.com \
    --cc=eric.miao@linaro.org \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.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