Commit graph

1464 commits

Author SHA1 Message Date
Linux Build Service Account 65e8ee2d00 Merge "spi_qsd: Initialize wait queue" 2014-07-08 11:56:34 -07:00
Sana Venkat Raju 4075780669 spi_qsd: Initialize wait queue
Due to missing initialization of wait queue
issues reported on customer builds. This patch
adds the missing wait queue initialization code.

Change-Id: I2150d94bfec74b26842aac4fbd0e2e44af3b9943
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
2014-07-04 15:18:04 +05:30
Dan Sneddon e04c6603d8 spi_qsd: Fix DMA errors
Fix DMA errors in spi_qsd driver.

Change-Id: I1f3d32696a94b4ba1d41df10baa9f8773a176e4b
Signed-off-by: Dan Sneddon <dsneddon@codeaurora.org>
2014-07-03 08:43:15 -06:00
Linux Build Service Account 94e5a85721 Merge "spi: spi_qsd: Prevent null pointer access" 2014-06-13 08:35:03 -07:00
Linux Build Service Account a3127b1bd0 Merge "spi_qsd: Add Runtime PM support to debugfs" 2014-06-10 01:46:07 -07:00
Linux Build Service Account bb75883e9f Merge "spi: spi_qsd: Add multi-ee support." 2014-06-06 16:35:17 -07:00
Linux Build Service Account 3f0ef71349 Merge "spi_qsd: Remove check for internal loopback" 2014-06-05 16:38:26 -07:00
Sana Venkat Raju c91a06b735 spi_qsd: Add Runtime PM support to debugfs
Use runtime PM calls to enable/disbale clocks
while accessing the registers using debugfs
interface.

Change-Id: Iba0de406a485a215aa9a882fc6f84eb3daebfb10
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
2014-06-05 14:49:48 +05:30
Dan Sneddon 6a464ae275 spi: spi_qsd: Add multi-ee support.
Add support for the same spi controller to be programmed
by the CPU and other execution environments rather than the
controller hw being owned by only one ee.

Change-Id: Id6560b9cb09ddf59045fdf48c713d14c5c013145
Signed-off-by: Dan Sneddon <dsneddon@codeaurora.org>
2014-05-19 08:25:43 -06:00
Linux Build Service Account d6c99845ec Merge "spi_qsd: Fix for SPI crash while updating the suspend state" 2014-05-15 22:13:09 -07:00
Sana Venkat Raju b7917fcd40 spi_qsd: Fix for SPI crash while updating the suspend state
When runtime_resume fails to resume due to
failed gpio_request call,Suspend state does not
updated and thus wait queue initialization
is not happen,accessing the same causes kernel
crash. This patch corrects this.

CRs-Fixed: 650143
Change-Id: I330af805577f457a43b1afa9f47db13ed33acb3e
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
2014-05-12 10:14:11 +05:30
Dan Sneddon 97cd2243cd spi: spi_qsd: Prevent transfer grouping
Prevent spi transfers from being grouped together.
Grouping multiple transfers together causes invalid
write then read transactions. This patch prevents
the transactions from being grouped and ensures the
chipselect toggles appropriately.

CRs-Fixed: 661007
Change-Id: I1962cc95fde196295f37c64ecd54e490a7285bc4
Signed-off-by: Dan Sneddon <dsneddon@codeaurora.org>
2014-05-11 16:00:33 -06:00
Linux Build Service Account 16296e0178 Merge "Merge upstream linux-stable v3.10.36 into msm-3.10" 2014-05-05 15:09:00 -07:00
Dan Sneddon d5efd4c9b6 spi: spi_qsd: Clean-up pinctrl code
Reduce the pinctrl overhead in the msm spi driver code.

Change-Id: I19854ecdcd4230bfda946c773bc39909508c0891
Signed-off-by: Dan Sneddon <dsneddon@codeaurora.org>
2014-04-29 09:20:16 -06:00
Tarun Gupta b184cb57bb spi_qsd: Change delay per transaction print to debug log level
ice40 bridge chip driver uses delay_usecs option, due to which this message
floods the dmesg logs. So change it's logging level to dev_dbg.

