Commit Graph

77 Commits

Author SHA1 Message Date
Jingoo Han b998aca8ad spi: s3c64xx: fix casting warning
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-24 15:32:36 +01:00
Jingoo Han c65bc4a8df spi: s3c64xx: fix printk warnings
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-24 15:32:35 +01:00
Jingoo Han db0606ecd6 spi: s3c64xx: fix checkpatch error and warnings
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-24 15:32:35 +01:00
Mark Brown 900bfe33b6 spi/s3c64xx: Remove unused message queue
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-24 15:32:24 +01:00
Girish K S 9f4b323803 spi: s3c64xx: add missing check for polling mode
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-15 11:43:14 +01:00
Mark Brown f4e975814e Merge remote-tracking branch 'spi/topic/s3c64xx' into spi-next 2013-06-26 16:21:04 +01:00
Mark Brown 6140b05ca3 Merge remote-tracking branch 'spi/topic/core' into spi-next 2013-06-26 16:20:58 +01:00
Mark Brown 4581949d52 Merge remote-tracking branch 'spi/topic/bpw' into spi-next 2013-06-26 16:20:57 +01:00
Mark Brown cd469106c3 spi/s3c64xx: Rely on the compiler eliminating the OF ID table
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-26 16:20:38 +01:00
Girish K S bff82038ca spi: s3c64xx: Added support for exynos5440 spi
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-25 11:15:33 +01:00
Girish K S 3146beec21 spi: s3c64xx: Added provision for dedicated cs pin
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-25 11:15:33 +01:00
Mark Brown 796170733e spi/s3c64xx: Make wait_for_timeout() function name less generic
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-19 19:12:39 +01:00
Girish K S 7e9955567e spi: s3c64xx: added support for polling mode
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-19 19:07:42 +01:00
Sylwester Nawrocki 6c6cf64b16 spi: s3c64xx: Fix pm_runtime_get_sync() return value check
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-06-10 18:04:00 +01:00
Stephen Warren 24778be20f spi: convert drivers to use bits_per_word_mask
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-29 20:48:17 +01:00
Jingoo Han 89e8773075 spi: remove unnecessary platform_set_drvdata()
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d06310
(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-05-13 18:00:30 +04:00
Mark Brown fb9d044efb spi/s3c64xx: Check for errors in dmaengine prepare_transfer()
Don't silently ignore errors, report them.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18 18:17:27 +01:00
Mark Brown 563b444e33 spi/s3c64xx: Fix non-dmaengine usage
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-18 18:17:22 +01:00
Thomas Abraham 00ab5392cb spi/s3c64xx: let device core setup the default pin configuration
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-16 11:52:34 +01:00
Arnd Bergmann 788437273f spi: s3c64xx: move to generic dmaengine API
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-12 13:54:58 +01:00
Jingoo Han 997230d02c spi/s3c64xx: add CONFIG_PM_SLEEP to suspend/resume functions
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-01 15:29:24 +01:00
Mark Brown e47ef0f1af Merge branch 'spi-fix' into spi-next 2013-04-01 14:55:16 +01:00
Mark Brown e761f4236e spi/s3c64xx: Convert to bits_per_word_mask
The core can do the validation for us.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-01 14:17:37 +01:00
Girish K S 375981f2e1 spi/s3c64xx: modified error interrupt handling and init
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-04-01 14:02:18 +01:00
Matthias Brugger 5c725b34d4 spi: spi-s3c64xx.c Remove unused argument.
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-03-26 14:03:33 +00:00
Linus Torvalds 06991c28f3 Driver core patches for 3.9-rc1
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
 
 If you need me to provide a merged tree to handle these resolutions,
 please let me know.
 
 Other than those patches, there's not much here, some minor fixes and
 updates.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iEYEABECAAYFAlEmV0cACgkQMUfUDdst+yncCQCfbmnQZju7kzWXk6PjdFuKspT9
 weAAoMCzcAtEzzc4LXuUxxG/sXBVBCjW
 =yWAQ
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

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-21 12:05:51 -08:00
Linus Torvalds 460dc1eecf Sound updates for 3.9-rc1
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.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJRJjy2AAoJEGwxgFQ9KSmk4EoP/RRslXfGAb+lrWeehmh9oHQL
 P4JX+Cgv4OFFxaVjU7IgdjBCCnUNZoQ/Nm8wnpDbF+qP7DTcryPnuwWH8oaHLFSJ
 +knbbbOShC6hxUzd+ZbxQpEn+4mupSC9+egzczz0wcK1kzAf8CO/rj17t3VxsoW/
 Qa1yCWy6jbOmLu3JDpJTPyLfwA3x4/i3ViyTYfqgLP5kQHZZiv1eA9b682HFX9xQ
 uDQipb040k7wBLoeZosR8iF/EDuPHls8H2ASCmZw0K2scZgBok0SkI6BBwsCg2z3
 VbD9EkZmobRHwmubfDV1yCti050YnwGUbrN9tNpdSdv2cogKCkkxQ+zL8PX6Qf0l
 D1neA9JJPhSMx5fufDnG5oTghx/XlHsTJKmrJNu8Gr/14pAmSbNF8iIOFfYju++2
 LlpHLlwS4hxNYY0W3iAFTXi50BUng38tdhBCyZTgN2tSHaTwtdWvrVyizjpUa18N
 onjvFtceULtudddosJWkaKUSqHLN/CWmIWXufucfjxEk5exXjPBMhYTsvhmM3I5D
 zrK0GxUQqey7RToa48Sxs0iL269labUwH/8H1iMTL3/9UCCOqVRKR3X7NdGi3xtK
 EiEiCeNoZX8PojGqSEkmRifOJ19gBxchZDNO4ruct0Omc4Jn/nOlHbi4jXghgr9H
 D62m5PriiCnyBswjzKaX
 =nIPc
 -----END PGP SIGNATURE-----

Merge tag 'sound-3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

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-21 11:34:25 -08:00
Grant Likely 2deff8d602 spi: Remove erroneous __init, __exit and __exit_p() references in drivers
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-05 14:43:16 +00:00
Jingoo Han 75bf336110 spi/s3c64xx: fix checkpatch warnings and error
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-05 13:21:54 +00:00
Jingoo Han 4eb770067f spi/s3c64xx: Use devm_clk_get() and devm_request_irq()
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-05 13:19:43 +00:00
Grant Likely f305a0a8d7 Merge branch 'broonie/spi-next' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc.git
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-05 12:30:13 +00:00
Laxman Dewangan 766ed70447 spi: remove check for bits_per_word on transfer from low level driver
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-02-05 12:26:59 +00:00
Padmavathi Venna b5be04d35d spi: s3c64xx: Modify SPI driver to use generic DMA DT support
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-29 14:28:52 +08:00
Thierry Reding b0ee560523 spi: Convert to devm_ioremap_resource()
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-25 12:21:47 -08:00
Mark Brown e1b0f0df6a spi/s3c64xx: Complain if we fail to set a transfer speed
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-08 10:56:29 +00:00
Kyoungil Kim 7d859ff493 spi: Change FIFO flush operation and spi channel off
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-15 00:49:34 +00:00
Kyoungil Kim 6f38010d54 spi: Keep chipselect assertion during one message
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-15 00:49:33 +00:00
Grant Likely fd4a319bc9 spi: Remove HOTPLUG section attributes
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-07 17:06:43 +00:00
Mark Brown fad8f9c0b2 Merge branch 'spi-fix-s3c64xx' into spi-next 2012-11-07 09:22:32 +01:00
Abhilash Kesavan 45e5033851 spi: s3c64xx: Add fix for crash in spi suspend/resume
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>
2012-11-07 09:22:21 +01:00
Mark Brown 31271e9aac Merge branch 'spi-tegra' into spi-next 2012-10-30 18:39:02 +00:00
Olof Johansson 068a565afa Merge branch 'testing/driver-warnings' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc into fixes
A collection of warning fixes on non-ARM code from Arnd Bergmann:

* 'testing/driver-warnings' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  ARM: s3c: mark s3c2440_clk_add as __init_refok
  spi/s3c64xx: use correct dma_transfer_direction type
  pcmcia: sharpsl: don't discard sharpsl_pcmcia_ops
  USB: EHCI: mark ehci_orion_conf_mbus_windows __devinit
  mm/slob: use min_t() to compare ARCH_SLAB_MINALIGN
  SCSI: ARM: make fas216_dumpinfo function conditional
  SCSI: ARM: ncr5380/oak uses no interrupts
2012-10-19 15:40:18 -07:00
Arnd Bergmann c10356b984 spi/s3c64xx: use correct dma_transfer_direction type
There is a subtle difference between dma_transfer_direction and
dma_data_direction: the former is used by the dmaengine framework,
while the latter is used by the dma-mapping API. Although the
purpose is comparable, the actual values are different and must
not be mixed. In this case, the driver just wants to use
dma_transfer_direction.

Without this patch, building s3c6400_defconfig results in:

drivers/spi/spi-s3c64xx.c: In function 's3c64xx_spi_dmacb':
drivers/spi/spi-s3c64xx.c:239:21: warning: comparison between
	'enum dma_data_direction' and 'enum dma_transfer_direction' [-Wenum-compare]

As pointed out by Kukjin Kim, this also changes the use of constants
from DMA_FROM_DEVICE/DMA_TO_DEVICE to DMA_DEV_TO_MEM/DMA_MEM_TO_DEV.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: spi-devel-general@lists.sourceforge.net
2012-10-17 15:25:23 +02:00
Thomas Abraham 9f667bff0f spi/s3c64xx: use clk_prepare_enable and clk_disable_unprepare
Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare
calls as required by common clock framework.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-17 16:12:29 +09:00
Linus Torvalds a54dfb1a84 Devicetree updates for 3.7
- Import of latest upstream device tree compiler (dtc)
 - New function of_get_child_by_name
 - Support for #size-cells of 0 and #addr-cells of >2
 - Couple of DT binding documentation updates
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQEcBAABAgAGBQJQbF9eAAoJEMhvYp4jgsXiMVAH/3AsqH/ksWFO48L2342WhPzv
 JLP2YJQ+X2E3fi4sIXWDOAHXgSsKcKYiUqRJNpebdAzfK+/HCdtV594GXP9MfUdq
 05ByUBa728wNPHiQitbtwLu+MN0ot1icXeHB+Gx8LuVrJnW/iJv/FHa6QU+cc9ct
 jxnDu8Lfp4ja4rFWq56c5vda6ecP5nVIyAPZ40z9Q6QioL0BxJ4axQ8mW6lxG0SH
 BxOzCppxxShU3O52typ29UORfTDfFPFmskLuJPxGThI4HWaIfpBc55wKKw8P2SR0
 2/uK+TJw/UTsDwB/IIzbane4AIScj7ZdRjN1T132DcX9e/aDaZhDMNoG3TSE6kQ=
 =CZiW
 -----END PGP SIGNATURE-----

Merge tag 'dt-for-3.7' of git://sources.calxeda.com/kernel/linux

Pull devicetree updates from Rob Herring:
 - Import of latest upstream device tree compiler (dtc)
 - New function of_get_child_by_name
 - Support for #size-cells of 0 and #addr-cells of >2
 - Couple of DT binding documentation updates

Fix up trivial conflicts due to of_get_child_by_name() having been added
next to the new of_get_next_available_child().

* tag 'dt-for-3.7' of git://sources.calxeda.com/kernel/linux:
  MAINTAINERS: add scripts/dtc under Devicetree maintainers
  dtc: import latest upstream dtc
  dt: Document general interrupt controller bindings
  dt/s3c64xx/spi: Use of_get_child_by_name to get a named child
  dt: introduce of_get_child_by_name to get child node by name
  of: i2c: add support for wakeup-source property
  of/address: Handle #address-cells > 2 specially
  DT: export of_irq_to_resource_table()
  devicetree: serial: Add documentation for imx serial
  devicetree: pwm: mxs-pwm.txt: Fix reg field annotation
  of: Allow busses with #size-cells=0
2012-10-03 09:44:08 -07:00
Linus Torvalds 7fe0b14b72 spi: Updates for v3.7
No framework work here, only a bunch of driver updates of varying sizes:
 
 - Factoring out of the core hardware support from the MXS MMC driver by
   Marek Vasut to allow the hardware to also be used for SPI.
 - Lots of error handling cleanups from Guenter Roeck
 - Removal of the existing Tegra driver which is quite comprehensively
   broken as detailed in the changelog for the removal.
 - DT suppport for the PL022 and GPIO drivers.
 - pinctrl support for OMAP and PL022.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQarn8AAoJEOoSHmUN5Tg49U4QAKeAPTxlKBSwHuJUpvKsCFF7
 rfN9wsViOigcItsk065C1g20wViw6t8pSFkNmRzmbsIdSofqCYZlJapgWM5j2cXp
 BXs8z7za0JmK62ftS6C3IydacJPRDY/zd0fnSqXnhQOG7Z3YxDYJrM3Ugc97ZE6+
 dg9NUn6rw9ZSwHEwpl08H8tLYqNkd8A+wayPYKr0GSWX7EAqS8cJEWjS0DtvDAm1
 LxMx4BQHCorR6ydUZJrfhG6fLsubhIuMnXI4Ajhv/Ictl1qHH1Zx3mIAB+BNVV/B
 RlaQxPycr0eSikZ9UPMNST2o8vCRvamSfguPfBHMzRdRBp8M3TOKkNM2PmEGzCJW
 pgpDsMNAkEfktGqQfMTBJJMbAPLux1W5mPjfcjt7vOS+q6lkFPtecGdKbynnmLX6
 Vf6nImwp1vyNIvcCip0YZId+j/LrQimuDfMQOH99mwxbkNqMMA401bsxEt8ELmut
 Qt1XEFoS6Xxj8n2BhTS/lMgEzz8zOuH9uOJI0hpNtctOfue6vqPm76GaefVC1i/B
 jpMpUwexwsFc6IhekVFG0MAkolMhFmhlTwk9N24yfgArH8D1pa3emBFN762BQUHE
 Ba7pghcwZADm8rT5SFNoxblcyekT/hCSRSiQ55MHUpqdH77/eVA1Lah4PaHiOqxz
 b0mu9Ae98K077vGP3Z6r
 =ld23
 -----END PGP SIGNATURE-----

Merge tag 'spi-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc

Pull spi updates from Mark Brown:
 "No framework work here, only a bunch of driver updates of varying
  sizes:

   - Factoring out of the core hardware support from the MXS MMC driver
     by Marek Vasut to allow the hardware to also be used for SPI.
   - Lots of error handling cleanups from Guenter Roeck
   - Removal of the existing Tegra driver which is quite comprehensively
     broken as detailed in the changelog for the removal.
   - DT suppport for the PL022 and GPIO drivers.
   - pinctrl support for OMAP and PL022."

Pulling from Mark Brown as Grant Likely is still busy moving.

* tag 'spi-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc: (53 commits)
  spi: remove completely broken Tegra driver
  spi/imx: set the inactive state of the clock according to the clock polarity
  spi/pl022: get/put resources on suspend/resume
  spi/pl022: use more managed resources
  spi/pl022: Devicetree support w/o platform data
  spi/s3c64xx: Don't free controller_data on non-dt platforms
  spi: omap2-mcspi: add pinctrl support
  spi/pl022: adopt pinctrl support
  spi: omap2-mcspi: Cleanup the omap2_mcspi_txrx_dma function
  spi/gpio: Fix stub for spi_gpio_probe_dt()
  spi/mxs: Make the SPI block clock speed configurable via DT
  spi: spi-sh-hspi: drop frees of devm_ alloc'd data
  spi/pl022: Fix chipselects pointer computation
  spi: spi-tle62x0: Use module_spi_driver macro
  mxs/spi: Rework the mxs_ssp_timeout to be more readable
  mxs/spi: Decrement the DMA/PIO border
  mxs/spi: Increment the transfer length only if transfer succeeded
  mxs/spi: Fix issues when doing long continuous transfer
  spi: spi-gpio: Add DT bindings
  spi: spi-gpio: store chipselect information in private structure
  ...
2012-10-02 17:26:42 -07:00
Srinivas Kandagatla 06455bbcab dt/s3c64xx/spi: Use of_get_child_by_name to get a named child
As follow-up to "dt: introduce of_get_child_by_name to get child node by
name." patch, This patch removes some of the code duplication in the
driver by replacing it with of_get_child_by_name instead.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-10-01 10:50:26 -05:00
Mark Brown 8e5d0661b3 Linux 3.6-rc6
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQEcBAABAgAGBQJQVkutAAoJEHm+PkMAQRiGW8sH/36FVQ3zI75QH16AmR++2nMZ
 BRJGoxcRFMssrXTYVdkMyzygf8b7MZbNEn1qt2g63MNzGaJucPlw5NVL4GLzR+zr
 x/EglLrTEPCD5el9wJ3ls9iC1soudKQTvC2BjcdUjpoSwHrDM/7GKfbOacE54Wqc
 C1VHCcg5DWOD7F0RnYT2SQEVCeDODNmcyFdk7Oi4cUicTPJoYWJ9O9MGfBDBok0N
 M+dXxa9nvsl7EeEKpBKH9vo4TfXn3Gsj6LCRdedvI15ilZjfo8jdHYbSn7KBfQuZ
 JIKRnqkaQ1JfMFt+M/JJZ1b/+Wrd4HLMmmn5oUmrGGIvhpi32nJfi/97+nSy8iU=
 =c5gW
 -----END PGP SIGNATURE-----

Merge tag 'v3.6-rc6' into spi-drivers

Linux 3.6-rc6

Conflicts:
	drivers/spi/spi-omap2-mcspi.c
2012-09-25 13:37:05 +01:00
Sylwester Nawrocki 5bee3b94d9 spi/s3c64xx: Don't free controller_data on non-dt platforms
When s3c64xx-spi is instantiated from device tree an instance of
struct s3c64xx_spi_csinfo is dynamically allocated in the driver.
For non-dt platform it is passed from board code through
spi_register_board_info(). On error path in s3c64xx_spi_setup()
function there is an attempt to free this data struct
s3c64xx_spi_csinfo object as it would have been allocated in the
driver for both, dt and non-dt based platforms. This leads to
following bug when gpio request fails:

spi spi1.0: Failed to get /CS gpio [21]: -16
kernel BUG at mm/slub.c:3478!
Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0    Not tainted  (3.6.0-rc5-00092-g9b0b493-dirty #6111)
PC is at kfree+0x148/0x158
LR is at s3c64xx_spi_setup+0xac/0x290
pc : [<c00a513c>]    lr : [<c0227014>]    psr: 40000013
sp : ee043e10  ip : c032883c  fp : c0481f7c
r10: ee0abd80  r9 : 00000063  r8 : 00000000
r7 : ee129e78  r6 : ee104a00  r5 : fffffff0  r4 : c047bc64
r3 : 40000400  r2 : c047bc64  r1 : c04def60  r0 : 0004047b
Flags: nZcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5387d  Table: 4000404a  DAC: 00000015
Process swapper/0 (pid: 1, stack limit = 0xee0422f0)
Stack: (0xee043e10 to 0xee044000)
...
[<c00a513c>] (kfree+0x148/0x158) from [<c0227014>] (s3c64xx_spi_setup+0xac/0x290)
[<c0227014>] (s3c64xx_spi_setup+0xac/0x290) from [<c02251a4>] (spi_setup+0x34/0x4c)
[<c02251a4>] (spi_setup+0x34/0x4c) from [<c02258d0>] (spi_add_device+0x98/0x128)
[<c02258d0>] (spi_add_device+0x98/0x128) from [<c02259d4>] (spi_new_device+0x74/0xa8)
[<c02259d4>] (spi_new_device+0x74/0xa8) from [<c0225a2c>] (spi_match_master_to_boardinfo+0x24/0x44)
[<c0225a2c>] (spi_match_master_to_boardinfo+0x24/0x44) from [<c0225b40>] (spi_register_master+0xf4/0x2a8)
[<c0225b40>] (spi_register_master+0xf4/0x2a8) from [<c043fe0c>] (s3c64xx_spi_probe+0x34c/0x42c)
[<c043fe0c>] (s3c64xx_spi_probe+0x34c/0x42c) from [<c01fc198>] (platform_drv_probe+0x18/0x1c)

There should be no attempt to kfree controller_data when it was
externally provided through the board code. Fix this by freeing
controller_data only when dev->of_node is not null.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-25 07:06:16 -04:00
Arnd Bergmann 436d42c61c ARM: samsung: move platform_data definitions
Platform data for device drivers should be defined in
include/linux/platform_data/*.h, not in the architecture
and platform specific directories.

This moves such data out of the samsung include directories

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: "Wolfram Sang (embedded platforms)" <w.sang@pengutronix.de>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Bryan Wu <bryan.wu@canonical.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Chris Ball <cjb@laptop.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Sangbeom Kim <sbkim73@samsung.com>
Cc: Liam Girdwood <lrg@ti.com>
Cc: linux-samsung-soc@vger.kernel.org
2012-09-19 17:42:18 +02:00