Commit Graph

342 Commits

Author SHA1 Message Date
Mark Brown f7b93159ab Merge remote-tracking branches 'asoc/topic/blackfin', 'asoc/topic/davinci', 'asoc/topic/fsl', 'asoc/topic/hdmi' and 'asoc/topic/intel' into asoc-next 2015-09-23 11:01:19 -07:00
Peter Ujfalusi ab1fffe3a7 ASoC: davinci-mcasp: Fix devm_kasprintf format string
The '\n' at the end of the format string is not needed. It adds an extra
line break when doing
cat /proc/interrupts

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-18 16:22:07 +01:00
Jyri Sarha 14a998be08 ASoC: davinci-mcasp: Get rid of bclk_lrclk_ratio in private data
The slot_width is for essentially same thing. Instead of storing
bclk_lrclk_ratio, just store the slot_width. Comments has been updated
accordingly and some variable names changed to more descriptive.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-17 11:37:27 +01:00
Jyri Sarha dd55ff8346 ASoC: davinci-mcasp: Add set_tdm_slots() support
Implements set_tdm_slot() callback for mcasp. Channel constraints are
updated according to the configured tdm mask and slots each time
set_tdm_slot() is called. The special case when slot width is set to
zero is allowed and it means that slot width is the same as the sample
width.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16 17:59:15 +01:00
Jyri Sarha 295c3405a8 ASoC: davinci-mcasp: Set .symmetric_rates = 1 in snd_soc_dai_driver
The TX and RX direction share the same bit clock and frame sync, so
the samplerate must be the same to both directions.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 19:40:08 +01:00
Peter Ujfalusi 723831927e ASoC: davinci-mcasp: Revise the FIFO threshold calculation
The FIFO threshold for McASP should be <=[tx/rx]numevt so the initial value
for the refining should meet this requirement as well.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14 17:29:41 +01:00
Mark Brown 7c0031360b Merge remote-tracking branches 'asoc/topic/davinci', 'asoc/topic/davinci-vcif', 'asoc/topic/doc' and 'asoc/topic/dpcm' into asoc-next 2015-08-30 15:53:39 +01:00
Axel Lin 508a43fdd7 ASoC: davinci: Convert to use devm_ioremap_resource
Use devm_ioremap_resource() instead of open code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-25 10:27:04 +01:00
Vaishali Thakkar 553de19a0e ASoC: davinci-vcif: Use devm_snd_soc_register_component
Use resource managed function devm_snd_soc_register_component for
component registration instead of snd_soc_register_component.

Also, remove davinci_vcif_remove as it is now redundant.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-17 13:48:28 -07:00
Mark Brown 2924c96276 Merge remote-tracking branch 'asoc/topic/davinci' into asoc-next 2015-06-22 10:24:30 +01:00
Jyri Sarha 9fbd58cf4a ASoC: davinci-mcasp: Choose PCM driver based on configured DMA controller
Find the configured DMA controller by asking for a DMA channel in the
probe phase and releasing it right after. The controller device can be
found via the dma_chan struct and the controller is recognized from
the compatible property of its device node. The patch assumes EDMA if
there is no device node.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-09 19:00:52 +01:00
Misael Lopez Cruz 19db62ea05 ASoC: davinci-mcasp: Logic low for inactive output slots
The default state when serializers are in inactive slots is Hi-Z.
In some cases, there are no additional components driving the data
lines to a safe state so they might have noise.

