03 Oct, 2020
9 commits
-
s3c64xx_spi_hwinit() disables interrupts. In s3c64xx_spi_probe() after
calling s3c64xx_spi_hwinit() they are enabled with the following call.Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Łukasz Stelmach
Link: https://lore.kernel.org/r/20201002122243.26849-10-l.stelmach@samsung.com
Signed-off-by: Mark Brown -
Increase timeout by 30 ms for some wiggle room and set the minimum value
to 100 ms. This ensures a non-zero value for short transfers which
may take less than 1 ms. The timeout value does not affect
performance because it is used with a completion.Similar formula is used in other drivers e.g. sun4i, sun6i.
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Łukasz Stelmach
Link: https://lore.kernel.org/r/20201002122243.26849-9-l.stelmach@samsung.com
Signed-off-by: Mark Brown -
Make sure the cur_speed value used in s3c64xx_enable_datapath()
to configure DMA channel and in s3c64xx_wait_for_*() to calculate the
transfer timeout is set to the actual value of (half) the clock speed.Don't change non-CMU case, because no frequency calculation errors have
been reported.Reviewed-by: Krzysztof Kozlowski
Suggested-by: Tomasz Figa
Signed-off-by: Łukasz Stelmach
Link: https://lore.kernel.org/r/20201002122243.26849-8-l.stelmach@samsung.com
Signed-off-by: Mark Brown -
Remove descriptions for non-existent fields and fix indentation.
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Łukasz Stelmach
Link: https://lore.kernel.org/r/20201002122243.26849-7-l.stelmach@samsung.com
Signed-off-by: Mark Brown -
Rename S3C64XX_SPI_SLAVE_* to S3C64XX_SPI_CS_* to match documentation.
Signed-off-by: Łukasz Stelmach
Reviewed-by: Krzysztof Kozlowski
Link: https://lore.kernel.org/r/20201002122243.26849-6-l.stelmach@samsung.com
Signed-off-by: Mark Brown -
Report amount of pending data when a transfer stops due to errors.
Report if DMA was used to transfer data and print the status code.
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Łukasz Stelmach
Link: https://lore.kernel.org/r/20201002122243.26849-5-l.stelmach@samsung.com
Signed-off-by: Mark Brown -
Check return values in prepare_dma() and s3c64xx_spi_config() and
propagate errors upwards.Fixes: 788437273fa8 ("spi: s3c64xx: move to generic dmaengine API")
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Łukasz Stelmach
Link: https://lore.kernel.org/r/20201002122243.26849-4-l.stelmach@samsung.com
Signed-off-by: Mark Brown -
Fix issues with DMA transfers bigger than 512 bytes on Exynos3250. Without
the patches such transfers fail.The vendor kernel for ARTIK5 handles CS in a simmilar way.
Signed-off-by: Łukasz Stelmach
Reviewed-by: Krzysztof Kozlowski
Link: https://lore.kernel.org/r/20201002122243.26849-3-l.stelmach@samsung.com
Signed-off-by: Mark Brown -
Fix issues with DMA transfers bigger than 512 bytes on Exynos3250. Without
the patches such transfers fail to complete. This solution to the problem
is found in the vendor kernel for ARTIK5 boards based on Exynos3250.Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Łukasz Stelmach
Link: https://lore.kernel.org/r/20201002122243.26849-2-l.stelmach@samsung.com
Signed-off-by: Mark Brown
17 Jul, 2020
1 commit
-
Fixes the following W=1 kernel build warning(s):
drivers/spi/spi-s3c64xx.c:150: warning: Function parameter or member 'quirks' not described in 's3c64xx_spi_port_config'
drivers/spi/spi-s3c64xx.c:150: warning: Function parameter or member 'clk_ioclk' not described in 's3c64xx_spi_port_config'
drivers/spi/spi-s3c64xx.c:189: warning: Function parameter or member 'pdev' not described in 's3c64xx_spi_driver_data'
drivers/spi/spi-s3c64xx.c:189: warning: Function parameter or member 'rx_dma' not described in 's3c64xx_spi_driver_data'
drivers/spi/spi-s3c64xx.c:189: warning: Function parameter or member 'tx_dma' not described in 's3c64xx_spi_driver_data'
drivers/spi/spi-s3c64xx.c:189: warning: Function parameter or member 'port_conf' not described in 's3c64xx_spi_driver_data'
drivers/spi/spi-s3c64xx.c:189: warning: Function parameter or member 'port_id' not described in 's3c64xx_spi_driver_data'Signed-off-by: Lee Jones
Cc: Kukjin Kim
Cc: Krzysztof Kozlowski
Cc: Andi Shyti
Cc: Jaswinder Singh
Cc: linux-samsung-soc@vger.kernel.org
Link: https://lore.kernel.org/r/20200717135424.2442271-8-lee.jones@linaro.org
Signed-off-by: Mark Brown
15 Nov, 2019
1 commit
-
dma_request_slave_channel_reason() is:
#define dma_request_slave_channel_reason(dev, name) \
dma_request_chan(dev, name)Signed-off-by: Peter Ujfalusi
Acked-by: Krzysztof Kozlowski
Acked-by: Andi Shyti
Link: https://lore.kernel.org/r/20191113094256.1108-8-peter.ujfalusi@ti.com
Signed-off-by: Mark Brown
17 May, 2018
1 commit
-
Since Linux v4.10 release (commit 1d9174fbc55e "PM / Runtime: Defer
resuming of the device in pm_runtime_force_resume()"),
pm_runtime_force_resume() function doesn't runtime resume device if it was
not runtime active before system suspend. Thus, driver should not do any
register access after pm_runtime_force_resume() without checking the
runtime status of the device. To fix this issue, simply move
s3c64xx_spi_hwinit() call to s3c64xx_spi_runtime_resume() to ensure that
hardware is always properly initialized. This fixes Synchronous external
abort issue on system suspend/resume cycle on newer Exynos SoCs.Signed-off-by: Marek Szyprowski
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Mark Brown
Cc: stable@vger.kernel.org
25 Apr, 2018
1 commit
-
The Exynos5440 is not actively developed, there are no development
boards available and probably there are no real products with it.
Remove wide-tree support for Exynos5440.Signed-off-by: Krzysztof Kozlowski
Reviewed-by: Sylwester Nawrocki
Signed-off-by: Mark Brown
18 Apr, 2018
4 commits
-
Some variants of the SPI controller have no DMA support, in such case
SPI transfers longer than the FIFO length are not currently properly
handled by the driver. Fix it by doing multiple transfers in the
s3c64xx_spi_transfer_one() function if the SPI transfer length exceeds
the FIFO size.Signed-off-by: Sylwester Nawrocki
Reviewed-by: Andi Shyti
Signed-off-by: Mark Brown -
More references to fifo_len are added in subsequent patch.
Signed-off-by: Sylwester Nawrocki
Reviewed-by: Andi Shyti
Signed-off-by: Mark Brown -
Add a s3c64xx_ prefix to remaining generic function names so it is clear
the code is part of the driver when grepping or looking at debug logs.Signed-off-by: Sylwester Nawrocki
Reviewed-by: Andi Shyti
Signed-off-by: Mark Brown -
The spi pointer argument is not used now so remove it.
Signed-off-by: Sylwester Nawrocki
Reviewed-by: Andi Shyti
Signed-off-by: Mark Brown
17 Apr, 2018
4 commits
-
Change indentation so register address offset and register bit definitions
are aligned to same column.Signed-off-by: Sylwester Nawrocki
Reviewed-by: Andi Shyti
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Mark Brown -
Currently timeout errors in polling I/O mode transfer are silently ignored.
Fix it by returning an error when we time out waiting on the RX FIFO level
to reach the transfer length.Signed-off-by: Sylwester Nawrocki
Reviewed-by: Andi Shyti
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Mark Brown -
The channel argument is not used and anyway it could be retrieved from
the passed driver data structure.Signed-off-by: Sylwester Nawrocki
Reviewed-by: Andi Shyti
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Mark Brown -
The tgl_spi pointer is now unused so remove it.
Signed-off-by: Sylwester Nawrocki
Reviewed-by: Andi Shyti
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Mark Brown
08 Jan, 2018
1 commit
-
Replace the original license statement with the SPDX identifier.
Signed-off-by: Andi Shyti
Reviewed-by: Krzysztof Kozlowski
Acked-by: Philippe Ombredanne
Signed-off-by: Mark Brown
04 Nov, 2017
1 commit
-
The pointer sci is assigned but never read, hence it is redundant
and can be removed. Cleans up clang warning:drivers/spi/spi-s3c64xx.c:791:2: warning: Value stored to 'sci' is
never readSigned-off-by: Colin Ian King
Signed-off-by: Mark Brown
20 Feb, 2017
1 commit
-
…c/s3c64xx', 'spi/topic/sh-msiof' and 'spi/topic/slave' into spi-next
14 Feb, 2017
1 commit
-
Commit a92e7c3d82a1 ("spi: s3c64xx: consider the case when the CS
line is not connected") introduced an inconsistency between the
binding, where the disconnected CS line was marked as
'no-cs-readback', and the driver.The driver is erroneously checking for that attribute with
property name of 'broken-cs'.Check for 'no-cs-readback' in the driver as well.
Fixes: a92e7c3d82a1 ("spi: s3c64xx: consider the case when the CS line is not connected")
Signed-off-by: Andi Shyti
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Mark Brown
Cc: stable@vger.kernel.org
18 Jan, 2017
1 commit
-
We accidentally mixed up freeing the rx and tx channels which would a
leak and an oops.Fixes: 3d63a47a380a ("spi: s3c64xx: Don't request/release DMA channels for each SPI transfer")
Signed-off-by: Dan Carpenter
Acked-by: Marek Szyprowski
Acked-by: Andi Shyti
Signed-off-by: Mark Brown
09 Jan, 2017
1 commit
-
Requesting a DMA channel might be a time consuming operation, so there is
no need to acquire and release DMA channel for each SPI transfer.
DMA channels can be requested during driver probe and kept all the time,
also because there are no shared nor dynamically allocated channels on
Samsung S3C/S5P/Exynos platforms.While moving dma_requrest_slave_channel calls, lets switch to
dma_request_slave_channel_reason(), which returns error codes on failure,
which can be properly propagated to the caller (this for example defers
SPI probe when DMA controller is not yet available).Signed-off-by: Marek Szyprowski
Reviewed-by: Andi Shyti
Tested-by: Andi Shyti
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Mark Brown
17 Nov, 2016
1 commit
-
All related platforms use either devicetree or the DMA slave
map API for mapping DMA channels to DMA slaves so we can now
stop using platform_data for passing DMA details.Signed-off-by: Sylwester Nawrocki
Tested-by: Andi Shyti
Tested-by: Charles Keepax
Acked-by: Mark Brown
Acked-by: Arnd Bergmann
Signed-off-by: Vinod Koul
15 Jul, 2016
5 commits
-
Patch a9e93e8 has erroneously removed some comments which are
important to understand why the bus frequency is multiplied by
two during the spi transfer.Reword the previous comment to a more appropriate message.
Suggested-by: Sylwester Nawrocki
Signed-off-by: Andi Shyti
Reviewed-by: Michael Turquette
Signed-off-by: Mark Brown -
The new compatible is related to the Samsung Exynos5433 SoC. The
difference between the previous is that in the exynos5433 the SPI
controller is driven by three clocks instead of only one.The new clock (ioclk) is controlling the input/output clock
whenever the controller is slave or master.The presence of the clock line is detected from the compatibility
structure (exynos5433_spi_port_config) as a boolean value.The probe function checks whether the ioclk is present and if so,
it acquires.The runtime suspend and resume functions will handle the clock
enabling and disabling as well.Signed-off-by: Andi Shyti
Reviewed-by: Michael Turquette
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Mark Brown -
If clk_prepare_enable() fails do not return -EBUSY but use the
value provided by the function itself.Suggested-by: Krzysztof Kozlowski
Signed-off-by: Andi Shyti
Reviewed-by: Michael Turquette
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Mark Brown -
The goto labels of the style of
err4:
err3:
err2:
err1:are complex to insert in between new errors without renaming all
the goto statements. Replace the errX naming style to meaningful
names in order to make it easier to insert new goto exit points.Signed-off-by: Andi Shyti
Reviewed-by: Krzysztof Kozlowski
Reviewed-by: Michael Turquette
Signed-off-by: Mark Brown -
Once a spi_master_get() call succeeds, we need an additional
spi_master_put() call to free the memory, otherwise we will
leak a reference to master. Fix by removing the unnecessary
spi_master_get() call.Signed-off-by: Wei Yongjun
Reviewed-by: Andi Shyti
Signed-off-by: Mark Brown
07 Jul, 2016
1 commit
-
When the clock is coming from the cmu it is not required to be
disabled and then re-enabled in order to change the rate.Besides, some exynos chipsets (e.g. exynos5433) do not deliver
any to the SFR if one from the pclk ("spi" in this case) or sclk
("busclk") is disabled.Remove the clock disabling/enabling to avoid falling into this
situation.Signed-off-by: Sylwester Nawrocki
Signed-off-by: Andi Shyti
Signed-off-by: Mark Brown
04 Jul, 2016
1 commit
-
It generates a static checker warning if an if statement isn't indented.
I think the code is fine except for the white space issue.Signed-off-by: Dan Carpenter
Signed-off-by: Mark Brown
30 Jun, 2016
4 commits
-
The whole function is inside an 'if' statement
("!is_polling(sdd)").Check the opposite of that statement at the beginning and exit,
this way we can have one level less of indentation.Remove the goto paths as they are redundant.
Signed-off-by: Andi Shyti
Signed-off-by: Mark Brown -
At the start of the transfer, the spi_config function is called
twice, the first time when the 3c64xx_spi_prepare_message is
called and the second time with the s3c64xx_spi_transfer_one,
both called from the spi framework.Remove the first call at the prepare message because in that
point we don't have the imformation about "bit per word" and
frequency.Signed-off-by: Andi Shyti
Signed-off-by: Mark Brown -
When the CS line is not connected, it is not needed to enable or
disable the chip selection functionality from the s3c64xx
devices in order to perform a transfer.
Set the CS controller logically always enabled already during
initialization (by writing '0' in the S3C64XX_SPI_SLAVE_SEL
register) and never disable it.Signed-off-by: Andi Shyti
Signed-off-by: Mark Brown -
To enable/disable the CS line, the driver performs a writel in
the S3C64XX_SPI_SLAVE_SEL registers. Group the register's
configuration in a single function.Signed-off-by: Andi Shyti
Signed-off-by: Mark Brown
31 Dec, 2015
1 commit
-
s5pv210 and exynos4 are now DT only platforms hence these
entries can now be safely removed from the match table.Signed-off-by: Sylwester Nawrocki
Signed-off-by: Mark Brown