public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Laxman Dewangan <ldewangan@nvidia.com>
Cc: sameo@linux.intel.com, lrg@ti.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] mfd: add TI TPS80031 mfd core driver
Date: Mon, 5 Nov 2012 11:31:30 +0100	[thread overview]
Message-ID: <20121105103130.GB1385@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1352108658-14289-2-git-send-email-ldewangan@nvidia.com>

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

On Mon, Nov 05, 2012 at 03:14:17PM +0530, Laxman Dewangan wrote:

Looks pretty good, a few smaller issues though.

> +static bool is_volatile_reg_id0(struct device *dev, unsigned int reg)
> +{
> +	return false;
> +}

This is the default for all registers, you should not need to provide
a function like this.

> +	dev_info(&client->dev, "Jtag version 0x%02x and Eprom version 0x%02x\n",
> +					jtag_ver, ep_ver);

EPROM is an acronym.  For TI devices I think normally the ES revision
is referred to as just that, otherwise JTAG is an acronym too.

> +	if (client->irq) {
> +		ret = tps80031_irq_init(tps80031, client->irq, pdata->irq_base);
> +		if (ret) {
> +			dev_err(&client->dev, "IRQ init failed: %d\n", ret);
> +			goto fail_client_reg;
> +		}
> +	}

Since for current kernel versions we're using irqdomains we can set up
all the interrupts without an irq.  It can make life easier to just
always set up the interrupt controller so drivers don't need to worry
about it.

> +	ret = mfd_add_devices(tps80031->dev, -1,
> +			tps80031_cell, ARRAY_SIZE(tps80031_cell),
> +			NULL, tps80031->irq_base,
> +			regmap_irq_get_domain(tps80031->irq_data));

If you're supplying a domain you shouldn't need to provide an irq_base,
the domain fulfuls the same role better.

> +static int __devexit tps80031_remove(struct i2c_client *client)
> +{
> +	struct tps80031 *tps80031 = i2c_get_clientdata(client);
> +	int i;
> +
> +	mfd_remove_devices(tps80031->dev);
> +
> +	if (client->irq)
> +		free_irq(client->irq, tps80031);

regmap_irq_exit()

> +#ifdef CONFIG_PM_SLEEP
> +static int tps80031_suspend(struct device *dev)
> +{
> +	struct i2c_client *client = to_i2c_client(dev);
> +
> +	if (client->irq)
> +		disable_irq(client->irq);

The interrupt core should take care of this for you if it's important,
and note that people often use things like RTC alarms to wake the
system.

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

  reply	other threads:[~2012-11-05 10:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-05  9:44 [PATCH 0/2] tps80031: Add mfd and regulator driver Laxman Dewangan
2012-11-05  9:44 ` [PATCH 1/2] mfd: add TI TPS80031 mfd core driver Laxman Dewangan
2012-11-05 10:31   ` Mark Brown [this message]
2012-11-05  9:44 ` [PATCH 2/2] regulator: tps80031: add regulator driver for tps80031 Laxman Dewangan
2012-11-05 10:42   ` Mark Brown
2012-11-05 12:00     ` Laxman Dewangan
2012-11-06  8:16       ` Mark Brown
2012-11-06  8:33         ` Laxman Dewangan

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=20121105103130.GB1385@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=sameo@linux.intel.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