Age | Commit message (Collapse) | Author |
|
GPIO number 0 *is* legal and must be accepted.
Set .ena_gpio to -ENODEV on regulators having no GPIO in preparation
of a code change to accept GPIO 0 in the config.
|
|
Each spdif sample is qualified by the validity bit.
The bit shall be logic '0' if the audio sample is valid.
This commit configures the transmitter to always send '0' rather
than always send '1'.
|
|
|
|
pointer"
After change the pointer, ALSA lib would re-copy the initial data to
DMA buffer because the pointer is pointing the zero position at the
beginning, which results an audiable duplicated playback at the first
eight periods.
Even though dropping this patch would cause pointer being incorrectly
estimated. But to maintain the sanity of basic playback, we revert
the previous patch.
This reverts commit 5d0d4e1558fa0c235691436e1c5d26d9c8950775.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
We might not be able to get appl_ptr, so we estimated it by using hw_ptr,
while the distance between then should not be 2 * priv->period_bytes
initially but 8 * priv->period_bytes as we pri-filled one entire buffer
size at the beginning. The driver's memory access might be overlapped
with ALSA's buffer updating. So this patch fixes this inaccurate distance.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
Use neon data copy function as default to improve data copy performance so that
we can prevent some noise issue happening to HDMI audio due to the performance
issue.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
The HDMI IP in i.MX6DQ has a bug that it limits the dma period size within 8K.
Patch 'ENGR00300188-1 ASoC: imx-hdmi-dma: Double the buffer and period sizes'
doubled the period size which works great with Dual Lite but broke the HDMI
audio function on DQ. Thus fix it for 6DQ case.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
The offset reflects the current position of DMA access in the ALSA ring buffer.
So we should clear it before re-start DMA engine becasue the DMA access should
re-start its job from the 0 position. If we don't do this, the driver might get
a wrong idea about current position of DMA access. Thus fix it.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
(cherry picked from commit 8f265543ffda0a19e3f469967a7d61d8b344f080)
|
|
We found HDMI Audio has a performance issue when playback 8 channels 192KHz
files, CPU might lag its interrupt responsing while SDMA continues updating
HDMI internal AHB DMA's address and restarting AHB DMA, which resulted the
noise when AHB DMA access overlaps with the data copy procedures in this
driver.
Thus we here double the buffer size and period size of HDMI Audio to chop
the CPU interrupt to its half in the same span of time so that we can keep
the data copy procedures safe and provent it from overlapping access with
AHB DMA.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
(cherry picked from commit 04af1a351e016f52276ae002fd9f64b6b2962168)
|
|
This patch extracts the register init code for ESAI along with the default slot
number which is more common to I2S and LEFT_J mode.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
(cherry picked from commit ad9c7ab4ff75488c0cc44bcc5d87af2d5d1139cf)
|
|
This patch sets ESAI as LEFT_J format master so as to let ESAI provide bit
clock and frame clock for stability.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
(cherry picked from commit 38df16f71c95e2aa8e0b4c1ddd2ed7ec2c4fef4b)
|
|
All of these functions might be called before we enable the core clock in the
startup() by set_bias_level() or late_probe() in machine driver for example.
To make it safe, we here add pair of clock en/disabling to each function.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
(cherry picked from commit e6df36df2bc8062f3d1c0a19d18acc843a77619d)
|
|
slow issue"
The root cause of playback slow issue should be trying to get DSPCLK_DIV
before enabling SYSCLK of WM8962. Since we have a patch fixed it, we can
revert this work round.
This reverts commit 49a3ca545a88cdf4aa597c4dd7d904b4faaea555.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
(cherry picked from commit a4d253a8ab038661f515d72a175eb11688774874)
|
|
Set a default slot number in startup() so that those who use I2S or other
2-channel DAI format would not need to call set_dai_tdm_slot() in their
machine drivers.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
(cherry picked from commit eb22fac84c62cccb98dc4503bc9a537c435d216b)
|
|
If disabling SSI when SSI is already in the working state, the whole running
substream would be broken. Thus we here replace it to a safer way -- saving
the current SSIEN value and restore it afterward.
This patch also adds a slot number checking code before setting slot number.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
(cherry picked from commit 2f71335a5b39afec4cf976b45683e5de1baed31d)
|
|
Leaving clk_set_rate() in hw_params() is a bit dangerous when handling two
substreams. So we let set_sysclk() finish the clk_set_rate() directly.
This patch also adds spinlock to protect the baud clock configuration so
that it won't be broken during race.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
(cherry picked from commit d3818ba35e4cbb6a3fa769eb83ceb7335b7c19e6)
|
|
Since we introduced symmetric_channels and symmetric_samplebits, we can
implement these new feature to SSI synchronous mode and drop the useless
code accordingly.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
(cherry picked from commit 63a818ebd8fa88d8a91faa491c4f7909e7c8bdd5)
|
|
DSPCLK_DIV can be only generated correctly after enabling SYSCLK. But if the
current bias_level hasn't reached SND_SOC_BIAS_ON, DAPM won't enable SYSCLK,
which would cause the calculation result from DSPCLK_DIV invalid since bit
DSPCLK_DIV will be finally turned to its true value after DAPM enables SYSCLK
while the driver won't calculate it again for the current instance. In this
circumstance, a playback which needs non-zero DSPCLK_DIV would be distorted
due to unexpected clock frequency resulted from an invalid DSPCLK_DIV value.
So this patch provisionally enables the SYSCLK to get a valid DSPCLK_DIV for
calculation and then disables it afterward.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 75704ecfbb4124139b78b71dd603f05d61abe689)
(cherry picked from commit 46ff60a75d0db92848913435bc345def2a2ccc5e)
|
|
The snd_soc_dai_digital_mute() here will be never executed because we only
decrease codec->active in snd_soc_close(). Thus correct it.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 7f62b6ee767586ee7e5d12787dbaaaf47a91979a)
(cherry picked from commit 7ff4bd4a786d049cd4bc7306920e01f348acdaca)
|
|
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)
(cherry picked from commit eb745901177ab907ee2ec2ab8c8ca9b4deb0e35a)
|
|
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)
(cherry picked from commit bb3317659966b170d9481fad887df8808774c696)
|
|
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)
|
|
Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
|
|
I obviously forgot to merge the right version...
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
It turned out that we can't use gen_pool_*() functions on archs
without CONFIG_GENERIC_ALLOCATOR (resulting in missing symbols), since
linux/genalloc.h doesn't provide dummy functions for all. We'd be
able to fix linux/genalloc.h size, but I take an easier path for
now...
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
|
|
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>
|
|
Now it's quite common that an SoC contains its on-chip internal RAM.
By using this RAM space for DMA buffer during audio playback/record,
we can shutdown the voltage for external RAM to save power.
So add new DEV type with iram malloc()/free() and accordingly modify
current default mmap() for the iram circumstance.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
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>
|