spi: dw: Add mem_ops
authorSean Anderson <seanga2@gmail.com>
Fri, 16 Oct 2020 22:57:53 +0000 (18:57 -0400)
committerJagan Teki <jagan@amarulasolutions.com>
Fri, 18 Dec 2020 10:46:37 +0000 (16:16 +0530)
commitfec7bf0460dbf5a6744e1f98298a9b664f856a34
tree63b07738b3ea02b39d75d78d123e453148ed44ac
parent0d98f6de62dc02cbdbf0a40bdb02e465256e2150
spi: dw: Add mem_ops

The designware ssi device has "broken" chip select behaviour [1], and needs
specific manipulation to use the built-in chip select. The existing fix is
to use an external GPIO for chip select, but typically the K210 has SPI3
directly connected to a flash chip with dedicated pins. This makes it
impossible to use the spi_xfer function to use spi, since the CS is
de-asserted in between calls.  This patch adds an implementation of
exec_op, which gives correct behaviour when reading/writing spi flash.

This patch also rearranges the headers to conform to U-Boot style.

[1] https://lkml.org/lkml/2015/12/23/132

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
drivers/spi/designware_spi.c