From a560943ead2cbded93c30c9b04886f3c743d7f00 Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Tue, 1 Oct 2013 13:15:47 -0700 Subject: [PATCH] spi: spi-mxs: Don't set clock for each xfer mxs_spi_setup_transfer() would set the SSP SCK rate every time it was called, which is before every transfer. It is uncommon for the SCK rate to change between transfers (or at all of that matter) and this causes many unnecessary reprogrammings of the clock registers. Code changed to only set the rate when it changes. This significantly speeds up short SPI messages, especially messages made up of many transfers, as the calculation of the clock divisors is rather costly. On an iMX287, using spidev with messages that consist of 511 transfers of 4 bytes each at an SCK of 48 MHz, the effective transfer rate more than doubles from about 290 KB/sec to 600 KB/sec! Signed-off-by: Trent Piepho Cc: Marek Vasut Cc: Fabio Estevam Cc: Shawn Guo Signed-off-by: Mark Brown --- Reading git-format-patch failed