| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
disabling TE/RE"
Patch "ASoC: fsl_sai: Reset FIFOs after disabling TE/RE" may accidentally
increase the underrun rate of SAI.
To keep an equal quality as previous release, we decide to revert this patch
and find a thorough way to reset the FIFO later.
This reverts commit b85f840a60de8d0a5ca8fbe7eda15f611ff5b622.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
|
|
|
|
|
| |
In the rx irq handling part, we should clear the flags in RCSR not TCSR.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
|
|
|
|
|
|
| |
SAI will not clear their FIFOs after disabling TE/RE. Therfore, the driver
should take care the task so as not to let useless data remain in the FIFO.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
|
|
|
|
| |
The SRPC register should be volatile, LOCK bit is set by the hardware.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
|
|
|
| |
When test asrc p2p first, then test no asrc p2p, There is no
sound after 5s. The reason is that the substream is not same for
this two case, then delay powerdown will close the widget for cs42888.
But the second will also use the cs42888. So set ignore_pmdown_time
to 1.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
|
|
| |
Not only SIS but also other read-only or write-only reigsters should be marked
as volatile register so as not to let regcache cache them. So this patch just
adds those missing registers.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
(cherry picked from commit 56ad235ba23274fc05422ad4b13153d1c56801c4)
|
|
|
|
|
|
|
|
|
| |
The reason is that PRRC and PCRC isn't cleared in restore_reg(), then
update_bits for PCRC and PRRC will fail for cache is not updated.
In other side, remove the store_reg() and restore_reg for adding regcache,
and use regcache_sync to restore the registers.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
MEGA Fast
For i.MX6 SoloX, there is a mode of the SoC to shutdown all power source of
modules during system suspend and resume procedure. Thus, AUDMUX needs to
save all the values of registers before the system suspend and restore them
after the system resume.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
|
|
|
|
|
|
|
|
| |
For i.MX6 SoloX, there is a mode of the SoC to shutdown all power source of
modules during system suspend and resume procedure. Thus, SSI needs to save
all the values of registers before the system suspend and restore them after
the system resume.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
MEGA Fast
For i.MX6 SoloX, there is a mode of the SoC to shutdown all power source of
modules during system suspend and resume procedure. Thus, SPDIF needs to save
all the values of registers before the system suspend and restore them after
the system resume.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fast
For i.MX6 SoloX, there is a mode of the SoC to shutdown all power source of
modules during system suspend and resume procedure. Thus, ESAI needs to save
all the values of registers before the system suspend and restore them after
the system resume.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
|
|
|
|
|
|
|
|
| |
For i.MX6 SoloX, there is a mode of the SoC to shutdown all power source of
modules during system suspend and resume procedure. Thus, SAI needs to save
all the values of registers before the system suspend and restore them after
the system resume.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
|
|
|
|
|
| |
Add parameter for slots, and caculate the number of TX/RX pins with
slots.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
|
| |
Enable NEON optimization will cause pulseaudio crash in the user space.
Which is caused by using the NEON instruction, if only use "VPUSH, VPOP" in the
function, crash will be happened also.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
| |
Register p2p width amd p2p rate tow kcontrol for asrc p2p, use can get/change
these parameter with amixer.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
| |
Remove local parameter for p2p_width, p2p_rate, which will be
get from the cpu driver of fe directly.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The upsteamed commit is 0c516b4ff85c0be4cee5b30ae59c9565c7f91a00
ASoC: cs42xx8: Add codec driver support for CS42448/CS42888
This patch adds support for the Cirrus Logic CS42448/CS42888 Audio CODEC that
has six/four 24-bit AD and eight 24-bit DA converters.
[ CS42448/CS42888 supports both I2C and SPI control ports. As initial patch,
this patch only adds the support for I2C. ]
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
| |
Move rate constraint from codec driver to machine driver. Because fe and be
use same runtime structure, so be needn't startup function.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
|
|
| |
The reason of pop noise is that we change the sysclk in hw_free, which is
for another wm8962 issue. So in currently the pop noise can't be resolved
with no confliction. So for Android, because the samplerate is fixed. we can
use other workaround for this issue: change the sysclk in the set_bias().
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
|
| |
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 236014ac7a6524f9f466139c2e47af70cb340ba3)
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
|
|
|
|
|
| |
Android need driver to export several kcontrol. "Support channels",
"Support Rates", "Support Formats".
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
| |
mclk of cs42888 is changed for slx.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
cherry-picked commit is 43d24e76b69826ce32292f47060ad78cdd0197fa
Header of this commit is "ASoC: fsl_esai: Add ESAI CPU DAI driver", use upstream
driver to replace current one.
Merged feature is:
1. Move setting of PRRC and PCRC to the end of hw_params, and disable it in
shutdown function.
2. Merged the xrun handler with this commit.
3. Use dma init with NO_RESIDUE|NO_DT|COMPAT.
4. Add spba clock for ESAI
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
| |
There are three clock for ESAI, esai_extal, esai_ipg, esai_mem.
Make the clock for ESAI more clear.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
| |
It'd better to tell people what's the current rate from the clock
selecting function against the required sample rate.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The sysclk, which could be connected to IPG clock, is one of the eight
clocks on the inner clock mux of SPDIF. Previously we forbade the usage
of this clock due to imperfect clock selecting function.
This patch adds the sysclk_df divisor so as to complete sysclk function.
[ In order to potect those clocks from other modules and the situation
when SPDIF root clock is shared with other module (ASRC on imx6sx for
example) that demands us to fix the clock and not to change its rate,
starting from now on, we no longer use clk_round() and clk_set_rate(). ]
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
|
|
|
|
|
|
|
|
| |
Even if we assign regmap to manage the coreclk control, we still need
to open the clock if we are going to run the driver because DMA access
would not be detected by regmap.
So this patch adds clock control for coreclk.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
|
|
|
|
|
| |
The src_maxburst and dst_maxburst means the watermark level for
p2p, no need to be scaled.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
|
| |
It should use STC_SYSCLK_DIV_OFFSET. Thus fix it.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 6ae6698276ca36f37afc2ad38054092021519ad4)
|
|
|
|
|
|
|
|
|
|
|
| |
There's a possiblity that ASRC P2P would error out during its probe() due to
missing some DT bindings for example. If that happens, this asrc_p2p would
be a NULL pointer and accessing it would cause Kernel Panic.
Thus this patch adds an error out here to keep it safe.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
|
|
|
|
| |
update asrc p2p to support recording, which use ideal ratio mode.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
| |
improve code ligibility.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
| |
Change the output-rate, output-width to p2p-rate, p2p-width.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
|
| |
By doing this, the driver can drop around 50 lines and become neater.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 2a266f8b2ae790454edb79cb8c707c9305e0307a)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patch ASoC: fsl_sai: Fix buggy configurations in trigger() doesn't entirely
fix the condition: FRDE of the current substream direction is being cleared
while the code is still using the non-updated one.
Thus this patch fixes this issue by checking the opposite one's FRDE alone
since the current one's is absolutely disabled.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit f84526cfae46672308a361333c76b724384b61ee)
|
|
|
|
|
|
|
| |
When ASRC P2P is working, it will check the xrun status of cpu dai
in the back end bistream. then will do Whole route stop and restart.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
| |
When esai xrun happened, there is possibility of channel swap. So ESAI
need to be reset.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
| |
1. PCRC and PRRC should be set after the setting of control register
according the RM. Then no need init TCCR and RCCR in init function.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
|
| |
Since we are able to link SAI and sgtl5000 and wm8962, we should update
the Kconfig to make it build-in if enabling their machine drivers.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current imx-wm8962 machine driver is designed for SSI as CPU DAI only
while as its name we should make the driver more generic to any other CPU
DAI on i.MX serires -- ESAI, SAI for example.
So this patch makes the driver more general so as to support those non-SSI
cases.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
|
|
|
|
|
| |
Add a new micro for SAI so as to make further define flexible.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The SAI mainly has the following clocks:
bus clock
control and configure registers and to generate synchronous
interrupts and DMA requests.
mclk1, mclk2, mclk3
to generate the bit clock when the receiver or transmitter is
configured for an internally generated bit clock.
So this patch adds these clocks and their clock controls to the driver.
[ To concern the old DTB cases, I've added a bit of extra code to make
the driver compatible with them. And by marking clock NULL if failed
to get, the clk_prepare() or clk_get_rate() would easily return 0
so no further path should be broken. -- by Nicolin ]
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Acked-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 17d1eb6628e70488c44c46003dcfe583696bb7b7)
|
|
|
|
|
|
|
|
|
|
|
| |
When using ASRC p2p as a for-end with other back-end modules like ESAI,
it'd be safer to add 1ms delay, less might be futile for extreme cases,
after enabling ASRC so as to keep ASRC output FIFO with enough data to
content the DMA burstsize of back-ends and accordingly prevent underrun
that might happen to them.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The BCP bit in TCR4/RCR4 register rules as followings:
0 Bit clock is active high with drive outputs on rising edge
and sample inputs on falling edge.
1 Bit clock is active low with drive outputs on falling edge
and sample inputs on rising edge.
For all formats currently supported in the fsl_sai driver, they're exactly
sending data on the falling edge and sampling on the rising edge.
However, the driver clears this BCP bit for all of them which results click
noise when working with SGTL5000 and big noise with WM8962.
Thus this patch corrects the BCP settings for all the formats here to fix
the nosie issue.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Acked-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit ef33bc3217c7aa9868f497c4f797cc50ad3ce357)
|
|
|
|
|
|
|
| |
Pulseaudio will detect the Headphone Jack, then swith to Headphone.
So register new Jack for Headphone, the iface=CARD.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
(cherry picked from commit cb6cd68b00fbb52852101ca2f3bc93ae45310b66)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The next coming i.MX6 Solo X SoC also contains SAI module while we use
imp_pcm_init() for i.MX platform.
So this patch adds one compatible route for imx6sx and updates the DT
doc accordingly.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 30c35252aadb460e009ca8a3fdc8891903bdfc66)
[ Added essential parameters to imx_pcm_init() calling due to build error,
resulted from the define change of the function on the upstream. ]
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
We only enable one side interrupt for each stream since over/underrun
on the opposite stream would be resulted from what we previously did,
enabling TERE but remaining FRDE disabled, even though the xrun on the
opposite direction will not break the current stream.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Acked-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 20ea0d31528f7a461a4ecfb5924ca228bf3ca3c5)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current trigger() has two crucial problems:
1) The DMA request enabling operations (FSL_SAI_CSR_FRDE) for Tx and Rx are
now totally exclusive: It would fail to run simultaneous Tx-Rx cases.
2) The TERE disabling operation depends on an incorrect condition -- active
reference count that only gets increased in snd_pcm_open() and decreased
in snd_pcm_close(): The TERE would never get cleared.
So this patch overwrites the trigger function by following these rules:
A) We continue to support tx-async-while-rx-sync-to-tx case alone, which's
originally limited by this fsl_sai driver, but we make the code easy to
modify for the further support of the opposite case.
B) We enable both TE and RE for PLAYBACK stream or CAPTURE stream but only
enabling the DMA request bit (FSL_SAI_CSR_FRDE) of the current direction
due to the requirement of SAI -- For tx-async-while-rx-sync-to-tx case,
the receiver is enabled only when both the transmitter and receiver are
enabled.
Tested cases:
a) aplay test.wav -d5
b) arecord -r44100 -c2 -fS16_LE test.wav -d5
c) arecord -r44100 -c2 -fS16_LE -d5 | aplay
d) (aplay test2.wav &); sleep 1; arecord -r44100 -c2 -fS16_LE test.wav -d1
e) (arecord -r44100 -c2 -fS16_LE test.wav -d5 &); sleep 1; aplay test.wav -d1
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Acked-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit d827786ea623da7ceadaa037f2574a19cbeb90e5)
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
(cherry picked from commit 5d0d4e1558fa0c235691436e1c5d26d9c8950775)
|