mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Laxman Dewangan <ldewangan@nvidia.com>
Cc: lee.jones@linaro.org, sameo@linux.intel.com,
	linus.walleij@linaro.org, akpm@linux-foundation.org,
	devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
	rtc-linux@googlegroups.com, rob.herring@calxeda.com,
	mark.rutland@arm.com, pawel.moll@arm.com, swarren@wwwdotorg.org,
	rob@landley.net, ijc+devicetree@hellion.org.uk,
	grant.likely@linaro.org, florian.lobmaier@ams.com
Subject: Re: [PATCH 1/4] mfd: add support for AMS AS3722 PMIC
Date: Tue, 17 Sep 2013 12:24:44 +0100	[thread overview]
Message-ID: <20130917112444.GU21013@sirena.org.uk> (raw)
In-Reply-To: <1379400338-20704-2-git-send-email-ldewangan@nvidia.com>

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

On Tue, Sep 17, 2013 at 12:15:35PM +0530, Laxman Dewangan wrote:

> +MFD driver adds following mfd devices with their compatible values:
> +as3722-gpio: The compatible value of this as3722 gpio driver is
> +	     "ams,as3722-gpio";
> +as3722-regulator: The compatible value of this as3722 regulator driver is
> +	     "ams,as3722-regulator";
> +as3722-rtc: The compatible value of this as3722 rtc driver is
> +	     "ams,as3722-rtc";
> +as3722-adc: The compatible value of this as3722 adc driver is
> +	     "ams,as3722-adc";
> +as3722-power-off: he compatible value of this as3722 power off driver is
> +	     "ams,as3722-power-off".

Personally I find this to be exposing implementation details of Linux -
unless there is something reusable about the binding that'd allow it to
be used to describe the contents of the chip the subnodes really aren't 
adding any information that wasn't present from just knowing the parent
chip.  If there were relocatable IPs it'd be a bit different.

> +#define reg_range(min, max)	{.range_min = min, .range_max = max,}
> +static const struct regmap_range as3722_readable_ranges[] = {
> +	reg_range(AS3722_SD0_VOLTAGE_REG, AS3722_SD6_VOLTAGE_REG),
> +	reg_range(AS3722_GPIO0_CONTROL_REG, AS3722_LDO7_VOLTAGE_REG),

If this macro is useful it should be a generic thing in the header, not
done driver local.

> +static const struct regmap_access_table as3722_volatile_table = {
> +	.no_ranges = as3722_voltaile_ranges,
> +	.n_no_ranges = ARRAY_SIZE(as3722_voltaile_ranges),
> +};

This looks wrong - the registers listed in _volatile_ranges are in fact
the ones that are not volatile.  I'd rename _volatile_ranges to
something like _cacheable_ranges.

> +static int __init as3722_i2c_init(void)
> +{
> +	return i2c_add_driver(&as3722_i2c_driver);
> +}
> +subsys_initcall(as3722_i2c_init);
> +
> +static void __exit as3722_i2c_exit(void)
> +{
> +	i2c_del_driver(&as3722_i2c_driver);
> +}
> +module_exit(as3722_i2c_exit);

Modern systems should be able to use module_i2c_driver() and deferred
probing - is this not working well?

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

  parent reply	other threads:[~2013-09-17 11:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-17  6:45 [PATCH 0/4] Add AMS AS3722 mfd, GPIO, regulator and RTC driver Laxman Dewangan
2013-09-17  6:45 ` [PATCH 1/4] mfd: add support for AMS AS3722 PMIC Laxman Dewangan
2013-09-17  8:02   ` Lee Jones
2013-09-17 11:24   ` Mark Brown [this message]
2013-09-17 12:03     ` Laxman Dewangan
2013-09-17 12:22       ` Laxman Dewangan
2013-09-23 16:45   ` Stephen Warren
2013-09-17  6:45 ` [PATCH 2/4] gpio: add support for AMS AS3722 gpio driver Laxman Dewangan
2013-09-23 16:53   ` Stephen Warren
2013-09-17  6:45 ` [PATCH 3/4] regulator: as3722: add regulator driver for AMS AS3722 Laxman Dewangan
2013-09-17 11:41   ` Mark Brown
2013-09-17 12:15     ` Laxman Dewangan
2013-09-23 16:58   ` Stephen Warren
2013-09-17  6:45 ` [PATCH 4/4] drivers/rtc/rtc-as3722: add RTC driver Laxman Dewangan
2013-09-17 11:43   ` 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=20130917112444.GU21013@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=devicetree@vger.kernel.org \
    --cc=florian.lobmaier@ams.com \
    --cc=grant.likely@linaro.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=ldewangan@nvidia.com \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=rtc-linux@googlegroups.com \
    --cc=sameo@linux.intel.com \
    --cc=swarren@wwwdotorg.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

all inboxes | Powered by JetHome®