diff options
author | Linus Walleij <linus.walleij@stericsson.com> | 2009-08-15 10:12:05 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-18 17:09:02 -0400 |
commit | ee2b805c8eb6459cf541ef141ff70dae17af59ca (patch) | |
tree | ca1e0f1988e71f2285ca336d88c5da2c5efa8c71 | |
parent | a2ca00ea9398265a26eabb358bba83c8b75c463d (diff) |
ARM: 5678/1: SSP/SPI PL022 polarity terminology fix
The definition of the SPI clock phase for the Motorola mode of
the PL022 driver was incorrect: the spec had been interpreted as
data being recieved on rising or falling edge of the clocks while
the correct interpretation is that data can be recieved on the
first or second edge transition, falling or rising depending on
the polarity setting.
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-u300/spi.c | 2 | ||||
-rw-r--r-- | drivers/spi/amba-pl022.c | 8 | ||||
-rw-r--r-- | include/linux/amba/pl022.h | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/arch/arm/mach-u300/spi.c b/arch/arm/mach-u300/spi.c index 307d007ea7f3..f0e887bea30e 100644 --- a/arch/arm/mach-u300/spi.c +++ b/arch/arm/mach-u300/spi.c | |||
@@ -48,7 +48,7 @@ struct pl022_config_chip dummy_chip_info = { | |||
48 | .data_size = SSP_DATA_BITS_8, /* used to be 12 in some default */ | 48 | .data_size = SSP_DATA_BITS_8, /* used to be 12 in some default */ |
49 | .rx_lev_trig = SSP_RX_1_OR_MORE_ELEM, | 49 | .rx_lev_trig = SSP_RX_1_OR_MORE_ELEM, |
50 | .tx_lev_trig = SSP_TX_1_OR_MORE_EMPTY_LOC, | 50 | .tx_lev_trig = SSP_TX_1_OR_MORE_EMPTY_LOC, |
51 | .clk_phase = SSP_CLK_FALLING_EDGE, | 51 | .clk_phase = SSP_CLK_SECOND_EDGE, |
52 | .clk_pol = SSP_CLK_POL_IDLE_LOW, | 52 | .clk_pol = SSP_CLK_POL_IDLE_LOW, |
53 | .ctrl_len = SSP_BITS_12, | 53 | .ctrl_len = SSP_BITS_12, |
54 | .wait_state = SSP_MWIRE_WAIT_ZERO, | 54 | .wait_state = SSP_MWIRE_WAIT_ZERO, |
diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c index da76797ce8b9..35521af0d0d7 100644 --- a/drivers/spi/amba-pl022.c +++ b/drivers/spi/amba-pl022.c | |||
@@ -534,7 +534,7 @@ static void restore_state(struct pl022 *pl022) | |||
534 | GEN_MASK_BITS(SSP_DATA_BITS_12, SSP_CR0_MASK_DSS, 0) | \ | 534 | GEN_MASK_BITS(SSP_DATA_BITS_12, SSP_CR0_MASK_DSS, 0) | \ |
535 | GEN_MASK_BITS(SSP_MICROWIRE_CHANNEL_FULL_DUPLEX, SSP_CR0_MASK_HALFDUP, 5) | \ | 535 | GEN_MASK_BITS(SSP_MICROWIRE_CHANNEL_FULL_DUPLEX, SSP_CR0_MASK_HALFDUP, 5) | \ |
536 | GEN_MASK_BITS(SSP_CLK_POL_IDLE_LOW, SSP_CR0_MASK_SPO, 6) | \ | 536 | GEN_MASK_BITS(SSP_CLK_POL_IDLE_LOW, SSP_CR0_MASK_SPO, 6) | \ |
537 | GEN_MASK_BITS(SSP_CLK_FALLING_EDGE, SSP_CR0_MASK_SPH, 7) | \ | 537 | GEN_MASK_BITS(SSP_CLK_SECOND_EDGE, SSP_CR0_MASK_SPH, 7) | \ |
538 | GEN_MASK_BITS(NMDK_SSP_DEFAULT_CLKRATE, SSP_CR0_MASK_SCR, 8) | \ | 538 | GEN_MASK_BITS(NMDK_SSP_DEFAULT_CLKRATE, SSP_CR0_MASK_SCR, 8) | \ |
539 | GEN_MASK_BITS(SSP_BITS_8, SSP_CR0_MASK_CSS, 16) | \ | 539 | GEN_MASK_BITS(SSP_BITS_8, SSP_CR0_MASK_CSS, 16) | \ |
540 | GEN_MASK_BITS(SSP_INTERFACE_MOTOROLA_SPI, SSP_CR0_MASK_FRF, 21) \ | 540 | GEN_MASK_BITS(SSP_INTERFACE_MOTOROLA_SPI, SSP_CR0_MASK_FRF, 21) \ |
@@ -1249,8 +1249,8 @@ static int verify_controller_parameters(struct pl022 *pl022, | |||
1249 | return -EINVAL; | 1249 | return -EINVAL; |
1250 | } | 1250 | } |
1251 | if (chip_info->iface == SSP_INTERFACE_MOTOROLA_SPI) { | 1251 | if (chip_info->iface == SSP_INTERFACE_MOTOROLA_SPI) { |
1252 | if ((chip_info->clk_phase != SSP_CLK_RISING_EDGE) | 1252 | if ((chip_info->clk_phase != SSP_CLK_FIRST_EDGE) |
1253 | && (chip_info->clk_phase != SSP_CLK_FALLING_EDGE)) { | 1253 | && (chip_info->clk_phase != SSP_CLK_SECOND_EDGE)) { |
1254 | dev_err(chip_info->dev, | 1254 | dev_err(chip_info->dev, |
1255 | "Clock Phase is configured incorrectly\n"); | 1255 | "Clock Phase is configured incorrectly\n"); |
1256 | return -EINVAL; | 1256 | return -EINVAL; |
@@ -1487,7 +1487,7 @@ static int pl022_setup(struct spi_device *spi) | |||
1487 | chip_info->data_size = SSP_DATA_BITS_12; | 1487 | chip_info->data_size = SSP_DATA_BITS_12; |
1488 | chip_info->rx_lev_trig = SSP_RX_1_OR_MORE_ELEM; | 1488 | chip_info->rx_lev_trig = SSP_RX_1_OR_MORE_ELEM; |
1489 | chip_info->tx_lev_trig = SSP_TX_1_OR_MORE_EMPTY_LOC; | 1489 | chip_info->tx_lev_trig = SSP_TX_1_OR_MORE_EMPTY_LOC; |
1490 | chip_info->clk_phase = SSP_CLK_FALLING_EDGE; | 1490 | chip_info->clk_phase = SSP_CLK_SECOND_EDGE; |
1491 | chip_info->clk_pol = SSP_CLK_POL_IDLE_LOW; | 1491 | chip_info->clk_pol = SSP_CLK_POL_IDLE_LOW; |
1492 | chip_info->ctrl_len = SSP_BITS_8; | 1492 | chip_info->ctrl_len = SSP_BITS_8; |
1493 | chip_info->wait_state = SSP_MWIRE_WAIT_ZERO; | 1493 | chip_info->wait_state = SSP_MWIRE_WAIT_ZERO; |
diff --git a/include/linux/amba/pl022.h b/include/linux/amba/pl022.h index dcad0ffd1755..e4836c6b3dd7 100644 --- a/include/linux/amba/pl022.h +++ b/include/linux/amba/pl022.h | |||
@@ -136,12 +136,12 @@ enum ssp_tx_level_trig { | |||
136 | 136 | ||
137 | /** | 137 | /** |
138 | * enum SPI Clock Phase - clock phase (Motorola SPI interface only) | 138 | * enum SPI Clock Phase - clock phase (Motorola SPI interface only) |
139 | * @SSP_CLK_RISING_EDGE: Receive data on rising edge | 139 | * @SSP_CLK_FIRST_EDGE: Receive data on first edge transition (actual direction depends on polarity) |
140 | * @SSP_CLK_FALLING_EDGE: Receive data on falling edge | 140 | * @SSP_CLK_SECOND_EDGE: Receive data on second edge transition (actual direction depends on polarity) |
141 | */ | 141 | */ |
142 | enum ssp_spi_clk_phase { | 142 | enum ssp_spi_clk_phase { |
143 | SSP_CLK_RISING_EDGE, | 143 | SSP_CLK_FIRST_EDGE, |
144 | SSP_CLK_FALLING_EDGE | 144 | SSP_CLK_SECOND_EDGE |
145 | }; | 145 | }; |
146 | 146 | ||
147 | /** | 147 | /** |