Re: [PATCH] mmc: mmci: switch the driver to using gpio descriptors

Alexander Shiyan shc_work at mail.ru
Tue Apr 15 01:43:55 PDT 2014


Tue, 15 Apr 2014 10:33:06 +0200 от Linus Walleij <linus.walleij at linaro.org>:
> The next step in modernization of GPIO is to let drivers handle
> descriptors rather than integer numbers representing GPIO pins,
> akin to how clocks or regulators are already handled today.
> 
> This patch makes the MMCI driver use GPIO descriptos in the
> core code with fallback code using the platform data if that
> is not possible. After all platforms with MMCI have been
> migrated to use descriptors, the platform data entries for
> GPIO pins can be removed.
> 
> Cc: Alexandre Courbot <gnurou at gmail.com>
> Cc: Ulf Hansson <ulf.hansson at linaro.org>
> Cc: Russell King <linux at arm.linux.org.uk>
> Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
> ---
> Hi Russell,Ulf: there is no hurry to do these changes (only used
> for my very corner-case MMCI PL181 experiments) but it's the
> desired direction to use descriptors for GPIOs going forward.
> I can rebase this on top of Ulf's patch stack any time, no
> problem.
> ---
...
>  static void mmci_dt_populate_generic_pdata(struct device_node *np,
> -					struct mmci_platform_data *pdata)
> +					   struct mmci_platform_data *pdata)
>  {
>  	int bus_width = 0;
>  
> -	pdata->gpio_wp = of_get_named_gpio(np, "wp-gpios", 0);
> -	pdata->gpio_cd = of_get_named_gpio(np, "cd-gpios", 0);
> -
>  	if (of_get_property(np, "cd-inverted", NULL))
>  		pdata->cd_invert = true;

You could even eliminate "cd-inverted" property for DT case.

---



More information about the linux-arm-kernel mailing list