summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2024-03-26 14:46:40 +0300
committerMark Brown <broonie@kernel.org>2024-03-26 14:46:40 +0300
commit7f2f4caaf66624b6ece6801749fc47d804a6be16 (patch)
tree5bad51e5fdfa166268d263e3134810f1d34a63a8
parent9b163e0d330debbf7dcc14b2c3e2dc19a3b50a1d (diff)
parentb5867a5c0d7a6bf36f59f3d472c7aed33ca4d02c (diff)
downloadlinux-7f2f4caaf66624b6ece6801749fc47d804a6be16.tar.xz
spi: pxa2xx: Clean up linux/spi/pxa2xx_spi.h
Merge series from Andy Shevchenko <andriy.shevchenko@linux.intel.com>: A couple of cleanups against linux/spi/pxa2xx_spi.h. I'm sending this as v3 to land in the SPI subsystem. Meanwhile I'm preparing an update to make linux/spi/pxa2xx_spi.h private to the subsystem (PXA2xx driver). But the second part will be presented later on (likely after v6.9-rc1). That said, this can be routed either via SoC tree or SPI, up to respective maintainers.
-rw-r--r--Documentation/spi/pxa2xx.rst2
-rw-r--r--arch/arm/mach-pxa/devices.c18
-rw-r--r--arch/arm/mach-pxa/spitz.c14
-rw-r--r--drivers/soc/pxa/ssp.c2
-rw-r--r--include/linux/spi/pxa2xx_spi.h10
5 files changed, 16 insertions, 30 deletions
diff --git a/Documentation/spi/pxa2xx.rst b/Documentation/spi/pxa2xx.rst
index 43e0b758803a..33d2ad95901e 100644
--- a/Documentation/spi/pxa2xx.rst
+++ b/Documentation/spi/pxa2xx.rst
@@ -24,7 +24,7 @@ arch/.../mach-*/board-*.c as a "platform device". The host controller configurat
is passed to the driver via a table found in include/linux/spi/pxa2xx_spi.h::
struct pxa2xx_spi_controller {
- u16 num_chipselect;
+ u8 num_chipselect;
u8 enable_dma;
...
};
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index 661b3fc43275..1e4cd502340e 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -7,7 +7,6 @@
#include <linux/clk-provider.h>
#include <linux/dma-mapping.h>
#include <linux/dmaengine.h>
-#include <linux/spi/pxa2xx_spi.h>
#include <linux/platform_data/i2c-pxa.h>
#include <linux/soc/pxa/cpu.h>
@@ -665,23 +664,6 @@ struct platform_device pxa27x_device_gpio = {
.resource = pxa_resource_gpio,
};
-/* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1.
- * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */
-void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info)
-{
- struct platform_device *pd;
-
- pd = platform_device_alloc("pxa2xx-spi", id);
- if (pd == NULL) {
- printk(KERN_ERR "pxa2xx-spi: failed to allocate device id %d\n",
- id);
- return;
- }
-
- pd->dev.platform_data = info;
- platform_device_add(pd);
-}
-
static struct resource pxa_dma_resource[] = {
[0] = {
.start = 0x40000000,
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index cc691b199429..318402ad685e 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -585,6 +585,9 @@ static struct gpiod_lookup_table spitz_spi_gpio_table = {
static void __init spitz_spi_init(void)
{
+ struct platform_device *pd;
+ int id = 2;
+
if (machine_is_akita())
gpiod_add_lookup_table(&akita_lcdcon_gpio_table);
else
@@ -592,7 +595,16 @@ static void __init spitz_spi_init(void)
gpiod_add_lookup_table(&spitz_ads7846_gpio_table);
gpiod_add_lookup_table(&spitz_spi_gpio_table);
- pxa2xx_set_spi_info(2, &spitz_spi_info);
+
+ /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1 */
+ pd = platform_device_alloc("pxa2xx-spi", id);
+ if (pd == NULL) {
+ pr_err("pxa2xx-spi: failed to allocate device id %d\n", id);
+ } else {
+ pd->dev.platform_data = &spitz_spi_info;
+ platform_device_add(pd);
+ }
+
spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices));
}
#else
diff --git a/drivers/soc/pxa/ssp.c b/drivers/soc/pxa/ssp.c
index 7af04e8b8163..854d32e04558 100644
--- a/drivers/soc/pxa/ssp.c
+++ b/drivers/soc/pxa/ssp.c
@@ -25,7 +25,7 @@
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/platform_device.h>
-#include <linux/spi/pxa2xx_spi.h>
+#include <linux/pxa2xx_ssp.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/of_device.h>
diff --git a/include/linux/spi/pxa2xx_spi.h b/include/linux/spi/pxa2xx_spi.h
index ca2cd4e30ead..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;
@@ -45,12 +45,4 @@ struct pxa2xx_spi_chip {
u32 timeout;
};
-#if defined(CONFIG_ARCH_PXA) || defined(CONFIG_ARCH_MMP)
-
-#include <linux/clk.h>
-
-extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info);
-
-#endif
-
#endif /* __LINUX_SPI_PXA2XX_SPI_H */