summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-orion.c
AgeCommit message (Collapse)Author
2014-08-04Merge remote-tracking branches 'spi/topic/orion', 'spi/topic/pl022', ↵Mark Brown
'spi/topic/qup', 'spi/topic/rockchip' and 'spi/topic/rspi' into spi-next
2014-07-28spi: orion: fix incorrect handling of cell-index DT propertyThomas Petazzoni
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+
2014-07-25spi: orion: Fix error return code in orion_spi_probe()Wei Yongjun
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>
2014-06-21spi: spi-orion: add runtime PM supportRussell King
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>
2014-06-21spi: spi-orion: check return value from clk_prepare()/clk_enable()Russell King
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>
2014-03-30Merge remote-tracking branches 'spi/topic/omap-uwire', 'spi/topic/omap100k', ↵Mark Brown
'spi/topic/omap2', 'spi/topic/orion', 'spi/topic/pl022', 'spi/topic/qup', 'spi/topic/rspi' and 'spi/topic/s3c24xx' into spi-next
2014-03-01spi: orion: Let spi core handle validating transfer lengthAxel Lin
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>
2014-02-11spi: orion: Convert to let spi core validate xfer->bits_per_wordAxel Lin
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>
2014-02-07spi: orion: Let spi core handle checking transfer speedAxel Lin
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>
2014-02-06spi: orion: Remove unused pointer in orion_spi_write_read()Christian Engelmayer
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>
2014-02-03spi: delete non-required instances of include <linux/init.h>Paul Gortmaker
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>
2013-12-09spi: orion: Use devm_clk_get()Jingoo Han
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>
2013-10-25Merge remote-tracking branch 'spi/topic/orion' into spi-nextMark Brown
2013-10-15spi: orion: Fix checkpatch issueJingoo Han
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>
2013-09-26spi: orion: use devm_spi_register_master()Jingoo Han
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>
2013-09-01Merge remote-tracking branch 'spi/topic/orion' into spi-nextMark Brown
2013-07-29spi/orion: Convert to devm_ioremap_resource()Mark Brown
Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Andrew Lunn <andrew@lunn.ch>
2013-07-29spi/orion: Directly include linux/size.hMark Brown
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-05-23spi: use platform_{get,set}_drvdata()Jingoo Han
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>
2013-02-05spi/orion: Use module_platform_driver()Ezequiel Garcia
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>
2013-02-05spi: Remove erroneous __init, __exit and __exit_p() references in driversGrant Likely
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>
2012-12-07spi: Remove HOTPLUG section attributesGrant Likely
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>
2012-12-06spi/orion: Add SPI_CHPA and SPI_CPOL support to kirkwood driver.Jason Gunthorpe
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>
2012-08-17spi: Refactor spi-orion to use SPI framework queue.Andrew Lunn
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>
2012-07-23spi/orion: remove uneeded spi_infoMichael Walle
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>
2012-07-23spi/orion: add device tree bindingAndrew Lunn
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>
2012-05-08ARM: Orion: SPI: Add clk/clkdev support.Andrew Lunn
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>
2012-03-16ARM: orion: spi: remove enable_clock_fix which is not usedAndrew Lunn
Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Jason Cooper <jason@lakedaemon.net> Acked-by: Grant Likely <grant.likely@secretlab.ca>
2011-10-31spi: Add module.h to implicit users in drivers/spiPaul Gortmaker
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>
2011-06-10spi: Convert uses of struct resource * to resource_size(ptr)Joe Perches
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>
2011-06-06spi: reorganize driversGrant Likely
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>