linux/drivers/spi
Flavio Suligoi 29f2133717
spi: pxa2xx: fix SCR (divisor) calculation
Calculate the divisor for the SCR (Serial Clock Rate), avoiding
that the SSP transmission rate can be greater than the device rate.

When the division between the SSP clock and the device rate generates
a reminder, we have to increment by one the divisor.
In this way the resulting SSP clock will never be greater than the
device SPI max frequency.

For example, with:

 - ssp_clk  = 50 MHz
 - dev freq = 15 MHz

without this patch the SSP clock will be greater than 15 MHz:

 - 25 MHz for PXA25x_SSP and CE4100_SSP
 - 16,56 MHz for the others

Instead, with this patch, we have in both case an SSP clock of 12.5MHz,
so the max rate of the SPI device clock is respected.

Signed-off-by: Flavio Suligoi <f.suligoi@asem.it>
Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-02 10:38:39 +09:00
..
Kconfig spi: sifive: Add driver for the SiFive SPI controller 2019-02-19 15:28:53 +00:00
Makefile spi: sifive: Add driver for the SiFive SPI controller 2019-02-19 15:28:53 +00:00
atmel-quadspi.c spi: atmel-quadspi: add support for sam9x60 qspi controller 2019-02-06 17:21:00 +00:00
internals.h spi: Add an helper to flush the message queue 2018-04-23 15:48:18 +01:00
spi-altera.c
spi-armada-3700.c Merge remote-tracking branches 'spi/topic/a3700', 'spi/topic/atmel', 'spi/topic/bcm53xx', 'spi/topic/davinci' and 'spi/topic/dw' into spi-next 2018-01-26 17:57:24 +00:00
spi-at91-usart.c spi: fix spi-at91-usart.c build errors when PINCTRL is not set 2018-12-03 11:57:14 +00:00
spi-ath79.c spi: ath79: Remove now useless code 2019-01-17 12:34:55 +00:00
spi-atmel.c spi-atmel: support inter-word delay 2019-01-30 23:02:11 +00:00
spi-au1550.c
spi-axi-spi-engine.c
spi-bcm-qspi.c spi: bcm-qspi: switch back to reading flash using smaller chunks 2018-10-11 15:00:34 +01:00
spi-bcm-qspi.h
spi-bcm63xx-hsspi.c spi/bcm63xx-hsspi: keep pll clk enabled 2018-09-18 09:16:34 -07:00
spi-bcm63xx.c
spi-bcm2835.c spi: bcm2835: Synchronize with callback on DMA termination 2018-12-04 16:51:55 +00:00
spi-bcm2835aux.c spi: bcm2835aux: remove unneeded NULL check of devm_clk_get 2019-01-23 10:31:21 +00:00
spi-bitbang-txrx.h
spi-bitbang.c spi: bitbang: Don't call chipselect() in spi_bitbang_setup() 2019-01-17 12:34:14 +00:00
spi-brcmstb-qspi.c
spi-butterfly.c spi: add flags parameter to txrx_word function pointers 2018-08-01 14:50:24 +01:00
spi-cadence.c spi: cadence: Fix default polarity of native chipselect 2019-01-24 19:03:11 +00:00
spi-cavium-octeon.c
spi-cavium-thunderx.c
spi-cavium.c
spi-cavium.h
spi-clps711x.c spi: clps711x: Convert to use CS GPIO descriptors 2019-01-09 12:41:58 +00:00
spi-coldfire-qspi.c
spi-davinci.c spi: davinci: Get rid of dangling variable 2019-01-10 11:54:13 +00:00
spi-dln2.c
spi-dw-mid.c spi: dw: Convert to generalized SPI controller API 2018-02-12 12:04:16 +00:00
spi-dw-mmio.c spi: dw: Convert to use CS GPIO descriptors 2019-01-09 12:42:18 +00:00
spi-dw-pci.c
spi-dw.c Merge branch 'for-5.0' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-5.1 2019-02-20 17:58:18 +00:00
spi-dw.h dw: spi: add support for Amazon's Alpine spi controller 2018-10-11 15:11:04 +01:00
spi-efm32.c
spi-ep93xx.c spi: spi-ep93xx: Use dma_data_direction for ep93xx_spi_dma_{finish,prepare} 2018-10-09 00:11:28 +01:00
spi-falcon.c
spi-fsl-cpm.c
spi-fsl-cpm.h
spi-fsl-dspi.c Merge branch 'for-5.0' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-5.1 2019-02-20 17:58:18 +00:00
spi-fsl-espi.c spi: Do not print a message if spi_controller_{suspend,resume}() fails 2018-09-05 12:38:27 +01:00
spi-fsl-lib.c
spi-fsl-lib.h
spi-fsl-lpspi.c spi: lpspi: fix dataloss when SS is inactivated between every words 2019-03-21 15:02:28 +00:00
spi-fsl-qspi.c spi: spi-mem: spi-fsl-qspi: typo fix in author name 2019-01-29 12:12:03 +00:00
spi-fsl-spi.c
spi-fsl-spi.h
spi-geni-qcom.c spi: spi-geni-qcom: Get rid of forward declaration 2019-01-14 12:24:05 +00:00
spi-gpio.c spi: spi-gpio: Remove spi->controller_data comment 2019-04-04 12:57:05 +07:00
spi-img-spfi.c spi: img-spfi: Set device select bits for SPFI port state 2018-07-30 16:31:54 +01:00
spi-imx.c spi: imx: stop buffer overflow in RX FIFO flush 2019-03-13 15:16:24 +00:00
spi-iproc-qspi.c
spi-jcore.c spi: jcore: disable ref_clk after getting its rate 2018-03-18 17:57:42 -07:00
spi-lantiq-ssc.c
spi-lm70llp.c spi: add flags parameter to txrx_word function pointers 2018-08-01 14:50:24 +01:00
spi-loopback-test.c
spi-lp8841-rtc.c
spi-mem.c Merge branch 'for-5.0' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-5.1 2019-02-20 17:58:18 +00:00
spi-meson-spicc.c spi: meson-spicc: Fix error handling in meson_spicc_probe() 2018-05-02 05:59:21 +09:00
spi-meson-spifc.c
spi-mpc52xx-psc.c
spi-mpc52xx.c spi: mpc52xx: Use gpio_is_valid() 2018-04-27 12:05:39 +01:00
spi-mpc512x-psc.c
spi-mt65xx.c spi: mediatek: add spi support for mt7629 IC 2018-11-27 14:17:20 +00:00
spi-mxic.c spi: Add MXIC controller driver 2018-11-05 11:55:06 +00:00
spi-mxs.c spi: mxs: add tracing to custom .transfer_one_message callback 2019-01-29 15:08:58 +00:00
spi-npcm-pspi.c spi: npcm-pspi: Fix wrong priv pointer 2019-01-03 12:27:17 +00:00
spi-nuc900.c
spi-nxp-fspi.c spi: spi-mem: spi-nxp-fspi: add module license info 2019-01-29 11:55:41 +00:00
spi-oc-tiny.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
spi-omap-100k.c
spi-omap-uwire.c
spi-omap2-mcspi.c spi: omap2-mcspi: Fix DMA and FIFO event trigger size mismatch 2019-01-15 13:17:04 +00:00
spi-orion.c spi: orion: cosmetics - alias long direct_access variables 2018-09-03 15:14:18 +01:00
spi-pic32-sqi.c spi: pic32-sqi: don't pass GFP_DMA32 to dma_alloc_coherent 2018-10-17 11:11:32 +01:00
spi-pic32.c spi: pic32: fix dma channels termination 2019-04-01 15:24:47 +07:00
spi-pl022.c spi: pl022: add a message state STATE_TIMEOUT for timeout transfer 2019-01-28 18:23:04 +00:00
spi-ppc4xx.c
spi-pxa2xx-dma.c pxa2xx: replace spi_master with spi_controller 2019-01-23 10:59:56 +00:00
spi-pxa2xx-pci.c pxa2xx: replace spi_master with spi_controller 2019-01-23 10:59:56 +00:00
spi-pxa2xx.c spi: pxa2xx: fix SCR (divisor) calculation 2019-05-02 10:38:39 +09:00
spi-pxa2xx.h pxa2xx: replace spi_master with spi_controller 2019-01-23 10:59:56 +00:00
spi-qcom-qspi.c spi: spi-qcom-qspi: Fix remaining driver nits 2018-11-22 14:38:13 +00:00
spi-qup.c
spi-rb4xx.c spi: rb4xx: Use SPI_BPW_MASK to set bits_per_word_mask 2018-10-10 12:48:06 +01:00
spi-rockchip.c spi: rockchip: support lsb-first mode 2018-11-05 11:42:43 +00:00
spi-rspi.c spi: rspi: Fix sequencer reset during initialization 2019-03-15 16:32:19 +00:00
spi-s3c24xx-fiq.S
spi-s3c24xx-fiq.h
spi-s3c24xx.c
spi-s3c64xx.c spi: spi-s3c64xx: Fix system resume support 2018-05-17 13:27:08 +09:00
spi-sc18is602.c
spi-sh-hspi.c spi: sh-hspi: Replace spi_master by spi_controller 2019-02-08 13:04:19 +00:00
spi-sh-msiof.c spi: sh-msiof: Restrict bits per word to 8/16/24/32 on R-Car Gen2/3 2019-03-04 00:02:28 +00:00
spi-sh-sci.c spi: add flags parameter to txrx_word function pointers 2018-08-01 14:50:24 +01:00
spi-sh.c spi: use SPDX identifier for Renesas drivers 2018-08-28 20:32:00 +01:00
spi-sifive.c spi: sifive: Remove redundant dev_err call in sifive_spi_probe() 2019-02-22 15:17:58 +00:00
spi-sirf.c spi: sirf: account for const type of of_device_id.data 2018-01-03 11:38:46 +00:00
spi-slave-mt27xx.c spi: mediatek: add spi slave for Mediatek MT2712 2018-09-28 14:29:14 +01:00
spi-slave-system-control.c spi: slave: Fix missing break in switch 2018-10-03 16:23:10 +01:00
spi-slave-time.c
spi-sprd-adi.c spi: sprd: Change to use devm_hwspin_lock_request_specific() 2018-06-26 13:52:27 -07:00
spi-sprd.c Merge branch 'for-5.0' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-5.1 2019-02-20 17:58:18 +00:00
spi-st-ssc4.c
spi-stm32-qspi.c spi: spi-mem: stm32-qspi: avoid memory corruption at low frequency 2019-03-15 16:32:33 +00:00
spi-stm32.c spi: stm32: add support for STM32F4 2019-01-07 18:25:48 +00:00
spi-sun4i.c
spi-sun6i.c
spi-tegra20-sflash.c
spi-tegra20-slink.c spi: tegra20-slink: change chip select action order 2019-03-27 12:33:33 +00:00
spi-tegra114.c spi: tegra114: avoid reset call in atomic context 2019-04-05 09:59:21 +07:00
spi-test.h
spi-ti-qspi.c spi: ti-qspi: Fix mmap read when more than one CS in use 2019-01-29 12:08:03 +00:00
spi-tle62x0.c
spi-topcliff-pch.c spi : spi-topcliff-pch: Fix to handle empty DMA buffers 2019-03-18 12:14:33 +00:00
spi-txx9.c
spi-uniphier.c spi: uniphier: remove unnecessary include headers 2018-08-02 11:08:06 +01:00
spi-xcomm.c
spi-xilinx.c
spi-xlp.c
spi-xtensa-xtfpga.c spi: add flags parameter to txrx_word function pointers 2018-08-01 14:50:24 +01:00
spi-zynqmp-gqspi.c spi: spi-zynqmp-gqspi: simplify getting .driver_data 2018-11-05 11:54:35 +00:00
spi.c spi: Add missing error handling for CS GPIOs 2019-04-04 12:58:18 +07:00
spidev.c spi: spidev: Fix OF tree warning logic 2018-10-10 13:46:54 +01:00