CRs-Fixed: 655184
Change-Id: I3b7016237322763002209b9fc021f0af0f7af687
Signed-off-by: Tarun Gupta <tarung@codeaurora.org>
2014-04-25 12:02:09 +05:30
Ian Maund 356fb13538 Merge upstream linux-stable v3.10.36 into msm-3.10
* commit 'v3.10.36': (494 commits)
  Linux 3.10.36
  netfilter: nf_conntrack_dccp: fix skb_header_pointer API usages
  mm: close PageTail race
  net: mvneta: rename MVNETA_GMAC2_PSC_ENABLE to MVNETA_GMAC2_PCS_ENABLE
  x86: fix boot on uniprocessor systems
  Input: cypress_ps2 - don't report as a button pads
  Input: synaptics - add manual min/max quirk for ThinkPad X240
  Input: synaptics - add manual min/max quirk
  Input: mousedev - fix race when creating mixed device
  ext4: atomically set inode->i_flags in ext4_set_inode_flags()
  Linux 3.10.35
  sched/autogroup: Fix race with task_groups list
  e100: Fix "disabling already-disabled device" warning
  xhci: Fix resume issues on Renesas chips in Samsung laptops
  Input: wacom - make sure touch_max is set for touch devices
  KVM: VMX: fix use after free of vmx->loaded_vmcs
  KVM: x86: handle invalid root_hpa everywhere
  KVM: MMU: handle invalid root_hpa at __direct_map
  Input: elantech - improve clickpad detection
  ARM: highbank: avoid L2 cache smc calls when PL310 is not present
  ...

Change-Id: Ib68f565291702c53df09e914e637930c5d3e5310
Signed-off-by: Ian Maund <imaund@codeaurora.org>
2014-04-23 16:23:49 -07:00
Sana Venkat Raju c3beccb70f spi_qsd: Fix for SPI crash while updating the message status
When transfer speed exceeds the maximum supported frequency,
cur_msg is not initialized, Thus accessing the same cause kernel
crash. This patch corrects this.

CRs-Fixed: 647032
Change-Id: Ic0487a6b8859040f57c085fdcd78093480e64d49
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
2014-04-21 19:39:02 +05:30
Dan Sneddon 46a043dc9c spi: spi_qsd: Prevent null pointer access
Prevent null pointer accesses in msm spi driver.

CRs-Fixed: 629862

Change-Id: I204db8e96c077ced452fd6e515c17f7601f39561
Signed-off-by: Dan Sneddon <dsneddon@codeaurora.org>
2014-04-04 14:50:18 -06:00
Alok Chauhan 0ec1a39480 spi_qsd: Fix bug in multi-xfer bam mode transaction
Spi doesn't handle multiple xfer per message scenario
(eg:Rd->Wr or Wr->Rd) correctly and spi request
stuck indefinetly in while loop when total byte count
is not 0.

increment both(rx,tx) references so next bam
transaction will be queued correctly. Flush the
bam pipes after each transactions.

CRs-Fixed: 637693
Change-Id: I455df38be2f9687b1eb2a704466f6974dfb83a22
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2014-04-04 15:00:04 +05:30
Linux Build Service Account b198cb9af1 Merge "Merge upstream linux-stable v3.10.28 into msm-3.10" 2014-03-26 23:36:07 -07:00
Ian Maund f1b32d4e47 Merge upstream linux-stable v3.10.28 into msm-3.10
The following commits have been reverted from this merge, as they are
known to introduce new bugs and are currently incompatible with our
audio implementation. Investigation of these commits is ongoing, and
they are expected to be brought in at a later time:

86e6de7 ALSA: compress: fix drain calls blocking other compress functions (v6)
16442d4 ALSA: compress: fix drain calls blocking other compress functions

This merge commit also includes a change in block, necessary for
compilation. Upstream has modified elevator_init_fn to prevent race
conditions, requring updates to row_init_queue and test_init_queue.

