public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: Laxman Dewangan <ldewangan@nvidia.com>
Cc: sameo@linux.intel.com, linux-doc@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org,
	broonie@opensource.wolfsonmicro.com,
	linux-kernel@vger.kernel.org, rob.herring@calxeda.com
Subject: Re: [PATCH RESEND 1/4] mfd: tps65090: add DT support for tps65090
Date: Mon, 28 Jan 2013 08:52:29 -0700	[thread overview]
Message-ID: <51069EBD.7060104@wwwdotorg.org> (raw)
In-Reply-To: <1359277035-16854-2-git-send-email-ldewangan@nvidia.com>

On 01/27/2013 01:57 AM, Laxman Dewangan wrote:
> Add device tree support for the TI PMIC TPS65090.
> The device can be registered through platform or DT.
> 
> Add device tree binding document for this device.

> diff --git a/Documentation/devicetree/bindings/regulator/tps65090.txt b/Documentation/devicetree/bindings/regulator/tps65090.txt

> +Required properties:
> +- compatible: "ti,tps65090"
> +- reg: I2C slave address
> +- interrupts: the interrupt outputs of the controller
> +- regulators: A node that houses a sub-node for each regulator within the
> +  device. Each sub-node is identified using the node's name (or the deprecated
> +  regulator-compatible property if present), with valid values listed below.

It may not be worth mentioning deprecated stuff in a new binding doc.

> +  The content of each sub-node is defined by the standard binding for
> +  regulators; see regulator.txt.
> +  dcdc[1-3], fet[1-7] and ldo[1-2] respectively.
> +- vsys[1-3]-supply: The input supply for DCDC[1-3] respectively.
> +- infet[1-7]-supply: The input supply for FET[1-7] respectively.
> +- vsys_l[1-2]-supply: The input supply for LDO[1-2] respectively.

_ in a DT property name is unusual; perhaps use - instead?

> +Optional properties:
> +- ti,enable-ext-control: This is applicable for DCDC1, DCDC2 and DCDC3.
> +  If DCDCs are externally controlled then this property should be there.
> +- gpio: This is applicable for DCDC1, DCDC2 and DCDC3. If DCDCs are
> +  extrenally controlled and if it is from GPIO then gpio number should

s/extrenally/externally/

GPIO should always be capitalized it text.

"gpio" is a rather generic property name. "dcdc-gpios" or
"dcdc-ext-control-gpios" might be better?

> diff --git a/drivers/mfd/tps65090.c b/drivers/mfd/tps65090.c

> @@ -155,9 +188,22 @@ static int tps65090_i2c_probe(struct i2c_client *client,
>  	struct tps65090 *tps65090;
>  	int ret;
>  
> -	if (!pdata) {
> +	if (client->dev.of_node) {
> +		const struct of_device_id *match;
> +
> +		match = of_match_device(of_match_ptr(tps65090_of_match),
> +				&client->dev);
> +		if (!match) {
> +			dev_err(&client->dev, "No match device found\n");
> +			return -ENODEV;
> +		}

Is that useful; "match" doesn't seem to be used anywhere, and this
driver won't be instantiated through DT unless the driver/I2C core found
a matching entry in tps65090_of_match already.

> +	if (!pdata && client->dev.of_node)
> +		pdata = of_get_tps65090_platform_data(&client->dev);
> +	if (IS_ERR_OR_NULL(pdata)) {
>  		dev_err(&client->dev, "tps65090 requires platform data\n");
> -		return -EINVAL;
> +		return (pdata) ? PTR_ERR(pdata) : -EINVAL;
>  	}

Does the driver really /require/ pdata?

  reply	other threads:[~2013-01-28 15:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-27  8:57 [PATCH RESEND 0/4] mfd/regulator: tps65090: add DT support and suspend/resume cleanups Laxman Dewangan
2013-01-27  8:57 ` [PATCH RESEND 1/4] mfd: tps65090: add DT support for tps65090 Laxman Dewangan
2013-01-28 15:52   ` Stephen Warren [this message]
2013-01-27  8:57 ` [PATCH RESEND 2/4] regulator: tps65090: add DT support Laxman Dewangan
2013-01-28 15:58   ` Stephen Warren
2013-01-27  8:57 ` [PATCH RESEND 3/4] mfd: tps65090: Pass irq domain when adding mfd sub devices Laxman Dewangan
2013-01-27  8:57 ` [PATCH RESEND 4/4] mfd: tps65090: remove suspend/resume callbacks 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=51069EBD.7060104@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=ldewangan@nvidia.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob.herring@calxeda.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