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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tue, 15 Apr 2014 10:33:06 +0200 от Linus Walleij <linus.walleij@xxxxxxxxxx>:
> 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@xxxxxxxxx>
> Cc: Ulf Hansson <ulf.hansson@xxxxxxxxxx>
> Cc: Russell King <linux@xxxxxxxxxxxxxxxx>
> Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
> ---
> 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.

---

��.n��������+%������w��{.n�����{��i��)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥





[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux