mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Raphaël Poggi" <poggi.raph@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] pinctrl: at91: add driver data
Date: Mon, 8 Sep 2014 15:46:50 +0200	[thread overview]
Message-ID: <20140908134650.GP5352@pengutronix.de> (raw)
In-Reply-To: <1410181677-17441-2-git-send-email-poggi.raph@gmail.com>

On Mon, Sep 08, 2014 at 03:07:55PM +0200, Raphaël Poggi wrote:
> This commit adds the driver data for the gpio-at91 driver.


Could you explain what exactly this patch fixes? It seems without this
patch the pinctrl part is non functional. Is this correct?

Sascha

> 
> Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com>
> ---
>  drivers/pinctrl/pinctrl-at91.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
> index d3423d0..29e54cf 100644
> --- a/drivers/pinctrl/pinctrl-at91.c
> +++ b/drivers/pinctrl/pinctrl-at91.c
> @@ -606,8 +606,10 @@ static struct gpio_ops at91_gpio_ops = {
>  static struct of_device_id at91_gpio_dt_ids[] = {
>  	{
>  		.compatible = "atmel,at91rm9200-gpio",
> +                .data = (unsigned long)&at91rm9200_ops,
>  	}, {
>  		.compatible = "atmel,at91sam9x5-gpio",
> +		.data = (unsigned long)&at91sam9x5_ops,
>  	}, {
>  		/* sentinel */
>  	},
> @@ -629,6 +631,12 @@ static int at91_gpio_probe(struct device_d *dev)
>  
>  	at91_gpio = &gpio_chip[alias_idx];
>  
> +	ret = dev_get_drvdata(dev, (unsigned long *)&at91_gpio->ops);
> +        if (ret) {
> +                dev_err(dev, "dev_get_drvdata failed: %d\n", ret);
> +                return ret;
> +        }
> +
>  	clk = clk_get(dev, NULL);
>  	if (IS_ERR(clk)) {
>  		ret = PTR_ERR(clk);
> @@ -667,8 +675,10 @@ static int at91_gpio_probe(struct device_d *dev)
>  static struct platform_device_id at91_gpio_ids[] = {
>  	{
>  		.name = "at91rm9200-gpio",
> +                .driver_data = (unsigned long)&at91rm9200_ops,
>  	}, {
>  		.name = "at91sam9x5-gpio",
> +		.driver_data = (unsigned long)&at91sam9x5_ops,
>  	}, {
>  		/* sentinel */
>  	},
> -- 
> 2.1.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2014-09-08 13:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08 13:07 [PATCH] mach-at91: declare device tree clock Raphaël Poggi
2014-09-08 13:07 ` [PATCH] pinctrl: at91: add driver data Raphaël Poggi
2014-09-08 13:46   ` Sascha Hauer [this message]
2014-09-08 13:07 ` [PATCH] pinctrl: at91: fix the pin_to_controller function Raphaël Poggi
2014-09-08 13:07 ` [PATCH] pinctrl: at91: retrieve device id in non dtb probe Raphaël Poggi
2014-09-08 13:37 ` [PATCH] mach-at91: declare device tree clock Sascha Hauer

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=20140908134650.GP5352@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=poggi.raph@gmail.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