While in inactive slots, the McASP AXR pins configured as outputs
can be driven low through the serializer pin drive mode setting
(DISMOD) to prevent such noise.

Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-08 18:51:26 +01:00
Mark Brown 698803f8b9 Merge remote-tracking branches 'asoc/topic/davinci' and 'asoc/topic/dpcm' into asoc-next 2015-06-05 18:54:52 +01:00
Peter Ujfalusi 27796e755a ASoC: davinci-mcasp: Correct pm status check in suspend callback
pm_runtime_enabled() will only tell if the pm runtime has been enabled for
the device, which is done at probe time but will not tell the actual power
state of the device.
pm_runtime_active() provides this information.
This patch fixes a kernel crash when doing suspend when McASP is not
active.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-30 21:08:56 +01:00
Jyri Sarha 518f6bab13 ASoC: davinci-macsp: Optimize implicit BLCK sample-rate rule
There is no need to copy the list of all supported sample-rates.
Finding the supported endpoints within the current range is enough
(see snd_interval_list()).

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-30 20:47:16 +01:00
Jyri Sarha 5935a05626 ASoC: davinci-mcasp: Channel count constraints for multi-serializer case
Set channel count constraints for multiple serializers case. On McASP
the active channels mask is the same for all the serializers. With the
current implementation this means that if more than one serializers is
used, all TDM slots have to be active on all serializers. The patch
sets the channel count constraints according to number of RX and TX
serializers.

Reported-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-30 20:47:16 +01:00
Jyri Sarha 1f114f772a ASoC: davinci-mcasp: Calculate BCLK using TDM slots and remove channels rule
The McASP driver currently always sends as many slots or channels to a
i2s-wire as there are configured tdm_slots (see mcasp_i2s_hw_param()).
Thus the BLCK rate does not depend on the amount of channels, just the
configure amount of tdm-slots.

Reported-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-30 20:47:16 +01:00
Mark Brown 41caf0564e Merge remote-tracking branches 'asoc/topic/cx20442' and 'asoc/topic/davinci' into asoc-next 2015-04-12 19:48:56 +01:00
Mark Brown 89a88dd3d6 ASoC: Changes for v4.1
A selection of changes for v4.1 so far.  The main things are:
 
  - Move of jack registration to the card where it belongs.
  - Support for DAPM routes specified by both the machine driver and DT.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJU960DAAoJECTWi3JdVIfQkKIH/RDvxRn8dvKOPF5U9Uix3chH
 JWKkzqfsMP0EpmQTzCQPp0ShAyYcWSbYsopicynPxUem5vS4Z8+UmOgEEgkj59pK
 USbF6v1jCQXA6BcbKyUcRRBD9FtRkfVDc7mYbRs2CcwQz2CGCgee41cvPM+2BT+z
 QdNC9UJARSweGvE1IUJSfpfYOly+BJ2s0/28RaQ0PGt+I0auoYx7IMFgMSDjv2p6
 PY0kyQiwm3Kyj2uNXPZ5gEuPxlw/t8n4fbQNrBYAvxzN+EF5NrGdKE3N7MI1xRV/
 EkFhzy+uM3X9c37tb2lT2fgPFlBc9rgPuLPSyoQ6nxa5ghCqAlgRhzpxRem8hhU=
 =VlCw
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v4.1' into asoc-next

ASoC: Changes for v4.1

A selection of changes for v4.1 so far.  The main things are:

 - Move of jack registration to the card where it belongs.
 - Support for DAPM routes specified by both the machine driver and DT.

# gpg: Signature made Thu 05 Mar 2015 01:10:27 GMT using RSA key ID 5D5487D0
# gpg: WARNING: digest algorithm MD5 is deprecated
# gpg: please see https://gnupg.org/faq/weak-digest-algos.html for more information
# gpg: Oops: keyid_from_fingerprint: no pubkey
# gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>"
# gpg:                 aka "Mark Brown <broonie@debian.org>"
# gpg:                 aka "Mark Brown <broonie@kernel.org>"
# gpg:                 aka "Mark Brown <broonie@tardis.ed.ac.uk>"
# gpg:                 aka "Mark Brown <broonie@linaro.org>"
# gpg:                 aka "Mark Brown <Mark.Brown@linaro.org>"
2015-04-12 19:48:29 +01:00
Lars-Peter Clausen b213b44a96 ASoC: davinci-evm: Use card DAPM context to access widgets
The dapm field of the snd_soc_codec struct will eventually be removed
(replaced with the DAPM context from the component embedded inside the
CODEC). Replace its usage with the card's DAPM context. The idea is that
DAPM is hierarchical and with the card at the root it is possible to access
widgets from other contexts through the card context.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-12 12:44:24 +01:00
Peter Ujfalusi 4cd9db0859 ASoC: davinci-mcasp: Fix ruledata setup in davinci_mcasp_startup
Passing &mcasp->ruledata[dir] to snd_pcm_hw_rule_add() is not correct since
commit:
7b3d165a28 ASoC: davinci-mcasp: Index ruledata in drvdata with substream->stream
now sets up the struct based on the substream->stream (0 or 1) while we pass
a pointer which we take with dir (1 or 2). This will lead kernel crash.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-07 12:05:44 +01:00
Jyri Sarha 7b3d165a28 ASoC: davinci-mcasp: Index ruledata in drvdata with substream->stream
The serializer direction definitions runs from 1 to 2, which does not
suite the purpose. The substream->stream is perfect for the purpose
and should have been used from the beginning.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-01 21:34:15 +01:00
Manish Badarkhe a57069e33f ASoC: davinci-evm: drop un-necessary remove function
As davinci card gets registered using 'devm_' api
there is no need to unregister the card in 'remove'
function.
Hence drop the 'remove' function.