* commit 'v3.10.28': (1964 commits)
  Linux 3.10.28
  ARM: 7938/1: OMAP4/highbank: Flush L2 cache before disabling
  drm/i915: Don't grab crtc mutexes in intel_modeset_gem_init()
  serial: amba-pl011: use port lock to guard control register access
  mm: Make {,set}page_address() static inline if WANT_PAGE_VIRTUAL
  md/raid5: Fix possible confusion when multiple write errors occur.
  md/raid10: fix two bugs in handling of known-bad-blocks.
  md/raid10: fix bug when raid10 recovery fails to recover a block.
  md: fix problem when adding device to read-only array with bitmap.
  drm/i915: fix DDI PLLs HW state readout code
  nilfs2: fix segctor bug that causes file system corruption
  thp: fix copy_page_rep GPF by testing is_huge_zero_pmd once only
  ftrace/x86: Load ftrace_ops in parameter not the variable holding it
  SELinux: Fix possible NULL pointer dereference in selinux_inode_permission()
  writeback: Fix data corruption on NFS
  hwmon: (coretemp) Fix truncated name of alarm attributes
  vfs: In d_path don't call d_dname on a mount point
  staging: comedi: adl_pci9111: fix incorrect irq passed to request_irq()
  staging: comedi: addi_apci_1032: fix subdevice type/flags bug
  mm/memory-failure.c: recheck PageHuge() after hugetlb page migrate successfully
  GFS2: Increase i_writecount during gfs2_setattr_chown
  perf/x86/amd/ibs: Fix waking up from S3 for AMD family 10h
  perf scripting perl: Fix build error on Fedora 12
  ARM: 7815/1: kexec: offline non panic CPUs on Kdump panic
  Linux 3.10.27
  sched: Guarantee new group-entities always have weight
  sched: Fix hrtimer_cancel()/rq->lock deadlock
  sched: Fix cfs_bandwidth misuse of hrtimer_expires_remaining
  sched: Fix race on toggling cfs_bandwidth_used
  x86, fpu, amd: Clear exceptions in AMD FXSAVE workaround
  netfilter: nf_nat: fix access to uninitialized buffer in IRC NAT helper
  SCSI: sd: Reduce buffer size for vpd request
  intel_pstate: Add X86_FEATURE_APERFMPERF to cpu match parameters.
  mac80211: move "bufferable MMPDU" check to fix AP mode scan
  ACPI / Battery: Add a _BIX quirk for NEC LZ750/LS
  ACPI / TPM: fix memory leak when walking ACPI namespace
  mfd: rtsx_pcr: Disable interrupts before cancelling delayed works
  clk: exynos5250: fix sysmmu_mfc{l,r} gate clocks
  clk: samsung: exynos5250: Add CLK_IGNORE_UNUSED flag for the sysreg clock
  clk: samsung: exynos4: Correct SRC_MFC register
  clk: clk-divider: fix divisor > 255 bug
  ahci: add PCI ID for Marvell 88SE9170 SATA controller
  parisc: Ensure full cache coherency for kmap/kunmap
  drm/nouveau/bios: make jump conditional
  ARM: shmobile: mackerel: Fix coherent DMA mask
  ARM: shmobile: armadillo: Fix coherent DMA mask
  ARM: shmobile: kzm9g: Fix coherent DMA mask
  ARM: dts: exynos5250: Fix MDMA0 clock number
  ARM: fix "bad mode in ... handler" message for undefined instructions
  ARM: fix footbridge clockevent device
  net: Loosen constraints for recalculating checksum in skb_segment()
  bridge: use spin_lock_bh() in br_multicast_set_hash_max
  netpoll: Fix missing TXQ unlock and and OOPS.
  net: llc: fix use after free in llc_ui_recvmsg
  virtio-net: fix refill races during restore
  virtio_net: don't leak memory or block when too many frags
  virtio-net: make all RX paths handle errors consistently
  virtio_net: fix error handling for mergeable buffers
  vlan: Fix header ops passthru when doing TX VLAN offload.
  net: rose: restore old recvmsg behavior
  rds: prevent dereference of a NULL device
  ipv6: always set the new created dst's from in ip6_rt_copy
  net: fec: fix potential use after free
  hamradio/yam: fix info leak in ioctl
  drivers/net/hamradio: Integer overflow in hdlcdrv_ioctl()
  net: inet_diag: zero out uninitialized idiag_{src,dst} fields
  ip_gre: fix msg_name parsing for recvfrom/recvmsg
  net: unix: allow bind to fail on mutex lock
  ipv6: fix illegal mac_header comparison on 32bit
  netvsc: don't flush peers notifying work during setting mtu
  tg3: Initialize REG_BASE_ADDR at PCI config offset 120 to 0
  net: unix: allow set_peek_off to fail
  net: drop_monitor: fix the value of maxattr
  ipv6: don't count addrconf generated routes against gc limit
  packet: fix send path when running with proto == 0
  virtio: delete napi structures from netdev before releasing memory
  macvtap: signal truncated packets
  tun: update file current position
  macvtap: update file current position
  macvtap: Do not double-count received packets
  rds: prevent BUG_ON triggered on congestion update to loopback
  net: do not pretend FRAGLIST support
  IPv6: Fixed support for blackhole and prohibit routes
  HID: Revert "Revert "HID: Fix logitech-dj: missing Unifying device issue""
  gpio-rcar: R-Car GPIO IRQ share interrupt
  clocksource: em_sti: Set cpu_possible_mask to fix SMP broadcast
  irqchip: renesas-irqc: Fix irqc_probe error handling
  Linux 3.10.26
  sh: add EXPORT_SYMBOL(min_low_pfn) and EXPORT_SYMBOL(max_low_pfn) to sh_ksyms_32.c
  ext4: fix bigalloc regression
  arm64: Use Normal NonCacheable memory for writecombine
  arm64: Do not flush the D-cache for anonymous pages
  arm64: Avoid cache flushing in flush_dcache_page()
  ARM: KVM: arch_timers: zero CNTVOFF upon return to host
  ARM: hyp: initialize CNTVOFF to zero
  clocksource: arch_timer: use virtual counters
  arm64: Remove unused cpu_name ascii in arch/arm64/mm/proc.S
  arm64: dts: Reserve the memory used for secondary CPU release address
  arm64: check for number of arguments in syscall_get/set_arguments()
  arm64: fix possible invalid FPSIMD initialization state
  ...

