All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Tony Lindgren <tony@atomide.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
	Samuel Ortiz <sameo@linux.intel.com>
Subject: Re: [PATCH 1/5] mfd: twl-core: Fix passing of platform data in the device tree case
Date: Mon, 18 Nov 2013 10:29:07 +0000	[thread overview]
Message-ID: <20131118102907.GC13640@lee--X1> (raw)
In-Reply-To: <1384562167-14725-2-git-send-email-tony@atomide.com>

> Since we still need to rely on a mix of device tree initialized
> drivers and legacy platform data initialize drivers, let's fix
> the passing of platform data to twl4030-gpio.
> 
> As the twl4030 GPIO is initialized by twl-core.c, we need to register
> the auxdata for twl4030 GPIO in twl-core.c.
> 
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> 
> Samuel & Lee, I'd like to merge this fix via arm-soc tree if this looks
> OK to you as I have other patches that depend on this.
> 
> ---
>  drivers/mfd/twl-core.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
> index 29473c2..d5b3dd8 100644
> --- a/drivers/mfd/twl-core.c
> +++ b/drivers/mfd/twl-core.c
> @@ -1133,6 +1133,11 @@ static int twl_remove(struct i2c_client *client)
>  	return 0;
>  }
>  
> +static struct of_dev_auxdata twl_auxdata_lookup[] = {
> +	OF_DEV_AUXDATA("ti,twl4030-gpio", 0, "twl4030-gpio", NULL),
> +	{ /* sentinel */ },
> +};
> +
>  /* NOTE: This driver only handles a single twl4030/tps659x0 chip */
>  static int
>  twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
> @@ -1271,10 +1276,14 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
>  		twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1);
>  	}
>  
> -	if (node)
> -		status = of_platform_populate(node, NULL, NULL, &client->dev);
> -	else
> +	if (node) {
> +		if (pdata)
> +			twl_auxdata_lookup[0].platform_data = pdata->gpio;
> +		status = of_platform_populate(node, NULL, twl_auxdata_lookup,
> +					      &client->dev);
> +	} else {
>  		status = add_children(pdata, irq_base, id->driver_data);

Why doesn't the TWL driver use the MFD framework for this stuff?

> +	}
>  
>  fail:
>  	if (status < 0)

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/5] mfd: twl-core: Fix passing of platform data in the device tree case
Date: Mon, 18 Nov 2013 10:29:07 +0000	[thread overview]
Message-ID: <20131118102907.GC13640@lee--X1> (raw)
In-Reply-To: <1384562167-14725-2-git-send-email-tony@atomide.com>

