All of lore.kernel.org
 help / color / mirror / Atom feed
* amba_pl022 spi->mode fix/cleanup patches
@ 2010-09-10 16:19 ` wellsk40 at gmail.com
  0 siblings, 0 replies; 26+ messages in thread
From: wellsk40 @ 2010-09-10 16:19 UTC (permalink / raw)
  To: linus.walleij, spi-devel-general
  Cc: sameo, rabin.vincent, srinidhi.kasagar, linux-kernel, linux,
	u.kleine-koenig, linux-arm-kernel, tj, grant.likely, Lukasz.Baj,
	quentinyang05

This patch series updates drivers and platforms that depend on the
amba_pl022 driver and use the pl022_config_chip structure for
setting up the SPI mode and data transfer width.

The SPI configuration (CPOL/CPHA mode, bit send order, data bits per
word, and loopback mode) were previously setup as part of board
specific data in the pl022_config_chip structure. This has been
changed to now use the .mode field in spi_board_info structure (or
drivers that setup the mode). The SPI transfer's data width is now
configured from spi->bits_per_word.

The SPI driver changes have been previously submitted to the SPI ML.
This patch series need to be layered on that patch series.

These changes add or fix the .mode field in the plats/boards that use the
driver (u300, ux500, lpc32xx). The patches also move the data width
from the board specific area to the driver for mfd/ab8500. As the
fields in the pl022_config_chip structure are no longer needed, they
are removed in the last patch.

These changes have been tested on the phy3250 platform (lpc32xx). I
was able to test the ab8500 driver to some degree, but I only have a
standard pl022. I am unable to test u300 and ux500 changes, but the
u300 changes compiled fine.

[PATCH 1/5] mfd/ab8500: Setup SPI transfer for 24 bits
[PATCH 2/5] ARM: LPC32XX: Add missing SPI mode and remove unused fields
[PATCH 3/5] ARM: U300: spi->mode and spi_bits_per_words updates
[PATCH 4/5] ARM: Ux500: Change SPI mode and remove unused fields
[PATCH 5/5] spi: amba_pl022: Remove unused fields from pl022_config_chip

^ permalink raw reply	[flat|nested] 26+ messages in thread

* amba_pl022 spi->mode fix/cleanup patches
@ 2010-09-10 16:19 ` wellsk40 at gmail.com
  0 siblings, 0 replies; 26+ messages in thread
From: wellsk40 at gmail.com @ 2010-09-10 16:19 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series updates drivers and platforms that depend on the
amba_pl022 driver and use the pl022_config_chip structure for
setting up the SPI mode and data transfer width.

The SPI configuration (CPOL/CPHA mode, bit send order, data bits per
word, and loopback mode) were previously setup as part of board
specific data in the pl022_config_chip structure. This has been
changed to now use the .mode field in spi_board_info structure (or
drivers that setup the mode). The SPI transfer's data width is now
configured from spi->bits_per_word.

The SPI driver changes have been previously submitted to the SPI ML.
This patch series need to be layered on that patch series.

These changes add or fix the .mode field in the plats/boards that use the
driver (u300, ux500, lpc32xx). The patches also move the data width
from the board specific area to the driver for mfd/ab8500. As the
fields in the pl022_config_chip structure are no longer needed, they
are removed in the last patch.

These changes have been tested on the phy3250 platform (lpc32xx). I
was able to test the ab8500 driver to some degree, but I only have a
standard pl022. I am unable to test u300 and ux500 changes, but the
u300 changes compiled fine.

[PATCH 1/5] mfd/ab8500: Setup SPI transfer for 24 bits
[PATCH 2/5] ARM: LPC32XX: Add missing SPI mode and remove unused fields
[PATCH 3/5] ARM: U300: spi->mode and spi_bits_per_words updates
[PATCH 4/5] ARM: Ux500: Change SPI mode and remove unused fields
[PATCH 5/5] spi: amba_pl022: Remove unused fields from pl022_config_chip

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 1/5] mfd/ab8500: Setup SPI transfer for 24 bits
  2010-09-10 16:19 ` wellsk40 at gmail.com
@ 2010-09-10 16:19   ` wellsk40 at gmail.com
  -1 siblings, 0 replies; 26+ messages in thread
From: wellsk40 @ 2010-09-10 16:19 UTC (permalink / raw)
  To: linus.walleij, spi-devel-general
  Cc: sameo, rabin.vincent, srinidhi.kasagar, linux-kernel, linux,
	u.kleine-koenig, linux-arm-kernel, tj, grant.likely, Lukasz.Baj,
	quentinyang05, Kevin Wells

From: Kevin Wells <wellsk40@gmail.com>

The data bit transfer size should be part of the driver using the
SPI interface. This was previously setup in the AMBA PL022 driver
from board specific configuration data.

Signed-off-by: Kevin Wells <wellsk40@gmail.com>
---
 drivers/mfd/ab8500-spi.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/ab8500-spi.c b/drivers/mfd/ab8500-spi.c
index e1c8b62..01b6d58 100644
--- a/drivers/mfd/ab8500-spi.c
+++ b/drivers/mfd/ab8500-spi.c
@@ -83,6 +83,11 @@ static int __devinit ab8500_spi_probe(struct spi_device *spi)
 	struct ab8500 *ab8500;
 	int ret;
 
+	spi->bits_per_word = 24;
+	ret = spi_setup(spi);
+	if (ret < 0)
+		return ret;
+
 	ab8500 = kzalloc(sizeof *ab8500, GFP_KERNEL);
 	if (!ab8500)
 		return -ENOMEM;
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 1/5] mfd/ab8500: Setup SPI transfer for 24 bits
@ 2010-09-10 16:19   ` wellsk40 at gmail.com
  0 siblings, 0 replies; 26+ messages in thread
From: wellsk40 at gmail.com @ 2010-09-10 16:19 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kevin Wells <wellsk40@gmail.com>

The data bit transfer size should be part of the driver using the
SPI interface. This was previously setup in the AMBA PL022 driver
from board specific configuration data.

Signed-off-by: Kevin Wells <wellsk40@gmail.com>
---
 drivers/mfd/ab8500-spi.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/ab8500-spi.c b/drivers/mfd/ab8500-spi.c
index e1c8b62..01b6d58 100644
--- a/drivers/mfd/ab8500-spi.c
+++ b/drivers/mfd/ab8500-spi.c
@@ -83,6 +83,11 @@ static int __devinit ab8500_spi_probe(struct spi_device *spi)
 	struct ab8500 *ab8500;
 	int ret;
 
+	spi->bits_per_word = 24;
+	ret = spi_setup(spi);
+	if (ret < 0)
+		return ret;
+
 	ab8500 = kzalloc(sizeof *ab8500, GFP_KERNEL);
 	if (!ab8500)
 		return -ENOMEM;
-- 
1.7.2.2

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 2/5] ARM: LPC32XX: Add missing SPI mode and remove unused fields
@ 2010-09-10 16:19   ` wellsk40-Re5JQEeQqe8AvxtiuMwx3w
  0 siblings, 0 replies; 26+ messages in thread
