Unverified Commit 51eea52d authored by Lubomir Rintel's avatar Lubomir Rintel Committed by Mark Brown
Browse files

pxa2xx: replace spi_master with spi_controller



It's also a slave controller driver now, calling it "master" is slightly
misleading.

Signed-off-by: default avatarLubomir Rintel <lkundrak@v3.sk>
Acked-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent bfc7af6d
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -21,15 +21,15 @@ Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a
"platform device".  The master configuration is passed to the driver via a table
found in include/linux/spi/pxa2xx_spi.h:

struct pxa2xx_spi_master {
struct pxa2xx_spi_controller {
	u16 num_chipselect;
	u8 enable_dma;
};

The "pxa2xx_spi_master.num_chipselect" field is used to determine the number of
The "pxa2xx_spi_controller.num_chipselect" field is used to determine the number of
slave device (chips) attached to this SPI master.

The "pxa2xx_spi_master.enable_dma" field informs the driver that SSP DMA should
The "pxa2xx_spi_controller.enable_dma" field informs the driver that SSP DMA should
be used.  This caused the driver to acquire two DMA channels: rx_channel and
tx_channel.  The rx_channel has a higher DMA service priority the tx_channel.
See the "PXA2xx Developer Manual" section "DMA Controller".
@@ -51,7 +51,7 @@ static struct resource pxa_spi_nssp_resources[] = {
	},
};

static struct pxa2xx_spi_master pxa_nssp_master_info = {
static struct pxa2xx_spi_controller pxa_nssp_master_info = {
	.num_chipselect = 1, /* Matches the number of chips attached to NSSP */
	.enable_dma = 1, /* Enables NSSP DMA */
};
@@ -206,7 +206,7 @@ DMA and PIO I/O Support
-----------------------
The pxa2xx_spi driver supports both DMA and interrupt driven PIO message
transfers.  The driver defaults to PIO mode and DMA transfers must be enabled
by setting the "enable_dma" flag in the "pxa2xx_spi_master" structure.  The DMA
by setting the "enable_dma" flag in the "pxa2xx_spi_controller" structure.  The DMA
mode supports both coherent and stream based DMA mappings.

The following logic is used to determine the type of I/O to be used on
+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ static unsigned long cmx255_pin_config[] = {
};

#if defined(CONFIG_SPI_PXA2XX)
static struct pxa2xx_spi_master pxa_ssp_master_info = {
static struct pxa2xx_spi_controller pxa_ssp_master_info = {
	.num_chipselect	= 1,
};

+1 −1
Original line number Diff line number Diff line
@@ -313,7 +313,7 @@ static inline void cmx270_init_mmc(void) {}
#endif

#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
static struct pxa2xx_spi_master cm_x270_spi_info = {
static struct pxa2xx_spi_controller cm_x270_spi_info = {
	.num_chipselect	= 1,
	.enable_dma	= 1,
};
+1 −1
Original line number Diff line number Diff line
@@ -530,7 +530,7 @@ static struct pxa2xx_udc_mach_info udc_info __initdata = {
};

#if IS_ENABLED(CONFIG_SPI_PXA2XX)
static struct pxa2xx_spi_master corgi_spi_info = {
static struct pxa2xx_spi_controller corgi_spi_info = {
	.num_chipselect	= 3,
};

+1 −1
Original line number Diff line number Diff line
@@ -1065,7 +1065,7 @@ struct platform_device pxa93x_device_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_master *info)
void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info)
{
	struct platform_device *pd;

Loading