Change-Id: Ia0e5d71b536ab49ec3a1179d59238c05bdd03106
Signed-off-by: Ian Maund <imaund@codeaurora.org>
2014-03-24 14:28:34 -07:00
Gabor Juhos cb67b44a0d spi: spi-ath79: fix initial GPIO CS line setup
commit 61d1cf163c8653934cc8cd5d0b2a562d0990c265 upstream.

The 'ath79_spi_setup_cs' function initializes the chip
select line of a given SPI device in order to make sure
that the device is inactive.

If the SPI_CS_HIGH bit is set for a given device, it
means that the CS line of that device is active HIGH
so it must be set to LOW initially. In case of GPIO
CS lines, the 'ath79_spi_setup_cs' function does the
opposite of that due to the wrong GPIO flags.

Fix the code to use the correct GPIO flags.

Reported-by: Ronald Wahl <ronald.wahl@raritan.com>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-23 21:38:16 -07:00
Sana Venkat Raju 42ad2c8f83 spi_qsd: Add support for pinctrl to configure chip select pins
As part of pinctrl frame work migration, add support
for chip select GPIO configuration using pinctrl frame work.

Now SPI driver supports both pinctrl frame work as
well as GPIO mux to configure chip select GPIO's.

CRs-Fixed: 621109
Change-Id: Id4aa58f9e2d2ae667719c6c600fb35b88b0f5b77
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
2014-03-13 12:50:37 +05:30
Linux Build Service Account 560e8a7ec0 Merge "spi_qsd: Remove duplicate Free Chip Select GPIO" 2014-03-11 15:49:38 -07:00
Sana Venkat Raju 812a8fe08e spi_qsd: Remove duplicate Free Chip Select GPIO
Chip select GPIO can be  free during the suspend.
Duplicate chip select  free causing RX SPI data
Corruption recently reported from customers, this
Patch corrects this.

