spi: Bug fixes for v3.18

A couple of small driver fixes for v3.18, both quite problematic if you
 hit a use case that's affected.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJUXKDwAAoJECTWi3JdVIfQIn8H/1+j+DVzOISeS+xivOrcAc6h
 +FeTWRUJMP/1jqeqWImLB8jFpyAMF6l6kV/D9XOc+FojmCM/xcg4ewj+Z/uqYekO
 a8TU9+ymHGuPpZcn7LEGZy2KjvKPS7KqBxZ9FNGiFhfDvv41vuYOKReU6Dauc7m9
 FNPApIG0l1J0SA8Osok3bip7oQGcx1hJsmDB2X0GkN7QSk4+FCYxmk0vtlXJK0at
 1aksQsgwv4GZLrFD01V2kxyYFubbt5JEDOKRU+QvNmUB+gohdZ6cAHBy1rGomc4a
 /Twru9QP/4Pve7JgSNnuoQoSiE7GWrxDa40CFpB89ZHnhJAz/1utJcuK2OzDcKo=
 =hDs9
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2014-11-07 11:54:44 -08:00
commit 1395b9cfd5
2 changed files with 7 additions and 4 deletions

View file

@ -46,7 +46,7 @@
#define SPI_TCR 0x08
#define SPI_CTAR(x) (0x0c + (x * 4))
#define SPI_CTAR(x) (0x0c + (((x) & 0x3) * 4))
#define SPI_CTAR_FMSZ(x) (((x) & 0x0000000f) << 27)
#define SPI_CTAR_CPOL(x) ((x) << 26)
#define SPI_CTAR_CPHA(x) ((x) << 25)
@ -70,7 +70,7 @@
#define SPI_PUSHR 0x34
#define SPI_PUSHR_CONT (1 << 31)
#define SPI_PUSHR_CTAS(x) (((x) & 0x00000007) << 28)
#define SPI_PUSHR_CTAS(x) (((x) & 0x00000003) << 28)
#define SPI_PUSHR_EOQ (1 << 27)
#define SPI_PUSHR_CTCNT (1 << 26)
#define SPI_PUSHR_PCS(x) (((1 << x) & 0x0000003f) << 16)

View file

@ -1274,7 +1274,9 @@ static int pxa2xx_spi_suspend(struct device *dev)
if (status != 0)
return status;
write_SSCR0(0, drv_data->ioaddr);
clk_disable_unprepare(ssp->clk);
if (!pm_runtime_suspended(dev))
clk_disable_unprepare(ssp->clk);
return 0;
}
@ -1288,7 +1290,8 @@ static int pxa2xx_spi_resume(struct device *dev)
pxa2xx_spi_dma_resume(drv_data);
/* Enable the SSP clock */
clk_prepare_enable(ssp->clk);
if (!pm_runtime_suspended(dev))
clk_prepare_enable(ssp->clk);
/* Restore LPSS private register bits */
lpss_ssp_setup(drv_data);