> Since we still need to rely on a mix of device tree initialized
> drivers and legacy platform data initialize drivers, let's fix
> the passing of platform data to twl4030-gpio.
> 
> As the twl4030 GPIO is initialized by twl-core.c, we need to register
> the auxdata for twl4030 GPIO in twl-core.c.
> 
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> 
> Samuel & Lee, I'd like to merge this fix via arm-soc tree if this looks
> OK to you as I have other patches that depend on this.
> 
> ---
>  drivers/mfd/twl-core.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
> index 29473c2..d5b3dd8 100644
> --- a/drivers/mfd/twl-core.c
> +++ b/drivers/mfd/twl-core.c
> @@ -1133,6 +1133,11 @@ static int twl_remove(struct i2c_client *client)
>  	return 0;
>  }
>  
> +static struct of_dev_auxdata twl_auxdata_lookup[] = {
> +	OF_DEV_AUXDATA("ti,twl4030-gpio", 0, "twl4030-gpio", NULL),
> +	{ /* sentinel */ },
> +};
> +
>  /* NOTE: This driver only handles a single twl4030/tps659x0 chip */
>  static int
>  twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
> @@ -1271,10 +1276,14 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
>  		twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1);
>  	}
>  
> -	if (node)
> -		status = of_platform_populate(node, NULL, NULL, &client->dev);
> -	else
> +	if (node) {
> +		if (pdata)
> +			twl_auxdata_lookup[0].platform_data = pdata->gpio;
> +		status = of_platform_populate(node, NULL, twl_auxdata_lookup,
> +					      &client->dev);
> +	} else {
>  		status = add_children(pdata, irq_base, id->driver_data);

Why doesn't the TWL driver use the MFD framework for this stuff?

> +	}
>  
>  fail:
>  	if (status < 0)

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

  reply	other threads:[~2013-11-18 10:29 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-16  0:36 [PATCH 0/5] Prepare making omap3 device tree only and convert LDP Tony Lindgren
2013-11-16  0:36 ` Tony Lindgren
2013-11-16  0:36 ` [PATCH 1/5] mfd: twl-core: Fix passing of platform data in the device tree case Tony Lindgren
2013-11-16  0:36   ` Tony Lindgren
2013-11-18 10:29   ` Lee Jones [this message]
2013-11-18 10:29     ` Lee Jones
2013-11-18 17:25     ` Felipe Balbi
2013-11-18 17:25       ` Felipe Balbi
2013-11-18 17:46       ` Lee Jones
2013-11-18 17:46         ` Lee Jones
2013-11-18 18:11         ` Tony Lindgren
2013-11-18 18:11           ` Tony Lindgren
2013-11-18 19:09           ` Lee Jones
2013-11-18 19:09             ` Lee Jones
2013-11-18 19:22             ` Tony Lindgren
2013-11-18 19:22               ` Tony Lindgren
2013-11-18 19:28               ` Lee Jones
2013-11-18 19:28                 ` Lee Jones
2013-11-18 19:33                 ` Tony Lindgren
2013-11-18 19:33                   ` Tony Lindgren
2013-11-21 10:46               ` Lee Jones
2013-11-21 10:46                 ` Lee Jones
2013-11-21 11:09                 ` Lee Jones
2013-11-21 11:09                   ` Lee Jones
2013-11-25 23:22                   ` Tony Lindgren
2013-11-25 23:22                     ` Tony Lindgren
2013-11-18 18:40         ` Felipe Balbi
2013-11-18 18:40           ` Felipe Balbi
2013-11-16  0:36 ` [PATCH 2/5] ARM: OMAP2+: Add support for legacy auxdata for twl Tony Lindgren
2013-11-16  0:36   ` Tony Lindgren
2013-11-16  0:36 ` [PATCH 3/5] ARM: OMAP2+: Add DT init code for DPI displays and make omap3 LDP to use it Tony Lindgren
2013-11-16  0:36   ` Tony Lindgren
2013-11-18 13:06   ` Tomi Valkeinen
2013-11-18 13:06     ` Tomi Valkeinen
2013-11-18 18:19     ` Tony Lindgren
2013-11-18 18:19       ` Tony Lindgren
2013-11-16  0:36 ` [PATCH 4/5] ARM: dts: Add basic support for omap3 LDP zoom1 labrador Tony Lindgren
2013-11-16  0:36   ` Tony Lindgren
2013-11-16  8:04   ` Sebastian Reichel
2013-11-16  8:04     ` Sebastian Reichel
2013-11-16 14:40     ` Tony Lindgren
2013-11-16 14:40       ` Tony Lindgren
2013-11-16  0:36 ` [PATCH 5/5] ARM: OMAP2+: Remove legacy booting support for LDP Tony Lindgren
2013-11-16  0:36   ` Tony Lindgren
2013-11-16 12:05 ` N900 board code in 3.14 Sebastian Reichel
2013-11-16 14:12   ` Tony Lindgren
2013-11-16 14:12     ` Tony Lindgren
2013-11-16 15:50     ` Sebastian Reichel
2013-11-16 15:50       ` Sebastian Reichel
2013-11-21 18:58       ` Tony Lindgren
2013-11-21 18:58         ` Tony Lindgren
2013-11-21 23:51         ` Sebastian Reichel
2013-11-21 23:51           ` Sebastian Reichel
2013-11-22 10:41           ` Javier Martinez Canillas
2013-11-22 10:41             ` Javier Martinez Canillas
2013-11-23 21:09             ` Sebastian Reichel
2013-11-23 21:09               ` Sebastian Reichel

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=20131118102907.GC13640@lee--X1 \
    --to=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=tony@atomide.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.