Fixes: ee2f615d6e (ASoC: davinci-evm: Add device tree binding)
Signed-off-by: Manish Badarkhe <manishvb@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2015-03-26 10:01:43 -07:00
Jyri Sarha a75a053f1e ASoC: davinci-mcasp: Set rule constraints if implicit BCLK divider is used
Set rule constraints to allow only combinations of sample-rate,
sample-format, and channels counts that can be played/captured with
reasonable sample-rate accuracy.

The logic with tdm-slots and serializers (=i2s data wires) goes like
this: The first wire will take all channels up to number of tdm-slots,
before following wires (if any) are used. If the first wire is used
fully, the remaining wires share the same clocks and the divider can
be calculated for the first wire.

Also, takes the number of tdm-slots into account when implicitly
selecting the BLCK divider.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-24 10:19:43 -07:00
Peter Ujfalusi 66e618857c ASoC: davinci-mcasp: Fix compilation error
Introduced by commit:
6afda7f507 ASoC: davinci-mcasp: Allow complete shutdown of McASP when not in use

I'm really sorry for this...

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-06 10:30:15 +00:00
Peter Ujfalusi 6afda7f507 ASoC: davinci-mcasp: Allow complete shutdown of McASP when not in use
Rearrange the pm_runtime_get/put_sync calls so the IP will be turned off
when it is not in use.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-05 16:41:25 +00:00
Peter Ujfalusi 4da4608c91 ASoC: davinci: Remove unused davinci-pcm platform driver
All DAI drivers has been converted to use edma-pcm instead of davinci-pcm
and the driver can be removed from the tree.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-04 17:26:28 +00:00
Peter Ujfalusi 9759e7ef53 ASoC: davinci-mcasp: Deprecate the use of davinci-pcm in favor of edma-pcm
The edma-pcm performs as good as the old davinci-pcm and it's use does not
require the 'ping-pong' mode of davinci-pcm, which was introduced to
overcome under/over flow issues when using davinci-pcm.