CRs-Fixed: 626641
Change-Id: Ib80516b6d43c7185586a8815c4430446a9e31ce0
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
2014-03-11 14:17:31 +05:30
Alok Chauhan 017fa5c6ab spi_qsd: correct bam parameters type
Bam parameter variable types for physical address
and handles are defined incorrectly for 64 bit bam.

Correct the variable types.

CRs-Fixed: 622639
Change-Id: Ia886406dd4a43b6f2eaa584a7deb717da5618e81
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2014-02-25 14:29:19 +05:30
Geert Uytterhoeven 6982300594 spi: Fix crash with double message finalisation on error handling
commit 1f802f8249a0da536877842c43c7204064c4de8b upstream.

This reverts commit e120cc0dcf2880a4c5c0a6cb27b655600a1cfa1d.

It causes a NULL pointer dereference with drivers using the generic
spi_transfer_one_message(), which always calls
spi_finalize_current_message(), which zeroes master->cur_msg.

Drivers implementing transfer_one_message() theirselves must always call
spi_finalize_current_message(), even if the transfer failed:

 * @transfer_one_message: the subsystem calls the driver to transfer a single
 *      message while queuing transfers that arrive in the meantime. When the
 *      driver is finished with this message, it must call
 *      spi_finalize_current_message() so the subsystem can issue the next
 *      transfer

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-22 12:41:26 -08:00
Sana Venkat Raju 31e980744a spi_qsd: Remove check for internal loopback
During multiple transfers,  currently SPI
driver imposes check for read/write length,
If read/write length is greater than  FIFO size
the  transaction are failing due to this check.
This patch removes this check to successfully
transfer the data during  multiple transfers of
size greater than FIFO size.

CRs-Fixed: 592431
Change-Id: I5e24744155d585811a280a213f8d7f298027cd5b
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
2014-02-14 15:19:08 +05:30
Daniel Santos 4371c27218 spidev: fix hang when transfer_one_message fails
commit e120cc0dcf2880a4c5c0a6cb27b655600a1cfa1d upstream.

This corrects a problem in spi_pump_messages() that leads to an spi
message hanging forever when a call to transfer_one_message() fails.
This failure occurs in my MCP2210 driver when the cs_change bit is set
on the last transfer in a message, an operation which the hardware does
not support.

Rationale
Since the transfer_one_message() returns an int, we must presume that it
may fail.  If transfer_one_message() should never fail, it should return
void.  Thus, calls to transfer_one_message() should properly manage a
failure.

Fixes: ffbbdd2132 (spi: create a message queueing infrastructure)
Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-13 13:48:01 -08:00
Jonas Gorski d128254781 spi/bcm63xx: don't substract prepend length from total length
commit 86b3bde003e6bf60ccb9c09b4115b8a2f533974c upstream.

The spi command must include the full message length including any
prepended writes, else transfers larger than 256 bytes will be
incomplete.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-13 13:48:01 -08:00
Martin Schwidefsky ac7df0d7c4 Remove GENERIC_HARDIRQ config option
After the last architecture switched to generic hard irqs the config
options HAVE_GENERIC_HARDIRQS & GENERIC_HARDIRQS and the related code
for !CONFIG_GENERIC_HARDIRQS can be removed.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Git-commit: 0244ad004a54e39308d495fee0a2e637f8b5c317
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[imaund@codeaurora.org: resolve merge conflicts]
Signed-off-by: Ian Maund <imaund@codeaurora.org>
2014-02-07 13:49:47 -08:00
Michael Bohan ccfeb3cba9 Merge commit 8916-dev into msm-3.10
Merge support needed for the ARM64 8916 target into msm-3.10.

