Move the context register storage behind of a struct and use a pointer to
it in the suspend/resume callbacks to remove the long lines.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Rename the struct for the platform data:
snd_platform_data -> davinci_mcasp_pdata
Since we have users under arch/arm/mach-davinci/ for this struct add
temporary define to avoid breakage. The arch code can be updated later to
use the new struct name.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Rearrange the code in the function for readability.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Handle the PM callbacks via the ASoC core instead of device core.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Take the return value from mcasp_common_hw_param() and use that in case of
error.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The use of pm_runtime in trigger() callback is not correct and it will lead
to unbalanced power.usage_count.
The only place which might need to call pm_runtime is the set_fmt callback.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
These registers can be configured synchronously for playback and capture.
Furthermore when McASP is in master and sync mode the capture operation
needs the TX path to be configured in order to be able to provide the needed
clocks for the bus.
xxFMT and xxFMCT registers has been already configured for both TX and RX
other places in the driver.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Instead of
davinci_hw_common_param - for common, I2S/DIT mode settings
davinci_hw_dit_param - for DIT protocol configuration
davinci_hw_param - for I2S (and compatible protocols)
Use the following names:
mcasp_common_hw_param, mcasp_dit_hw_param and mcasp_i2s_hw_param.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Make BCLK divider setting implicite in hw_params call if McASP device
is the bit clock master on the audio serial bus.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The referenced clock is used to get codec clock rate and the clock is
disabled and enabled in startup and shutdown snd_soc_ops call
backs. The change is also documented in DT bindigs document.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
cc: bcousson@baylibre.com
Signed-off-by: Mark Brown <broonie@linaro.org>
A couple more fixes plus some extensions to DPCM for use with compressed
audio from Liam which arrived just after my previous pull request.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABAgAGBQJS3Q2+AAoJELSic+t+oim9LaIP/1CIapKkqePf+Cz2uY1ANtZj
nykSNAr+0WLPYq1cqm2xiIb4yOdev9Q6m6g8K9CgHLNXzbLPadY2fM0YljqWJnlb
OUFVnK8Beo2eMzRPrLFxiPP/jhMsdFfhMtTNV4XxlqZsjPR8Cdt7oTtbfS+9XV5j
jhhjTQwBmTN/fzuKzmgJrvFap1CMSvbTze7oAAXUBSKF8jxA+7WPXq7VsCyAS50g
C/eWNIh4rXTntwGRp36cK8mVNasmXyr16P8P9hJZrxpkLA2CPStJjW1pddoHQZPe
Cjfq0tKuE92FZusp7mlYsw20SlfhfPzGLEKNmjzVBe3T9YTijhdhNB6/IheMlkyo
ewfE863RNgQlSbD5QiAa99dS4UBEyWLs2OFOAlM4h1U1RbKx5k+ws7pFIffYQ8vz
hlVdZpfsMZVjlL2NHc7lBChravf/0gr1q/TkfCNqwagKunkkLphkkJSM4XPxgIpk
M5ke35kr905OcR2W6soi7eP97bdqttVyL6t0CW3+uyX/SxOPq8h7mejR372G/DmW
HmFIWywEA5A+7XkxjpIR3pcu8SlwojaVjnVhfkMmsWnATroDL1wgsTmFYt78Hxnn
uAPT5ro3v6nLYASs9lGRC1ZTO5grNa/hxFo7gIZ4aUq3pqF5CVLhzMxSzW0nSLMY
BuF4cEGIIrDvU/Z4SbBn
=iOdI
-----END PGP SIGNATURE-----
Merge tag 'asoc-v3.14-3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Last updates for the merge window
A couple more fixes plus some extensions to DPCM for use with compressed
audio from Liam which arrived just after my previous pull request.
The prefix for the codec driver can be used during dual identical
codec usecases. However, dapm adds prefix twice for codec DAI widget
in snd_soc_dapm_add_route API.
This change is to avoid double prefix addition for codec DAI widget
and is needed while using identical dual codecs.
Signed-off-by: Songhee Baek <sbaek@nvidia.com>
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Currently compressed audio streams are statically routed from the /dev
to the DAI link. Some DSPs can route compressed data to multiple BE DAIs
like they do for PCM data.
Add support to allow dynamically routed compressed streams using the existing
DPCM infrastructure. This patch adds special FE versions of the compressed ops
that work out the runtime routing.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The ASoC compressed code needs to call the internal DPCM APIs in order to
dynamically route compressed data to different DAIs.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
A few small fixes in drivers, nothing too remarkable here but all good
to have - mainly these are fixes for things that were introduced in the
last merge window but only just got useful testing.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABAgAGBQJS1+akAAoJELSic+t+oim9o2oP/1YkeWBLH2NHc5MZ/Z0OhQkA
Gx7yg88pf0gxFU1Y7aRoEtij8h27tLvze8Rtu2BRIGZhISfAyhkTsND+Z7f8PfnZ
INf/Qe74vU3fsevkxJuBPS34UtPklfI4bLyCuPHcsGz12WhETmKPFX9opAHL4aIf
JeVZjiHpJ3WuixcP2BMLAlwZAlrTQVLNPgJ0bM/OoB5c/aFqOkYqXeLb4U93RZYX
86L0GJcwSNZ0HrAuW1vLOkaGUHPVByQsvIyRvJNi0yd0Bz2EnNUsQ1KX89db8038
o9/mZWSjZY8igyKG8bob2wZPacJSswsXtWm/dWn/a1MGj5UvoH9ic+MbJvrh5AXZ
UwRhckC5UcBj8+sQ1CbqzOHJBx6wUYZYLRiAVqIeGbpqJOu37DAQCvAENLlmDqFb
MUFlrr1/MsqLGOCPvD88yeA0DaIIScvKRG4gtA2hNLl3/sLjcJMF2yrF6WV2MM/j
ACwdhSfcNdFqFetj9FkA2S1s/Hv1Rt+gCZtOTcRlxZ/sO8fJlXvxuvpTcWV+L/pw
0tR1FlvCc5RC5l40WZk6h/qy1U7+w6GkLhWztbqq/YtiWrhQrm5x4Eh9NKC5VtNb
GGxvPsJ7SPv5Hp21WUOZODoIe3DqDaFIpVta0jBbNMwhtV0n0X9cD2AZ1GsLu67T
3Jp+dmozdHfRKVor0voV
=zx4F
-----END PGP SIGNATURE-----
Merge tag 'asoc-v3.13-rc8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.13
A few small fixes in drivers, nothing too remarkable here but all good
to have - mainly these are fixes for things that were introduced in the
last merge window but only just got useful testing.
Since the soc generic dmaengine pcm driver allows using the defualt settings,
so the pcm->config maybe NULL.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
A few more updates for v3.14 since the last set, highlights include:
- Lots of DMA updates from Lars-Peter
- Improvements to the constraints handling code from Lars-Peter
- A very helpful conversion of the TWL4030 driver to regmap from Peter
- A new driver for the Freescale ESAI controller from Nicolin Chen
- Conversion of some of the drivers to use params_width()
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABAgAGBQJS19X7AAoJELSic+t+oim9/psQAIKo9sqkQEd6jg/jhSLw5mu5
jVOvIGnSkmfhmnHtgHxFpJtnYiMCpTnUb1Irb16djO7ODpQ1yP3buv6Go5enUmVU
zZgsFF+RudM16iXz6ZyAWW8BZJlMDAQTKkepAs7VLCt+FH/PaxOH7apZJi4dGCqj
URt3NkvfJigPZciYcPGoFtSvSJnNb31ymdymmWxV6rTureyk9/KEKXiQ1r7QJWKY
fQFyreSXaPfrAcBw8ALIHzdxJalW3M6hKQo9PhS5Z+yoqZRwc1XQ90I0LnB6xruo
MZp+fQobxbioJDQjt7QluVOKpeUNojvG9dzeZaC7XS9qoejYFewwZNoscg0wljc6
DveEmRgU7AcHo7PYzBqih8gQGBw0Rhl08b0demyq/XHfaJ8Uf8Whfmwmv9MMXpju
6rR9yU2lsne/w+ND8Jj0FPvzARQrLjIXOJEWP9q58ZpDeiUBhcZN9qMtnTyAmh6P
mauPd+mmBRLgojfD4+CDSMIFItGKc3rPivCIK7QRMps+aHcitiJO5AOhhBR18Z6Q
W3LGrr1oGkc9gZQzaN5dOiPJ9ywJWReuca7EVp7eAK27HGMXfSvTC162uVM7Rv/v
N2OtH+6ar2By5Q5HS8if7fU/n6E0QWU++WbTcfny/VHAJXz2p6uIFbymBH8H+5ws
JC2F3pHVrCFF9rdgPrKy
=9Nvq
-----END PGP SIGNATURE-----
Merge tag 'asoc-v3.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: More updates for v3.14
A few more updates for v3.14 since the last set, highlights include:
- Lots of DMA updates from Lars-Peter
- Improvements to the constraints handling code from Lars-Peter
- A very helpful conversion of the TWL4030 driver to regmap from Peter
- A new driver for the Freescale ESAI controller from Nicolin Chen
- Conversion of some of the drivers to use params_width()
When we plug a 3-ring headset on some Dell machines, the headset
mic can't be detected, after apply this patch, the headset mic
can work well on all those machines.
On the machine with the Subsytem ID 0x10280610, if we use
ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, the headset mic can be
detected and work well, but the sound can't be outputed via
headphone anymore, use ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
can fix this problem.
BugLink: https://bugs.launchpad.net/bugs/1260303
Cc: David Henningsson <david.henningsson@canonical.com>
Tested-by: David Chen <david.chen@canonical.com>
Tested-by: Cyrus Lien <cyrus.lien@canonical.com>
Tested-by: Shawn Wang <shawn.wang@canonical.com>
Tested-by: Chih-Hsyuan Ho <chih.ho@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
range_min is the lowest address in the virtual register range. This is
the first register with address 0, not the first register of page 1.
Currently all writes to page 1 are mapped to page 0, so the codec fails
to operate.
Fixes: 4d208ca429 (ASoC: tlv320aic32x4: Convert to direct regmap API usage)
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org (v3.13 if the fix misses -final)
Make it easier for generic code to work with set_sysclk() by distinguishing
between the operation not being supported and an error as is done for
other operations like set_dai_fmt()
Signed-off-by: Mark Brown <broonie@linaro.org>
soc_widget_read API returns the register data and it is possible
that a register can contain 0xffffffff. Thus, change the prototype
of soc_widget_read to return only the error code and pass the reg
data through pointer argument.
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The Samsung dmaengine ASoC driver is used with two different dmaengine drivers.
The pl80x, which properly supports residue reporting and the pl330, which
reports that it does not support residue reporting. So there is no need to
manually set the NO_RESIDUE flag. This has the advantage that a proper (race
condition free) PCM pointer() implementation is used when the pl80x driver is
used. Also once the pl330 driver supports residue reporting the ASoC PCM driver
will automatically start using it.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
The pl330 driver properly reports that it does not have residue reporting
support, which means the PCM dmanegine driver is able to figure this out on its
own. So there is no need to set the flag manually. Removing the flag has the
advantage that once the pl330 driver gains support for residue reporting it will
automatically be used by the generic dmaengine PCM driver.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
The dmaengine framework now exposes the granularity with which it is able to
report the transfer residue for a certain DMA channel. Check the granularity in
the generic dmaengine PCM driver and
a) Set the SNDRV_PCM_INFO_BATCH if the granularity is per period or worse.
b) Fallback to the (race condition prone) period counting if the driver does
not support any residue reporting.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Currently we have two different snd_soc_platform_driver structs in the generic
dmaengine PCM driver. One for dmaengine drivers that support residue reporting
and one for those which do not. When registering the PCM component we check
whether the NO_RESIDUE flag is set or not and use the corresponding
snd_soc_platform_driver. This patch modifies the driver to only have one
snd_soc_platform_driver struct where the pointer() callback checks the
NO_RESIDUE flag at runtime. This allows us to set the NO_RESIDUE flag after the
PCM component has been registered. This becomes necessary when querying whether
the dmaengine driver supports residue reporting from the dmaengine driver itself
since the DMA channel might only be requested after the PCM component has been
registered.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
The pl330 driver currently does not support residue reporting, so set the
residue granularity to DMA_RESIDUE_GRANULARITY_DESCRIPTOR.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This patch adds a new field to the dma_slave_caps struct which indicates the
granularity with which the driver is able to update the residue field of the
dma_tx_state struct. Making this information available to dmaengine users allows
them to make better decisions on how to operate. E.g. for audio certain features
like wakeup less operation or timer based scheduling only make sense and work
correctly if the reported residue is fine-grained enough.
Right now four different levels of granularity are supported:
* DESCRIPTOR: The DMA channel is only able to tell whether a descriptor has
been completed or not, which means residue reporting is not supported by
this channel. The residue field of the dma_tx_state field will always be
0.
* SEGMENT: The DMA channel updates the residue field after each successfully
completed segment of the transfer (For cyclic transfers this is after each
period). This is typically implemented by having the hardware generate an
interrupt after each transferred segment and then the drivers updates the
outstanding residue by the size of the segment. Another possibility is if
the hardware supports SG and the segment descriptor has a field which gets
set after the segment has been completed. The driver then counts the
number of segments without the flag set to compute the residue.
* BURST: The DMA channel updates the residue field after each transferred
burst. This is typically only supported if the hardware has a progress
register of some sort (E.g. a register with the current read/write address
or a register with the amount of bursts/beats/bytes that have been
transferred or still need to be transferred).
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
It's a bug that writing to the platform data directly, for it should
be constant. So just copy it before writing.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Instead of open-coding the intersecting of two rate masks (and getting slightly
wrong for some of the corner cases) use the new snd_pcm_rate_mask_intersect()
helper function.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
A bit of special care is necessary when creating the intersection of two rate
masks. This comes from the special meaning of the SNDRV_PCM_RATE_CONTINUOUS and
SNDRV_PCM_RATE_KNOT bits, which needs special handling when intersecting two
rate masks. SNDRV_PCM_RATE_CONTINUOUS means the hardware supports all rates in a
specific interval. SNDRV_PCM_RATE_KNOT means the hardware supports a set of
discrete rates specified by a list constraint. For all other cases the supported
rates are specified directly in the rate mask.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
SNDRV_PCM_RATE_CONTINUOUS means that all rates (possibly limited to a certain
interval) are supported. There is no need to manually set other rate bits.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Daniel Glöckner <daniel-gl@gmx.net>
Signed-off-by: Mark Brown <broonie@linaro.org>
SNDRV_PCM_RATE_CONTINUOUS means that all rates (possibly limited to a certain
interval) are supported. There is no need to manually set other rate bits.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
If none of the components (CODEC or CPU DAI) sets a maximum sample rate we'll
end up with the rate_max field of the runtime hardware set to 0. (Note that it
is still possible for the components to constrain the supported sample rates
using other methods, e.g. setting a list constraint) If rate_max is 0 this means
that the sound card doesn't support any rates at all, which is not the desired
result. So initialize rate_max to UINT_MAX. For symmetry reasons also set
rate_min to 0.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>