From: wellsk40 @ 2010-09-10 16:19 UTC (permalink / raw)
  To: linus.walleij, spi-devel-general
  Cc: sameo, rabin.vincent, srinidhi.kasagar, linux-kernel, linux,
	u.kleine-koenig, linux-arm-kernel, tj, grant.likely, Lukasz.Baj,
	quentinyang05, Kevin Wells

From: Kevin Wells <wellsk40@gmail.com>

Some of the fields in the pl022_chip_info structure used with
the amba pl022 driver are no longer used. This patch removes
those unused fields and adds the missing .mode flags to the
spi_board_info structure.

Signed-off-by: Kevin Wells <wellsk40@gmail.com>
---
 arch/arm/mach-lpc32xx/phy3250.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-lpc32xx/phy3250.c b/arch/arm/mach-lpc32xx/phy3250.c
index bc9a42d..0c936cf 100644
--- a/arch/arm/mach-lpc32xx/phy3250.c
+++ b/arch/arm/mach-lpc32xx/phy3250.c
@@ -172,18 +172,12 @@ static void phy3250_spi_cs_set(u32 control)
 }
 
 static struct pl022_config_chip spi0_chip_info = {
-	.lbm			= LOOPBACK_DISABLED,
 	.com_mode		= INTERRUPT_TRANSFER,
 	.iface			= SSP_INTERFACE_MOTOROLA_SPI,
 	.hierarchy		= SSP_MASTER,
 	.slave_tx_disable	= 0,
-	.endian_tx		= SSP_TX_LSB,
-	.endian_rx		= SSP_RX_LSB,
-	.data_size		= SSP_DATA_BITS_8,
 	.rx_lev_trig		= SSP_RX_4_OR_MORE_ELEM,
 	.tx_lev_trig		= SSP_TX_4_OR_MORE_EMPTY_LOC,
-	.clk_phase		= SSP_CLK_FIRST_EDGE,
-	.clk_pol		= SSP_CLK_POL_IDLE_LOW,
 	.ctrl_len		= SSP_BITS_8,
 	.wait_state		= SSP_MWIRE_WAIT_ZERO,
 	.duplex			= SSP_MICROWIRE_CHANNEL_FULL_DUPLEX,
@@ -239,6 +233,7 @@ static int __init phy3250_spi_board_register(void)
 			.max_speed_hz = 5000000,
 			.bus_num = 0,
 			.chip_select = 0,
+			.mode = SPI_MODE_0,
 			.platform_data = &eeprom,
 			.controller_data = &spi0_chip_info,
 		},
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 2/5] ARM: LPC32XX: Add missing SPI mode and remove unused fields
@ 2010-09-10 16:19   ` wellsk40-Re5JQEeQqe8AvxtiuMwx3w
  0 siblings, 0 replies; 26+ messages in thread
From: wellsk40-Re5JQEeQqe8AvxtiuMwx3w @ 2010-09-10 16:19 UTC (permalink / raw)
  To: linus.walleij-0IS4wlFg1OjSUeElwK9/Pw,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: rabin.vincent-0IS4wlFg1OjSUeElwK9/Pw,
	linux-lFZ/pmaqli7XmaaqVzeoHQ, sameo-VuQAYsv1563Yd54FQh9/CA,
	srinidhi.kasagar-0IS4wlFg1OjSUeElwK9/Pw,
	Lukasz.Baj-++hxYGjEMp0AvxtiuMwx3w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ,
	tj-DgEjT+Ai2ygdnm+yROfE0A,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Kevin Wells <wellsk40-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Some of the fields in the pl022_chip_info structure used with
the amba pl022 driver are no longer used. This patch removes
those unused fields and adds the missing .mode flags to the
spi_board_info structure.

Signed-off-by: Kevin Wells <wellsk40-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 arch/arm/mach-lpc32xx/phy3250.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-lpc32xx/phy3250.c b/arch/arm/mach-lpc32xx/phy3250.c
index bc9a42d..0c936cf 100644
--- a/arch/arm/mach-lpc32xx/phy3250.c
+++ b/arch/arm/mach-lpc32xx/phy3250.c
@@ -172,18 +172,12 @@ static void phy3250_spi_cs_set(u32 control)
 }
 
 static struct pl022_config_chip spi0_chip_info = {
-	.lbm			= LOOPBACK_DISABLED,
 	.com_mode		= INTERRUPT_TRANSFER,
 	.iface			= SSP_INTERFACE_MOTOROLA_SPI,
 	.hierarchy		= SSP_MASTER,
 	.slave_tx_disable	= 0,
-	.endian_tx		= SSP_TX_LSB,
-	.endian_rx		= SSP_RX_LSB,
-	.data_size		= SSP_DATA_BITS_8,
 	.rx_lev_trig		= SSP_RX_4_OR_MORE_ELEM,
 	.tx_lev_trig		= SSP_TX_4_OR_MORE_EMPTY_LOC,
-	.clk_phase		= SSP_CLK_FIRST_EDGE,
-	.clk_pol		= SSP_CLK_POL_IDLE_LOW,
 	.ctrl_len		= SSP_BITS_8,
 	.wait_state		= SSP_MWIRE_WAIT_ZERO,
 	.duplex			= SSP_MICROWIRE_CHANNEL_FULL_DUPLEX,
@@ -239,6 +233,7 @@ static int __init phy3250_spi_board_register(void)
 			.max_speed_hz = 5000000,
 			.bus_num = 0,
 			.chip_select = 0,
+			.mode = SPI_MODE_0,
 			.platform_data = &eeprom,
 			.controller_data = &spi0_chip_info,
 		},
-- 
1.7.2.2


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 2/5] ARM: LPC32XX: Add missing SPI mode and remove unused fields
@ 2010-09-10 16:19   ` wellsk40-Re5JQEeQqe8AvxtiuMwx3w
  0 siblings, 0 replies; 26+ messages in thread
From: wellsk40 at gmail.com @ 2010-09-10 16:19 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kevin Wells <wellsk40@gmail.com>

Some of the fields in the pl022_chip_info structure used with
the amba pl022 driver are no longer used. This patch removes
those unused fields and adds the missing .mode flags to the
spi_board_info structure.

Signed-off-by: Kevin Wells <wellsk40@gmail.com>
---
 arch/arm/mach-lpc32xx/phy3250.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-lpc32xx/phy3250.c b/arch/arm/mach-lpc32xx/phy3250.c
