Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

+16 -30
+1 -1
Documentation/spi/pxa2xx.rst
··· 24 24 is passed to the driver via a table found in include/linux/spi/pxa2xx_spi.h:: 25 25 26 26 struct pxa2xx_spi_controller { 27 - u16 num_chipselect; 27 + u8 num_chipselect; 28 28 u8 enable_dma; 29 29 ... 30 30 };
-18
arch/arm/mach-pxa/devices.c
··· 7 7 #include <linux/clk-provider.h> 8 8 #include <linux/dma-mapping.h> 9 9 #include <linux/dmaengine.h> 10 - #include <linux/spi/pxa2xx_spi.h> 11 10 #include <linux/platform_data/i2c-pxa.h> 12 11 #include <linux/soc/pxa/cpu.h> 13 12 ··· 663 664 .num_resources = ARRAY_SIZE(pxa_resource_gpio), 664 665 .resource = pxa_resource_gpio, 665 666 }; 666 - 667 - /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1. 668 - * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */ 669 - void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info) 670 - { 671 - struct platform_device *pd; 672 - 673 - pd = platform_device_alloc("pxa2xx-spi", id); 674 - if (pd == NULL) { 675 - printk(KERN_ERR "pxa2xx-spi: failed to allocate device id %d\n", 676 - id); 677 - return; 678 - } 679 - 680 - pd->dev.platform_data = info; 681 - platform_device_add(pd); 682 - } 683 667 684 668 static struct resource pxa_dma_resource[] = { 685 669 [0] = {
+13 -1
arch/arm/mach-pxa/spitz.c
··· 585 585 586 586 static void __init spitz_spi_init(void) 587 587 { 588 + struct platform_device *pd; 589 + int id = 2; 590 + 588 591 if (machine_is_akita()) 589 592 gpiod_add_lookup_table(&akita_lcdcon_gpio_table); 590 593 else ··· 595 592 596 593 gpiod_add_lookup_table(&spitz_ads7846_gpio_table); 597 594 gpiod_add_lookup_table(&spitz_spi_gpio_table); 598 - pxa2xx_set_spi_info(2, &spitz_spi_info); 595 + 596 + /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1 */ 597 + pd = platform_device_alloc("pxa2xx-spi", id); 598 + if (pd == NULL) { 599 + pr_err("pxa2xx-spi: failed to allocate device id %d\n", id); 600 + } else { 601 + pd->dev.platform_data = &spitz_spi_info; 602 + platform_device_add(pd); 603 + } 604 + 599 605 spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices)); 600 606 } 601 607 #else
+1 -1
drivers/soc/pxa/ssp.c
··· 25 25 #include <linux/clk.h> 26 26 #include <linux/err.h> 27 27 #include <linux/platform_device.h> 28 - #include <linux/spi/pxa2xx_spi.h> 28 + #include <linux/pxa2xx_ssp.h> 29 29 #include <linux/io.h> 30 30 #include <linux/of.h> 31 31 #include <linux/of_device.h>
+1 -9
include/linux/spi/pxa2xx_spi.h
··· 17 17 * (resides in device.platform_data). 18 18 */ 19 19 struct pxa2xx_spi_controller { 20 - u16 num_chipselect; 20 + u8 num_chipselect; 21 21 u8 enable_dma; 22 22 u8 dma_burst_size; 23 23 bool is_target; ··· 44 44 u8 dma_burst_size; 45 45 u32 timeout; 46 46 }; 47 - 48 - #if defined(CONFIG_ARCH_PXA) || defined(CONFIG_ARCH_MMP) 49 - 50 - #include <linux/clk.h> 51 - 52 - extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info); 53 - 54 - #endif 55 47 56 48 #endif /* __LINUX_SPI_PXA2XX_SPI_H */