* origin/tmp-b7dbbd5: (289 commits)
  arm: add pdev_archdata for dma_mask
  thermal: tsens: fix compilation warning
  msm: sps: remove sps header file
  defconfig: arm64: msm: enable gpio sysfs reporting
  arm64: Align CMA sizes to PAGE_SIZE
  msm: ipa: add 64-bit support for IPA
  defconfig: msm: Enable IPC Router and QMI kernel interface
  msm: kgsl: Implement ioctl_rb_issueibcmds for compat
  msm: rndis_ipa: add support for 64 bit
  msm: ecm_ipa: add support for 64 bit
  ARM: dts: msm: Add SPI clocks for QUP1 on plutonium.
  ARM: dts: msm: Configure SPI on plutonium QUP1.
  msm: ipa: set dma mask of IPA device
  msm: ipa: add support for compat_ioctl
  msm: ipa: move out of mach tree
  arm: dts: msm8916: Change property for CMA regions
  arm64: Change type of dma_{alloc,free}_from_contiguous
  msm: kgsl: manage active count for perfcounter read compat ioctl
  ion: msm: Add custom compat ioctl
  ion: Add custom_compat_ioctl
  ...

Conflicts:
	arch/arm/mach-msm/Kconfig
	drivers/platform/msm/ipa/teth_bridge.c

Change-Id: I2e5ebfd104d72a91191fef6de33e107399c17938
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
2014-02-06 13:29:57 -08:00
Dan Sneddon 5325ff443f msm: spi: Make spi_qsd architecture independent.
Make spi_qsd architecture independent by removing
references to mach-msm directory and not assuming
a particular pointer size.

Change-Id: Ie4ccb6ee24b694ba52476a89285c77d7c547502b
Signed-off-by: Dan Sneddon <dsneddon@codeaurora.org>
2014-02-05 09:34:19 -08:00
Dan Sneddon c067ad672a msm: spi: Remove unused data mover code
Data Mover is no longer supported on hardware and removed as dead
code.

Change-Id: Icfbf30e709f7d1ed0ece0eb9c31e4ddb42ac9d5f
Signed-off-by: Dan Sneddon <dsneddon@codeaurora.org>
2014-02-05 09:34:16 -08:00
Sana Venkat Raju e8b08ec7df spi_qsd: Fix SPI L2 Crash
Message queue is scheduled to process
SPI messages during system suspend
state which leads to crash.

This patch make sure all the messages
in queue are processed before system
suspends.

CRs-Fixed: 593658
Change-Id: I722f24fcee4a1d2bbfee4341c8bc6c36ff9e1ec8
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
2014-01-27 15:20:31 +05:30
Sana Venkat Raju 8ec9d1f3bc spi_qsd: Add support for pinctrl
As part of pinctrl frame work migration, add support
for GPIO configuration using pinctrl frame work.

Now SPI driver supports both pinctrl frame work as
well as GPIO mux to configure GPIO's.

CRs-Fixed: 554189
Change-Id: Ie4232e181705e8c352079fdec882ff4b59bf074f
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
2014-01-16 21:59:04 -08:00
Linux Build Service Account 282fefbf86 Merge "spi_qsd: Add support for multiple BAM descriptors" 2013-12-26 11:58:53 -08:00
Alok Chauhan 7f72af2c52 spi_qsd: Add support for multiple BAM descriptors
Currently SPI driver is queuing a single BAM descriptor
at a time. The BAM engine supports queuing of multiple
transfer descriptors.

Add support to spi driver to queue multiple descriptors.

CRs-Fixed: 546346
Change-Id: Iaee9b3b362832262b75e46e19ad18552d037620b
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2013-12-25 11:45:44 +05:30
Sana Venkat Raju e162ea451a spi_qsd: Remove check for unaligned length during input_irq
QUP_IRQ complete is triggered before dmov_rx callback.
Which will initiate SPI to start next transfer, due to
this earlier DMOV_CMD is blocked and results in kernel panic.

Current Implementation  make sure that transfer complete waits
For DMOV callback only in case of aligned lengths ,This patch
ensures transfer trigger only after DMOV RX call back for
unaligned length also.

CRs-Fixed: 583126
Change-Id: I306a705d0eaf0eac33b2dbf335992254351cce20
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
2013-12-16 12:43:54 +05:30
Jeff Hugo e0fde3653d spi_qsd: Remove remote mutex usage
The code paths using remote mutexes are inactive.  Remove the dead code.

