2024-04-17 15:19:46

by Andy Shevchenko

[permalink] [raw]
Subject: [PATCH v3 0/9] spi: pxa2xx: Drop linux/spi/pxa2xx_spi.h

As Arnd suggested we may drop linux/spi/pxa2xx_spi.h as most of
its content is being used solely internally to SPI subsystem
(PXA2xx drivers). Hence this refactoring series with the additional
win of getting rid of legacy documentation.

Note, that we have the only user of a single plain integer field
in the entire kernel for that. Switching to software nodes does not
diminish any of type checking as we only pass an integer.

On top of that it includes the previously sent "spi: pxa2xx: Cleanup
(part 2)" series that makes effort to clean up even more things.

Changelog v3:
- added new patches that were previously sent separately
([email protected])
- extended cover letter a bit to explain that the replacement is
not worse than the current approach
- v2: [email protected]

Changelog v2:
- dropped applied patches
- added patch to amend dependencies (Mark)
- amended the second patch accordingly (Mark)
- elaborated purpose of the patch 6 in the commit message (Mark)
- v1: [email protected]

Cc: Arnd Bergmann <[email protected]>

Andy Shevchenko (9):
spi: pxa2xx: Allow number of chip select pins to be read from property
spi: pxa2xx: Provide num-cs for Sharp PDAs via device properties
spi: pxa2xx: Move contents of linux/spi/pxa2xx_spi.h to a local one
spi: pxa2xx: Remove outdated documentation
spi: pxa2xx: Don't use "proxy" headers
spi: pxa2xx: Drop struct pxa2xx_spi_chip
spi: pxa2xx: Remove DMA parameters from struct chip_data
spi: pxa2xx: Remove timeout field from struct chip_data
spi: pxa2xx: Don't provide struct chip_data for others

Documentation/spi/pxa2xx.rst | 208 ---------------------------------
arch/arm/mach-pxa/spitz.c | 25 ++--
drivers/spi/Kconfig | 3 +-
drivers/spi/spi-pxa2xx-dma.c | 38 ++----
drivers/spi/spi-pxa2xx-pci.c | 10 +-
drivers/spi/spi-pxa2xx.c | 94 +++++----------
drivers/spi/spi-pxa2xx.h | 42 +++----
include/linux/spi/pxa2xx_spi.h | 48 --------
8 files changed, 87 insertions(+), 381 deletions(-)
delete mode 100644 Documentation/spi/pxa2xx.rst
delete mode 100644 include/linux/spi/pxa2xx_spi.h

--
2.43.0.rc1.1336.g36b5255a03ac



2024-04-17 15:34:50

by Andy Shevchenko

[permalink] [raw]
Subject: [PATCH v3 3/9] spi: pxa2xx: Move contents of linux/spi/pxa2xx_spi.h to a local one

There is no user of the linux/spi/pxa2xx_spi.h. Move its contents
to the drivers/spi/spi-pxa2xx.h.

Suggested-by: Arnd Bergmann <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/spi/spi-pxa2xx-dma.c | 1 -
drivers/spi/spi-pxa2xx-pci.c | 4 +--
drivers/spi/spi-pxa2xx.c | 1 -
drivers/spi/spi-pxa2xx.h | 36 ++++++++++++++++++++++++-
include/linux/spi/pxa2xx_spi.h | 48 ----------------------------------
5 files changed, 37 insertions(+), 53 deletions(-)
delete mode 100644 include/linux/spi/pxa2xx_spi.h

diff --git a/drivers/spi/spi-pxa2xx-dma.c b/drivers/spi/spi-pxa2xx-dma.c
index be563f0dd03a..26416ced6505 100644
--- a/drivers/spi/spi-pxa2xx-dma.c
+++ b/drivers/spi/spi-pxa2xx-dma.c
@@ -12,7 +12,6 @@
#include <linux/scatterlist.h>
#include <linux/sizes.h>

-#include <linux/spi/pxa2xx_spi.h>
#include <linux/spi/spi.h>

#include "spi-pxa2xx.h"
diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
index 861b21c63504..e11a613bc340 100644
--- a/drivers/spi/spi-pxa2xx-pci.c
+++ b/drivers/spi/spi-pxa2xx-pci.c
@@ -10,11 +10,11 @@
#include <linux/pci.h>
#include <linux/platform_device.h>

-#include <linux/spi/pxa2xx_spi.h>
-
#include <linux/dmaengine.h>
#include <linux/platform_data/dma-dw.h>

+#include "spi-pxa2xx.h"
+
#define PCI_DEVICE_ID_INTEL_QUARK_X1000 0x0935
#define PCI_DEVICE_ID_INTEL_BYT 0x0f0e
#define PCI_DEVICE_ID_INTEL_MRFLD 0x1194
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index ab6fd55237cd..82633682b581 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -24,7 +24,6 @@
#include <linux/property.h>
#include <linux/slab.h>

-#include <linux/spi/pxa2xx_spi.h>
#include <linux/spi/spi.h>

#include "spi-pxa2xx.h"
diff --git a/drivers/spi/spi-pxa2xx.h b/drivers/spi/spi-pxa2xx.h
index 45cdbbc71c4b..08296729ea80 100644
--- a/drivers/spi/spi-pxa2xx.h
+++ b/drivers/spi/spi-pxa2xx.h
@@ -7,6 +7,7 @@
#ifndef SPI_PXA2XX_H
#define SPI_PXA2XX_H