index bc9a42d..0c936cf 100644
--- a/arch/arm/mach-lpc32xx/phy3250.c
+++ b/arch/arm/mach-lpc32xx/phy3250.c
@@ -172,18 +172,12 @@ static void phy3250_spi_cs_set(u32 control)
 }
 
 static struct pl022_config_chip spi0_chip_info = {
-	.lbm			= LOOPBACK_DISABLED,
 	.com_mode		= INTERRUPT_TRANSFER,
 	.iface			= SSP_INTERFACE_MOTOROLA_SPI,
 	.hierarchy		= SSP_MASTER,
 	.slave_tx_disable	= 0,
-	.endian_tx		= SSP_TX_LSB,
-	.endian_rx		= SSP_RX_LSB,
-	.data_size		= SSP_DATA_BITS_8,
 	.rx_lev_trig		= SSP_RX_4_OR_MORE_ELEM,
 	.tx_lev_trig		= SSP_TX_4_OR_MORE_EMPTY_LOC,
-	.clk_phase		= SSP_CLK_FIRST_EDGE,
-	.clk_pol		= SSP_CLK_POL_IDLE_LOW,
 	.ctrl_len		= SSP_BITS_8,
 	.wait_state		= SSP_MWIRE_WAIT_ZERO,
 	.duplex			= SSP_MICROWIRE_CHANNEL_FULL_DUPLEX,
@@ -239,6 +233,7 @@ static int __init phy3250_spi_board_register(void)
 			.max_speed_hz = 5000000,
 			.bus_num = 0,
 			.chip_select = 0,
+			.mode = SPI_MODE_0,
 			.platform_data = &eeprom,
 			.controller_data = &spi0_chip_info,
 		},
-- 
1.7.2.2

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 3/5] ARM: U300: spi->mode and spi_bits_per_words updates
  2010-09-10 16:19 ` wellsk40 at gmail.com
@ 2010-09-10 16:19   ` wellsk40 at gmail.com
  -1 siblings, 0 replies; 26+ messages in thread
From: wellsk40 @ 2010-09-10 16:19 UTC (permalink / raw)
  To: linus.walleij, spi-devel-general
  Cc: sameo, rabin.vincent, srinidhi.kasagar, linux-kernel, linux,
	u.kleine-koenig, linux-arm-kernel, tj, grant.likely, Lukasz.Baj,
	quentinyang05, Kevin Wells

From: Kevin Wells <wellsk40@gmail.com>

Some of the fields in the pl022_chip_info structure used with
the amba pl022 driver are no longer used. This patch removes
those unused fields and changes the .mode flags in the
spi_board_info structure to setup the correct SPI mode.

For the loopback driver, the bus_info pointer can be removed
and the bits_per_word field can be used instead for setting
the bus data width.

