aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-s3c64xx.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-09-01Merge remote-tracking branch 'spi/topic/s3c64xx' into spi-nextMark Brown1-69/+43
2013-09-01Merge remote-tracking branch 'spi/topic/qspi' into spi-nextMark Brown1-3/+1
2013-08-29Merge remote-tracking branch 'spi/topic/rspi' into spi-pdataMark Brown1-0/+3
Conflicts: drivers/spi/spi-rspi.c
2013-08-29spi: use dev_get_platdata()Jingoo Han1-2/+2
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-14spi/s3c64xx: Take runtime PM reference even if DMA is not supportedMark Brown1-20/+19
We always need the device to be runtime PM enabled to use it so just skip the DMA initialisation not the entire prepare when polling. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-11spi: s3c64xx: Use dmaengine_prep_slave_single() to prepare DMA transfersTomasz Figa1-9/+2
Since the driver supports only contiguous buffers, there is no need to manually construct a scatterlist with just a single entry, when there is a dedicated helper for this purpose. This patch modifies prepare_dma() function to use available helper instead of manually creating a scatterlist. Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-11spi: s3c64xx: Do not request CS GPIO on subsequent calls to .setup()Tomasz Figa1-11/+12
Comments in linux/spi/spi.h and observed behavior show that .setup() callback can be called multiple times without corresponding calls to .cleanup(), what was incorrectly assumed by spi-s3c64xx driver, leading to failures trying to request CS GPIO multiple times. This patch modifies the behavior of spi-s3c64xx driver to request CS GPIO only on first call to .setup() after last .cleanup(). Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-11spi: s3c64xx: Zero dma_slave_config struct in prepare_dma()Tomasz Figa1-0/+2
Not all fields of dma_slave_config struct are being initialized by prepare_dma() function, leaving those which are not in undefined state, which can confuse DMA drivers using them. This patch adds call to memset() to zero the struct before initializing a subset of its fields. Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29spi/s3c64xx: Use core for runtime PMMark Brown1-3/+1
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-24spi: s3c64xx: fix casting warningJingoo Han1-4/+4
sdd->ops->request is unsigned int, not unsigned long. Also, sdd->rx_dma.ch is a 'struct dma_chan *'. Thus, (void *) is converted to (struct dma_chan *)(unsigned long), in order to fix possible sparse warnings. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-24spi: s3c64xx: fix printk warningsJingoo Han1-2/+2
Fix the following build warnings when LPAE is enabled: drivers/spi/spi-s3c64xx.c:1466:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' [-Wformat] drivers/spi/spi-s3c64xx.c:1466:2: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'resource_size_t' [-Wformat] Use vsprintf extension %pR to format resource. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-24spi: s3c64xx: fix checkpatch error and warningsJingoo Han1-8/+8
Fix the following checkpatch error and warnings: ERROR: "(foo*)" should be "(foo *)" WARNING: line over 80 characters WARNING: quoted string split across lines Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-24spi/s3c64xx: Remove unused message queueMark Brown1-21/+0
Since the driver has been converted to use the core message pump code the only use of the messsage queue in the driver is a check to see if it is empty which will always succeed since nothing ever adds to the queue. Just remove the queue. Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Kukjin Kim <kgene.kim@samsung.com>
2013-07-15spi: s3c64xx: add missing check for polling modeGirish K S1-0/+3
Due to changes in mainline prior to submission the spi device detection in polling mode breaks. This revealed the missing check for polling during dma prepare. This patch adds the missing check. Signed-off-by: Girish K S <ks.giri@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-02spi: s3c64xx: add missing check for polling modeGirish K S1-0/+3
After the patch "spi/s3c64xx: Fix non-dmaengine usage" with commit id 563b444e33810f3120838620c990480304e24e63 submitted by Mark Brown, the spi device detection in polling mode breaks. This revealed the missing check for polling during dma prepare. This patch adds the missing check. Signed-off-by: Girish K S <ks.giri@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-26Merge remote-tracking branch 'spi/topic/s3c64xx' into spi-nextMark Brown1-59/+143
2013-06-26Merge remote-tracking branch 'spi/topic/core' into spi-nextMark Brown1-2/+0
2013-06-26Merge remote-tracking branch 'spi/topic/bpw' into spi-nextMark Brown1-1/+2
2013-06-26spi/s3c64xx: Rely on the compiler eliminating the OF ID tableMark Brown1-2/+0
This should work with modern compilers, isn't that much of an issue if it goes wrong and it ensures that the DT-only hardware variants don't leave unreferenced parameters structures lying around. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-25spi: s3c64xx: Added support for exynos5440 spiGirish K S1-0/+12
This patch adds support for the exynos5440 spi controller. The integration of the spi IP in exynos5440 is different from other SoC's. The I/O pins are no more configured via gpio, they have dedicated pins. Signed-off-by: Girish K S <ks.giri@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-25spi: s3c64xx: Added provision for dedicated cs pinGirish K S1-8/+26
The existing driver supports gpio based /cs signal. For controller's that have one device per controller, the slave device's /cs signal might be internally controlled by the chip select bit of slave select register. They are not externally asserted/deasserted using gpio pin. This patch adds support for controllers with dedicated /cs pin. if "cs-gpio" property doesnt exist in a spi dts node, the controller would treat the /cs pin as dedicated. Signed-off-by: Girish K S <ks.giri@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-19spi/s3c64xx: Make wait_for_timeout() function name less genericMark Brown1-2/+3
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-19spi: s3c64xx: added support for polling modeGirish K S1-49/+104
The 64xx spi driver supports partial polling mode. Only the last chunk of the transfer length is transferred or recieved in polling mode. Some SoC's that adopt this controller might not have have dma interface. This patch adds support for complete polling mode and gives flexibity for the user to select poll/dma mode. Signed-off-by: Girish K S <ks.giri@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-10spi: s3c64xx: Fix pm_runtime_get_sync() return value checkSylwester Nawrocki1-1/+1
If the device is already in a runtime PM enabled state pm_runtime_get_sync() will return 1, so a test for negative value should be used to check for errors. Without this patch there are seen errors like: [ 8.540000] s3c64xx-spi 13930000.spi: Failed to enable device: 1 [ 8.545000] spi_master spi1: failed to prepare transfer hardware Likely because the driver uses synchronous API to runtime enable the device and asynchronous one to disable it. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mark Brown <broonielinaro.org> Cc: stable@vger.kernel.org
2013-05-29spi: convert drivers to use bits_per_word_maskStephen Warren1-1/+2
Fill in the recently added spi_master.bits_per_word_mask field in as many drivers as possible. Make related cleanups, such as removing any redundant error-checking, or empty setup callbacks. Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-13spi: remove unnecessary platform_set_drvdata()Jingoo Han1-2/+0
The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18spi/s3c64xx: Check for errors in dmaengine prepare_transfer()Mark Brown1-1/+25
Don't silently ignore errors, report them. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18spi/s3c64xx: Fix non-dmaengine usageMark Brown1-3/+3
The multiplatform conversion in commit 788437 (spi: s3c64xx: move to generic dmaengine API) tested for the use of the Samsung-specific DMA API with SAMSUNG_DMADEV when in fact S3C_DMA should be used. This renderd DMA based transfers non-functional on platforms not using dmaengine. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-16spi/s3c64xx: let device core setup the default pin configurationThomas Abraham1-62/+4
With device core now able to setup the default pin configuration, the pin configuration code based on the deprecated Samsung specific gpio bindings is removed. Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Signed-off-by: Doug Anderson <dianders@chromium.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Doug Anderson <dianders@chromium.org> Tested-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Grant Likely <grant.likely@linaro.org>
2013-04-12spi: s3c64xx: move to generic dmaengine APIArnd Bergmann1-44/+141
The spi-s3c64xx uses a Samsung proprietary interface for talking to the DMA engine, which does not work with multiplatform kernels. This version of the patch leaves the old code in place, behind an #ifdef. This can be removed in the future, after the s3c64xx platform start supporting the regular dmaengine interface. An earlier version of this patch was tested successfully on exynos5250 by Padma Venkat. The conversion was rather mechanical, since the samsung interface is just a shallow wrapper around the dmaengine interface. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2013-04-01spi/s3c64xx: add CONFIG_PM_SLEEP to suspend/resume functionsJingoo Han1-2/+2
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SET_SYSTEM_SLEEP_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. drivers/spi/spi-s3c64xx.c:1362:12: warning: 's3c64xx_spi_suspend' defined but not used [-Wunused-function] drivers/spi/spi-s3c64xx.c:1381:12: warning: 's3c64xx_spi_resume' defined but not used [-Wunused-function] Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-01Merge branch 'spi-fix' into spi-nextMark Brown1-16/+25
2013-04-01spi/s3c64xx: Convert to bits_per_word_maskMark Brown1-9/+1
The core can do the validation for us. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-01spi/s3c64xx: modified error interrupt handling and initGirish K S1-16/+25
The status of the interrupt is available in the status register, so reading the clear pending register and writing back the same value will not actually clear the pending interrupts. This patch modifies the interrupt handler to read the status register and clear the corresponding pending bit in the clear pending register. Modified the hwInit function to clear all the pending interrupts. Signed-off-by: Girish K S <ks.giri@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2013-03-26spi: spi-s3c64xx.c Remove unused argument.Matthias Brugger1-2/+1
The pointer to the driver data is never used to get the slave controller data. We can delete the unused argument from the function. Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-02-21Merge tag 'driver-core-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-coreLinus Torvalds1-4/+3
Pull driver core patches from Greg Kroah-Hartman: "Here is the big driver core merge for 3.9-rc1 There are two major series here, both of which touch lots of drivers all over the kernel, and will cause you some merge conflicts: - add a new function called devm_ioremap_resource() to properly be able to check return values. - remove CONFIG_EXPERIMENTAL Other than those patches, there's not much here, some minor fixes and updates" Fix up trivial conflicts * tag 'driver-core-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (221 commits) base: memory: fix soft/hard_offline_page permissions drivercore: Fix ordering between deferred_probe and exiting initcalls backlight: fix class_find_device() arguments TTY: mark tty_get_device call with the proper const values driver-core: constify data for class_find_device() firmware: Ignore abort check when no user-helper is used firmware: Reduce ifdef CONFIG_FW_LOADER_USER_HELPER firmware: Make user-mode helper optional firmware: Refactoring for splitting user-mode helper code Driver core: treat unregistered bus_types as having no devices watchdog: Convert to devm_ioremap_resource() thermal: Convert to devm_ioremap_resource() spi: Convert to devm_ioremap_resource() power: Convert to devm_ioremap_resource() mtd: Convert to devm_ioremap_resource() mmc: Convert to devm_ioremap_resource() mfd: Convert to devm_ioremap_resource() media: Convert to devm_ioremap_resource() iommu: Convert to devm_ioremap_resource() drm: Convert to devm_ioremap_resource() ...
2013-02-21Merge tag 'sound-3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/soundLinus Torvalds1-54/+23
Pull sound updates from Takashi Iwai: "The biggest change in this update is the unification of HD-audio codec parsers. Now the HD-audio codec is parsed in a generic parser code which is invoked by each HD-audio codec driver. Some background information is found in David Henningsson's blog entry: http://voices.canonical.com/david.henningsson/2013/01/18/upcoming-changes-to-the-intel-hda-drivers/ Other than that, some random updates/fixes like USB-audio and a bunch of small AoC updates as usual. Highlights: - Unification of HD-audio parser code (aka generic parser) - Support of new Intel HD-audio controller, new IDT codecs - Fixes for HD-audio HDMI audio hotplug - Haswell HDMI audio fixup - Support of Creative CA0132 DSP code - A few fixes of HDSP driver - USB-audio fix for Roland A-PRO, M-Audio FT C600 - Support PM for aloop driver (and fixes Oops) - Compress API updates for gapless playback support For ASoC part: - Support for a wider range of hardware in the compressed stream code - The ability to mute capture streams as well as playback streams while inactive - DT support for AK4642, FSI, Samsung I2S and WM8962 - AC'97 support for Tegra - New driver for max98090, replacing the stub which was there - A new driver from Dialog Note that due to dependencies, DTification of DMA support for Samsung platforms (used only by the and I2S driver and SPI) is merged here as well." Fix up trivial conflict in drivers/spi/spi-s3c64xx.c due to removed code being changed. * tag 'sound-3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (453 commits) ALSA: usb: Fix Processing Unit Descriptor parsers ALSA: hda - hdmi: Notify userspace when ELD control changes ALSA: hda - hdmi: Protect ELD buffer ALSA: hda - hdmi: Refactor hdmi_eld into parsed_hdmi_eld ALSA: hda - hdmi: Do not expose eld data when eld is invalid ALSA: hda - hdmi: ELD shouldn't be valid after unplug ALSA: hda - Fix the silent speaker output on Fujitsu S7020 laptop ALSA: hda - add quirks for mute LED on two HP machines ALSA: usb/quirks, fix out-of-bounds access ASoC: codecs: Add da7213 codec ALSA: au88x0 - Define channel map for au88x0 ALSA: compress: add support for gapless playback ALSA: hda - Remove speaker clicks on CX20549 ALSA: hda - Disable runtime PM for Intel 5 Series/3400 ALSA: hda - Increase badness for missing multi-io ASoC: arizona: Automatically manage input mutes ALSA: hda - Fix broken workaround for HDMI/SPDIF conflicts ALSA: hda/ca0132 - Add missing \n to debug prints ALSA: hda/ca0132 - Fix type of INVALID_CHIP_ADDRESS ALSA: hda - update documentation for no-primary-hp fixup ...
2013-02-05spi: Remove erroneous __init, __exit and __exit_p() references in driversGrant Likely1-1/+1
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>
2013-02-05spi/s3c64xx: fix checkpatch warnings and errorJingoo Han1-20/+13
Fix checkpatch warnings and error as below: ERROR: "foo * bar" should be "foo *bar" WARNING: please, no space before tabs WARNING: quoted string split across lines WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2013-02-05spi/s3c64xx: Use devm_clk_get() and devm_request_irq()Jingoo Han1-26/+15
Use devm_clk_get() and devm_request_irq() rather than clk_get() and request_irq() to make cleanup paths more simple. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2013-02-05Merge branch 'broonie/spi-next' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc.gitGrant Likely1-0/+2
Minor features and bug fixes for PXA, OMAP and GPIO deivce drivers and a cosmetic change to the bitbang driver. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2013-02-05spi: remove check for bits_per_word on transfer from low level driverLaxman Dewangan1-1/+1
The spi core make sure that each transfer structure have the proper setting for bits_per_word before calling low level transfer APIs. Hence it is no more require to check again in low level driver for this field whether this is set correct or not. Removing such code from low level driver. The txx9 change also removes a test for bits_per_word set to 0, and forcing it to 8 in that case. This can also be removed now since spi_setup() ensures spi->bits_per_word is not zero. if (!spi->bits_per_word) spi->bits_per_word = 8; Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2013-01-29spi: s3c64xx: Modify SPI driver to use generic DMA DT supportPadmavathi Venna1-54/+23
This patch modifies the SPI driver to use generic dma dt bindings support. This passes all the required arguments to dma dev request functon which in turn calls the dma_request_slave_channel or dma__ request_channel based on DT or non-DT respectively. Signed-off-by: Padmavathi Venna <padma.v@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-25spi: Convert to devm_ioremap_resource()Thierry Reding1-4/+3
Convert all uses of devm_request_and_ioremap() to the newly introduced devm_ioremap_resource() which provides more consistent error handling. devm_ioremap_resource() provides its own error messages so all explicit error messages can be removed from the failure code paths. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Cc: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-08spi/s3c64xx: Complain if we fail to set a transfer speedMark Brown1-0/+2
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-15spi: Change FIFO flush operation and spi channel offKyoungil Kim1-4/+4
Setting SW_RST does TX/RX FIFO flush. After FIFO flush, SW_RST should be cleared. The above setting and clearing SW_RST operation should be done after spi channel off. Signed-off-by: Kyoungil Kim <ki0351.kim@samsung.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2012-12-15spi: Keep chipselect assertion during one messageKyoungil Kim1-2/+0
During all transfers in one message, the device will not be chagned. So we don't need to deassert chipselect during one message. Signed-off-by: Kyoungil Kim <ki0351.kim@samsung.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2012-12-07spi: Remove HOTPLUG section attributesGrant Likely1-2/+2
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-11-07Merge branch 'spi-fix-s3c64xx' into spi-nextMark Brown1-1/+1
2012-11-07spi: s3c64xx: Add fix for crash in spi suspend/resumeAbhilash Kesavan1-1/+1
The SPI driver makes a gpio_request during initialization. The requested gpios need to be populated as part of the s3c64xx_spi_driver_data so that they can be released during suspend and requested again during resume. Add the missing code to save the requested gpios as part of the driver data. This fixes a SPI driver suspend crash. Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>