summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-omap-uwire.c
Commit message (Collapse)AuthorAgeFilesLines
* spi: Replace all spi->chip_select and spi->cs_gpiod references with function ↵Amit Kumar Mahapatra via Alsa-devel2023-03-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | call Supporting multi-cs in spi drivers would require the chip_select & cs_gpiod members of struct spi_device to be an array. But changing the type of these members to array would break the spi driver functionality. To make the transition smoother introduced four new APIs to get/set the spi->chip_select & spi->cs_gpiod and replaced all spi->chip_select and spi->cs_gpiod references with get or set API calls. While adding multi-cs support in further patches the chip_select & cs_gpiod members of the spi_device structure would be converted to arrays & the "idx" parameter of the APIs would be used as array index i.e., spi->chip_select[idx] & spi->cs_gpiod[idx] respectively. Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com> Acked-by: Heiko Stuebner <heiko@sntech.de> # Rockchip drivers Reviewed-by: Michal Simek <michal.simek@amd.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> # Aspeed driver Reviewed-by: Dhruva Gole <d-gole@ti.com> # SPI Cadence QSPI Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> # spi-stm32-qspi Acked-by: William Zhang <william.zhang@broadcom.com> # bcm63xx-hsspi driver Reviewed-by: Serge Semin <fancer.lancer@gmail.com> # DW SSI part Link: https://lore.kernel.org/r/167847070432.26.15076794204368669839@mailman-core.alsa-project.org Signed-off-by: Mark Brown <broonie@kernel.org>
* spi: omap-uwire: Convert to platform remove callback returning voidUwe Kleine-König2023-03-061-3/+2
| | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230303172041.2103336-50-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ARM: omap1: remove dead codeArnd Bergmann2023-01-121-15/+1
| | | | | | | | | | | | | | | | | After the removal of the unused board files, I went through the omap1 code to look for code that no longer has any callers and remove that. In particular, support for the omap7xx/omap8xx family is now completely unused, so I'm only leaving omap15xx/omap16xx/omap59xx. Cc: Aaro Koskinen <aaro.koskinen@iki.fi> Cc: Janusz Krzysztofik <jmkrzyszt@gmail.com> Cc: linux-omap@vger.kernel.org Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* ARM: omap1: move perseus spi pinconf to board fileArnd Bergmann2022-04-211-12/+3
| | | | | | | | | | | | | | The driver has always had a FIXME about this, and it seems like this trivial code move avoids a mach header inclusion, so just do it. With that out of the way, and the header file inclusions changed to global files, the driver can also be compile-tested on other platforms. Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* Merge branch 'for-5.13' of ↵Mark Brown2021-06-011-1/+8
|\ | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-5.14
| * spi: Cleanup on failure of initial setupLukas Wunner2021-06-011-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit c7299fea6769 ("spi: Fix spi device unregister flow") changed the SPI core's behavior if the ->setup() hook returns an error upon adding an spi_device: Before, the ->cleanup() hook was invoked to free any allocations that were made by ->setup(). With the commit, that's no longer the case, so the ->setup() hook is expected to free the allocations itself. I've identified 5 drivers which depend on the old behavior and am fixing them up hereinafter: spi-bitbang.c spi-fsl-spi.c spi-omap-uwire.c spi-omap2-mcspi.c spi-pxa2xx.c Importantly, ->setup() is not only invoked on spi_device *addition*: It may subsequently be called to *change* SPI parameters. If changing these SPI parameters fails, freeing memory allocations would be wrong. That should only be done if the spi_device is finally destroyed. I am therefore using a bool "initial_setup" in 4 of the affected drivers to differentiate between the invocation on *adding* the spi_device and any subsequent invocations: spi-bitbang.c spi-fsl-spi.c spi-omap-uwire.c spi-omap2-mcspi.c In spi-pxa2xx.c, it seems the ->setup() hook can only fail on spi_device addition, not any subsequent calls. It therefore doesn't need the bool. It's worth noting that 5 other drivers already perform a cleanup if the ->setup() hook fails. Before c7299fea6769, they caused a double-free if ->setup() failed on spi_device addition. Since the commit, they're fine. These drivers are: spi-mpc512x-psc.c spi-pl022.c spi-s3c64xx.c spi-st-ssc4.c spi-tegra114.c (spi-pxa2xx.c also already performs a cleanup, but only in one of several error paths.) Fixes: c7299fea6769 ("spi: Fix spi device unregister flow") Signed-off-by: Lukas Wunner <lukas@wunner.de> Cc: Saravana Kannan <saravanak@google.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # pxa2xx Link: https://lore.kernel.org/r/f76a0599469f265b69c371538794101fa37b5536.1622149321.git.lukas@wunner.de Signed-off-by: Mark Brown <broonie@kernel.org>
* | spi: omap-uwire: add parenthesis for sizeofZhiqi Song2021-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fix missing parenthesis of sizeof reported by checkpatch.pl: WARNING: sizeof *pp should be sizeof(*pp). The kernel coding style suggests thinking of sizeof as a function and add parenthesis. Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com> Link: https://lore.kernel.org/r/1621301902-64158-7-git-send-email-songzhiqi1@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | spi: omap-uwire: Use SPI_MODE_X_MASKAndy Shevchenko2021-05-111-1/+1
|/ | | | | | | | Use SPI_MODE_X_MASK instead of open coded variant. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210510131217.49357-5-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* spi: omap-uwire: Use clk_prepare_enable and clk_disable_unprepareQing Zhang2020-07-151-2/+2
| | | | | | | | | Convert clk_enable() to clk_prepare_enable() and clk_disable() to clk_disable_unprepare() respectively in the spi-omap-uwire.c. Signed-off-by: Qing Zhang <zhangqing@loongson.cn> Link: https://lore.kernel.org/r/1594790807-32319-1-git-send-email-zhangqing@loongson.cn Signed-off-by: Mark Brown <broonie@kernel.org>
* spi: omap-uwire: Remove needless bits_per_word and speed_hz testsJarkko Nikula2015-09-171-3/+4
| | | | | | | | | | SPI core validates both bits_per_word and speed_hz transfer parameters and defaults to spi->bits_per_word and spi->max_speed_hz in case these per transfer parameters are not set. This allows to remove two needless tests from uwire_txrx() and uwire_setup_transfer(). Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* spi: omap-uwire: Remove needless include asm/irq.hJarkko Nikula2015-03-231-1/+0
| | | | | | | asm/irq.h is already included by linux/interrupt.h. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* spi: Remove FSF mailing addressesJarkko Nikula2014-12-221-4/+0
| | | | | Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* spi: drop owner assignment from platform_driversWolfram Sang2014-10-201-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>
* spi: omap-uwire: Fix build errorSachin Kamat2014-06-241-1/+1
| | | | | | | | | | | | Fixes the following build error introduced by commit b3f6a57506 ("spi: omap-uwire: use devm_ functions"): drivers/spi/spi-omap-uwire.c:465:2: error: implicit declaration of function ‘devm_ioremap’ Since we are including <linux/io.h>, <asm/io.h> is no longer needed. Remove it. Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: omap-uwire: Ensure devm_ioremap() is prototypedMark Brown2014-06-241-0/+1
| | | | Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: omap-uwire: use devm_ functionsHimangi Saraogi2014-06-211-6/+2
| | | | | | | | | | This patch introduces the use of devm_clk_get and devm_ioremap instead of the unmanaged interfaces and removes the corresponding free function calls. Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: Remove unneeded include of linux/workqueue.hAxel Lin2014-04-141-1/+0
| | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
*-. Merge remote-tracking branches 'spi/topic/omap-uwire', 'spi/topic/omap100k', ↵Mark Brown2014-03-301-20/+3
|\ \ | | | | | | | | | 'spi/topic/omap2', 'spi/topic/orion', 'spi/topic/pl022', 'spi/topic/qup', 'spi/topic/rspi' and 'spi/topic/s3c24xx' into spi-next
| * | spi: omap-uwire: add missing iounmapNishanth Menon2014-03-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This fixes the following coccicheck warning: linux-2.6/drivers/spi/spi-omap-uwire.c:485:2-8: ERROR: missing iounmap; ioremap on line 471 and execution via conditional on line 481 Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | spi: omap-uwire: Remove full duplex checkAxel Lin2014-03-261-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | This driver sets the SPI_MASTER_HALF_DUPLEX flag, so the spi core will check transfers to ensure they are not full duplex. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | spi: omap-uwire: Convert to use bits_per_word_maskAxel Lin2014-03-031-16/+2
| | | | | | | | | | | | | | | | | | | | | | | | Set bits_per_word_mask so spi core will reject transfers that attempt to use an unsupported bits_per_word value. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | |
| \ \
*-. | | Merge remote-tracking branches 'spi/topic/bus-num', 'spi/topic/cleanup', ↵Mark Brown2014-03-301-6/+0
|\ \| | | | |/ | |/| | | | 'spi/topic/clps711x', 'spi/topic/coldfire', 'spi/topic/completion' and 'spi/topic/davinci' into spi-next
| | * spi: Remove duplicate code to check chip_selectAxel Lin2014-02-121-6/+0
| |/ | | | | | | | | | | | | | | | | In spi_add_device(), we have the code to validate spi->chip_select. So remove the duplicate code in various drivers. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* / spi: bitbang: Make spi_bitbang_stop() return voidAxel Lin2014-03-291-3/+2
|/ | | | | | | spi_bitbang_stop() never fails, so make it return void. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: spi-omap-uwire: replace platform_driver_probe to support deferred probingWolfram Sang2013-10-091-2/+3
| | | | | | | | | | Subsystems like pinctrl and gpio rightfully make use of deferred probing at core level. Now, deferred drivers won't be retried if they don't have a .probe function specified in the driver struct. Fix this driver to have that, so the devices it supports won't get lost in a deferred probe. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: use platform_{get,set}_drvdata()Jingoo Han2013-05-231-2/+2
| | | | | | | | | Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* spi: Remove erroneous __init, __exit and __exit_p() references in driversGrant Likely2013-02-051-3/+3
| | | | | | | | | | | | | | | Some of the spi driver module remove hooks were annotated with __exit and referenced with __exit_p(). Presumably these were supposed to be __devinit, __devexit and __devexit_p() since __init/__exit for a probe/remove hook has never been correct. They also got missed during the big __devinit/__devexit purge since they didn't match the pattern. Remove then now to be rid of it. v2: purge __init also Reported-by: Arnd Bergmann <arnd@arndb.de> [Arnd set a patch cleaning up one, and then I found more] Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* ARM: OMAP1: Make plat/mux.h omap1 onlyTony Lindgren2012-09-201-1/+1
| | | | | | | | | | | | | | | | | | We are moving omap2+ to use the device tree based pinctrl-single.c and will be removing the old mux framework. This will remove the omap1 specific parts from plat-omap. Acked-by: Felipe Balbi <balbi@ti.com> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: linux-usb@vger.kernel.org Cc: linux-pcmcia@lists.infradead.org Cc: spi-devel-general@lists.sourceforge.net Signed-off-by: Tony Lindgren <tony@atomide.com>
* ARM: OMAP1: Move SoC specific headers from plat to mach for omap1Tony Lindgren2012-09-121-1/+2
| | | | | | | | | | | | There's no need to have these in plat-omap any longer. Note that these could eventually be made local to mach-omap1 instead of being in mach. But to do that, at least various driver access using omap7xxx.h registers needs to be fixed first. Cc: spi-devel-general@lists.sourceforge.net Cc: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Tony Lindgren <tony@atomide.com>
* Remove all #inclusions of asm/system.hDavid Howells2012-03-281-1/+0
| | | | | | | | | Remove all #inclusions of asm/system.h preparatory to splitting and killing it. Performed with the following command: perl -p -i -e 's!^#\s*include\s*<asm/system[.]h>.*\n!!' `grep -Irl '^#\s*include\s*<asm/system[.]h>' *` Signed-off-by: David Howells <dhowells@redhat.com>
* spi: Add module.h to implicit users in drivers/spiPaul Gortmaker2011-10-311-0/+1
| | | | | | | | We are clipping down the presence of module.h, since it was everywhere. If you really need it, you better call it out, as per this changeset. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
* spi: reorganize driversGrant Likely2011-06-061-0/+593
Sort the SPI makefile and enforce the naming convention spi_*.c for spi drivers. This change also rolls the contents of atmel_spi.h into the .c file since there is only one user of that particular include file. v2: - Use 'spi-' prefix instead of 'spi_' to match what seems to be be the predominant pattern for subsystem prefixes. - Clean up filenames in Kconfig and header comment blocks Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Linus Walleij <linus.walleij@linaro.org>