Signed-off-by: Kevin Wells <wellsk40@gmail.com>
---
 arch/arm/mach-u300/dummyspichip.c |    5 ++---
 arch/arm/mach-u300/spi.c          |   10 +---------
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-u300/dummyspichip.c b/arch/arm/mach-u300/dummyspichip.c
index 5f55012..03f7936 100644
--- a/arch/arm/mach-u300/dummyspichip.c
+++ b/arch/arm/mach-u300/dummyspichip.c
@@ -46,7 +46,6 @@ static ssize_t dummy_looptest(struct device *dev,
 	 * struct, this is just used here to alter the behaviour of the chip
 	 * in order to perform tests.
 	 */
-	struct pl022_config_chip *chip_info = spi->controller_data;
 	int status;
 	u8 txbuf[14] = {0xDE, 0xAD, 0xBE, 0xEF, 0x2B, 0xAD,
 			0xCA, 0xFE, 0xBA, 0xBE, 0xB1, 0x05,
@@ -72,7 +71,7 @@ static ssize_t dummy_looptest(struct device *dev,
 	 * Force chip to 8 bit mode
 	 * WARNING: NEVER DO THIS IN REAL DRIVER CODE, THIS SHOULD BE STATIC!
 	 */
-	chip_info->data_size = SSP_DATA_BITS_8;
+	spi->bits_per_word = 8;
 	/* You should NOT DO THIS EITHER */
 	spi->master->setup(spi);
 
@@ -159,7 +158,7 @@ static ssize_t dummy_looptest(struct device *dev,
 	 * Force chip to 16 bit mode
 	 * WARNING: NEVER DO THIS IN REAL DRIVER CODE, THIS SHOULD BE STATIC!
 	 */
-	chip_info->data_size = SSP_DATA_BITS_16;
+	spi->bits_per_word = 16;
 	/* You should NOT DO THIS EITHER */
 	spi->master->setup(spi);
 
diff --git a/arch/arm/mach-u300/spi.c b/arch/arm/mach-u300/spi.c
index f0e887b..edb2c0d 100644
--- a/arch/arm/mach-u300/spi.c
+++ b/arch/arm/mach-u300/spi.c
@@ -30,8 +30,6 @@ static void select_dummy_chip(u32 chipselect)
 }
 
 struct pl022_config_chip dummy_chip_info = {
-	/* Nominally this is LOOPBACK_DISABLED, but this is our dummy chip! */
-	.lbm = LOOPBACK_ENABLED,
 	/*
 	 * available POLLING_TRANSFER and INTERRUPT_TRANSFER,
 	 * DMA_TRANSFER does not work
@@ -42,14 +40,8 @@ struct pl022_config_chip dummy_chip_info = {
 	.hierarchy = SSP_MASTER,
 	/* 0 = drive TX even as slave, 1 = do not drive TX as slave */
 	.slave_tx_disable = 0,
-	/* LSB first */
-	.endian_tx = SSP_TX_LSB,
-	.endian_rx = SSP_RX_LSB,
-	.data_size = SSP_DATA_BITS_8, /* used to be 12 in some default */
 	.rx_lev_trig = SSP_RX_1_OR_MORE_ELEM,
 	.tx_lev_trig = SSP_TX_1_OR_MORE_EMPTY_LOC,
-	.clk_phase = SSP_CLK_SECOND_EDGE,
-	.clk_pol = SSP_CLK_POL_IDLE_LOW,
 	.ctrl_len = SSP_BITS_12,
 	.wait_state = SSP_MWIRE_WAIT_ZERO,
 	.duplex = SSP_MICROWIRE_CHANNEL_FULL_DUPLEX,
@@ -75,7 +67,7 @@ static struct spi_board_info u300_spi_devices[] = {
 		.bus_num        = 0, /* Only one bus on this chip */
 		.chip_select    = 0,
 		/* Means SPI_CS_HIGH, change if e.g low CS */
-		.mode           = 0,
+		.mode           = SPI_MODE_1 | SPI_LSB_FIRST | SPI_LOOP,
 	},
 #endif
 };
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 3/5] ARM: U300: spi->mode and spi_bits_per_words updates
@ 2010-09-10 16:19   ` wellsk40 at gmail.com
  0 siblings, 0 replies; 26+ messages in thread
From: wellsk40 at gmail.com @ 2010-09-10 16:19 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kevin Wells <wellsk40@gmail.com>

Some of the fields in the pl022_chip_info structure used with
the amba pl022 driver are no longer used. This patch removes
those unused fields and changes the .mode flags in the
spi_board_info structure to setup the correct SPI mode.

For the loopback driver, the bus_info pointer can be removed
and the bits_per_word field can be used instead for setting
the bus data width.

Signed-off-by: Kevin Wells <wellsk40@gmail.com>
---
 arch/arm/mach-u300/dummyspichip.c |    5 ++---
 arch/arm/mach-u300/spi.c          |   10 +---------
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-u300/dummyspichip.c b/arch/arm/mach-u300/dummyspichip.c
index 5f55012..03f7936 100644
--- a/arch/arm/mach-u300/dummyspichip.c
+++ b/arch/arm/mach-u300/dummyspichip.c
@@ -46,7 +46,6 @@ static ssize_t dummy_looptest(struct device *dev,
 	 * struct, this is just used here to alter the behaviour of the chip
 	 * in order to perform tests.
 	 */
-	struct pl022_config_chip *chip_info = spi->controller_data;
 	int status;
 	u8 txbuf[14] = {0xDE, 0xAD, 0xBE, 0xEF, 0x2B, 0xAD,
 			0xCA, 0xFE, 0xBA, 0xBE, 0xB1, 0x05,
@@ -72,7 +71,7 @@ static ssize_t dummy_looptest(struct device *dev,
 	 * Force chip to 8 bit mode
 	 * WARNING: NEVER DO THIS IN REAL DRIVER CODE, THIS SHOULD BE STATIC!
 	 */
-	chip_info->data_size = SSP_DATA_BITS_8;
+	spi->bits_per_word = 8;
 	/* You should NOT DO THIS EITHER */
 	spi->master->setup(spi);
 
@@ -159,7 +158,7 @@ static ssize_t dummy_looptest(struct device *dev,
 	 * Force chip to 16 bit mode
 	 * WARNING: NEVER DO THIS IN REAL DRIVER CODE, THIS SHOULD BE STATIC!
 	 */
-	chip_info->data_size = SSP_DATA_BITS_16;
+	spi->bits_per_word = 16;
 	/* You should NOT DO THIS EITHER */
 	spi->master->setup(spi);
 
diff --git a/arch/arm/mach-u300/spi.c b/arch/arm/mach-u300/spi.c
index f0e887b..edb2c0d 100644
--- a/arch/arm/mach-u300/spi.c
+++ b/arch/arm/mach-u300/spi.c
@@ -30,8 +30,6 @@ static void select_dummy_chip(u32 chipselect)
 }
 
 struct pl022_config_chip dummy_chip_info = {
-	/* Nominally this is LOOPBACK_DISABLED, but this is our dummy chip! */
-	.lbm = LOOPBACK_ENABLED,
 	/*
 	 * available POLLING_TRANSFER and INTERRUPT_TRANSFER,
 	 * DMA_TRANSFER does not work
@@ -42,14 +40,8 @@ struct pl022_config_chip dummy_chip_info = {
 	.hierarchy = SSP_MASTER,
 	/* 0 = drive TX even as slave, 1 = do not drive TX as slave */
 	.slave_tx_disable = 0,
-	/* LSB first */
-	.endian_tx = SSP_TX_LSB,
-	.endian_rx = SSP_RX_LSB,
-	.data_size = SSP_DATA_BITS_8, /* used to be 12 in some default */
 	.rx_lev_trig = SSP_RX_1_OR_MORE_ELEM,
 	.tx_lev_trig = SSP_TX_1_OR_MORE_EMPTY_LOC,
-	.clk_phase = SSP_CLK_SECOND_EDGE,
-	.clk_pol = SSP_CLK_POL_IDLE_LOW,
 	.ctrl_len = SSP_BITS_12,
 	.wait_state = SSP_MWIRE_WAIT_ZERO,
 	.duplex = SSP_MICROWIRE_CHANNEL_FULL_DUPLEX,
@@ -75,7 +67,7 @@ static struct spi_board_info u300_spi_devices[] = {
 		.bus_num        = 0, /* Only one bus on this chip */
 		.chip_select    = 0,
 		/* Means SPI_CS_HIGH, change if e.g low CS */
-		.mode           = 0,
+		.mode           = SPI_MODE_1 | SPI_LSB_FIRST | SPI_LOOP,
 	},
 #endif
 };
-- 
1.7.2.2

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 4/5] ARM: Ux500: Change SPI mode and remove unused fields
@ 2010-09-10 16:19   ` wellsk40-Re5JQEeQqe8AvxtiuMwx3w
  0 siblings, 0 replies; 26+ messages in thread
From: wellsk40 @ 2010-09-10 16:19 UTC (permalink / raw)
  To: linus.walleij, spi-devel-general
  Cc: sameo, rabin.vincent, srinidhi.kasagar, linux-kernel, linux,
	u.kleine-koenig, linux-arm-kernel, tj, grant.likely, Lukasz.Baj,
	quentinyang05, Kevin Wells

From: Kevin Wells <wellsk40@gmail.com>

Some of the fields in the pl022_chip_info structure used with
the amba pl022 driver are no longer used. This patch removes
those unused fields and changes the .mode flags in the
spi_board_info structure to setup the correct SPI mode.

Signed-off-by: Kevin Wells <wellsk40@gmail.com>
---
 arch/arm/mach-ux500/board-mop500.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 0e8fd13..219ae0c 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -55,19 +55,13 @@ static void ab4500_spi_cs_control(u32 command)
 }
 
 struct pl022_config_chip ab4500_chip_info = {
-	.lbm = LOOPBACK_DISABLED,
 	.com_mode = INTERRUPT_TRANSFER,
 	.iface = SSP_INTERFACE_MOTOROLA_SPI,
 	/* we can act as master only */
 	.hierarchy = SSP_MASTER,
 	.slave_tx_disable = 0,
-	.endian_rx = SSP_RX_MSB,
-	.endian_tx = SSP_TX_MSB,
-	.data_size = SSP_DATA_BITS_24,
 	.rx_lev_trig = SSP_RX_1_OR_MORE_ELEM,
 	.tx_lev_trig = SSP_TX_1_OR_MORE_EMPTY_LOC,
-	.clk_phase = SSP_CLK_SECOND_EDGE,
-	.clk_pol = SSP_CLK_POL_IDLE_HIGH,
 	.cs_control = ab4500_spi_cs_control,
 };
 
@@ -83,7 +77,7 @@ static struct spi_board_info u8500_spi_devices[] = {
 		.max_speed_hz = 12000000,
 		.bus_num = 0,
 		.chip_select = 0,
-		.mode = SPI_MODE_0,
+		.mode = SPI_MODE_3,
 		.irq = IRQ_DB8500_AB8500,
 	},
 };
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 4/5] ARM: Ux500: Change SPI mode and remove unused fields
@ 2010-09-10 16:19   ` wellsk40-Re5JQEeQqe8AvxtiuMwx3w
  0 siblings, 0 replies; 26+ messages in thread
From: wellsk40-Re5JQEeQqe8AvxtiuMwx3w @ 2010-09-10 16:19 UTC (permalink / raw)
  To: linus.walleij-0IS4wlFg1OjSUeElwK9/Pw,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: rabin.vincent-0IS4wlFg1OjSUeElwK9/Pw,
	linux-lFZ/pmaqli7XmaaqVzeoHQ, sameo-VuQAYsv1563Yd54FQh9/CA,
	srinidhi.kasagar-0IS4wlFg1OjSUeElwK9/Pw,
	Lukasz.Baj-++hxYGjEMp0AvxtiuMwx3w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ,
	tj-DgEjT+Ai2ygdnm+yROfE0A,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Kevin Wells <wellsk40-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Some of the fields in the pl022_chip_info structure used with
the amba pl022 driver are no longer used. This patch removes
those unused fields and changes the .mode flags in the
spi_board_info structure to setup the correct SPI mode.

Signed-off-by: Kevin Wells <wellsk40-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 arch/arm/mach-ux500/board-mop500.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 0e8fd13..219ae0c 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -55,19 +55,13 @@ static void ab4500_spi_cs_control(u32 command)
 }
 
 struct pl022_config_chip ab4500_chip_info = {
-	.lbm = LOOPBACK_DISABLED,
 	.com_mode = INTERRUPT_TRANSFER,
 	.iface = SSP_INTERFACE_MOTOROLA_SPI,
 	/* we can act as master only */
 	.hierarchy = SSP_MASTER,
 	.slave_tx_disable = 0,
-	.endian_rx = SSP_RX_MSB,
-	.endian_tx = SSP_TX_MSB,
-	.data_size = SSP_DATA_BITS_24,
 	.rx_lev_trig = SSP_RX_1_OR_MORE_ELEM,
 	.tx_lev_trig = SSP_TX_1_OR_MORE_EMPTY_LOC,
-	.clk_phase = SSP_CLK_SECOND_EDGE,
-	.clk_pol = SSP_CLK_POL_IDLE_HIGH,
 	.cs_control = ab4500_spi_cs_control,
 };
 
@@ -83,7 +77,7 @@ static struct spi_board_info u8500_spi_devices[] = {
 		.max_speed_hz = 12000000,
 		.bus_num = 0,
 		.chip_select = 0,
-		.mode = SPI_MODE_0,
+		.mode = SPI_MODE_3,
 		.irq = IRQ_DB8500_AB8500,
 	},
 };
-- 
1.7.2.2


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 4/5] ARM: Ux500: Change SPI mode and remove unused fields
@ 2010-09-10 16:19   ` wellsk40-Re5JQEeQqe8AvxtiuMwx3w
  0 siblings, 0 replies; 26+ messages in thread
