mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	"open list:BAREBOX" <barebox@lists.infradead.org>
Subject: Re: [PATCH 3/3] spi: spi-gpio: switch to new gpio binding
Date: Thu, 26 Sep 2024 08:09:44 +0200	[thread overview]
Message-ID: <42e379a1-412b-4f46-81db-7dbd270d0dfd@pengutronix.de> (raw)
In-Reply-To: <20240925-spi-gpio-v1-3-47f6285b3bf1@pengutronix.de>

Hello Sascha,

On 25.09.24 16:06, Sascha Hauer wrote:
> The old deprecated device tree binding for the spi-gpio driver uses
> "gpio-sck", "gpio-mosi" and "gpio-miso" to specify the GPIOs. Switch to
> the new binding which uses the standard GPIO property names.
> 
> The old binding is still used in some device trees, but none of the SoCs
> using them is actually supported in barebox, so do not bother to keep a
> fallback to the old binding. The one in-tree user of the old binding is
> converted in this patch.

There is one more user in sandbox-libftdi-example.dtsi. Please fix that as well.

Also, while you are it, why not switch over to the GPIOD API? :-)

Cheers,
Ahmad

> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  arch/arm/dts/stm32mp151-mect1s.dts | 6 +++---
>  drivers/spi/gpio_spi.c             | 6 +++---
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/dts/stm32mp151-mect1s.dts b/arch/arm/dts/stm32mp151-mect1s.dts
> index 4d0e31d189..b0dc1cfaa8 100644
> --- a/arch/arm/dts/stm32mp151-mect1s.dts
> +++ b/arch/arm/dts/stm32mp151-mect1s.dts
> @@ -65,9 +65,9 @@ led-1 {
>  
>  	spi_gpio: spi-gpio-0 {
>  		compatible = "spi-gpio";
> -		gpio-sck = <&gpioi 1 GPIO_ACTIVE_HIGH>;
> -		gpio-mosi = <&gpioi 3 GPIO_ACTIVE_HIGH>;
> -		gpio-miso = <&gpioi 2 GPIO_ACTIVE_HIGH>;
> +		sck-gpios = <&gpioi 1 GPIO_ACTIVE_HIGH>;
> +		mosi-gpios = <&gpioi 3 GPIO_ACTIVE_HIGH>;
> +		miso-gpios = <&gpioi 2 GPIO_ACTIVE_HIGH>;
>  		cs-gpios = <&gpioj 3 GPIO_ACTIVE_LOW>;
>  		num-chipselects = <1>;
>  		#address-cells = <1>;
> diff --git a/drivers/spi/gpio_spi.c b/drivers/spi/gpio_spi.c
> index c76b71f610..34d74faf4c 100644
> --- a/drivers/spi/gpio_spi.c
> +++ b/drivers/spi/gpio_spi.c
> @@ -178,7 +178,7 @@ static int gpio_spi_of_probe(struct device *dev)
>  	if (!IS_ENABLED(CONFIG_OFDEVICE) || dev->platform_data)
>  		return 0;
>  
> -	sck = of_get_named_gpio(np, "gpio-sck", 0);
> +	sck = of_get_named_gpio(np, "sck-gpios", 0);
>  	if (!gpio_is_valid(sck))
>  		return dev_err_probe(dev, sck < 0 ? sck : -EINVAL,
>  				     "missing mandatory SCK gpio\n");
> @@ -187,11 +187,11 @@ static int gpio_spi_of_probe(struct device *dev)
>  	pdata->sck = sck;
>  	pdata->num_cs = MAX_CHIPSELECT;
>  
> -	pdata->miso = of_get_named_gpio(np, "gpio-miso", 0);
> +	pdata->miso = of_get_named_gpio(np, "miso-gpios", 0);
>  	if (!gpio_is_valid(pdata->miso))
>  		pdata->miso = SPI_GPIO_NO_MISO;
>  
> -	pdata->mosi = of_get_named_gpio(np, "gpio-mosi", 0);
> +	pdata->mosi = of_get_named_gpio(np, "mosi-gpios", 0);
>  	if (!gpio_is_valid(pdata->mosi))
>  		pdata->mosi = SPI_GPIO_NO_MOSI;
>  
> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



  reply	other threads:[~2024-09-26  6:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 14:06 [PATCH 0/3] spi-gpio updates Sascha Hauer
2024-09-25 14:06 ` [PATCH 1/3] spi: spi-gpio: actually delay in spidelay() Sascha Hauer
2024-09-26  5:55   ` Ahmad Fatoum
2024-09-26  7:05     ` Sascha Hauer
2024-09-25 14:06 ` [PATCH 2/3] spi: spi-gpio: support different word widths Sascha Hauer
2024-09-26  6:07   ` Ahmad Fatoum
2024-09-26  7:16     ` Sascha Hauer
2024-09-25 14:06 ` [PATCH 3/3] spi: spi-gpio: switch to new gpio binding Sascha Hauer
2024-09-26  6:09   ` Ahmad Fatoum [this message]
2024-09-26  8:19     ` 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=42e379a1-412b-4f46-81db-7dbd270d0dfd@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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