| Commit message (Collapse) | Author | Age |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We're now applying soc_hw_params_symmetry() to reject unmatched parameters
while we clear parameters in soc_pcm_close(). So here's a use case might be
broken by this mechanism: aplay -Dhw:0 44100.wav 48000.wav 32000.wav
In this case, we call soc_pcm_open()->soc_pcm_hw_params()->soc_pcm_hw_free()
->soc_pcm_hw_params()->soc_pcm_hw_free()->soc_pcm_close() in order. As we
only clear parameters in soc_pcm_close(). The parameters would be remained
in the system even if the playback of 44100.wav is finished.
Thus, this patch is trying to move parameters cleaning into hw_free() so that
the system can continue to serve this kind of use case.
Also, since we set them in hw_params(), it should be better to clear them in
hw_free() for symmetry.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit d3383420c969c25deffd33270ebe321e8401191a)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some SoCs can only work in mono or stereo mode at one time. So if
we let them capture a mono stream while playing a stereo stream,
there might be a problem occur to one of these two streams: double
paced or slowed down.
In soc-pcm.c, we have soc_pcm_apply_symmetry() to apply the rate
symmetry. But we don't have one for channels.
Likewise, we can treat symmetric_rate as a solution for those SoCs
or CODECs which can not handle asymmetrical LRCLK. But it's also
impossible for them to handle asymmetrical BCLK. And accodring to
BCLK = LRCLK * channel number * slot size(fixed or sample bits),
sample bits might also be a problem if they are not using a fixed
slot size.
Thus, this patch applys symmetry for channels and sample bits.
Meanwhile, there might be a race between two substreams if starting
simultaneously. Previously, we only added warning to compalin but
still using conservative way to let it carry on. However, this patch
rejects the second stream with any unmatched parameter to make sure
the first existing stream won't be broken.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 3635bf09a89cf92b80ac44198c5c8f0989624ea6)
|
|
|
|
|
|
|
|
|
|
|
| |
As DAPM would do the sync() for us, we don't need to handle it by ourselves.
And leaving snd_soc_dapm_sync() here is dangerous because it would disable
the clock from WM8962 during the short period of the output route changing
since we don't leave the alternative route's enanbling to this machine driver
but to DAPM core.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
| |
Both esai and spdif are using SDMA script to transmit and receive data while
the essential spba clock is missed in the current two drivers. Thus add them.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
|
|
| |
If there is no codec device, the machine driver will not register the
card. then alsa will not return RETRY error. update the error handling
for machine driver.
Add for cs42888 and si476x.
update dts file for sound-fm.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
|
|
| |
It's no good to use static variable because there might be several
drivers calling the function and the value would be overwritten by
all of them. Thus we move it into ssi_private.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The current clock selecting mechanism would choose a clock and set its rate
later when using it. It might be feasible for other clock sources but not
for sysclk -- ipg clock. Changing ipg clock rate in specific driver would
be a dangerous operation, so we here ingore the sysclk and will restore it
after we accomplish a better mechanism.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
|
| |
According to the Reference Manual, we should use system clock to calculate
rx clock rate instead of spdif own clock. Thus add system clock to spdif
driver and replace the incorrect one in rate calculation.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
|
| |
When using SSI I2S master mode, we need to decide the time slot number.
Because we use SSI normal mode to trick I2S signal, we here need to set
time slot number to two (left/right).
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
|
| |
We use SSI's normal mode to trick I2S signal by fetching data only from
one side of time slot so that we can purely get or put the monaural audio
data.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
|
| |
DC indicates Frame Rate Divider. By setting it we can get a desired
time slot numbers. Thus it should be more plausible to set DC in
set_dai_tdm_slot() instead of hw_params().
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
|
| |
When using dual fifo mode, we need to keep period size as an even number
due to behavior of SDMA script. Otherwise, it might neglect the 2nd fifo
at each period when its size appears to be an odd number.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When allocating memory space for DMA buffer, use on-chip internal SRAM
as default choice to save power. Since the core would allocate memory
from traditional external memory if iram allocation failed, we don't
need to worry about any side effect.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit ca2b029515b4a81bbedcffc69a5d9574bb5ba475)
|
|
|
|
|
|
|
|
|
| |
Each CPU DAI driver has its own defined DMA buffer size, so this patch just
drops the original one that uses a fixed size for all drivers and implements
a different DMA buffer size to each driver.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
| |
Redundant semicolon at the end of brace is removed.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
|
|
| |
The S/PDIF driver needs regmap so select it to make sure it gets
included in the build.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ASRC and HDMI audio might meet unexpected stop, 'ctrl+z' for example,
and then disable its sdma channel. But after 'fg' resume, because sdma
channel's status has already been set into DMA_ERROR, we need to prepare
dmaengine again to clear its error state, otherwise sdma driver would
bypass its channel enabling and 'Input/Output error' would happen to
ALSA lib.
The combined prepare and submit are also being used in soc-dmaengine,
the common ASoC dmaengine driver.
And since we already use a proper way to handle sdma channel status,
there's no need to make an exception for HDMI any more, so drop it.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
| |
'params' might be confused with snd_pcm_hw_params, so use 'priv' instead.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
| |
Use generic dmaengine_prep_dma_cyclic() in imx-hdmi-dma.c and fsl-asrc.c
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
|
|
| |
Alsa machine drivers need snd_soc_pm_ops to support normal suspend/resume
feature, thus add this to all machine drivers.
Also add missing SUSPEND and RESUME cases to trigger() in fsl_ssi.c
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
| |
The resume function is useless for the driver because registered jack pin has
already handled suspend/resume cases, thus drop it.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
| |
When rmmod snd-soc-imx-hdmi if loadable module feature of HDMI audio
is being used, there would be a kernel dump promt:
Unable to handle kernel NULL pointer dereference at virtual address
This was caused by inappropriate priv pointer fetching, thus fix it.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use platform_device_add() which can pass drvdata correctly: previously
we register the dma_dev first and pass its drvdata, but this would fail
to pass its drvdata correctly when using loadable module, because the
probe() hdmi dma driver would be executed right after the register()
and before set_drvdata(). Then the drvdata actually failed to be set
to the hdmi dma driver. While platform_device_add() has no such issue
because it would finish the set_drvdata() before its execution.
This patch also move codec driver registering into CPU DAI driver.
When using autoload module, the codec driver would alwasy fail to
be detected due to its registering located in manchine driver.
Thus move this to CPU DAI driver.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
|
| |
SND_SOC_FSL_UTILS is only used by PowerPC machines, so let's drop it in the
i.mx case.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
|
|
|
|
|
|
|
| |
There is a blank space missing between ':=' and 'imx-spdif.o', thus add it.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
|
|
|
|
|
|
|
|
|
|
| |
Remove the "====" pattern to let the comments cleaner and more uniform.
Also, do not use multi-line style for a single line comment.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
|
|
|
|
|
| |
Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Nicolin Chen <B42378@freescale.com>
|
|
|
|
|
|
|
| |
Add wrapping '\n' for dev_dbg() in fsl_spdif.c
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
|
|
|
|
|
|
|
|
| |
There're two GPIOs connected to the headphone jack and microphone jack,
thus add the states detection.
Reviewed-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The constraint would disavow two simultaineous streams, eg: arecord | aplay.
Since the hw_params() have the SSIEN checking, the stccr register would not
be modified during a actual procedure of one stream, we can safely drop this
one in startup().
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
| |
Add pm runtime for fsl audio codec
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
| |
Add hdmi audio machine dirver
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
| |
Add hdmi audio cpu dai dirver
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
| |
i.MX HDMI audio uses its own AHB DMA while there's also an extra SDMA channel
to update its buffer addresses. Thus add a new driver for HDMI audio.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
| |
The omap hdmi audio dummy codec driver is a generic hdmi codec driver but
have build dependency, thus drop the dependency in order to use it.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
We only need to mute WM8962 after playback, so add direction check
before doing mute.
And a mute failure would cause hw_free() abruptly return after it,
which might drop the essential procedure code for FLL controlling.
Thus put mute before FLL controlling code and drop its return check.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
| |
We are using generic dma binding from devicetree for spdif, thus use
the correct flag.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
|
|
| |
This patch implements a device-tree-only machine driver for Freescale
i.MX series Soc. It works with spdif_transmitter/spdif_receiver and
fsl_spdif.c drivers.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
|
|
|
|
|
|
|
|
|
|
| |
Driver core clears the driver data to NULL after device_release or on probe
failure, so just remove it from here.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Reviewed-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
| |
Add si476x machine dirver for i.MX series SoC and binding doc.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
| |
Add I2S master/PCM(DSP_A, DSP_B)/LEFT_J formats support for ssi,
also dropped the constrain of i2s-slave in probe().
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
| |
Also treat the ipg clock as ssi core clock.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
|
|
|
|
|
|
|
| |
This patch implements a device-tree-only CPU DAI driver for Freescale
S/PDIF controller that supports stereo playback and record feature.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
|
|
|
|
|
|
|
|
| |
Add request_bus_freq() and release_bus_freq() calls to the
various drivers to ensure that the DDR and AHB are the requested
frequency before the driver starts its task.
Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
|
|
|
|
|
|
|
|
| |
This error message is not actual error, which is a warning. When using
FE/BE, if there is widget which is used by playback and capture route, then
this message will be printed.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
| |
1. add 24bit format support.
2. enlarge the buffer size for ESAI.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
| |
add cs42888 machine driver.
add bindings document of cs42888 machine.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
| |
add esai driver.
add bindings documentation of esai
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
| |
add asrc p2p driver.
add bindings document of asrc p2p.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
| |
Add codec driver cs42888.
Add bindings document for cs42888 audio codec.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|