summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-orion.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'platform/remove_owner' of ↵Greg Kroah-Hartman2014-11-031-1/+0
|\ | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux into driver-core-next Remove all .owner fields from platform drivers
| * 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: orion: fix potential NULL pointer de-referenceGreg Ungerer2014-10-221-1/+1
|/ | | | | | | | | | | | It's possible that the call to of_match_device() (introduced in commit df59fa7f ["spi: orion: support armada extended baud rates"]) may return a NULL if there is no match in the device tree (or perhaps no device tree at all). Check the return pointer and set the local device data to the lowest common denominator orion device data if it is NULL. Reported-by: Karl Beldan <karl.beldan@gmail.com> Signed-off-by: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Mark Brown <broonie@kernel.org>
*-. Merge remote-tracking branches 'spi/topic/fsl-dspi', 'spi/topic/imx', ↵Mark Brown2014-10-031-22/+94
|\ \ | | | | | | | | | 'spi/topic/mxs', 'spi/topic/omap-100k' and 'spi/topic/orion' into spi-next
| | * spi: orion: support armada extended baud ratesGreg Ungerer2014-10-011-22/+94
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Armada SoC family implementation of this SPI hardware module has extended the configuration register to allow for a wider range of SPI clock rates. Specifically the Serial Baud Rate Pre-selection bits in the SPI Interface Configuration Register now also use bits 6 and 7 as well. Modify the baud rate calculation to handle these differences for the Armada case. Potentially a baud rate can be setup using a number of different pre-scalar and scalar combinations. This code tries all possible pre-scalar divisors (8 in total) to try and find the most accurate set. This change introduces (and documents) a new device tree compatible device name "armada-370-spi" to support this. Signed-off-by: Greg Ungerer <gerg@uclinux.org> Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Reviewed-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* / spi: orion: Fix checkpatch issueJingoo Han2014-09-031-2/+3
|/ | | | | | | | | | Fix the following checkpatch warnings. WARNING: else is not generally useful after a break or return WARNING: Missing a blank line after declarations Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
*-. Merge remote-tracking branches 'spi/topic/orion', 'spi/topic/pl022', ↵Mark Brown2014-08-041-12/+56
|\ \ | | | | | | | | | 'spi/topic/qup', 'spi/topic/rockchip' and 'spi/topic/rspi' into spi-next
| * | spi: orion: Fix error return code in orion_spi_probe()Wei Yongjun2014-07-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Fix to return a negative error code from the error handling case of orion_spi_reset() instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | spi: spi-orion: add runtime PM supportRussell King2014-06-211-9/+50
| | | | | | | | | | | | | | | | | | | | | | | | Add trivial runtime PM support. This will only be of benefit on SoCs where the clock to the SPI interface can be shut down. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | spi: spi-orion: check return value from clk_prepare()/clk_enable()Russell King2014-06-211-2/+4
| |/ | | | | | | | | | | | | | | | | clk_prepare()/clk_enable() can fail, and it's return value should be checked. Add the proper checking, and while we're here, convert to clk_prepare_enable(). Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Mark Brown <broonie@linaro.org>
* / spi: orion: fix incorrect handling of cell-index DT propertyThomas Petazzoni2014-07-281-6/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | In commit f814f9ac5a81 ("spi/orion: add device tree binding"), Device Tree support was added to the spi-orion driver. However, this commit reads the "cell-index" property, without taking into account the fact that DT properties are big-endian encoded. Since most of the platforms using spi-orion with DT have apparently not used anything but cell-index = <0>, the problem was not visible. But as soon as one starts using cell-index = <1>, the problem becomes clearly visible, as the master->bus_num gets a wrong value (actually it gets the value 0, which conflicts with the first bus that has cell-index = <0>). This commit fixes that by using of_property_read_u32() to read the property value, which does the appropriate endianness conversion when needed. Fixes: f814f9ac5a81 ("spi/orion: add device tree binding") Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: <stable@vger.kernel.org> # v3.6+
*-. Merge remote-tracking branches 'spi/topic/omap-uwire', 'spi/topic/omap100k', ↵Mark Brown2014-03-301-68/+11
|\ \ | | | | | | | | | 'spi/topic/omap2', 'spi/topic/orion', 'spi/topic/pl022', 'spi/topic/qup', 'spi/topic/rspi' and 'spi/topic/s3c24xx' into spi-next
| | * spi: orion: Let spi core handle validating transfer lengthAxel Lin2014-03-011-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | spi core will handle validating transfer length since commit 4d94bd21b333 "spi: core: Validate length of the transfers in message". So remove the same checking in this driver. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * spi: orion: Convert to let spi core validate xfer->bits_per_wordAxel Lin2014-02-111-18/+9
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * spi: orion: Let spi core handle checking transfer speedAxel Lin2014-02-071-37/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit a2fd4f9fa3b9 'spi: Support transfer speed checking in the core', the SPI core validates the desired speed of a given transfer against the minimum and maximum speeds supported by the controller. So we can remove the same code in this driver and let spi core handle checking the desired speed of a given transfer. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * spi: orion: Remove unused pointer in orion_spi_write_read()Christian Engelmayer2014-02-061-2/+0
| |/ | | | | | | | | | | | | | | | | Remove unused devdata pointer 'orion_spi' in function orion_spi_write_read(). Detected by Coverity: CID 1077860. Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Signed-off-by: Mark Brown <broonie@linaro.org>
* / spi: delete non-required instances of include <linux/init.h>Paul Gortmaker2014-02-031-1/+0
|/ | | | | | | | | | None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: orion: Use devm_clk_get()Jingoo Han2013-12-091-3/+1
| | | | | | | | Use devm_clk_get() to make cleanup paths simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Jason Cooper <jason@lakedaemon.net> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge remote-tracking branch 'spi/topic/orion' into spi-nextMark Brown2013-10-251-3/+3
|\
| * spi: orion: Fix checkpatch issueJingoo Han2013-10-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | Fix the following checkpatch warnings. WARNING: quoted string split across lines WARNING: sizeof *spi should be sizeof(*spi) Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Jason Cooper <jason@lakedaemon.net> Signed-off-by: Mark Brown <broonie@linaro.org>
* | spi: orion: use devm_spi_register_master()Jingoo Han2013-09-261-3/+1
|/ | | | | | | | Use devm_spi_register_master() to make cleanup paths simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Jason Cooper <jason@lakedaemon.net> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge remote-tracking branch 'spi/topic/orion' into spi-nextMark Brown2013-09-011-17/+5
|\
| * spi/orion: Convert to devm_ioremap_resource()Mark Brown2013-07-291-17/+5
| | | | | | | | | | Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Andrew Lunn <andrew@lunn.ch>
* | spi/orion: Directly include linux/size.hMark Brown2013-07-291-0/+1
|/ | | | 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/orion: Use module_platform_driver()Ezequiel Garcia2013-02-051-11/+2
| | | | | | | | | | This patch reduces and simplifies initalization code by using module_platform_driver(). With this change it's necessary to remove the __init annotation to avoid section mismatch warnings. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* spi: Remove erroneous __init, __exit and __exit_p() references in driversGrant Likely2013-02-051-4/+4
| | | | | | | | | | | | | | | 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>
* spi: Remove HOTPLUG section attributesGrant Likely2012-12-071-1/+1
| | | | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away. Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit. Bill Pemberton has done most of the legwork on this series. I've used his script to purge the attributes from the drivers/gpio tree. Reported-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* spi/orion: Add SPI_CHPA and SPI_CPOL support to kirkwood driver.Jason Gunthorpe2012-12-061-1/+24
| | | | | | | | | | | Support these transfer modes from the SPI layer by setting the appropriate register bits before doing the transfer. This was tested on the Marvell kirkwood SOC that uses this driver. Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Rolf Manderscheid <rvm@obsidianresearch.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* spi: Refactor spi-orion to use SPI framework queue.Andrew Lunn2012-08-171-148/+61
| | | | | | | | | | Replace the deprecated master->transfer with transfer_one_message() and allow the SPI subsystem handle all the queuing of messages. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@googlemail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* spi/orion: remove uneeded spi_infoMichael Walle2012-07-231-5/+0
| | | | | | | | | | | This was formerly used to store the tclk value. This is now discovered using the clk API, rather than pass it as platform data. Signed-off-by: Michael Walle <michael@walle.cc> Acked-by: Jason Cooper <jason@lakedaemon.net> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@googlemail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* spi/orion: add device tree bindingAndrew Lunn2012-07-231-0/+17
| | | | | | | | Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Acked-by: Jason Cooper <jason@lakedaemon.net> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@googlemail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ARM: Orion: SPI: Add clk/clkdev support.Andrew Lunn2012-05-081-7/+23
| | | | | | | | | Remove now redundant tclk from SPI platform data. This makes the platform data empty, so remove it. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Jamie Lentin <jm@lentin.co.uk> Signed-off-by: Mike Turquette <mturquette@linaro.org>
* ARM: orion: spi: remove enable_clock_fix which is not usedAndrew Lunn2012-03-161-5/+0
| | | | | | Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Jason Cooper <jason@lakedaemon.net> Acked-by: Grant Likely <grant.likely@secretlab.ca>
* 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: Convert uses of struct resource * to resource_size(ptr)Joe Perches2011-06-101-3/+3
| | | | | | | | | | | | | | | | | | Done via coccinelle scripts like: @@ struct resource *ptr; @@ - ptr->end - ptr->start + 1 + resource_size(ptr) and some grep and typing. Mostly uncompiled, no cross-compilers. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* spi: reorganize driversGrant Likely2011-06-061-0/+573
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>