23 Feb, 2017
40 commits
-
After allocating memory for m2m, we should null check for m2m instead of pair.
In fsl_asrc_close(), null-checking pair suggests that it may be null, but it
has already been dereferenced before the null check. pair will be alloceted
in fsl_asrc_open(), pair is null means that open dev file failed, and
close should not be called in user space. So remove null check for pair.buf_len should not greater than ASRC_DMA_BUFFER_SIZE, otherwith dma buffer will
be overrun.Reported by Coverity.
Signed-off-by: Zidan Wang
(cherry picked from commit b0dc15375b12b6c1bf46b9071b92267b827d8ce0) -
check the return value for snd_pcm_hw_constraint_integer().
Reported by Coverity.Signed-off-by: Zidan Wang
(cherry picked from commit 26f8fea617fcebd8835f660534a988c58b9f0517) -
fix mqs_priv->name overrun issue. Reported by Coverity.
Signed-off-by: Zidan Wang
(cherry picked from commit ef1c59f93981b15412a0207d5517a26901bb2ecd) -
rate_tx and rate_rx are always greater than or equal to 0, so remove the
no effect comparison. Reported by Coverity.Signed-off-by: Zidan Wang
(cherry picked from commit d5957250784a27cf6f6f421d8a6e0ba45b4bbc18) -
init fm_np to avoid wild pointer. Reported by Coverity.
Signed-off-by: Zidan Wang
(cherry picked from commit dea49f320f33e1f723301a0bfa18573c0f7b5fb1) -
fix missing break in switch. Reported by Coverity.
Signed-off-by: Zidan Wang
(cherry picked from commit 302516a1dfca5758a34cbed939c9976679febb0c) -
fix missing break in switch. Reported by Coverity.
Signed-off-by: Zidan Wang
(cherry picked from commit ec9d74d9258e3320ec68a1f977932cb20ace4ca2) -
init codec_np to avoid wild pointer. Reported by Coverity.
Signed-off-by: Zidan Wang
(cherry picked from commit 76665930654867cf38a86ba747a9f8a5bf2665e2) -
…urn value of set_fmt()
init asrc_np to avoid wild pointer and check return value of
set_fmt(). Reported by Coverity.Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit 4ccc87a93e180e09b6494fd6c6d81b07dc054e9b) -
init sii902x_np to avoid wild pointer. Reported by Coverity.
Signed-off-by: Zidan Wang
(cherry picked from commit 780e27683c38f785ea7f7e07e83b00ffd3c22d78) -
init codec_np to avoid wild pointer. Reported by Coverity.
Signed-off-by: Zidan Wang
(cherry picked from commit 8e27b90c9adf5033038a40e0b61a7ffe4c971290) -
check return value for set_fmt and set_sysclk function, and init
codec_np to avoid wild pointer. Reported by coverity.Signed-off-by: Zidan Wang
(cherry picked from commit 68021ab9ada4a7f3037993a3887453e12271d4ed) -
For SAI master mode, when Tx(Rx) sync with Rx(Tx) clock, Rx(Tx) will
generate bclk and frame clock for Tx(Rx), we should set RCR4(TCR4),
RCR5(TCR5) and RMR(TMR) for playback(capture), or there will be sync
error sometimes.Signed-off-by: Zidan Wang
Acked-by: Nicolin Chen
Signed-off-by: Mark Brown
(cherry picked from commit 51659ca069ce5bdf20675a7967a39ef8419e87f2) -
Attempt to read volatile register when cache_only is set will return
EBUSY. After playback/record, wm8962_runtime_suspend function will set
cache_only flag, so the volitale register ALC2 can't be read from cache.Separate ALC Coefficients to four reigsters, the volatile register ALC2
will be read from hardware instead of cache.Signed-off-by: Zidan Wang
(cherry picked from commit 5ec8878be12530517b4c8ae307441a0ac16071a3) -
For lpsr mode, the codec will be power down, the register value will be lost,
so we should store the context at the end of codec suspend, and load the
registers at the beginning of codec resume.Signed-off-by: Zidan Wang
(cherry picked from commit e35e15983e14caf48dadf235bc6b33014818c62e) -
When codec sysclk is 24576000, the sample rate ratio can be 128, 192,
256, 384, 512, 768, 1024. So 32k, 48k, 64k, 96k, 192k can be support.Signed-off-by: Zidan Wang
(cherry picked from commit b436254cd55dc0d2ebb6d2ca7ce5f58520ea5dbc) -
After playback audio with saiwm8960 sound card, is_slave_mode
will be set, but it will not be cleared. So playback audio with
saisii902x sound card will have no voice.Signed-off-by: Zidan Wang
-
Add 96k and 192k sample rate support for hdmi audio.
Signed-off-by: Zidan Wang
(cherry picked from commit fa94b89ab94ce78800d112d0a013d0c0901d9b78) -
imx7d-sdb board using one SAI for wm8960 and sii902x hdmi audio, wm8960
using SAI as slave mode and sii902x hdmi audio using SAI as master mode,
so SAI can't be used at the same time.Forbid palyback(capture) when SAI is being used capture(playback) by other
device.Signed-off-by: Zidan Wang
(cherry picked from commit bac15c28c3b8a57fbe04ea80b8fb5eb47a0211f1) -
Add machine driver for sii902x hdmi audio. Restricting by SAI master clock,
the hdmi audio just support 16bit 24bit sample width and 32k 48k sample rate.Signed-off-by: Zidan Wang
(cherry picked from commit 8dc359b46c81105efcd13007325d9cadc9a6214d) -
In the frame_to_bytes(), when hw_ptr*frame_bits exceed the maxmum of unsigned
long, the return value is saturated, so the appl_bytes is wrong.
This patch is to correct the usage of frame_to_bytes().Signed-off-by: Shengjiu Wang
(cherry picked from commit 9e66132d9c96305b65aa5fa3ba8a35271a04ded9) -
cherry-pick below patch from v3.14.y:
ENGR00330403-2: ASoC: fsl_hdmi: port hdmi audio driver from imx_3.10.yPort HDMI audio driver (CPU driver, machine driver, platform driver) from
imx_3.10.y.Signed-off-by: Shengjiu Wang
(cherry picked from commit 60996f868ed6ff68b45a39a0747df831e27571ba) -
Enable ASRC p2p for ssi->wm8962, base on the new p2p script,
which support to select dualfifo for source/destination device.Signed-off-by: Shengjiu Wang
-
cherry-pick below patch from v3.14.y:
ENGR00307635-5 ASoC: imx-wm8962: Add non-SSI cpu dai supportThe 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
Signed-off-by: Nicolin Chen
(cherry picked from commit b6fca438dde1b4c0bbdee31729871d601f287dc9) -
cherry-pick below patch from v3.14.y:
ENGR00312217-1 ASoC: fsl: pop noise with wm8962The 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
(cherry picked from commit 84babc7fa0a56f6620f8b04a86baece620297dda) -
cherry-pick below patch from v3.14.y:
ENGR00306857 pulseaudio5.0 mute Headphone volume when Headphone pluggedPulseaudio will detect the Headphone Jack, then swith to Headphone.
So register new Jack for Headphone, the iface=CARD.Signed-off-by: Shengjiu Wang
(cherry picked from commit 6a715373c43f16e48883061049e67919281878d1) -
cherry-pick below patch from v3.14.y:
ENGR00290229 ASoC: fsl: Drop snd_soc_dapm_sync() in imx-wm8962As 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
Signed-off-by: Nicolin Chen
(cherry picked from commit c4dcde0b5119262cbb75c5136422af2071bffbda) -
cherry-pick below patch from v3.14.y:
ENGR00279368-1 ASoC: fsl: Drop useless resume function in WM8962 machine driverThe resume function is useless for the driver because registered jack pin has
already handled suspend/resume cases, thus drop it.Acked-by: Wang Shengjiu
Signed-off-by: Nicolin Chen
(cherry picked from commit d9357cae4492abd5bca41515793ab6fe461717b2) -
cherry-pick below patch from v3.14.y:
ENGR00277715-3 ASoC: fsl: Add WM8962 jack detecting supportThere're two GPIOs connected to the headphone jack and microphone jack,
thus add the states detection.Reviewed-by: Wang Shengjiu
Signed-off-by: Nicolin Chen
(cherry picked from commit f85ca1dd664178328bd813651e91d612787b6926) -
cherry-pick below patch from v3.14.y:
ENGR00277471 ASoC: fsl: Fix set-mute-failed issue after WM8962 captureWe 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
Signed-off-by: Nicolin Chen
(cherry picked from commit 3133b6cfb31b202805d31d449bfa70383e5e1c75) -
cherry-pick below patch from v3.14.y:
ENGR00274386-2 ASoC: imx-wm8962: Set MCLK source clock to 0Hz in hw_free()When DAPM closed WM8962 after playback, its driver would prompt
'wm8962 0-001a: Unsupported sysclk ratio 500' due to the invalid
divisor calculated by WM8962 codec driver.To fix it, we can work around by setting its MCLK source to 0Hz,
so the codec driver would never get an invalid divisor any more.
Since hw_params() would re-set the MCLK source, no need to worry
about any side-effect.Acked-by: Wang Shengjiu
Signed-off-by: Nicolin Chen
(cherry picked from commit a935f7680ac3958ce72cf7413cac278c0683d4c0) -
cherry-pick below patch from v3.14.y:
ENGR00273838-8 ASoC: WM8962: Let codec driver enable/disable its MCLKWM8962 needs its MCLK when powerup -- wm8962_resume(). Thus it's better
to control the MCLK in codec driver. Thus remove the clock enable in
machine dirver accordingly.Acked-by: Wang Shengjiu
Signed-off-by: Nicolin Chen
(cherry picked from commit 007d3504914096760124f2ef13d52da206341a66) -
cherry-pick below patch from v3.14.y:
ENGR00273838-7 ASoC: fsl: Use hw_params() and hw_free() to set FLLWe followed community way by using set_bias() to set FLL of WM8962.
But this can't meet our requirement: aplay -Dhw: 16khz.wav 24khz.wav.
Thus use hw_params() and hw_free() instead.Acked-by: Wang Shengjiu
Signed-off-by: Nicolin Chen
(cherry picked from commit 8db9a2f44a5eecd02be2259a3783178a521ef2d2) -
add snd_soc_pm_ops for mqs machine driver to make the trigger
suspend/resume be called in suspend/resume.Signed-off-by: Zidan Wang
(cherry picked from commit 7887d4d9ab461f8d1d67f62c6cbc032e082193c2) -
The fsl_ssi revert the mask in tdm_slot, so machine use 1 present enable
not 0.Signed-off-by: Shengjiu Wang
-
The hw parameter is set failed for si476x if si476x is not powerup,
the codec use the default value of this module. So add startup/shutdown
to powerup/powerdown FM, then we can set parameter successfully.Signed-off-by: Shengjiu Wang
(cherry picked from commit 796665760605e020e6835f13db6ce49e0a0e03f5) -
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.Signed-off-by: Shengjiu Wang
(cherry picked from commit 01ffd8e5e828d20214a196e64b981c9fd94c913e) -
Configure the aumux port to output SRCK and SRFS from STCK and STFS
of internal port when use the SYN mode.Signed-off-by: Shengjiu Wang
(cherry picked from commit f4428f5617916863b5410afea5614cc52190f1a8)
(cherry picked from commit 5335e2a2d5f0f2e1b96aa920425203912b1e34d9) -
As the codec_name has a suffix, which is a index and is different
for different platform or different kernel. So here change machine driver
to use codec_of_node, which can be same for different platform/kernel,
then we can maintain a same machine driver for fm.Signed-off-by: Shengjiu Wang
(cherry picked from commit e87b135f34cba5cfcd0614b045d4035118fb6d77)
(cherry picked from commit b1dc86a327d96e431c2a55cc6744c6c3bc6b84af) -
cherry-pick below patch from imx_3.14.y
ENGR00330403-3: ASoC: fsl: port si476x machine driver from imx_3.10.yPort si476x machine dirver for i.MX series SoC and binding doc from imx_3.10.y
Signed-off-by: Shengjiu Wang
(cherry picked from commit 05a68db09806fe5b0aa927dd94cf69b1b0c0fa5a)