summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-bcm63xx-hsspi.c
AgeCommit message (Collapse)AuthorFilesLines
2018-04-26spi/bcm63xx-hspi: Enable the clock before calling clk_get_rate().Stefan Potyra1-8/+17
Enable the clock prior to calling clk_get_rate(), because clk_get_rate() should only be called if the clock is enabled. Additionally, prepare/enable the pll_clk before calling clk_get_rate() for the same reason. Found by Linux Driver Verification project (linuxtesting.org). Fixes: 142168eba9dc ("spi: bcm63xx-hsspi: add bcm63xx HSSPI driver") Signed-off-by: Stefan Potyra <Stefan.Potyra@elektrobit.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-09-04Merge remote-tracking branches 'spi/topic/altera', 'spi/topic/at79', ↵Mark Brown1-5/+5
'spi/topic/bcm-qspi', 'spi/topic/bcm63xx' and 'spi/topic/bcm63xx-hspi' into spi-next
2017-08-08spi/bcm63xx-hspi: fix error return code in bcm63xx_hsspi_probe()Gustavo A. R. Silva1-2/+2
platform_get_irq() returns an error code, but the spi-bcm63xx-hsspi driver ignores it and always returns -ENXIO. This is not correct and, prevents -EPROBE_DEFER from being propagated properly. Notice that platform_get_irq() no longer returns 0 on error: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af Print and propagate the return value of platform_get_irq on failure. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17spi/bcm63xx-hspi: Fix checkpatch warningsAravind Thokala1-3/+3
This patch fixes the checkpatch.pl warnings on the driver file. Signed-off-by: Aravind Thokala <aravind.thk@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14spi: bcm63xx-hsspi: Export OF device ID table as module aliasesAndres Galacho1-0/+1
The device table is required to load modules based on modaliases. After adding MODULE_DEVICE_TABLE, below entries for example will be added to module.alias: alias: of:N*T*Cbrcm,bcm6328-hsspiC* alias: of:N*T*Cbrcm,bcm6328-hsspi Signed-off-by: Andres Galacho <andresgalacho@gmail.com> Acked-by: Jonas Gorski <jonas.gorski@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13spi/bcm63xx-hsspi: allow for probing through devicetreeJonas Gorski1-3/+20
Add required binding support to probe through device tree. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13spi/bcm63xx-hsspi: allow providing clock rate through a second clockJonas Gorski1-2/+10
The HSSPI block actually has two clock inputs, one for gating the block, and one for the PLL rate. To allow these to be represented as two clocks, add support for retrieving the rate from a separate "pll" clock, if the "hsspi" clock does not provide one. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-25spi/bcm63xx-hsspi: add support for dual spi read/writeJonas Gorski1-4/+9
Add support for dual read/writes on spi-bcm63xx-hsspi. This has been tested with a s25fl129p1 dual read capable spi flash, with a nice speed improvement: serial read: root@OpenWrt:/# time dd if=/dev/mtd4 of=/dev/null bs=8192 2032+0 records in 2032+0 records out real 0m 4.39s user 0m 0.00s sys 0m 1.55s dual read: root@OpenWrt:/# time dd if=/dev/mtd4 of=/dev/null bs=8192 2032+0 records in 2032+0 records out real 0m 3.09s user 0m 0.00s sys 0m 1.56s Signed-off-by: Jonas Gorski <jogo@openwrt.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-20spi: drop owner assignment from platform_driversWolfram Sang1-1/+0
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-04-14spi: Remove unneeded include of linux/workqueue.hAxel Lin1-1/+0
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-30Merge remote-tracking branches 'spi/topic/bus-num', 'spi/topic/cleanup', ↵Mark Brown1-1/+2
'spi/topic/clps711x', 'spi/topic/coldfire', 'spi/topic/completion' and 'spi/topic/davinci' into spi-next
2014-03-05spi: bcm63xx-hsspi: Use SIMPLE_DEV_PM_OPS macroJingoo Han1-3/+2
Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-10spi: Use reinit_completion at appropriate placesAxel Lin1-1/+2
Calling init_completion() once is enough. For the rest of the iterations, call reinit_completion() instead. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-18spi/bcm63xx-hsspi: fix pm sleep supportJonas Gorski1-13/+10
Use the right CONFIG symbol to guard, properly (un)preprare clocks on suspend/resume, and check the result of it. Signed-off-by: Jonas Gorski <jogo@openwrt.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-18spi/bcm63xx-hsspi: use devm_register_master()Jonas Gorski1-3/+1
Simplifies the remove call. Signed-off-by: Jonas Gorski <jogo@openwrt.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-18spi/bcm63xx-hsspi: check result of clk_prepare_enableJonas Gorski1-1/+3
Ensure we notice if the clock cannot be enabled for any reason and pass the error down. Signed-off-by: Jonas Gorski <jogo@openwrt.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-18spi: bcm63xx-hsspi: Use devm_clk_get()Jingoo Han1-9/+3
Use devm_clk_get() to make cleanup paths simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Jonas Gorski <jogo@openwrt.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-09spi: bcm63xx-hsspi: checking for ERR_PTR instead of NULLDan Carpenter1-1/+1
devm_request_and_ioremap() returns NULL on error, it doesn't return an ERR_PTR(). This patch fixes it by switching to devm_ioremap_resource() which is the prefered function anyway. Fixes: 142168eba9dc ('spi: bcm63xx-hsspi: add bcm63xx HSSPI driver') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Jonas Gorski <jogo@openwrt.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-04spi: bcm63xx-hsspi: add bcm63xx HSSPI driverJonas Gorski1-0/+484
Add a driver for the High Speed SPI controller found on newer BCM63XX SoCs. It does feature some new modes like 3-wire or dual spi, but neither of it is currently implemented. Signed-off-by: Jonas Gorski <jogo@openwrt.org> Signed-off-by: Mark Brown <broonie@linaro.org>