09 Jun, 2017
2 commits
-
WM8960 derives bit clock from sysclock using BCLKDIV[3:0] of R8
clocking register (See WM8960 datasheet, page 71).There are use cases, like this:
aplay -Dhw:0,0 -r 48000 -c 1 -f S20_3LE -t raw audio48k20b_3LE1c.pcmwhere no BCLKDIV applied to sysclock can give us the exact requested
bitclk, so driver fails to configure clocking and aplay fails to run.Fix this by relaxing bitclk computation, so that when no exact value
can be derived from sysclk pick the closest value greater than
expected bitclk.Suggested-by: Charles Keepax
Signed-off-by: Daniel Baluta -
Add a separate function for finding (sysclk, lrclk, bclk)
when the clock is auto or mclk. This makes code easier to
read and reduces the indentation level in wm8960_configure_clocking.Signed-off-by: Daniel Baluta
Acked-by: Charles Keepax
08 Jun, 2017
23 commits
-
After starting playback with a single channel SSI runs in Normal mode
(SCR.net = 0b, SCR.i2s_mode = 00b). But, if starting also capture
in parallel with playback the SSI mode changes which breaks the playback.This happens because, we can change SSI mode from two distinct places:
* _fsl_ssi_set_dai_fmt
* fsl_ssi_hw_paramsWhen running playback and capture in parallel for a mono channel, changing
hw params for the second stream will have no effect.This patch allows changing the mode only from fsl_ssi_hw_parms so that
we have an atomic view of SSI mode.Signed-off-by: Shengjiu Wang
Signed-off-by: Daniel Baluta -
Currently the M4 audio driver don't support mono channel, so remove it.
After mono channel is supported in M4 os, this commit should be reverted.Signed-off-by: Shengjiu Wang
-
some cmd is sent by workqueue, others are sent by call send message
function directly, for workqueue may have delay, so there is occasion
that cmd is not sent in order.
Add flush_workqueue before the CLOSE and SUSPEND to make sure previous
cmd is finished in that time.Signed-off-by: Shengjiu Wang
-
The M4 audio driver only support 8k/16k/32k/44k/48kHz sample rate.
so remove other rate in supported list.Signed-off-by: Shengjiu Wang
-
This typo issue will cause that wrong cmd send to M4 side.
Fixes: 3e13a631aee0 ("MLK-13904-1: ASoC: fsl: add audio cpu dai driver base on rpmsg")
Signed-off-by: Shengjiu Wang
-
Add machine driver, which is using the dummy codec.
Signed-off-by: Shengjiu Wang
Acked-by: Robin Gong -
Add platform driver, each step like set hw param, trigger start
trigger stop, and so on, will call the rpmsg api.Signed-off-by: Shengjiu Wang
Acked-by: Robin Gong -
Add the cpu dai driver, as the rpmsg_send api can't be used in
atomic context, so using the workqueue instead of calling
rpmsg_send() directly.
The detail communication stack is defined in header file.Signed-off-by: Shengjiu Wang
Acked-by: Robin Gong -
Use the new ASoC hdmi-codec infrastructure.
Signed-off-by: Mihai Serban
-
There is occasion that wm8960 reset failed in the beginning,
Especially after board reboot. The issue is found in the
imx7d-sdb board Rev.C. After retry, the reset operation is
successful.Signed-off-by: Shengjiu Wang
-
TX synchronous with receiver: the RMR should not be changed and
the RCSR.RE should be set in playback.
RX synchronous with transmitter: the TMR should not be changed and
the TCSR.TE should be set in recording.Signed-off-by: Shengjiu Wang
-
The input MCLK is 12.288MHz, The desired output sysclk is 11.2896MHz
the sample rate is 44100Hz, with the pllprescale=2, postscale=sysclkdiv=1,
some chip may have wrong bclk and lrclk output in master mode. then there
will be no sound.
With the pllprescale=1, postscale=2, the output clock is correct. so use
this configuration to workaround this issue.
Tested 8k/11k/16k/22k/32k/44k/48kHz case.Signed-off-by: Shengjiu Wang
-
Before suspend, the sysclock select pll out as source, after resume
sysclock select the mlck as the source, so the sample rate is changed
the sound's pitch is shifted.
The issue is caused by the commit c1845da3d08de6cf2642fec74f7a46d05de6314d
Which removed the wm8960_configure_clocking() when bias level changes
from STANDBY to PREPARE, this patch is to add it back.Signed-off-by: Shengjiu Wang
-
In imx7ulp1, the sai can support two TX channel and two RX
channels, So the usage need to be updated.Signed-off-by: Shengjiu Wang
-
There is no gpr setting in some board. so we can't return
a fatal error.Signed-off-by: Shengjiu Wang
-
There is hard code for gpr address in machine driver, imx-wm8960
and imx-wm8958, when the sai interface changed to sai1 or sai3,
there will be issue, so remove the hard code, use the property
from the device tree.Signed-off-by: Shengjiu Wang
-
The calculation "runtime->status->hw_ptr * (runtime->frame_bits / 8)" may
exceed the integer scope, then appl_bytes is no correct.
This patch is to fix this issue.Signed-off-by: Shengjiu Wang
-
cs42xx8 is a 24 bit device, the maximum supported bit is 24bit.
So remove the S32_LE from the supported list.Signed-off-by: Shengjiu Wang
-
The test case is one p2p playback + two m2m converter running
simultaneously. There are three root cause for this issue:1. hw_free() of p2p may be called twice in the end, which cause
release twice of one pair, if another pair request is called between
this two release, there will be issue.2. In m2m close(), the asrc_priv->pair[i] will be set NULL twice,
which is same issue as 1.3. when output rate is more than eight multiple of input rate for m2m,
the last_period_size should be larger.Signed-off-by: Shengjiu Wang
-
mqs can't be used as recorder, the capture property need to be zero.
Signed-off-by: Shengjiu Wang
-
The maximum divider of asrc clock is 1024, but there is no judgement
for this limitaion in driver, which may cause the divider setting not
correct.When IDEAL_RATIO_RATE 200kHZ, the cost time of conversion from 192kHz
to 96kHz is 24ms every 1024 sample, but these sample's playback time
is 1024/96=11ms, so there will be underrun. So need to enlarge this RATE.Signed-off-by: Shengjiu Wang
-
Add codec-master property for imx-wm8962. If set this in device
tree, the codec will work as master, if don't set it, the cpu dai
will work as master.Signed-off-by: Shengjiu Wang
-
mclk0 is assigned through the device tree.
Signed-off-by: Shengjiu Wang
23 Feb, 2017
15 commits
-
In imx6ull, the esai errata ERR008000 for imx6q/dl is fixed, so remove the
workaround from imx6ull.Signed-off-by: Shengjiu Wang
-
Add codec master mode support, the default is slave mode.
Signed-off-by: Shengjiu Wang
-
Validity bit is set in default, which means the data is not reliable,
The receive device may drop this data. So clear it in default, and
provide a mixer interface for user to control this bit.Signed-off-by: Shengjiu Wang
-
Remove the pre-processing and post-processing table. use proc_autosel()
to select proper parameters.
Unify the supported input and output rate.Signed-off-by: Shengjiu Wang
-
After the suspend/resume, hw_params may be called in bias_level is not
BIAS_ON, then the PLL is not disable/enabled, if the sample rate is
changed, the output clock is not correct.Signed-off-by: Shengjiu Wang
-
After suspend and resume, the wm8960 codec will change the state from
BIAS_OFF to BIAS_ON, in this time, the hw_free is called, the PLL will be
diabled, and next instance is started in rapid sequence, hw_params is called
But PLL is not enabled, because the bias state is not BIAS_ON.As PLL is disabled in BIAS_ON->BIAS_STANDBY, so don't need to disable pll
in hw_free of machine driver.Signed-off-by: Shengjiu Wang
-
When audio stop, it will first stop dma, then stop cpu_dai.
If there is delay between dma stop and cpu dai stop, there
will be underrun error, the print will cost time, then will
cause another underrun error, it is a infinite loop.
Which will cause the cpu dai can't stop.Signed-off-by: Shengjiu Wang
-
commit 743cead0f8c4ac6311ffb500efd6146c40124310 is not a complete fix.
There is low possibility that this issue still occur.Last commit add init_completion() in the suspend function, but if the
dma callback function is called after convert error, the complete is
done, the init_completion will not be called, so the complete state is
not correct in the next conversion.This patch is to move init_completion to the beginning of conversion
to fix the issue.Signed-off-by: Shengjiu Wang
-
When load sound card, the pulseaudio will using the sound card to
playback and record. It may be cause a kernel crash when the sound
card is unloaded while the playback/record is activeAfter setting the sound card owner field, when pulseaudio is running,
the sound card module ref-count will not be 0 and the sound card will
not be unloaded. So you should stop the pulseaudio when you want to
unload the sound card.Signed-off-by: Zidan Wang
-
Revert "MLK-11623 ASoC: imx-cs42888: add 32k and 64k sample rate support"
This reverts commit 314a01f40599134086480ef3c5e89a54aeedbf1f.
In Async mode, record and playback use different samplerate, one is 32k,
another is 48kHz, there will be issue "unsupported sysclk ratio".example case is
arecord -Dhw:0,1 -f S16_LE -r 32000 -c 2 | aplay -f S16_LE -r 32000 -c 2Signed-off-by: Shengjiu Wang
-
In suspend function, the complete will be set to done in callback.
After resuming, the convert will not spend time to wait the complete.
which is a wrong complete.
So in suspend function, the complete need to be reinited for next convert.Signed-off-by: Shengjiu Wang
-
Add headphone/micphone/headset jack support for different board.
There are headphone detect gpio and microphone detect gpio which
can be configured from device tree.
If headphone and microphone using the same gpio for jack detect,
it suppose to be a headset and will register a headphone jack for it.
If headphone and microphone using different gpio for jack detect,
it suppose not to be a headset, and will register headphone jack
and microphone jack respectively.Is't not appropriate to set the adc data output in machine driver.
It will not be compatibly when we change hardware connection.
wm8960 codec driver has added "ADC Data Output Select" kcontrol,
so that we can set the ADC data output from user space.Signed-off-by: Zidan Wang
(cherry picked from commit 92f65b4bee51fabdfa3a3c191f511c2ec7cb18a1) -
Report by coverity (CID 18428). The return value need be checked
for snd_soc_dai_set_sysclk().Signed-off-by: Shengjiu Wang
-
Patch 11626b6a79e27c716f3731b7dc2208631afbc665 is not a complete workaround.
The complete workaround is that: Each time playback/recording, firstly clear
the xSMA/xSMB, then enable TE/RE, then enable xSMB and xSMA (xSMB must be
enabled before xSMA).Because the xSMA and xSMB is in enabled state after reset, so in original fix
the first time playback/recording after bootup, didn't follow the workaround
flow. There maybe still have channel swap issue.The PDM ticket of this issue is TKT251104.
Signed-off-by: Shengjiu Wang
-
free pair after allocating m2m failed. Reported by coverity.
Signed-off-by: Zidan Wang
(cherry picked from commit 237a35db5b48b78250a019f891d9d746c3411d49)