- 20 6月, 2018 8 次提交
-
-
由 Esben Haabendal 提交于
This prepares for adding support for extended SPI mode (XSPI), by extending the regmap with the extra SREX and CTAREx registers. An additional register map is made for allowing 16 bit access to CMD and TX FIFO of the PUSHR register separately, which is also needed for XSPI mode support. Signed-off-by: NEsben Haabendal <eha@deif.com> Acked-by: NMartin Hundebøll <martin@geanix.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Esben Haabendal 提交于
Mark volatile registers to avoid caching bugs. Note: SPI_MCR is marked volatile because of CLR_TXF and CLR_RXF bits. Signed-off-by: NEsben Haabendal <eha@deif.com> Acked-by: NMartin Hundebøll <martin@geanix.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Esben Haabendal 提交于
The MCR register is not changed, so initialize it in dspi_init(). The exception is the CLR_TXF and CLR_RXF bits, which should be written to before each transfer to make sure we start with empty FIFOs. With MCR register now configured as volatile, the regmap_update_bits will do a real read-modify-write cycle. Signed-off-by: NEsben Haabendal <eha@deif.com> Acked-by: NMartin Hundebøll <martin@geanix.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Esben Haabendal 提交于
This extends the driver with support for all SPI framesizes from 4 to 16 bits, and adds support for per transfer specific bits_per_word, while at the same time reducing code size and complexity. Signed-off-by: NEsben Haabendal <eha@deif.com> Acked-by: NMartin Hundebøll <martin@geanix.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Esben Haabendal 提交于
Simplify driver by avoiding counter wrapping by clearing transfer counter on first SPI transfer per interrupt instead of tracking what it was before. Signed-off-by: NEsben Haabendal <eha@deif.com> Acked-by: NMartin Hundebøll <martin@geanix.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Esben Haabendal 提交于
As of 92dc20d8, transfer->cs_change has been supported for non-last transfers, but not for last transfer. This change brings handling of cs_change in line with the specification in spi.h, implementing handling of transfer->cs_change for all transfers. The value for CMD FIFO is precalculated with transfer->cs_change field taken into account, allowing for CS de-activate between transfers and keeping CS activated after last transfer. Signed-off-by: NEsben Haabendal <eha@deif.com> Acked-by: NMartin Hundebøll <martin@geanix.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Esben Haabendal 提交于
Checking directly against pointer value should be at least as fast as doing bitmasking and compare, so let's keep it simple. Signed-off-by: NEsben Haabendal <eha@deif.com> Acked-by: NMartin Hundebøll <martin@geanix.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Esben Haabendal 提交于
The if statement just above this if/else statement triggers on the same condition, and then invalidates it. Signed-off-by: NEsben Haabendal <eha@deif.com> Acked-by: NMartin Hundebøll <martin@geanix.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 03 1月, 2018 1 次提交
-
-
由 Julia Lawall 提交于
This driver creates a number of const structures that it stores in the data field of an of_device_id array. The data field of an of_device_id structure has type const void *, so there is no need for a const-discarding cast when putting const values into such a structure. Done using Coccinelle. Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 16 11月, 2017 1 次提交
-
-
由 Kurt Kanzenbach 提交于
The driver as well as the controller support the SPI lsb first mode. However, it's not possible to configure it e.g. when using spidev. Adding this flag to mode_bits resolves the issue and lsb first mode can be used. Signed-off-by: NKurt Kanzenbach <kurt@linutronix.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 03 11月, 2017 1 次提交
-
-
由 Angelo Dureghello 提交于
Signed-off-by: NAngelo Dureghello <angelo@sysam.it> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 22 5月, 2017 1 次提交
-
-
由 Nikita Yushchenko 提交于
Propagate error return from dspi_request_dma() into probe routine's return. Signed-off-by: NNikita Yushchenko <nikita.yoush@cogentembedded.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 20 2月, 2017 1 次提交
-
-
由 Christophe JAILLET 提交于
According to error handling in this function, it is likely that going to 'out_master_put' was expected here. Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 23 11月, 2016 3 次提交
-
-
由 Sanchayan Maity 提交于
Current DMA implementation was not handling the continuous selection format viz. SPI chip select would be deasserted even between sequential serial transfers. Use existing dspi_data_to_pushr function to restructure the transmit code path and set or reset the CONT bit on same lines as code path in EOQ mode does. This correctly implements continuous selection format while also correcting and cleaning up the transmit code path. Signed-off-by: NSanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Sanchayan Maity 提交于
Currently dmaengine_prep_slave_single was being called with length set to the complete DMA buffer size. This resulted in unwanted bytes being transferred to the SPI register leading to clock and MOSI lines having unwanted data even after chip select got deasserted and the required bytes having been transferred. While at it also clean up the use of curr_xfer_len which is central to the DMA setup, from bytes to DMA transfers for every use. Signed-off-by: NSanchayan Maity <maitysanchayan@gmail.com> Reviewed-by: NStefan Agner <stefan@agner.ch> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Sanchayan Maity 提交于
Buffers allocated with a call to dma_alloc_coherent should be freed with dma_free_coherent instead of the currently used devm_kfree. Signed-off-by: NSanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 18 11月, 2016 1 次提交
-
-
由 Sanchayan Maity 提交于
Current DMA implementation had a bug where the DMA transfer would exit the loop in dspi_transfer_one_message after the completion of a single transfer. This results in a multi message transfer submitted with SPI_IOC_MESSAGE to terminate incorrectly without an error. Signed-off-by: NSanchayan Maity <maitysanchayan@gmail.com> Reviewed-by: NStefan Agner <stefan@agner.ch> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 11 11月, 2016 1 次提交
-
-
由 Sanchayan Maity 提交于
Add DMA support for Vybrid. Signed-off-by: NSanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 30 10月, 2016 1 次提交
-
-
由 Yuan Yao 提交于
Once dspi is used in uboot, the SPI_SR have been set by some value. At this time, if kernel enable the interrupt before clear the status flag, that will trigger the wrong interrupt. Signed-off-by: NYuan Yao <yao.yuan@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 23 8月, 2016 2 次提交
-
-
由 Wei Yongjun 提交于
The call sequence spi_alloc_master/spi_register_master/spi_unregister_master is complete; it reduces the device reference count to zero, which and results in device memory being freed. The subsequent call to spi_master_put is unnecessary and results in an access to free memory. Drop it. Fixes: 9298bc72 ("spi: spi-fsl-dspi: Remove spi-bitbang") Signed-off-by: NWei Yongjun <weiyj.lk@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Fabio Estevam 提交于
clk_prepare_enable() may fail, so we should better check its return value and propagate it in the case of failure. Signed-off-by: NFabio Estevam <fabio.estevam@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 16 8月, 2016 2 次提交
-
-
由 LABBE Corentin 提交于
of_match_device could return NULL, and so cause a NULL pointer dereference later. For fixing this problem, we use of_device_get_match_data(), this will simplify the code a little by using a standard function for getting the match data. Reported-by: coverity (CID 1324129) Signed-off-by: NLABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 LABBE Corentin 提交于
of_id->data is const, so instead of casting the pointer to drop its const status, this patch constify the devtype_data pointer. Signed-off-by: NLABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 06 4月, 2016 1 次提交
-
-
由 Andrey Vostrikov 提交于
There are use cases when chip select should be triggered between transfers in single SPI message. Current implementation does this only on last transfer in message ignoring cs_change value provided in current transfer. Signed-off-by: NAndrey Vostrikov <andrey.vostrikov@cogentembedded.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 23 3月, 2016 1 次提交
-
-
由 Bhuvanchandra DV 提交于
Calculate and update max speed from bus clock for SoCs using DSPI IP. The bus clock factor's are taken from the data sheets of respective SoCs. Signed-off-by: NBhuvanchandra DV <bhuvanchandra.dv@toradex.com> Acked-by: NStefan Agner <stefan@agner.ch> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 13 12月, 2015 1 次提交
-
-
由 Bhuvanchandra DV 提交于
DSPI instances in Vybrid have a different amount of chip selects and CTARs (Clock and transfer Attributes Register). In case of DSPI1 we only have 2 CTAR registers and 4 CS. In present driver implementation CTAR offset is derived from CS instance which will lead to out of bound access if chip select instance is greater than CTAR register instance, hence use single CTAR0 register for all CS instances. Since we write the CTAR register anyway before each access, there is no value in using the additional CTAR registers. Also one should not program a value in CTAS for a CTAR register that is not present, hence configure CTAS to use CTAR0. Signed-off-by: NBhuvanchandra DV <bhuvanchandra.dv@toradex.com> Acked-by: NStefan Agner <stefan@agner.ch> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 18 9月, 2015 1 次提交
-
-
由 Jarkko Nikula 提交于
SPI core makes sure that transfer speed is always set so code here writes the same register with the same value twice. Code has been doing this from the beginning. This looks to me some sort of copy paste error so I'm removing the second write. If this is not the case we can bring it back with a comment. Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 13 6月, 2015 1 次提交
-
-
由 Mirza Krak 提交于
Add support for "sleep" state of pinctrl. Signed-off-by: NMirza Krak <mirza.krak@hostmobility.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 10 6月, 2015 2 次提交
-
-
由 Haikun Wang 提交于
In current driver, we increase actual_length in the following way: message->actual_length += dspi_xxx_transfer() It has two defects. First, transmitting maybe in process when the function call finished and we don't know the transmitting result in this moment. Secondly, the last sentence in function before returning is accessing the SPI register and trigger the data transmitting. If we enable interrupt, interrupt may be generated before function return and we also have the same sentence "message->actual_length += dspi_xxx_transfer()" in the IRQ handler. And usually dspi_xxx_transfer will trigger a new IRQ. The original dspi_xxx_transfer call may return when no new IRQ generate. This may mess the variable spi_message->actual_length. Now we increase the variable in the IRQ handler and only when we get the TCF or EOQ interrupt And we get the transmitted data length from the SPI transfer counter instead of the function return value. Signed-off-by: NHaikun Wang <haikun.wang@freescale.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Haikun Wang 提交于
DSPI module has two optional interrupts when complete data transfer. One is EOQ interrupt, the other one is TCF interrupt. EOQ indicates a queue of data frame has been transmitted. TCF indicates a frame has been transmitted. This patch enable support TCF mode. Driver binds a correct interrupt mode to every compatible string. User should use the correct compatible string in the dts node. Signed-off-by: NHaikun Wang <haikun.wang@freescale.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 22 5月, 2015 1 次提交
-
-
由 Haikun Wang 提交于
SPI chip select signal need to keep asserted between several spi_transfer in the same spi_message usually. But the driver will de-assert CS signal and the assert it between serval spi_transfer in the same spi_message under some condiations. This patch fix the bug. Here is an example: Assume you have two variables like the following, struct spi_transfer a; struct spi_transfer b; if you send a spi_message only includes 'a' first, and then you send a spi_message includes 'a' and 'b' but without resetting 'a'. Driver will de-assert CS and then assert CS between 'a' and 'b'. Signed-off-by: NHaikun Wang <haikun.wang@freescale.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 24 4月, 2015 1 次提交
-
-
由 Haikun Wang 提交于
It is unnecessary for DSPI to enable/disable clk when access DSPI register. And it will reduce efficiency. Signed-off-by: NHaikun Wang <haikun.wang@freescale.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 07 4月, 2015 2 次提交
-
-
由 Aaron Brice 提交于
Add delay between chip select and clock signals, before clock starts and after clock stops. Signed-off-by: NAaron Brice <aaron.brice@datasoft.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Aaron Brice 提交于
Previous algorithm had an outer loop with the values {2,3,5,7} and an inner loop with {2,4,6,8,16,32,...,32768}, and would pick the first value over the required scaling value (where the total scale was the two numbers multiplied). Since the inner loop went up to 32768 it would always pick a value of 2 for PBR and a much higher than necessary value for BR. The desired scale factor was being divided by two I believe to compensate for the much higher scale factors (the divide by two not specified in the reference manual). Updated to check all values and find the smallest scale factor possible without going over the desired clock rate. Signed-off-by: NAaron Brice <aaron.brice@datasoft.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 31 3月, 2015 1 次提交
-
-
由 Aaron Brice 提交于
Previous algorithm had an outer loop with the values {2,3,5,7} and an inner loop with {2,4,6,8,16,32,...,32768}, and would pick the first value over the required scaling value (where the total scale was the two numbers multiplied). Since the inner loop went up to 32768 it would always pick a value of 2 for PBR and a much higher than necessary value for BR. The desired scale factor was being divided by two I believe to compensate for the much higher scale factors (the divide by two not specified in the reference manual). Updated to check all values and find the smallest scale factor possible without going over the desired clock rate. Signed-off-by: NAaron Brice <aaron.brice@datasoft.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 03 2月, 2015 1 次提交
-
-
由 Bhuvanchandra DV 提交于
Move the check for spi->bits_per_word before allocation, to avoid memory leak. Reported-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NBhuvanchandra DV <bhuvanchandra.dv@toradex.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 29 1月, 2015 1 次提交
-
-
由 Chao Fu 提交于
DSPI module need cs change information in a spi transfer. According to cs change, DSPI will give last data the right flag. Bitbang provide cs change behind the last data in a transfer. So DSPI can not deal the last data in every transfer properly, so remove the bitbang in the driver. Signed-off-by: NBhuvanchandra DV <bhuvanchandra.dv@toradex.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 28 1月, 2015 1 次提交
-
-
由 Bhuvanchandra DV 提交于
devm_* API was supposed to be used only in probe function call. Memory is allocated at 'probe' and free automatically at 'remove'. Usage of devm_* functions outside probe sometimes leads to memory leak. Avoid using devm_kzalloc in dspi_setup_transfer and use kzalloc instead. Also add the dspi_cleanup function to free the controller data upon cleanup. Acked-by: NStefan Agner <stefan@agner.ch> Signed-off-by: NBhuvanchandra DV <bhuvanchandra.dv@toradex.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 04 11月, 2014 1 次提交
-
-
由 Alexander Stein 提交于
There are only 4 CTAR registers (CTAR0 - CTAR3) so we can only use the lower 2 bits of the chip select to select a CTAR register. SPI_PUSHR_CTAS used the lower 3 bits which would result in wrong bit values if the chip selects 4/5 are used. For those chip selects SPI_CTAR even calculated offsets of non-existing registers. Signed-off-by: NAlexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 20 10月, 2014 1 次提交
-
-
由 Xiubo Li 提交于
Since we are using regmap framework's internal locks, so the lock_arg for dspi_regmap_config is redundant here. This patch just remove it, and then the dspi_regmap_config could be const type. Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-