- 29 7月, 2020 1 次提交
-
-
由 Jon Lin 提交于
The burst length can be adjusted according to the transmission length to improve the transmission rate Signed-off-by: NJon Lin <jon.lin@rock-chips.com> Tested-by: NEmil Renner Berthing <kernel@esmil.dk> Reviewed-by: NEmil Renner Berthing <kernel@esmil.dk> Link: https://lore.kernel.org/r/20200723004356.6390-1-jon.lin@rock-chips.comSigned-off-by: NMark Brown <broonie@kernel.org>
-
- 16 5月, 2020 3 次提交
-
-
由 Chris Ruehl 提交于
The original implementation set num_chipselect to ROCKCHIP_SPI_MAX_CS_NUM (2) which seems wrong here. spi0 has 2 native cs, all others just one. With enable and use of cs_gpiods / GPIO CS, its correct to set the num_chipselect from the num-cs property and set max_native_cs with the define. If num-cs is missing the default set to num_chipselect = 1. Signed-off-by: NChris Ruehl <chris.ruehl@gtsys.com.hk> Link: https://lore.kernel.org/r/20200511083022.23678-4-chris.ruehl@gtsys.com.hkSigned-off-by: NMark Brown <broonie@kernel.org>
-
由 Chris Ruehl 提交于
Add support for spi slave mode in spi-rockchip. The register map has an entry for it. If spi-slave is set in dts, set this corresponding bit and add to mode_bits the SPI_NO_CS, allow slave mode without explicit CS use. Slave abort function had been added. Signed-off-by: NChris Ruehl <chris.ruehl@gtsys.com.hk> Link: https://lore.kernel.org/r/20200511083022.23678-3-chris.ruehl@gtsys.com.hkSigned-off-by: NMark Brown <broonie@kernel.org>
-
由 Chris Ruehl 提交于
Cleanup, move from the compatibily layer struct spi_master over to struct spi_controller, and rename the related function calls. Signed-off-by: NChris Ruehl <chris.ruehl@gtsys.com.hk> Link: https://lore.kernel.org/r/20200511083022.23678-2-chris.ruehl@gtsys.com.hkSigned-off-by: NMark Brown <broonie@kernel.org>
-
- 10 3月, 2020 1 次提交
-
-
由 Johan Jonker 提交于
The Rockchip spi binding is updated to yaml and new models were added. The spi on px30,rk3308 and rk3328 are the same as other Rockchip based SoCs, so add compatible string for it. Signed-off-by: NJohan Jonker <jbx6244@gmail.com> Link: https://lore.kernel.org/r/20200309151004.7780-1-jbx6244@gmail.comSigned-off-by: NMark Brown <broonie@kernel.org>
-
- 05 6月, 2019 1 次提交
-
-
由 Thomas Gleixner 提交于
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms and conditions of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 263 file(s). Signed-off-by: NThomas Gleixner <tglx@linutronix.de> Reviewed-by: NAllison Randal <allison@lohutok.net> Reviewed-by: NAlexios Zavras <alexios.zavras@intel.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141901.208660670@linutronix.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 15 5月, 2019 1 次提交
-
-
由 Suren Baghdasaryan 提交于
kthread.h can't be included in psi_types.h because it creates a circular inclusion with kthread.h eventually including psi_types.h and complaining on kthread structures not being defined because they are defined further in the kthread.h. Resolve this by removing psi_types.h inclusion from the headers included from kthread.h. Link: http://lkml.kernel.org/r/20190319235619.260832-7-surenb@google.comSigned-off-by: NSuren Baghdasaryan <surenb@google.com> Acked-by: NJohannes Weiner <hannes@cmpxchg.org> Cc: Dennis Zhou <dennis@kernel.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: Li Zefan <lizefan@huawei.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 08 5月, 2019 1 次提交
-
-
由 Emil Renner Berthing 提交于
This fixes tx and bi-directional dma transfers on rk3399-gru-kevin. It seems the SPI fifo must have room for 2 bursts when the dma_tx_req signal is generated or it might skip some words. This in turn makes the rx dma channel never complete for bi-directional transfers. Fix it by setting tx burst length to fifo_len / 4 and the dma watermark to fifo_len / 2. However the rk3399 TRM says (sic): "DMAC support incrementing-address burst and fixed-address burst. But in the case of access SPI and UART at byte or halfword size, DMAC only support fixed-address burst and the address must be aligned to word." So this relies on fifo_len being a multiple of 16 such that the burst length (= fifo_len / 4) is a multiple of 4 and the addresses will be word-aligned. Fixes: dcfc861d ("spi: rockchip: adjust dma watermark and burstlen") Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 05 11月, 2018 14 次提交
-
-
由 Emil Renner Berthing 提交于
Add missing support for lsb-first mode. Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Tested-by: NHeiko Stuebner <heiko@sntech.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Emil Renner Berthing 提交于
The hardware supports 4, 8 and 16bit spi words, so add the missing support for 4bit words. Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Tested-by: NHeiko Stuebner <heiko@sntech.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Emil Renner Berthing 提交于
Register an interrupt handler to fill/empty the tx and rx fifos rather than busy-looping. Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Tested-by: NHeiko Stuebner <heiko@sntech.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Emil Renner Berthing 提交于
Now that we no longer potentially change spi clock at runtime we can precompute the rx sample delay at probe time rather than for each transfer. Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Tested-by: NHeiko Stuebner <heiko@sntech.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Emil Renner Berthing 提交于
The driver previously checked each transfer if the requested speed was higher than possible with the current spi clock rate and raised the clock rate accordingly. However, there is no check to see if the spi clock was actually set that high and no way to dynamically lower the spi clock rate again. So it seems any potiential users of this functionality are better off just setting the spi clock rate at init using the assigned-clock-rates devicetree property. Removing this dynamic spi clock rate raising allows us let the spi framework handle min/max speeds for us. Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Tested-by: NHeiko Stuebner <heiko@sntech.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Emil Renner Berthing 提交于
We only need to know if we're using dma when setting up the transfer, so just use a local variable for that. Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Tested-by: NHeiko Stuebner <heiko@sntech.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Emil Renner Berthing 提交于
In almost all cases we already have a pointer to the spi master structure where we have the driver data. The only exceptions are the dma callbacks which are easily fixed by passing them the master and using spi_master_get_devdata to retrieve the driver data. Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Tested-by: NHeiko Stuebner <heiko@sntech.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Emil Renner Berthing 提交于
The spi master (aka spi controller) structure already has two fields for storing the rx and tx dma channels. Just use them rather than duplicating them in driver data. Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Tested-by: NHeiko Stuebner <heiko@sntech.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Emil Renner Berthing 提交于
Just read transfer info directly from the spi device and transfer structures rather than storing it in driver data first. Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Tested-by: NHeiko Stuebner <heiko@sntech.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Emil Renner Berthing 提交于
Successful transfers leave the spi disabled, so if we just make sure to disable the spi on error there should be no need to disable the spi from master->unprepare_message. This also flushes the tx and rx fifos, so no need to do that manually. Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Tested-by: NHeiko Stuebner <heiko@sntech.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Emil Renner Berthing 提交于
The state field is currently only used to make sure only the last of the tx and rx dma callbacks issue an spi_finalize_current_transfer. Rather than using a spinlock we can get away with just turning the state field into an atomic_t. Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Tested-by: NHeiko Stuebner <heiko@sntech.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Emil Renner Berthing 提交于
The hardware supports 3 different variants of SPI and there were some code around it, but nothing to actually set it to anything but "Motorola SPI". Just drop that code and always use that mode. Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Tested-by: NHeiko Stuebner <heiko@sntech.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Emil Renner Berthing 提交于
Use C99 designated initializers for dma slave config structures. This also makes sure uninitialized fields are zeroed so we don't need an explicit memset. Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Tested-by: NHeiko Stuebner <heiko@sntech.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Emil Renner Berthing 提交于
The spi_enable_chip function takes a boolean argument. Change the type to reflect that. Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Tested-by: NHeiko Stuebner <heiko@sntech.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 11 10月, 2018 6 次提交
-
-
由 Emil Renner Berthing 提交于
Let the dma/non-dma code paths handle the spi enable flag themselves. This removes some logic to determine if the flag should be turned on before or after dma and also don't leave the spi enabled if the dma path fails. Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Emil Renner Berthing 提交于
The dma direction for the tx and rx dma channels never change, so just use the constants directly rather than storing them in device data. Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Emil Renner Berthing 提交于
The driver data has a u32 field use_dma which is only ever used as a boolean, so change its type to reflect that. Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Emil Renner Berthing 提交于
We no longer need the dma_caps since the dma driver already clamps the burst length to the hardware limit, so don't request and store dma_caps in device data. Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Huibin Hong 提交于
Signal tx dma when spi fifo is less than half full, and limit tx bursts to half the fifo length. Clamp rx burst length to 1 to avoid alignment issues. Signed-off-by: NHuibin Hong <huibin.hong@rock-chips.com> Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Huibin Hong 提交于
The rxconf and txconf structs are allocated on the stack, so make sure we zero them before filling out the relevant fields. Signed-off-by: NHuibin Hong <huibin.hong@rock-chips.com> Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 16 8月, 2017 1 次提交
-
-
由 Huibin Hong 提交于
CTRLR1 is number of data frames, when rx only. When data frame is 8 bit, CTRLR1 is len-1. When data frame is 16 bit, CTRLR1 is (len/2)-1. Signed-off-by: NHuibin Hong <huibin.hong@rock-chips.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 15 8月, 2017 1 次提交
-
-
由 Andy Yan 提交于
The spi on rv1108 is the same as other rockchip based socs, add compatible string for it. Signed-off-by: NAndy Yan <andy.yan@rock-chips.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 07 8月, 2017 3 次提交
-
-
由 Jeffy Chen 提交于
The runtime suspend callback might be called by pm domain framework at suspend_noirq stage. It would try to disable the clocks which already been disabled by rockchip_spi_suspend. Call pm_runtime_force_suspend/pm_runtime_force_resume when suspend/resume to avoid that. Signed-off-by: NJeffy Chen <jeffy.chen@rock-chips.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Jeffy Chen 提交于
We are assuming clocks enabled when calling rockchip_spi_remove, which is not always true. Those clocks might already been disabled by the runtime PM at that time. Call pm_runtime_get_sync before trying to disable clocks to avoid that. Signed-off-by: NJeffy Chen <jeffy.chen@rock-chips.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Jeffy Chen 提交于
Slightly rework return value handling, no functional changes. Signed-off-by: NJeffy Chen <jeffy.chen@rock-chips.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 29 6月, 2017 2 次提交
-
-
由 Jeffy Chen 提交于
The rockchip spi would stop driving pins when runtime suspended, which might break slave's xfer(for example cros_ec). Since we have pullups on those pins, we only need to care about this when the CS asserted. So let's keep the spi alive when chip select is asserted. Also use pm_runtime_put instead of pm_runtime_put_sync. Suggested-by: NDoug Anderson <dianders@chromium.org> Signed-off-by: NJeffy Chen <jeffy.chen@rock-chips.com> Reviewed-by: NDouglas Anderson <dianders@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Jeffy Chen 提交于
The rockchip spi still requires slave selection when using GPIO CS. Signed-off-by: NJeffy Chen <jeffy.chen@rock-chips.com> Reviewed-by: NDouglas Anderson <dianders@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 14 6月, 2017 1 次提交
-
-
由 Jeffy Chen 提交于
After failed to request dma tx chain, we need to disable pm_runtime. Also cleanup error labels for better readability. Signed-off-by: NJeffy Chen <jeffy.chen@rock-chips.com> Reviewed-by: NBrian Norris <briannorris@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 19 12月, 2016 1 次提交
-
-
由 Brian Norris 提交于
In the pattern of many other devices, support a system-sleep pin configuration. Signed-off-by: NBrian Norris <briannorris@chromium.org> Reviewed-by: NDouglas Anderson <dianders@chromium.org> Tested-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 21 7月, 2016 1 次提交
-
-
由 Brian Norris 提交于
The Rockchip SPI controller's length register only supports 16-bits, yielding a maximum length of 64KiB (the CTRLR1 register holds "length - 1"). Trying to transfer more than that (e.g., with a large SPI flash read) will cause the driver to hang. Now, it seems that while theoretically we should be able to program CTRLR1 with 0xffff, and get a 64KiB transfer, but that also seems to cause the core to choke, so stick with a maximum of 64K - 1 bytes -- i.e., 0xffff. Signed-off-by: NBrian Norris <briannorris@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 08 6月, 2016 1 次提交
-
-
由 Tomeu Vizoso 提交于
When using DMA, the transfer_one callback should return 1 because the transfer hasn't finished yet. A previous commit changed the function to return 0 when the DMA channels were correctly prepared. This manifested in Veyron boards with this message: [ 1.983605] cros-ec-spi spi0.0: EC failed to respond in time Fixes: ea984911 ("spi: rockchip: check return value of dmaengine_prep_slave_sg") Signed-off-by: NTomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 01 6月, 2016 1 次提交
-
-
由 Caesar Wang 提交于
In gerenal, the "rockchip,rockchip-spi" string will match the dts that's great in spi driver. After all the most of rockchip SoCs ar same spi controller. Then, we should keep the old style to match the dts various. Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-