devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Cc: Mark Brown <broonie@kernel.org>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Guenter Roeck <linux@roeck-us.net>
Subject: Re: [PATCH v2 3/8] mfd: da9055: Add DT support for PMIC
Date: Fri, 7 Feb 2014 11:03:20 +0000	[thread overview]
Message-ID: <20140207110320.GM14727@lee--X1> (raw)
In-Reply-To: <46f41a14205ac39de3adb8c87d2a6dba557ad8d1.1391705989.git.Adam.Thomson.Opensource@diasemi.com>

> Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
> ---
>  Documentation/devicetree/bindings/mfd/da9055.txt |   73 ++++++++++++++++++++++
>  drivers/mfd/da9055-i2c.c                         |    8 +++

Can you break this up please.

Bindings should be separate to the binding document.

>  2 files changed, 81 insertions(+), 0 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/mfd/da9055.txt
> 
> diff --git a/Documentation/devicetree/bindings/mfd/da9055.txt b/Documentation/devicetree/bindings/mfd/da9055.txt
> new file mode 100644
> index 0000000..f903c3f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/da9055.txt
> @@ -0,0 +1,73 @@
> +* Dialog DA9055 Power Management Integrated Circuit (PMIC)
> +
> +DA9055 consists of a large and varied group of sub-devices (I2C Only):
> +
> +Device			 Supply Names	 Description
> +------			 ------------	 -----------
> +da9055-gpio		:		: GPIOs
> +da9055-regulator	:		: Regulators
> +da9055-onkey		:		: On key
> +da9055-rtc		:		: RTC
> +da9055-hwmon		:		: ADC
> +da9055-watchdog		:		: Watchdog
> +
> +The CODEC device in DA9055 has a separate, configurable I2C address and so
> +is instantiated separately from the PMIC.
> +
> +For details on accompanying CODEC I2C device, see the following:
> +Documentation/devicetree/bindings/sound/da9055.txt
> +
> +======
> +
> +Required properties:
> +- compatible : Should be "dlg,da9055-pmic"
> +- reg: Specifies the I2C slave address (defaults to 0x5a but can be modified)
> +- interrupt-parent: Specifies the phandle of the interrupt controller to which
> +  the IRQs from da9055 are delivered to.
> +- interrupts: IRQ line info for da9055 chip.
> +- interrupt-controller: da9055 has internal IRQs (has own IRQ domain).
> +- #interrupt-cells: Should be 1, is the local IRQ number for da9055.
> +
> +Sub-nodes:
> +- regulators : Contain the regulator nodes. The DA9055 regulators are
> +  bound using their names as listed below:
> +
> +    buck1     : regulator BUCK1
> +    buck2     : regulator BUCK2
> +    ldo1      : regulator LDO1
> +    ldo2      : regulator LDO2
> +    ldo3      : regulator LDO3
> +    ldo4      : regulator LDO4
> +    ldo5      : regulator LDO5
> +    ldo6      : regulator LDO6
> +
> +  The bindings details of individual regulator device can be found in:
> +  Documentation/devicetree/bindings/regulator/regulator.txt
> +
> +
> +Example:
> +
> +	pmic: da9055-pmic@5a {
> +		compatible = "dlg,da9055-pmic";
> +		reg = <0x5a>;
> +		interrupt-parent = <&intc>;
> +		interrupts = <5 0x8>;
> +		interrupt-controller;
> +		#interrupt-cells = <1>;
> +
> +		regulators {
> +			buck1: BUCK1 {
> +				regulator-min-microvolt = <725000>;
> +				regulator-max-microvolt = <2075000>;
> +			};
> +
> +			buck2: BUCK2 {
> +				regulator-min-microvolt = <925000>;
> +				regulator-max-microvolt = <2500000>;
> +			};
> +			ldo1: LDO1 {
> +				regulator-min-microvolt = <900000>;
> +				regulator-max-microvolt = <3300000>;
> +			};
> +		};
> +	};
> diff --git a/drivers/mfd/da9055-i2c.c b/drivers/mfd/da9055-i2c.c
> index 8103e43..366a3e2 100644
> --- a/drivers/mfd/da9055-i2c.c
> +++ b/drivers/mfd/da9055-i2c.c
> @@ -15,6 +15,8 @@
>  #include <linux/device.h>
>  #include <linux/i2c.h>
>  #include <linux/err.h>
> +#include <linux/of.h>
> +#include <linux/of_device.h>
> 
>  #include <linux/mfd/da9055/core.h>
> 
> @@ -66,6 +68,11 @@ static struct i2c_device_id da9055_i2c_id[] = {
>  };
>  MODULE_DEVICE_TABLE(i2c, da9055_i2c_id);
> 
> +static const struct of_device_id da9055_of_match[] = {
> +	{ .compatible = "dlg,da9055-pmic", .data = (void *)&da9055_i2c_id[0] },

Entangling the i2c_device_id table with the of_device_id table sounds
a bit too wacky for my liking. Where do you even use it?

> +	{ }
> +};
> +
>  static struct i2c_driver da9055_i2c_driver = {
>  	.probe = da9055_i2c_probe,
>  	.remove = da9055_i2c_remove,
> @@ -73,6 +80,7 @@ static struct i2c_driver da9055_i2c_driver = {
>  	.driver = {
>  		.name = "da9055-pmic",
>  		.owner = THIS_MODULE,
> +		.of_match_table = of_match_ptr(da9055_of_match),
>  	},
>  };
> 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2014-02-07 11:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 18:03 [PATCH v2 0/8] da9055: Driver initialisation fixes, add DT support Adam Thomson
2014-02-06 18:03 ` [PATCH v2 1/8] ASoC: da9055: Fix device registration of PMIC and CODEC devices Adam Thomson
     [not found]   ` <6a398d176b0b2bf8792d27bd5e2995fd96afb32d.1391705989.git.Adam.Thomson.Opensource-WBD+wuPFNBhBDgjK7y7TUQ@public.gmane.org>
2014-02-07 10:56     ` Lee Jones
2014-02-07 12:58       ` Mark Brown
2014-02-10 11:51         ` Lee Jones
2014-02-10 13:43   ` Mark Brown
     [not found]     ` <20140210134310.GH1757-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-02-10 13:59       ` Lee Jones
2014-02-10 14:14         ` Mark Brown
2014-02-10 14:42           ` Lee Jones
2014-02-10 14:51             ` Mark Brown
2014-02-06 18:03 ` [PATCH v2 2/8] ASoC: da9055: Add DT support for CODEC Adam Thomson
2014-02-07 16:25   ` Mark Brown
     [not found]     ` <20140207162504.GP32298-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-02-07 16:26       ` Mark Brown
2014-02-10 10:48         ` Opensource [Adam Thomson]
2014-02-06 18:03 ` [PATCH v2 3/8] mfd: da9055: Add DT support for PMIC Adam Thomson
2014-02-07 11:03   ` Lee Jones [this message]
2014-02-07 15:45     ` Opensource [Adam Thomson]
2014-02-06 18:03 ` [PATCH v2 4/8] regulator: da9055: Add DT support Adam Thomson
     [not found]   ` <9c9235270af15eb50bd2d5c20daa7a81858910a4.1391705989.git.Adam.Thomson.Opensource-WBD+wuPFNBhBDgjK7y7TUQ@public.gmane.org>
2014-02-07 16:31     ` Mark Brown
2014-02-06 18:03 ` [PATCH v2 5/8] onkey: da9055: Remove use of regmap_irq_get_virq() Adam Thomson
2014-02-06 18:03 ` [PATCH v2 6/8] hwmon: " Adam Thomson
2014-02-07  1:29   ` Guenter Roeck
2014-02-06 18:03 ` [PATCH v2 7/8] rtc: " Adam Thomson
     [not found] ` <cover.1391705989.git.Adam.Thomson.Opensource-WBD+wuPFNBhBDgjK7y7TUQ@public.gmane.org>
2014-02-06 18:03   ` [PATCH v2 8/8] regulator: " Adam Thomson
2014-02-07 16:31     ` 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=20140207110320.GM14727@lee--X1 \
    --to=lee.jones@linaro.org \
    --cc=Adam.Thomson.Opensource@diasemi.com \
    --cc=a.zummo@towertech.it \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=robh+dt@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;
as well as URLs for NNTP newsgroup(s).