aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/mt7621-spi (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-06-17staging: mt7621-spi: Remove unnecessary braces {} from single statement if block.Sankalp Negi1-2/+1
The patch fixes following checkpatch.pl issue: WARNING : braces {} are not necessary for single statement blocks Signed-off-by: Sankalp Negi <sankalpnegi2310@gmail.com> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-17staging: mt7621-spi: Add a space before open paranthesis.Sankalp Negi1-1/+1
The patch fixes following checkpatch.pl issue: ERROR : space required before the open parenthesis Signed-off-by: Sankalp Negi <sankalpnegi2310@gmail.com> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-17staging: mt7621-spi: Use tabs for indentation instead of spaces.Sankalp Negi1-1/+1
The patch fixes following checkpatch.pl issue: ERROR : code indent should use tabs where possible Signed-off-by: Sankalp Negi <sankalpnegi2310@gmail.com> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-17staging: mt7621-spi: Fix line over 80 characters by refactoring.Sankalp Negi1-1/+2
The patch fixes following checkpatch.pl issue: WARNING : line over 80 characters Signed-off-by: Sankalp Negi <sankalpnegi2310@gmail.com> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-17staging: mt7621-spi: Indent case labels and switch at the same level.Sankalp Negi1-11/+11
The patch fixes following checkpatch.pl issue: ERROR : switch and case should be at the same indent Signed-off-by: Sankalp Negi <sankalpnegi2310@gmail.com> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-17staging: mt7621-spi: revised half-duplex message handlingNeilBrown1-67/+98
The mt7621 SPI engine has a 32 byte buffer and the driver currently only allows 32-byte read requests and 36 bytes writes (there is a 4byte op/addr buffer). This is an unnecessary limitation. As the SPI clock is controlled by the host it is quite acceptable to send a larger message in multiple smaller transactions. As long as Chip Select is kept asserted the whole time, the SPI engine can be run multiple times for a single SPI message. This patch factors out the transaction logic and calls for each transfer in the message. A write transfer might leave bytes in the buffer to be combined with a following read transfer, as this is a common pattern. With this in place, we can remove the current max_transfer_size limit. In testing, this increases the read throughput for a NOR flash chip from 1.4MB/s to 2.3MB/s, a 50% improvement. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-17staging: mt7621-spi: change mt7621_spi_wait_till_ready to take struct mt7621_spiNeilBrown1-6/+5
All callers have a 'struct mt7621_spi' and that is all mt7621_spi_wait_till_ready() needs. So just pass it instead of the spi_device. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: mt7621-spi: remove unused lock.NeilBrown1-3/+0
This lock is never initialized, locked once, and never unlocked. Clearly it is pointless - so remove it. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-spi: Remove redundant owner assignmentChristian Lütke-Stetzkamp1-1/+0
Remove the owner assignment form the platform driver as platform_driver_register() already initializes the owner. Found using coccinelle. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-19staging: mt7621-spi: add mt7621 supportJohn Crispin4-0/+501
NeilBrown: The code will fail with a warning if asked to transfer more than 32 bytes at a time. So used max_transfer_size interface to tell users about this. Signed-off-by: John Crispin <blogic@openwrt.org> Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>