While configuring QUP in SPI slave mode, an internal
HW signal needs to propagate from AHB clock domain
to SPI core clock domain. To make sure a safe and
correct propagation of this signal the software should
perform the SPI HW init sequence in proper order.
Change-Id: Ied621bb5d1ba793ce48c5a6a0f6be3b86b3a6773
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
QUP state entry exposes the state of the SPI QUP
hardware. It tells whether SPI QUP is in run state,
pause state or reset state.
Change-Id: Idc012a30f78846ff5b4c6da20adcf68a7cd2b4d3
Signed-off-by: Dilip Kota <dkota@codeaurora.org>
For SPI slave, software reset performs long pulse
reset. Software should wait for QUP to be in valid
state before doing operations on QUP.
Change-Id: Ifbed295df87a6c5c383cedb431b368b3dffca676
Signed-off-by: Dilip Kota <dkota@codeaurora.org>
The QUP core can be programmed to operate as an SPI slave. This
change modifies the existing SPI master driver and adds the slave
functionality.
Change-Id: I73189339956e0fd52449391737fb1e616a6e0bb2
Signed-off-by: Dilip Kota <dkota@codeaurora.org>
Do not call runtime suspend forcefully while holding the mutex as runtime
suspend also tries to acquire the same mutex. Instead acquire it properly
with the condition of runtime_pm enablement status without mutex.
Change-Id: I2347820e81ded0821e6f56a415af3bed17a951b4
Signed-off-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org>
when set_cs() is called by framework, first check the device suspend
status and if not suspended then proceed for register access. Let system
suspend call SPI runtime suspend but make sure set_cs doesn't race with
it by holding the mutex.
Change-Id: Id6d05ac37227bf3358438eeedf279ddd1c9aab8b
Signed-off-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org>
SPI core has a characterstic that it always sends data in FIFO word size
when we compress the data and fill the FIFO. This helps to improve the
overall througput but sometimes for the data transfers which is not
aligned to FIFO Word [i.e 4] it pads extra bytes and sends out which can
mislead spi slave device.
Do not enable packing if it's a FIFO mode transfer and data size is not
aligned to FIFO word size.
Change-Id: I28f4e3e38db4b882f229c00aa54aabdc72d2c139
Signed-off-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org>
These changes will merge back the enhancemnts done to improve the medium
side transfers. This was reverted temporarily till the fix identified.
Change-Id: Ib7ac92ecefe7ca3ff9f03716c51dc31b8322ee33
Signed-off-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org>
If the set_cs() call is made when the device has suspended then don't
try to make the register writes to force cs and return back to the
framework. Also remove the runtime PM calls from set_cs, these should be
done in the prepare/unprepare_transfer_hardware calls from the framework.
Modify the prepare_transfer_hardware_call() to fail if the runtime
framework is not enabled and in addition don't try to call the runtime
suspend callbacks from the system suspend callback as this could race with
an on-going SPI transfer.
Change-Id: Idc714b1024c1f181a4db59d5552d7ab9100c511f
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
Set the DMA mask for the SPI device appropriately.
This will alleviate usage of bounce buffers by the dma kernel library and
prevent some of the crashes due to the kernel running out of bounce
buffers.
Change-Id: I7b0b123be6e7bb1e30d0755ca8b1b72ea4e2b5f6
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
The unmap operation of a dma bounce buffer is performed using an incorrect
device compared to the map operation. This leads to a leaked bounce buffer
dma map.
Fix the device usage during the unmap operation.
CRs-Fixed: 1104864
Change-Id: I7da2484ce1f070a4545b9110e3602b4f39d7afdc
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Reverting the changes provided to improve small transfer rate.
Change-Id: Ifc1ae0ccbd0f991523f4715fbb1ff9951b268986
Signed-off-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org>
The spi_qsd driver allows peeking/poking registers via debugfs.
Currently a static variable is used as the user data to get to the spi
controller data structure. Unfortunately this means that the last device
to probe is always obtained.
Fix this to use a member of the spi controller data structure instead.
Change-Id: I711354941b4168f3f6ffe2d29185597bdad4da89
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
For smaller transfers when DMA mode isn't used improve the transfer
latencies by being more effecient when moving data to the hardware
FIFO especially when using bits_per_word that is less than 32. This
will reduce the number of interrupts being generated in such transfers
helping in overall transaction latency.
Change-Id: I6ddd933d4a43a4d24d7b5310a678a19411a14f2c
Signed-off-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org>
This change adds a snapshot of SPI QSD driver from the 3.18 branch.
kernel-3.18 baseline: e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1
Change-Id: I6e2a4be429a2681603a12e5ecb6853582cd3ffbe
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>