summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-npcm-pspi.c
AgeCommit message (Collapse)Author
2020-01-23Merge branch 'spi-5.6' into spi-nextMark Brown
2020-01-17spi: npcm-pspi: modify reset supportTomer Maimon
Modify NPCM perphiral SPI reset support from direct register access to reset controller support. Signed-off-by: Tomer Maimon <tmaimon77@gmail.com> Link: https://lore.kernel.org/r/20200115162301.235926-5-tmaimon77@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-17spi: npcm-pspi: improve spi transfer performanceTomer Maimon
Improving spi 8 bit per word mode transfer performance by using 16 bit per word transfer and receive when the data length is even and larger than one. Signed-off-by: Tomer Maimon <tmaimon77@gmail.com> Link: https://lore.kernel.org/r/20200115162301.235926-3-tmaimon77@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-17spi: npcm-pspi: fix 16 bit send and receive supportTomer Maimon
Fixing NPCM BMC Peripheral SPI controller 16 bit send and receive support by writing and reading the SPI data in the right order. Signed-off-by: Tomer Maimon <tmaimon77@gmail.com> Link: https://lore.kernel.org/r/20200115162301.235926-2-tmaimon77@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-09spi: npcm: Remove set but not used variable 'val'zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: drivers/spi/spi-npcm-pspi.c: In function npcm_pspi_handler: drivers/spi/spi-npcm-pspi.c:296:6: warning: variable val set but not used [-Wunused-but-set-variable] It is not used since commit 2a22f1b30cee ("spi: npcm: add NPCM PSPI controller driver") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: zhengbin <zhengbin13@huawei.com> Link: https://lore.kernel.org/r/1570581437-104549-3-git-send-email-zhengbin13@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-09-04spi: npcm: use devm_platform_ioremap_resource() to simplify codeYueHaibing
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20190904135918.25352-20-yuehaibing@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-02spi: Remove dev_err() usage after platform_get_irq()Stephen Boyd
We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Cc: Mark Brown <broonie@kernel.org> Cc: linux-spi@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20190730181557.90391-42-swboyd@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03spi: npcm-pspi: Fix wrong priv pointerAxel Lin
In npcm_pspi_probe(), current code set platform_set_drvdata(pdev, master); so in npcm_pspi_remove() platform_get_drvdata(pdev) will return pointer to master rather than priv. Fix it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-06spi: npcm: Modify pspi send functionTomer Maimon
Align pspi send function code with the recieve function code, Also simplify the code a bit with early return. Signed-off-by: Tomer Maimon <tmaimon77@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-27spi: npcm: Fix uninitialized variable warningOlof Johansson
The compiler has no way to know that rsize 1 or 2 are the only valid values. Also simplify the code a bit with early return. The warning was: drivers/spi/spi-npcm-pspi.c:215:6: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-23spi: npcm: Fix an error code in the probe functionDan Carpenter
There is an IS_ERR() vs PTR_ERR() typo here. The current code returns 1 but we want to return the negative error code. Fixes: 2a22f1b30cee ("spi: npcm: add NPCM PSPI controller driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-15spi: npcm: fix platform_no_drv_owner.cocci warningskbuild test robot
drivers/spi/spi-npcm-pspi.c:470:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Fixes: 2a22f1b30cee ("spi: npcm: add NPCM PSPI controller driver") CC: Tomer Maimon <tmaimon77@gmail.com> Signed-off-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-14spi: npcm: fix u32 csgpio being checked for less than zeroColin Ian King
The u32 variable csgpio is being checked for an error return from the call to of_get_named_gpio, however, since this is unsigned this comparison will always be false. Fix this by making csgpio an int and fix up the %u format specifiers to %d accordingly. Detected by CoverityScan, CID#1475476 ("Unsigned compared against 0") Fixes: 2a22f1b30cee ("spi: npcm: add NPCM PSPI controller driver") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-13spi: npcm: add NPCM PSPI controller driverTomer Maimon
Add Nuvoton NPCM BMC Peripheral SPI controller driver. Signed-off-by: Tomer Maimon <tmaimon77@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>