Keep the SND_DAVINCI_SOC config option to select the SND_EDMA_SOC to avoid
regression in audio support.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-04 17:26:28 +00:00
Peter Ujfalusi 62731d33c4 ASoC: davinci-vcif: Convert to use edma-pcm
The edma-pcm can replace the old davinci-pcm as platform driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-04 17:26:28 +00:00
Peter Ujfalusi 257ade78b6 ASoC: davinci-i2s: Convert to use edma-pcm
The edma-pcm can replace the old davinci-pcm as platform driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-04 17:26:28 +00:00
Peter Ujfalusi 4c03a5ebc7 ASoC: davinci: Select SND_EDMA_SOC when SND_DAVINCI_SOC is enabled
edma-pcm going to replace davinci-pcm as platform driver for daVinci
platform.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-04 17:26:28 +00:00
Peter Ujfalusi 226e2f1b0b ASoC: davinci-mcasp: Add support for CBS_CFM mode
Support for setups where codec is bitclock slave and frame master.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-14 13:27:03 +09:00
Peter Ujfalusi caa1d794cc ASoC: davinci-mcasp: Fix DIT only McASP instance support
One of the McASP instances in DM646x line of DMSoC only supports DIT mode.
This means that the given IP does not have support for rx and all the rx
related resources are missing, like irq and DMA request.
The driver should not fail if any or all  of the RX resource is missing
when the op_mode is set to DIT mode.
Since RX is not possible in DIT mode, we can just ignore the rx resources
when the McASP is used in DIT mode.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-02 18:32:43 +00:00
Peter Ujfalusi 8f511ffb6b ASoC: davicni-mcasp: Mark the common irq line as shared
On DA830 devices McASP0,1 and 2 shares a single combined interrupt request
line.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-02 18:32:43 +00:00
Peter Ujfalusi 67d35e5bc3 ASoC: davinci-evm: Do not include davinci-pcm.h and davinci-i2s.h
There is no need for them to be included.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-02 18:26:15 +00:00
Peter Ujfalusi 2f91ab86ec ASoC: davinci-evm: Do not include edma headers
The machine driver has no business with the underlying dma.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-02 18:26:15 +00:00
Arnd Bergmann f9a7ba3269 ASoC: davinci: fix DM365_EVM codec selection
An earlier bug fix of mine made the SND_DM365_VOICE_CODEC symbol
tristate to avoid creating an undefined reference from the
davinci-vcif.c driver to the davinci_soc_platform_register
function that may be in a module.

However, this may now lead to a different error on randconfig
kernels:

"warning: SND_DM365_VOICE_CODEC creates inconsistent choice state"

This happens because we now have a choice statement with
one bool and one tristate option, and the latter might not
support being set to 'y' because of dependencies.

This new change turns the other option into 'tristate' as well,
which avoids the problem.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 19926c6de0 ("ASoC: davinci: vcif must be a module if SND_DAVINCI_SOC is")
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-29 11:51:29 +00:00
Peter Ujfalusi 5a1b8a80da ASoC: davinci-mcasp: Support for combined tx/rx interrupt line
Some SoC, like da850/OMAP-L138 uses one common interrupt request for TX/RX
events.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-30 16:44:11 +00:00
Linus Torvalds e6b5be2be4 Driver core patches for 3.19-rc1
Here's the set of driver core patches for 3.19-rc1.
 
 They are dominated by the removal of the .owner field in platform
 drivers.  They touch a lot of files, but they are "simple" changes, just
 removing a line in a structure.
 
 Other than that, a few minor driver core and debugfs changes.  There are
 some ath9k patches coming in through this tree that have been acked by
 the wireless maintainers as they relied on the debugfs changes.
 
 Everything has been in linux-next for a while.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlSOD20ACgkQMUfUDdst+ylLPACg2QrW1oHhdTMT9WI8jihlHVRM
 53kAoLeteByQ3iVwWurwwseRPiWa8+MI
 =OVRS
 -----END PGP SIGNATURE-----

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

Pull driver core update from Greg KH:
 "Here's the set of driver core patches for 3.19-rc1.

  They are dominated by the removal of the .owner field in platform
  drivers.  They touch a lot of files, but they are "simple" changes,
  just removing a line in a structure.

  Other than that, a few minor driver core and debugfs changes.  There
  are some ath9k patches coming in through this tree that have been
  acked by the wireless maintainers as they relied on the debugfs
  changes.

  Everything has been in linux-next for a while"

* tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
  Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
  fs: debugfs: add forward declaration for struct device type
  firmware class: Deletion of an unnecessary check before the function call "vunmap"
  firmware loader: fix hung task warning dump
  devcoredump: provide a one-way disable function
  device: Add dev_<level>_once variants
  ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
  ath: use seq_file api for ath9k debugfs files
  debugfs: add helper function to create device related seq_file
  drivers/base: cacheinfo: remove noisy error boot message
  Revert "core: platform: add warning if driver has no owner"
  drivers: base: support cpu cache information interface to userspace via sysfs
  drivers: base: add cpu_device_create to support per-cpu devices
  topology: replace custom attribute macros with standard DEVICE_ATTR*
  cpumask: factor out show_cpumap into separate helper function
  driver core: Fix unbalanced device reference in drivers_probe
  driver core: fix race with userland in device_add()
  sysfs/kernfs: make read requests on pre-alloc files use the buffer.
  sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
  fs: sysfs: return EGBIG on write if offset is larger than file size
  ...
