diff mbox series

[v1,2/2] spi: pxa2xx: Make num_chipselect 8-bit in the struct pxa2xx_spi_controller

Message ID 20240307160823.3800932-3-andriy.shevchenko@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series spi: pxa2xx: Clean up linux/spi/pxa2xx_spi.h | expand

Commit Message

Andy Shevchenko March 7, 2024, 4:07 p.m. UTC
There is no use for whole 16-bit for the number of chip select pins.
Drop it to 8 bits.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/spi/pxa2xx_spi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Arnd Bergmann March 7, 2024, 4:37 p.m. UTC | #1
On Thu, Mar 7, 2024, at 17:07, Andy Shevchenko wrote:
> There is no use for whole 16-bit for the number of chip select pins.
> Drop it to 8 bits.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Acked-by: Arnd Bergmann <arnd@arndb.de>

> ---
>  include/linux/spi/pxa2xx_spi.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/spi/pxa2xx_spi.h b/include/linux/spi/pxa2xx_spi.h
> index 56aba2f737b1..e5a4a045fb67 100644
> --- a/include/linux/spi/pxa2xx_spi.h
> +++ b/include/linux/spi/pxa2xx_spi.h
> @@ -17,7 +17,7 @@ struct dma_chan;
>   * (resides in device.platform_data).
>   */
>  struct pxa2xx_spi_controller {
> -	u16 num_chipselect;
> +	u8 num_chipselect;
>  	u8 enable_dma;
>  	u8 dma_burst_size;
>  	bool is_target;

I wonder if we could just move the entire header to drivers/spi/.
The spitz board only fills the num_chipselect field anyway,
and that could be derived from the GPIO lookups instead.

      Arnd
Andy Shevchenko March 7, 2024, 4:53 p.m. UTC | #2
On Thu, Mar 07, 2024 at 05:37:17PM +0100, Arnd Bergmann wrote:
> On Thu, Mar 7, 2024, at 17:07, Andy Shevchenko wrote:

...

> Acked-by: Arnd Bergmann <arnd@arndb.de>

Thanks!

...

> I wonder if we could just move the entire header to drivers/spi/.
> The spitz board only fills the num_chipselect field anyway,
> and that could be derived from the GPIO lookups instead.

It seems to be used by drivers/soc/pxa/ssp.c.
Andy Shevchenko March 7, 2024, 4:55 p.m. UTC | #3
On Thu, Mar 07, 2024 at 06:53:44PM +0200, Andy Shevchenko wrote:
> On Thu, Mar 07, 2024 at 05:37:17PM +0100, Arnd Bergmann wrote:
> > On Thu, Mar 7, 2024, at 17:07, Andy Shevchenko wrote:

...

> > I wonder if we could just move the entire header to drivers/spi/.
> > The spitz board only fills the num_chipselect field anyway,
> > and that could be derived from the GPIO lookups instead.
> 
> It seems to be used by drivers/soc/pxa/ssp.c.

At closer look it seems a leftover!
diff mbox series

Patch

diff --git a/include/linux/spi/pxa2xx_spi.h b/include/linux/spi/pxa2xx_spi.h
index 56aba2f737b1..e5a4a045fb67 100644
--- a/include/linux/spi/pxa2xx_spi.h
+++ b/include/linux/spi/pxa2xx_spi.h
@@ -17,7 +17,7 @@  struct dma_chan;
  * (resides in device.platform_data).
  */
 struct pxa2xx_spi_controller {
-	u16 num_chipselect;
+	u8 num_chipselect;
 	u8 enable_dma;
 	u8 dma_burst_size;
 	bool is_target;