From: wellsk40 at gmail.com @ 2010-09-10 16:19 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kevin Wells <wellsk40@gmail.com>

Some of the fields in the pl022_chip_info structure used with
the amba pl022 driver are no longer used. This patch removes
those unused fields and changes the .mode flags in the
spi_board_info structure to setup the correct SPI mode.

Signed-off-by: Kevin Wells <wellsk40@gmail.com>
---
 arch/arm/mach-ux500/board-mop500.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 0e8fd13..219ae0c 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -55,19 +55,13 @@ static void ab4500_spi_cs_control(u32 command)
 }
 
 struct pl022_config_chip ab4500_chip_info = {
-	.lbm = LOOPBACK_DISABLED,
 	.com_mode = INTERRUPT_TRANSFER,
 	.iface = SSP_INTERFACE_MOTOROLA_SPI,
 	/* we can act as master only */
 	.hierarchy = SSP_MASTER,
 	.slave_tx_disable = 0,
-	.endian_rx = SSP_RX_MSB,
-	.endian_tx = SSP_TX_MSB,
-	.data_size = SSP_DATA_BITS_24,
 	.rx_lev_trig = SSP_RX_1_OR_MORE_ELEM,
 	.tx_lev_trig = SSP_TX_1_OR_MORE_EMPTY_LOC,
-	.clk_phase = SSP_CLK_SECOND_EDGE,
-	.clk_pol = SSP_CLK_POL_IDLE_HIGH,
 	.cs_control = ab4500_spi_cs_control,
 };
 
@@ -83,7 +77,7 @@ static struct spi_board_info u8500_spi_devices[] = {
 		.max_speed_hz = 12000000,
 		.bus_num = 0,
 		.chip_select = 0,
-		.mode = SPI_MODE_0,
+		.mode = SPI_MODE_3,
 		.irq = IRQ_DB8500_AB8500,
 	},
 };
-- 
1.7.2.2

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 5/5] spi: amba_pl022: Remove unused fields from pl022_config_chip
  2010-09-10 16:19 ` wellsk40 at gmail.com
@ 2010-09-10 16:19   ` wellsk40 at gmail.com
  -1 siblings, 0 replies; 26+ messages in thread
From: wellsk40 @ 2010-09-10 16:19 UTC (permalink / raw)
  To: linus.walleij, spi-devel-general
  Cc: sameo, rabin.vincent, srinidhi.kasagar, linux-kernel, linux,
	u.kleine-koenig, linux-arm-kernel, tj, grant.likely, Lukasz.Baj,
	quentinyang05, Kevin Wells

From: Kevin Wells <wellsk40@gmail.com>

Some of the fields in the pl022_config_chip structure are no
longer needed with the spi->mode updates. These fields have been
removed.

Signed-off-by: Kevin Wells <wellsk40@gmail.com>
---
 include/linux/amba/pl022.h |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/include/linux/amba/pl022.h b/include/linux/amba/pl022.h