Change-Id: I99bec429cb18f4b4eb317ccd0ddea807afdd849f
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
2013-12-02 18:16:42 -07:00
Sana Venkat Raju 8067a04c5c spi_qsd: Free Chip Select GPIO for each Transfer.
Currently msm_spi_process_message is freeing Chip
Select GPIO only when error occurs instead of
freeing it for every transfer. This patch releases
Chip select GPIO for each transfer complete.

CRs-Fixed: 579737
Change-Id: I3f24fda283714ee8422e42b297f9c10dc3367b65
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
2013-11-22 16:22:05 +05:30
Alok Chauhan fee1e81648 spi_qsd: Add core message queue feature
Add support to use new message queue feature provided
by SPI core framework. It is having benefits of saving
code space and getting the benefits of improvements
implemented in the core. User can set the priority
of message queue at compile time.

CRs-Fixed: 458268
Change-Id: I3f3a70b20ed6f2c8ceb9c27d616c5ba19acb422c
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2013-10-22 11:20:22 +05:30
Alok Chauhan c7348203cf spi_qsd: correct the chip select gpios valid field entry
During probe Chip select gpio's valid field is set to non-zero.
This is causing gpio free to get called for not-used gpios
during runtime suspend.

CRs-Fixed: 525743
Change-Id: Ib0de417d640f30908ad11650b584833dac286646
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2013-09-04 17:29:42 -07:00
Gilad Avidov 19a3fdb3c5 spi_qsd: Do not fail probe on DMA init error
Rather than failing the probe function on DMA
initialiation error, this patch just disables DMA
mode and logs an error. The driver continues to
function in FIFO mode.

Change-Id: Ib2532e3497192e1ef7efa02d2dff855826ad6091
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
2013-09-04 17:18:34 -07:00
Gilad Avidov 800d4dd7f4 spi_qsd: Remove redundant input first setting in bam mode
The HW is not mandating the use of input first in bam mode,
therefore, that statement is removed.

CRs-Fixed: 519665
Change-Id: I7c5bbe8a71ea5b8a0e25efdea585251c7c4d4d14
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
2013-09-04 17:18:20 -07:00
Alok Chauhan b6fa4a80a2 spi_qsd: Avoid unclocked register access
Avoid unclocked register access during reading
hardware version number

CRs-Fixed: 513626
Change-Id: Ie5a284cf4c6d2498ce091a380048f1aa7b4f8e4e
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2013-09-04 17:14:20 -07:00
Alok Chauhan c75a34d2b7 spi_qsd: set device's runtime PM status to 'suspended'
Sometimes system suspend is initiated before runtime
PM's auto-suspend delay expires and causing devices to
not suspended runtime. As part of system suspend if
device is not suspended runtime then clocks and gpios
are manages by system suspend.

If spi client does initiate transaction request immediately
after system resume then spi doesn't resume run-time
immediately as spi controller's device state is not in
'suspended state'.

Keep device's runtime PM status to suspended during
system suspend.

CRs-Fixed: 512718
Change-Id: I5c0cb39c0b91782d8686c1b3da81125169ccf9be
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2013-09-04 17:13:54 -07:00
Gilad Avidov c6fac19c3f spi_qsd: Correct an error reporting check
When reading values from the device tree, the error
check on BAM producer pipe must be negated.

Change-Id: Ia766cabdde47390c5a3c79b1c98a704e695fc571
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
2013-09-04 17:13:42 -07:00
Gilad Avidov 6e0781187a spi_qsd: Verify pointers prior to redirection
Redirection on a NULL pointer leads to a system crash.
Here we verify pointers which potentially may be NULL
before a redirection.

Change-Id: I72b856e52f63b13e517c28d8dbb04e1f333f8065
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
2013-09-04 17:10:12 -07:00
Gilad Avidov 64b36238fd spi_qsd: Add support for bam pipe flush on timeout
BAM pipes must be flushed when a transfer timeout
leaving dangling descriptors.

Change-Id: I29fbd2a98964bff5496630a165b3cd0a3f1f2d08
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
2013-09-04 17:05:41 -07:00