2014-12-14 16:10:09 -08:00
Mark Brown c117b4a39b Merge branch 'fix/davinci' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-davinci 2014-11-17 16:40:27 +00:00
Misael Lopez Cruz a7a3324a60 ASoC: davinci-mcasp: Add overrun/underrun event handling
An underrun (playback) event occurs when the serializer transfer
data from the XRBUF buffer to the XRSR shift register, but the
XRBUF hasn't been filled. Similarly, the overrun (capture) event
occurs when data from the XRSR shift register is transferred to
the XRBUF but it hasn't been read yet.

These events are handled as XRUN events that cause the pcm to stop.
The stream has to be explicitly restarted by the userspace which
ensures that after stopping/starting McASP the data transfer is
aligned with DMA. The other possibility was to internally stop and
start McASP without DMA even knowing about it.

Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-12 14:55:00 +00:00
Misael Lopez Cruz 18a4f55756 ASoC: davinci-mcasp: Active slots depend on active serializers
Active slots count depends on the number of channels in the stream
and the number of active serializers. Each serializer will handle
at most the number of channels specified via 'tdm-slots' parameter
in DT.

There are two possible scenarios:

- Single serializer: channel count fits in the max slots supported by
  McASP serializers, active slots is same as channel count

- Multiple serializers: channel count is bigger than max slots supported
  by a serializer. Channel count determines how many serializers are
  needed at their max slot count configuration

Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-10 15:00:01 +00:00
Peter Ujfalusi 11277833ce ASoC: davinci-mcasp: Place constraint on number of channels
In IIS (I2S, TDM, etc) mode the maximum number of allowed channels for
either direction can be:
number of serializers for the direction * tdm_slots.
This constraint applicable for the first stream, while consequent stream
should not have more channels then the first stream.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-10 15:00:01 +00:00
Peter Ujfalusi 1a5923da4e ASoC: davinci-mcasp: Validate tdm_slots parameter at probe time
Instead of validating the tdm_slots parameter every time at hw_params we
can do it once during probe. If the parameter is not valid (<2 or >32)
print an error and fix it up.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-10 15:00:01 +00:00
Peter Ujfalusi d742b92524 ASoC: davinci-mcasp: Fix rx format when more bclk is used on the bus
When the bus is configured to have more BCLK then the data type demands we
need to use the rotation to move the data to correct place.

Reported-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-10 14:55:54 +00:00
Peter Ujfalusi d75249f545 ASoC: davinci-mcasp: Symmetric sample bits for IIS mode
In IIS mode the tx and rx configuration is symmetric, the BCLK and FSYNC is
shared.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-10 14:55:26 +00:00
Anil Kumar 7771ef3286 ASoC: davinvi-mcasp: Balance pm_runtime_enable() on probe failure
If probe fails then we need to call pm_runtime_disable() to balance
out the previous pm_runtime_enable() call.

Signed-off-by: Anil Kumar <anilk4.v@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-10 13:45:38 +00:00
Peter Ujfalusi bb372af0f7 ASoC: davinci-mcasp: Move the AFIFO related code under start_tx/rx functions
In this way the start code for tx/rx going to be located at the same place.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-29 12:32:14 +00:00
Peter Ujfalusi 0380866a91 ASoC: davinci-mcasp: When stopping TX/RX stop the AFIFO as the last step
The AFIFO should not be stopped (or started for that matter) when McASP is
running since it can cause unpredictable issues because we are switching off
AFIFO for the direction which was handling the requests from McASP and was
generating DMA request toward the system DMA.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-29 12:31:38 +00:00
Peter Ujfalusi 4498273551 ASoC: davinci-mcasp: Correct RX start sequence
Follow the sequence described in the TRMs when starting RX.
Write to RXBUF register was not correct and there is no need to release the
RX state machine/Receive frame sync generator twice.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-29 12:31:38 +00:00