index abf26cc..0ad6977 100644
--- a/include/linux/amba/pl022.h
+++ b/include/linux/amba/pl022.h
@@ -271,19 +271,13 @@ struct pl022_ssp_controller {
  */
 struct pl022_config_chip {
 	struct device *dev;
-	enum ssp_loopback lbm;
 	enum ssp_interface iface;
 	enum ssp_hierarchy hierarchy;
 	bool slave_tx_disable;
 	struct ssp_clock_params clk_freq;
-	enum ssp_rx_endian endian_rx;
-	enum ssp_tx_endian endian_tx;
-	enum ssp_data_size data_size;
 	enum ssp_mode com_mode;
 	enum ssp_rx_level_trig rx_lev_trig;
 	enum ssp_tx_level_trig tx_lev_trig;
-	enum ssp_spi_clk_phase clk_phase;
-	enum ssp_spi_clk_pol clk_pol;
 	enum ssp_microwire_ctrl_len ctrl_len;
 	enum ssp_microwire_wait_state wait_state;
 	enum ssp_duplex duplex;
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 5/5] spi: amba_pl022: Remove unused fields from pl022_config_chip
@ 2010-09-10 16:19   ` wellsk40 at gmail.com
  0 siblings, 0 replies; 26+ messages in thread
From: wellsk40 at gmail.com @ 2010-09-10 16:19 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kevin Wells <wellsk40@gmail.com>

Some of the fields in the pl022_config_chip structure are no
longer needed with the spi->mode updates. These fields have been
removed.

Signed-off-by: Kevin Wells <wellsk40@gmail.com>
---
 include/linux/amba/pl022.h |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/include/linux/amba/pl022.h b/include/linux/amba/pl022.h
index abf26cc..0ad6977 100644
--- a/include/linux/amba/pl022.h
+++ b/include/linux/amba/pl022.h
@@ -271,19 +271,13 @@ struct pl022_ssp_controller {
  */
 struct pl022_config_chip {
 	struct device *dev;
-	enum ssp_loopback lbm;
 	enum ssp_interface iface;
 	enum ssp_hierarchy hierarchy;
 	bool slave_tx_disable;
 	struct ssp_clock_params clk_freq;
-	enum ssp_rx_endian endian_rx;
-	enum ssp_tx_endian endian_tx;
-	enum ssp_data_size data_size;
 	enum ssp_mode com_mode;
 	enum ssp_rx_level_trig rx_lev_trig;
 	enum ssp_tx_level_trig tx_lev_trig;
-	enum ssp_spi_clk_phase clk_phase;
-	enum ssp_spi_clk_pol clk_pol;
 	enum ssp_microwire_ctrl_len ctrl_len;
 	enum ssp_microwire_wait_state wait_state;
 	enum ssp_duplex duplex;
-- 
1.7.2.2

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH 5/5] spi: amba_pl022: Remove unused fields from pl022_config_chip
  2010-09-10 16:19   ` wellsk40 at gmail.com
@ 2010-09-13 13:22     ` Linus Walleij
  -1 siblings, 0 replies; 26+ messages in thread
From: Linus Walleij @ 2010-09-13 13:22 UTC (permalink / raw)
  To: wellsk40
  Cc: spi-devel-general, sameo, rabin.vincent, srinidhi.kasagar,
	linux-kernel, linux, u.kleine-koenig, linux-arm-kernel, tj,
	grant.likely, Lukasz.Baj, quentinyang05

2010/9/10  <wellsk40@gmail.com>:

> From: Kevin Wells <wellsk40@gmail.com>
>
> Some of the fields in the pl022_config_chip structure are no
> longer needed with the spi->mode updates. These fields have been
> removed.

I think you have to do a more thorough patch:

drivers/spi/amba-pl022.c: In function 'verify_controller_parameters':
drivers/spi/amba-pl022.c:1598: error: 'struct pl022_config_chip' has
no member named 'lbm'
drivers/spi/amba-pl022.c:1599: error: 'struct pl022_config_chip' has
no member named 'lbm'
drivers/spi/amba-pl022.c:1629: error: 'struct pl022_config_chip' has
no member named 'endian_rx'
(... etc)

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 5/5] spi: amba_pl022: Remove unused fields from pl022_config_chip
@ 2010-09-13 13:22     ` Linus Walleij
  0 siblings, 0 replies; 26+ messages in thread
From: Linus Walleij @ 2010-09-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel

2010/9/10  <wellsk40@gmail.com>:

> From: Kevin Wells <wellsk40@gmail.com>
>
> Some of the fields in the pl022_config_chip structure are no
> longer needed with the spi->mode updates. These fields have been
> removed.

I think you have to do a more thorough patch:

drivers/spi/amba-pl022.c: In function 'verify_controller_parameters':
drivers/spi/amba-pl022.c:1598: error: 'struct pl022_config_chip' has
no member named 'lbm'
drivers/spi/amba-pl022.c:1599: error: 'struct pl022_config_chip' has
no member named 'lbm'
drivers/spi/amba-pl022.c:1629: error: 'struct pl022_config_chip' has
no member named 'endian_rx'
(... etc)

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 5/5] spi: amba_pl022: Remove unused fields from pl022_config_chip
  2010-09-13 13:22     ` Linus Walleij
@ 2010-09-13 14:55       ` Linus Walleij
  -1 siblings, 0 replies; 26+ messages in thread
From: Linus Walleij @ 2010-09-13 14:55 UTC (permalink / raw)
  To: wellsk40
  Cc: spi-devel-general, sameo, rabin.vincent, srinidhi.kasagar,
	linux-kernel, linux, u.kleine-koenig, linux-arm-kernel, tj,
	grant.likely, Lukasz.Baj, quentinyang05

2010/9/13 Linus Walleij <linus.ml.walleij@gmail.com>:

> I think you have to do a more thorough patch:

No, wait it's me. I have to have the old patch first and then this
on top, sorry.

I'll test again...

Linus

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 5/5] spi: amba_pl022: Remove unused fields from pl022_config_chip
@ 2010-09-13 14:55       ` Linus Walleij
  0 siblings, 0 replies; 26+ messages in thread
From: Linus Walleij @ 2010-09-13 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

2010/9/13 Linus Walleij <linus.ml.walleij@gmail.com>:

> I think you have to do a more thorough patch:

No, wait it's me. I have to have the old patch first and then this
on top, sorry.

I'll test again...

Linus

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: amba_pl022 spi->mode fix/cleanup patches
  2010-09-10 16:19 ` wellsk40 at gmail.com
  (?)
@ 2010-09-13 15:19   ` Linus Walleij
  -1 siblings, 0 replies; 26+ messages in thread
From: Linus Walleij @ 2010-09-13 15:19 UTC (permalink / raw)
  To: wellsk40
  Cc: spi-devel-general, rabin.vincent, linux, sameo, srinidhi.kasagar,
	Lukasz.Baj, linux-kernel, u.kleine-koenig, tj, linux-arm-kernel

2010/9/10  <wellsk40@gmail.com>:

> This patch series updates drivers and platforms that depend on the
> amba_pl022 driver and use the pl022_config_chip structure for
> setting up the SPI mode and data transfer width.

I get regressions from the ab8500-spi.c driver from this patch:

> ssp-pl022 ssp0: ARM PL022 driver, device ID: 0x01080022
> pl022: mapped registers from 0x80002000 to d0834000
> ab8500-spi spi0.0: unknown chip, revision: 0x80
> ab8500-spi: probe of spi0.0 failed with error -22

The 0x80 above used to be 0x00 before these patches.
So all of a sudden bit 7 gets set...

I don't know why this happens, probably some flag that used to
be set had not been properly propagated in the first patch to alter
the AB8500 device registration?

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: amba_pl022 spi->mode fix/cleanup patches
@ 2010-09-13 15:19   ` Linus Walleij
  0 siblings, 0 replies; 26+ messages in thread
From: Linus Walleij @ 2010-09-13 15:19 UTC (permalink / raw)
  To: wellsk40
  Cc: rabin.vincent, linux, sameo, Lukasz.Baj, srinidhi.kasagar,
	linux-kernel, u.kleine-koenig, tj, spi-devel-general,
	linux-arm-kernel

2010/9/10  <wellsk40@gmail.com>:

> This patch series updates drivers and platforms that depend on the
> amba_pl022 driver and use the pl022_config_chip structure for
> setting up the SPI mode and data transfer width.

I get regressions from the ab8500-spi.c driver from this patch:

> ssp-pl022 ssp0: ARM PL022 driver, device ID: 0x01080022
> pl022: mapped registers from 0x80002000 to d0834000
> ab8500-spi spi0.0: unknown chip, revision: 0x80
> ab8500-spi: probe of spi0.0 failed with error -22

The 0x80 above used to be 0x00 before these patches.
So all of a sudden bit 7 gets set...

I don't know why this happens, probably some flag that used to
be set had not been properly propagated in the first patch to alter
the AB8500 device registration?

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 26+ messages in thread

* amba_pl022 spi->mode fix/cleanup patches
@ 2010-09-13 15:19   ` Linus Walleij
  0 siblings, 0 replies; 26+ messages in thread
From: Linus Walleij @ 2010-09-13 15:19 UTC (permalink / raw)
  To: linux-arm-kernel

2010/9/10  <wellsk40@gmail.com>:

> This patch series updates drivers and platforms that depend on the
> amba_pl022 driver and use the pl022_config_chip structure for
> setting up the SPI mode and data transfer width.

I get regressions from the ab8500-spi.c driver from this patch:

> ssp-pl022 ssp0: ARM PL022 driver, device ID: 0x01080022
> pl022: mapped registers from 0x80002000 to d0834000
> ab8500-spi spi0.0: unknown chip, revision: 0x80
> ab8500-spi: probe of spi0.0 failed with error -22

The 0x80 above used to be 0x00 before these patches.
So all of a sudden bit 7 gets set...

I don't know why this happens, probably some flag that used to
be set had not been properly propagated in the first patch to alter
the AB8500 device registration?

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: amba_pl022 spi->mode fix/cleanup patches
  2010-09-13 15:19   ` Linus Walleij
  (?)
@ 2010-09-13 16:52     ` Kevin Wells
  -1 siblings, 0 replies; 26+ messages in thread
From: Kevin Wells @ 2010-09-13 16:52 UTC (permalink / raw)
  To: Linus Walleij, wellsk40
  Cc: rabin.vincent, linux, sameo, Lukasz.Baj, srinidhi.kasagar,
	linux-kernel, u.kleine-koenig, tj, spi-devel-general,
	linux-arm-kernel

> 
> 2010/9/10  <wellsk40@gmail.com>:
> 
> > This patch series updates drivers and platforms that depend on the
> > amba_pl022 driver and use the pl022_config_chip structure for
> > setting up the SPI mode and data transfer width.
> 
> I get regressions from the ab8500-spi.c driver from this patch:
> 
> > ssp-pl022 ssp0: ARM PL022 driver, device ID: 0x01080022
> > pl022: mapped registers from 0x80002000 to d0834000
> > ab8500-spi spi0.0: unknown chip, revision: 0x80
> > ab8500-spi: probe of spi0.0 failed with error -22
> 
> The 0x80 above used to be 0x00 before these patches.
> So all of a sudden bit 7 gets set...
> 
> I don't know why this happens, probably some flag that used to
> be set had not been properly propagated in the first patch to alter
> the AB8500 device registration?
> 

I found a bug in the SPI driver for the SPHA field. This would effect
SPI mode 1/3 users. Can you please try it once more with the fix?
(see fix in patch email)
I was hoping these changes would be very minor, but I have limited
hardware to do SPI testing without resorting to loopback mode.

Thanks!
Kevin


^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: amba_pl022 spi->mode fix/cleanup patches
@ 2010-09-13 16:52     ` Kevin Wells
  0 siblings, 0 replies; 26+ messages in thread
From: Kevin Wells @ 2010-09-13 16:52 UTC (permalink / raw)
  To: Linus Walleij, wellsk40
  Cc: rabin.vincent, linux, sameo, Lukasz.Baj, srinidhi.kasagar,
	linux-kernel, u.kleine-koenig, tj, spi-devel-general,
	linux-arm-kernel

> 
> 2010/9/10  <wellsk40@gmail.com>:
> 
> > This patch series updates drivers and platforms that depend on the
> > amba_pl022 driver and use the pl022_config_chip structure for
> > setting up the SPI mode and data transfer width.
> 
> I get regressions from the ab8500-spi.c driver from this patch:
> 
> > ssp-pl022 ssp0: ARM PL022 driver, device ID: 0x01080022
> > pl022: mapped registers from 0x80002000 to d0834000
> > ab8500-spi spi0.0: unknown chip, revision: 0x80
> > ab8500-spi: probe of spi0.0 failed with error -22
> 
> The 0x80 above used to be 0x00 before these patches.
> So all of a sudden bit 7 gets set...
> 
> I don't know why this happens, probably some flag that used to
> be set had not been properly propagated in the first patch to alter
> the AB8500 device registration?
> 

I found a bug in the SPI driver for the SPHA field. This would effect
SPI mode 1/3 users. Can you please try it once more with the fix?
(see fix in patch email)
I was hoping these changes would be very minor, but I have limited
hardware to do SPI testing without resorting to loopback mode.

Thanks!
Kevin

^ permalink raw reply	[flat|nested] 26+ messages in thread

* amba_pl022 spi->mode fix/cleanup patches
@ 2010-09-13 16:52     ` Kevin Wells
  0 siblings, 0 replies; 26+ messages in thread
From: Kevin Wells @ 2010-09-13 16:52 UTC (permalink / raw)
  To: linux-arm-kernel

> 
> 2010/9/10  <wellsk40@gmail.com>:
> 
> > This patch series updates drivers and platforms that depend on the
> > amba_pl022 driver and use the pl022_config_chip structure for
> > setting up the SPI mode and data transfer width.
> 
> I get regressions from the ab8500-spi.c driver from this patch:
> 
> > ssp-pl022 ssp0: ARM PL022 driver, device ID: 0x01080022
> > pl022: mapped registers from 0x80002000 to d0834000
> > ab8500-spi spi0.0: unknown chip, revision: 0x80
> > ab8500-spi: probe of spi0.0 failed with error -22
> 
> The 0x80 above used to be 0x00 before these patches.
> So all of a sudden bit 7 gets set...
> 
> I don't know why this happens, probably some flag that used to
> be set had not been properly propagated in the first patch to alter
> the AB8500 device registration?
> 

I found a bug in the SPI driver for the SPHA field. This would effect
SPI mode 1/3 users. Can you please try it once more with the fix?
(see fix in patch email)
I was hoping these changes would be very minor, but I have limited
hardware to do SPI testing without resorting to loopback mode.

Thanks!
Kevin

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: amba_pl022 spi->mode fix/cleanup patches
  2010-09-10 16:19 ` wellsk40 at gmail.com
@ 2010-09-16  3:14   ` Grant Likely
  -1 siblings, 0 replies; 26+ messages in thread
From: Grant Likely @ 2010-09-16  3:14 UTC (permalink / raw)
  To: wellsk40
  Cc: linus.walleij, spi-devel-general, sameo, rabin.vincent,
	srinidhi.kasagar, linux-kernel, linux, u.kleine-koenig,
	linux-arm-kernel, tj, Lukasz.Baj, quentinyang05

On Fri, Sep 10, 2010 at 09:19:34AM -0700, wellsk40@gmail.com wrote:
> This patch series updates drivers and platforms that depend on the
> amba_pl022 driver and use the pl022_config_chip structure for
> setting up the SPI mode and data transfer width.
> 
> The SPI configuration (CPOL/CPHA mode, bit send order, data bits per
> word, and loopback mode) were previously setup as part of board
> specific data in the pl022_config_chip structure. This has been
> changed to now use the .mode field in spi_board_info structure (or
> drivers that setup the mode). The SPI transfer's data width is now
> configured from spi->bits_per_word.
> 
> The SPI driver changes have been previously submitted to the SPI ML.
> This patch series need to be layered on that patch series.
> 
> These changes add or fix the .mode field in the plats/boards that use the
> driver (u300, ux500, lpc32xx). The patches also move the data width
> from the board specific area to the driver for mfd/ab8500. As the
> fields in the pl022_config_chip structure are no longer needed, they
> are removed in the last patch.
> 
> These changes have been tested on the phy3250 platform (lpc32xx). I
> was able to test the ab8500 driver to some degree, but I only have a
> standard pl022. I am unable to test u300 and ux500 changes, but the
> u300 changes compiled fine.
> 
> [PATCH 1/5] mfd/ab8500: Setup SPI transfer for 24 bits
> [PATCH 2/5] ARM: LPC32XX: Add missing SPI mode and remove unused fields
> [PATCH 3/5] ARM: U300: spi->mode and spi_bits_per_words updates
> [PATCH 4/5] ARM: Ux500: Change SPI mode and remove unused fields
> [PATCH 5/5] spi: amba_pl022: Remove unused fields from pl022_config_chip

There are ordering issues with these patches and the patch they depend
on.  Basically, as-is it is not bisectable.  The above platforms stop
working after the SPI driver changes are applied, but before these
patches are.  You'll need to update the mode field for all the users
in or before the SPI driver changes patch to preserve bisectability.
Then you can have subsequent cleanup patches....

Or just squash all the patches into the SPI driver patch.  I'd be
okay with that in this case because the board changes are well
contained and easy to understand.

g.


^ permalink raw reply	[flat|nested] 26+ messages in thread

* amba_pl022 spi->mode fix/cleanup patches
@ 2010-09-16  3:14   ` Grant Likely
  0 siblings, 0 replies; 26+ messages in thread
From: Grant Likely @ 2010-09-16  3:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Sep 10, 2010 at 09:19:34AM -0700, wellsk40 at gmail.com wrote:
> This patch series updates drivers and platforms that depend on the
> amba_pl022 driver and use the pl022_config_chip structure for
> setting up the SPI mode and data transfer width.
> 
> The SPI configuration (CPOL/CPHA mode, bit send order, data bits per
> word, and loopback mode) were previously setup as part of board
> specific data in the pl022_config_chip structure. This has been
> changed to now use the .mode field in spi_board_info structure (or
> drivers that setup the mode). The SPI transfer's data width is now
> configured from spi->bits_per_word.
> 
> The SPI driver changes have been previously submitted to the SPI ML.
> This patch series need to be layered on that patch series.
> 
> These changes add or fix the .mode field in the plats/boards that use the
> driver (u300, ux500, lpc32xx). The patches also move the data width
> from the board specific area to the driver for mfd/ab8500. As the
> fields in the pl022_config_chip structure are no longer needed, they
> are removed in the last patch.
> 
> These changes have been tested on the phy3250 platform (lpc32xx). I
> was able to test the ab8500 driver to some degree, but I only have a
> standard pl022. I am unable to test u300 and ux500 changes, but the
> u300 changes compiled fine.
> 
> [PATCH 1/5] mfd/ab8500: Setup SPI transfer for 24 bits
> [PATCH 2/5] ARM: LPC32XX: Add missing SPI mode and remove unused fields
> [PATCH 3/5] ARM: U300: spi->mode and spi_bits_per_words updates
> [PATCH 4/5] ARM: Ux500: Change SPI mode and remove unused fields
> [PATCH 5/5] spi: amba_pl022: Remove unused fields from pl022_config_chip

There are ordering issues with these patches and the patch they depend
on.  Basically, as-is it is not bisectable.  The above platforms stop
working after the SPI driver changes are applied, but before these
patches are.  You'll need to update the mode field for all the users
in or before the SPI driver changes patch to preserve bisectability.
Then you can have subsequent cleanup patches....

Or just squash all the patches into the SPI driver patch.  I'd be
okay with that in this case because the board changes are well
contained and easy to understand.

g.

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2010-09-16  3:14 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-10 16:19 amba_pl022 spi->mode fix/cleanup patches wellsk40
2010-09-10 16:19 ` wellsk40 at gmail.com
2010-09-10 16:19 ` [PATCH 1/5] mfd/ab8500: Setup SPI transfer for 24 bits wellsk40
2010-09-10 16:19   ` wellsk40 at gmail.com
2010-09-10 16:19 ` [PATCH 2/5] ARM: LPC32XX: Add missing SPI mode and remove unused fields wellsk40
2010-09-10 16:19   ` wellsk40 at gmail.com
2010-09-10 16:19   ` wellsk40-Re5JQEeQqe8AvxtiuMwx3w
2010-09-10 16:19 ` [PATCH 3/5] ARM: U300: spi->mode and spi_bits_per_words updates wellsk40
2010-09-10 16:19   ` wellsk40 at gmail.com
2010-09-10 16:19 ` [PATCH 4/5] ARM: Ux500: Change SPI mode and remove unused fields wellsk40
2010-09-10 16:19   ` wellsk40 at gmail.com
2010-09-10 16:19   ` wellsk40-Re5JQEeQqe8AvxtiuMwx3w
2010-09-10 16:19 ` [PATCH 5/5] spi: amba_pl022: Remove unused fields from pl022_config_chip wellsk40
2010-09-10 16:19   ` wellsk40 at gmail.com
2010-09-13 13:22   ` Linus Walleij
2010-09-13 13:22     ` Linus Walleij
2010-09-13 14:55     ` Linus Walleij
2010-09-13 14:55       ` Linus Walleij
2010-09-13 15:19 ` amba_pl022 spi->mode fix/cleanup patches Linus Walleij
2010-09-13 15:19   ` Linus Walleij
2010-09-13 15:19   ` Linus Walleij
2010-09-13 16:52   ` Kevin Wells
2010-09-13 16:52     ` Kevin Wells
2010-09-13 16:52     ` Kevin Wells
2010-09-16  3:14 ` Grant Likely
2010-09-16  3:14   ` Grant Likely

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.