+#include <linux/dmaengine.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/types.h>
@@ -15,7 +16,40 @@
#include <linux/pxa2xx_ssp.h>

struct gpio_desc;
-struct pxa2xx_spi_controller;
+
+/*
+ * The platform data for SSP controller devices
+ * (resides in device.platform_data).
+ */
+struct pxa2xx_spi_controller {
+ u8 num_chipselect;
+ u8 enable_dma;
+ u8 dma_burst_size;
+ bool is_target;
+
+ /* DMA engine specific config */
+ dma_filter_fn dma_filter;
+ void *tx_param;
+ void *rx_param;
+
+ /* For non-PXA arches */
+ struct ssp_device ssp;
+};
+
+/*
+ * The controller specific data for SPI target devices
+ * (resides in spi_board_info.controller_data),
+ * copied to spi_device.platform_data ... mostly for
+ * DMA tuning.
+ */
+struct pxa2xx_spi_chip {
+ u8 tx_threshold;
+ u8 tx_hi_threshold;
+ u8 rx_threshold;
+ u8 dma_burst_size;
+ u32 timeout;
+};
+
struct spi_controller;
struct spi_device;
struct spi_transfer;
diff --git a/include/linux/spi/pxa2xx_spi.h b/include/linux/spi/pxa2xx_spi.h
deleted file mode 100644
index e5a4a045fb67..000000000000
--- a/include/linux/spi/pxa2xx_spi.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs
- */
-#ifndef __LINUX_SPI_PXA2XX_SPI_H
-#define __LINUX_SPI_PXA2XX_SPI_H
-
-#include <linux/dmaengine.h>
-#include <linux/types.h>
-
-#include <linux/pxa2xx_ssp.h>
-
-struct dma_chan;
-
-/*
- * The platform data for SSP controller devices
- * (resides in device.platform_data).
- */
-struct pxa2xx_spi_controller {
- u8 num_chipselect;
- u8 enable_dma;
- u8 dma_burst_size;
- bool is_target;
-
- /* DMA engine specific config */
- dma_filter_fn dma_filter;
- void *tx_param;
- void *rx_param;
-
- /* For non-PXA arches */
- struct ssp_device ssp;
-};
-
-/*
- * The controller specific data for SPI target devices
- * (resides in spi_board_info.controller_data),
- * copied to spi_device.platform_data ... mostly for
- * DMA tuning.
- */
-struct pxa2xx_spi_chip {
- u8 tx_threshold;
- u8 tx_hi_threshold;
- u8 rx_threshold;
- u8 dma_burst_size;
- u32 timeout;
-};
-
-#endif /* __LINUX_SPI_PXA2XX_SPI_H */
--
2.43.0.rc1.1336.g36b5255a03ac


2024-04-25 11:41:20

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v3 0/9] spi: pxa2xx: Drop linux/spi/pxa2xx_spi.h

On Wed, Apr 17, 2024 at 01:54:27PM +0300, Andy Shevchenko wrote:
> As Arnd suggested we may drop linux/spi/pxa2xx_spi.h as most of
> its content is being used solely internally to SPI subsystem
> (PXA2xx drivers). Hence this refactoring series with the additional
> win of getting rid of legacy documentation.
>
> Note, that we have the only user of a single plain integer field
> in the entire kernel for that. Switching to software nodes does not
> diminish any of type checking as we only pass an integer.
>
> On top of that it includes the previously sent "spi: pxa2xx: Cleanup
> (part 2)" series that makes effort to clean up even more things.

Any chance to have a fresh look at this?

--
With Best Regards,
Andy Shevchenko



2024-05-01 14:18:54

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH v3 0/9] spi: pxa2xx: Drop linux/spi/pxa2xx_spi.h

On Thu, Apr 25, 2024 at 02:40:29PM +0300, Andy Shevchenko wrote:

> Any chance to have a fresh look at this?

Please don't send content free pings and please allow a reasonable time
for review. People get busy, go on holiday, attend conferences and so
on so unless there is some reason for urgency (like critical bug fixes)
please allow at least a couple of weeks for review. If there have been
review comments then people may be waiting for those to be addressed.

Sending content free pings adds to the mail volume (if they are seen at
all) which is often the problem and since they can't be reviewed
directly if something has gone wrong you'll have to resend the patches
anyway, so sending again is generally a better approach though there are
some other maintainers who like them - if in doubt look at how patches
for the subsystem are normally handled.


Attachments:
(No filename) (877.00 B)
signature.asc (499.00 B)
Download all attachments

2024-05-02 08:09:30

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH v3 3/9] spi: pxa2xx: Move contents of linux/spi/pxa2xx_spi.h to a local one

On Wed, Apr 17, 2024 at 1:04 PM Andy Shevchenko
<[email protected]> wrote:

> There is no user of the linux/spi/pxa2xx_spi.h. Move its contents
> to the drivers/spi/spi-pxa2xx.h.
>
> Suggested-by: Arnd Bergmann <[email protected]>
> Signed-off-by: Andy Shevchenko <[email protected]>

Reviewed-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij