diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-11-07 14:54:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-11-07 14:54:44 -0500 |
commit | 1395b9cfd5b9b979a3b937df963158e62940016b (patch) | |
tree | 8bd6d6f1b1a61a564c23f1c2a0fad24cf39dbf21 | |
parent | ed78bb846e8bc1a8589fa6e0d9bf2b0f518893d5 (diff) | |
parent | 4e72b4278dbc228e4dc453d4dfeca997e521d9af (diff) |
Merge tag 'spi-v3.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi bugfixes from Mark Brown:
"A couple of small driver fixes for v3.18, both quite problematic if
you hit a use case that's affected"
* tag 'spi-v3.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
spi: pxa2xx: toggle clocks on suspend if not disabled by runtime PM
spi: fsl-dspi: Fix CTAR selection
-rw-r--r-- | drivers/spi/spi-fsl-dspi.c | 4 | ||||
-rw-r--r-- | drivers/spi/spi-pxa2xx.c | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index 448216025ce8..831ceb4a91f6 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c | |||
@@ -46,7 +46,7 @@ | |||
46 | 46 | ||
47 | #define SPI_TCR 0x08 | 47 | #define SPI_TCR 0x08 |
48 | 48 | ||
49 | #define SPI_CTAR(x) (0x0c + (x * 4)) | 49 | #define SPI_CTAR(x) (0x0c + (((x) & 0x3) * 4)) |
50 | #define SPI_CTAR_FMSZ(x) (((x) & 0x0000000f) << 27) | 50 | #define SPI_CTAR_FMSZ(x) (((x) & 0x0000000f) << 27) |
51 | #define SPI_CTAR_CPOL(x) ((x) << 26) | 51 | #define SPI_CTAR_CPOL(x) ((x) << 26) |
52 | #define SPI_CTAR_CPHA(x) ((x) << 25) | 52 | #define SPI_CTAR_CPHA(x) ((x) << 25) |
@@ -70,7 +70,7 @@ | |||
70 | 70 | ||
71 | #define SPI_PUSHR 0x34 | 71 | #define SPI_PUSHR 0x34 |
72 | #define SPI_PUSHR_CONT (1 << 31) | 72 | #define SPI_PUSHR_CONT (1 << 31) |
73 | #define SPI_PUSHR_CTAS(x) (((x) & 0x00000007) << 28) | 73 | #define SPI_PUSHR_CTAS(x) (((x) & 0x00000003) << 28) |
74 | #define SPI_PUSHR_EOQ (1 << 27) | 74 | #define SPI_PUSHR_EOQ (1 << 27) |
75 | #define SPI_PUSHR_CTCNT (1 << 26) | 75 | #define SPI_PUSHR_CTCNT (1 << 26) |
76 | #define SPI_PUSHR_PCS(x) (((1 << x) & 0x0000003f) << 16) | 76 | #define SPI_PUSHR_PCS(x) (((1 << x) & 0x0000003f) << 16) |
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index d8a105f76837..9e9e0f971e6c 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c | |||
@@ -1274,7 +1274,9 @@ static int pxa2xx_spi_suspend(struct device *dev) | |||
1274 | if (status != 0) | 1274 | if (status != 0) |
1275 | return status; | 1275 | return status; |
1276 | write_SSCR0(0, drv_data->ioaddr); | 1276 | write_SSCR0(0, drv_data->ioaddr); |
1277 | clk_disable_unprepare(ssp->clk); | 1277 | |
1278 | if (!pm_runtime_suspended(dev)) | ||
1279 | clk_disable_unprepare(ssp->clk); | ||
1278 | 1280 | ||
1279 | return 0; | 1281 | return 0; |
1280 | } | 1282 | } |
@@ -1288,7 +1290,8 @@ static int pxa2xx_spi_resume(struct device *dev) | |||
1288 | pxa2xx_spi_dma_resume(drv_data); | 1290 | pxa2xx_spi_dma_resume(drv_data); |
1289 | 1291 | ||
1290 | /* Enable the SSP clock */ | 1292 | /* Enable the SSP clock */ |
1291 | clk_prepare_enable(ssp->clk); | 1293 | if (!pm_runtime_suspended(dev)) |
1294 | clk_prepare_enable(ssp->clk); | ||
1292 | 1295 | ||
1293 | /* Restore LPSS private register bits */ | 1296 | /* Restore LPSS private register bits */ |
1294 | lpss_ssp_setup(drv_data); | 1297 | lpss_ssp_setup(drv_data); |