1
0
Fork 0
Commit Graph

8387 Commits (redonkable)

Author SHA1 Message Date
Jacob Rasmussen bb949b530c ASoC: rt5645: Fixed buddy jack support.
commit e7cfd867fd upstream.

The headphone jack on buddy was broken with the following commit:
commit 6b5da66322 ("ASoC: rt5645: read jd1_1 status for jd
detection").
This changes the jd_mode for buddy to 4 so buddy can read from the same
register that was used in the working version of this driver without
affecting any other devices that might use this, since no other device uses
jd_mode = 4. To test this I plugged and uplugged the headphone jack, verifying
audio works.

Signed-off-by: Jacob Rasmussen <jacobraz@google.com>
Reviewed-by: Ross Zwisler <zwisler@google.com>
Link: https://lore.kernel.org/r/20191111185957.217244-1-jacobraz@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-17 19:56:13 +01:00
Dong Aisheng 2a635fc846 Merge remote-tracking branch 'origin/audio/sai' into audio/next
* origin/audio/sai: (65 commits)
  LF-106: ASoC: fsl_sai: request BUS_FREQ_AUDIO
  ASoC: fsl_sai: Mark cache dirty at resume
  MLK-21876-4 ASoC: fsl: sai: fix build for next-20190524 upgrade
  ASoC: fsl: sai: fix build failture due to 5.1 RC7 upgrade
  ASoC: fsl_sai: support multi power domain
  ...
2019-12-02 18:00:43 +08:00
Dong Aisheng d7ba9dc826 Merge remote-tracking branch 'origin/audio/rpmsg' into audio/next
* origin/audio/rpmsg: (59 commits)
  LF-215: ASoC: fsl_rpmsg_i2s: Enable WQ_FREEZABLE for workqueue
  ASoC: imx-pcm-rpmsg: Remove the prtd
  ASoC: imx-pcm-rpmsg: Fix writecombine/wc build error
  ASoC: rpmsg_ak4497: ignore suspend with DAPM
  Revert "ASoC: soc-pcm: remove soc_rtdcom_ack()"
  ...
2019-12-02 18:00:43 +08:00
Dong Aisheng af11fb98c2 Merge remote-tracking branch 'origin/audio/hdmi' into audio/next
* origin/audio/hdmi: (22 commits)
  ASoC: imx-hdmi: Fix compile error
  ASoC: imx-hdmi-dma: Fix issue with dma_alloc_coherent
  ASoC: imx-hdmi-dma: replace platform to component
  ASoC: imx-cdnhdmi: Fix compile error
  MLK-20183-2: ASoC: imx-cdnhdmi: reconfigure the mclk for HDMI on imx8mq
  ...
2019-12-02 18:00:42 +08:00
Dong Aisheng f337340c23 Revert "ASoC: Remove dev_err() usage after platform_get_irq()"
This reverts commit cf9441adb1.
2019-11-25 15:53:33 +08:00
Shengjiu Wang 07386f3836 ASoC: rpmsg_ak4497: ignore suspend with DAPM
When suspend, the widget "AK4497 DAC" is powered down
then there is no sound output, which is not accepted
by LPA definition.

so ignore suspend with DAPM, that the widget will not
be powered down

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:53:23 +08:00
Shengjiu Wang 9c2bac2c85 ASoC: rpmsg_wm8960: replace codec to component
replace codec to component

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:53:22 +08:00
Shengjiu Wang b13fc2d9bb ASoC: rpmsg_cs42xx8: replace codec to component
replace codec to component

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:53:21 +08:00
Shengjiu Wang d4215f5953 ASoC: rpmsg_ak4497: replace codec to component
replace codec to component

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:53:21 +08:00
Shengjiu Wang 783c56a330 MLK-20277-2: ASoC: rpmsg_ak4497: remove digital_mute function
For the LPA mode, when the system enter suspend, the M4 will
continue to play the data, but for normal ALSA case, the digital
mute should be called at suspend, so the codec will be mute,
which conflict with the requirement of LPA.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:53:11 +08:00
Shengjiu Wang 66aea92f46 MLK-19750-3: ASoC: rpmsg_cs42xx8: enhance async mode for rpmsg_cs42xx8
with this patch,codec driver can support tx and rx in
different master/slave mode, for example, tx in master mode,
rx in slave mode

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:53:10 +08:00
Shengjiu Wang d895d7a234 MLK-19581-1: ASoC: rpmsg_ak4497: support ak4497 over rpmsg
The difference of rpmsg_ak4497 and ak4497 driver is first one
will send command through rpmsg, second one send command through
i2c.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 337f70c4ea5278db28abe1e6eaefbf2d0082aec5)
2019-11-25 15:53:08 +08:00
Shengjiu Wang dba422ef60 MLK-19168-2: ASoC: rpmsg_cs42xx8: support cs42xx8 over rpmsg
The difference of rpmsg_cs42xx8 and cs42xx8 driver is previous one
will send command through rpmsg, others are same.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit dda40ff395bb1d86fc75920bb2bc2ea99099ed4b)
2019-11-25 15:53:04 +08:00
Shengjiu Wang 69776826fd MLK-19168-1: ASoC: rpmsg_wm8960: port all function from wm8960
The difference of rpmsg_wm8960 and wm8960 driver is previous one
will send command through rpmsg, others are same.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 094521755ae806a572fd841455371b23408c36d1)
2019-11-25 15:53:04 +08:00
Shengjiu Wang 354ef27ff1 MLK-19042-3: ASoC: rpmsg_wm8960: changes for receive message
Update the read and write function for the send_message function
changes

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 4610826f39ee4124588b818e5589c25448aa3dba)
2019-11-25 15:53:02 +08:00
Shengjiu Wang ce72f6da78 MLK-17979: ASoC: rpmsg_wm8960: add mixer control for ADC input
The microphone only connect to left input, when record stereo channel
data, the right channel is mute. Add 'ADC Data Output Select' mixer
control that user can select the wanted configure. The default setting
is 'Left Data = Left ADC;  Right Data = Left ADC'.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:53:00 +08:00
Shengjiu Wang d41276f382 MLK-17156-4: ASoC: rpmsg_wm8960: add rpmsg_wm8960 codec
This codec is accessed by rpmsg. As the wm8960 is controlled
mainly by M4, so we only add volume in this rpmsg_wm8960 codec.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-11-25 15:52:58 +08:00
Shengjiu Wang 2c5a729e00 MLK-19312: ASoC: hdmi-codec: fix error log for hdmi audio
There is error log:

[   31.988272] hdmi-audio-codec hdmi-audio-codec.1: Not able to map channels to speakers (-22)
[   31.996659] hdmi-audio-codec hdmi-audio-codec.1: ASoC: can't set i2s-hifi hw params: -22

which is caused by the channel map read from device don't match
with current channel number.

Orignal method is just return error, but this channel number is
supported by device, so we think should not return error directly,
the playback can ongoing with UNKNOWN channel map.

This issue happen on some TV set (SUMSUNG UA40KUF30EJXXZ).

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:52:38 +08:00
Shengjiu Wang 184f623bb7 MLK-18368-1: ASoC: codecs: support rx in hdmi codec driver
The most difference with TX is that RX don't need to get edid
information.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2019-11-25 15:52:35 +08:00
Shengjiu Wang 5a56ee6204 LF-102: ASoC: ak4458: Support DSD512 when codec is ak4497
Support DSD512 when codec is ak4497

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:51:20 +08:00
Shengjiu Wang b25b67f5f9 ASoC: AK4458: Enable DSD for AK4497
Enable DSD for AK4497

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:51:20 +08:00
Viorel Suman d87a95d612 MLK-17817-1: ASoC: ak4458: enable daisy chain
Enable Daisy Chain if in TDM mode and the number of played
channels is bigger than the maximum supported number of channels.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 5ae97f159bfd9c4a37e7e60cd20aa3437041b251)
(Vipul: apply manually whilre rebase on v4.19)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
2019-11-25 15:51:19 +08:00
Viorel Suman d9b9ac9fb4 MLK-20189-7: ASoC: ak4458: check reset control status
Save error so that the following error checking now make sense.

This fixes Coverity issue: CID2828734

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Vipul: apply manuallly while rebase on v4.19
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
2019-11-25 15:51:18 +08:00
Viorel Suman 18b91ee0bc MLK-19573-2: ASoC: ak4458: enable DSD playback
Enable AK4458 DSD playback.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 2faade4b12f12e1fd33d20cda885ed6ddac0fd5e)
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2019-11-25 15:51:18 +08:00
Shengjiu Wang 24270174e5 MLK-21940-5: ASoC: wm8524: remove constrain for FE-BE
The constraint is not needed for back end bistream for
the sample rate is fixed by dts and the constraint
is propagate to front end bistream for they share same
snd_soc_pcm_runtime.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2019-11-25 15:51:18 +08:00
Shengjiu Wang e7b4562bbd MLK-19118-3: ASoC: AK5558: add regulators for ak5558
add regulators for ak5558

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 914f117ffb4233ba630515d8426d30006a82794f)
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
2019-11-25 15:51:17 +08:00
Shengjiu Wang e15d006d1a MLK-19118-1: ASoC: AK4458: add regulator for ak4458
add regulator for ak4458

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 6b9f1e42e6d4f59ad2c66c0d327fc6d63572147f)
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
2019-11-25 15:51:17 +08:00
Clark Wang a9b0619fa0 MLK-20940-3 codecs: cs42xx8: use single read/write to send i2c msg
cs42xx8 will call regcache_sync to refresh its register cache. However,
it will send a long msg which length is greater than the max buffer size
of virtual i2c driver. It will cause the regcache_sync operation failed.
So, use the single read/write to send i2c msg in regcache functions.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
(cherry picked from commit 0153e60c26a0fdcf463fb16b090511da7e52df0c)
2019-11-25 15:51:16 +08:00
Dong Aisheng 1a36afae7e ASoC: codecs: fsl_mqs: fix build for 5.1 RC kernel
Due to below patch:
999f7f5af8 ("ASoC: remove Codec related code")
codec related structures have been removed.
Need update legacy drivers accordingly.

  CC      sound/soc/codecs/hdmi-codec.o
  CC      sound/soc/codecs/si476x.o
../sound/soc/codecs/fsl_mqs.c: In function 'fsl_mqs_hw_params':
../sound/soc/codecs/fsl_mqs.c:65:35: error: 'struct snd_soc_dai' has no member named 'codec'
  struct snd_soc_codec *codec = dai->codec;
                                   ^
../sound/soc/codecs/fsl_mqs.c:66:9: error: implicit declaration of function 'snd_soc_codec_get_drvdata' [-Werror=implicit-function-declaration]
  struct fsl_mqs *mqs_priv = snd_soc_codec_get_drvdata(codec);
         ^
../sound/soc/codecs/fsl_mqs.c:66:29: warning: initialization makes pointer from integer without a cast
  struct fsl_mqs *mqs_priv = snd_soc_codec_get_drvdata(codec);

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2019-11-25 15:51:16 +08:00
Shengjiu Wang 62e2861cf0 ASoC: cs42xx8: support multi power domain
support multi power domain

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:51:16 +08:00
Shengjiu Wang 9b2cec9598 MLK-20428-1: ASoC: cs42xx8: add constraint for tdm mode
TDM mode can only work with codec slave mode, and the mclk
frequency should be 256FS.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:51:15 +08:00
Shengjiu Wang 41de343dab MLK-19750-2: ASoC: cs42xx8: enhance the async mode for cs42xx8
with this patch, codec driver can support tx and rx in
different master/slave mode, for example, tx in master mode,
rx in slave mode

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
[ Aisheng: fix big conflicts for next-20190730 upgrade ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2019-11-25 15:51:15 +08:00
Shengjiu Wang 1e66cff973 MLK-18530: ASoC: wm8524: support S32_LE
support S32_LE

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:51:14 +08:00
Viorel Suman 01924e035e MLK-17355-1: ASoC: fsl_mqs: Fix potential uninitialized pointer read
Initialize gpr_np in order to avoid potential unitialized
pointer read in the section following the "out:" label.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2019-11-25 15:51:13 +08:00
Shengjiu Wang ec3d8fb623 MLK-17089-7: ASoC: fsl_mqs: support suspend & resume for imx8
Base on latest power management design in MLK-17074, every driver
need to enter runtime suspend state in suspend, so the driver should
call the pm_runtime_force_suspend in suspend. with this implementation
the suspend function almost same as runtime suspend function. so remove
the suspend function, just use pm_runtime_force_suspend instead.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:51:13 +08:00
Shengjiu Wang a9ea8e0682 MLK-17089-6: ASoC: wm8962: support suspend & resume for imx8
Base on latest power management design in MLK-17074, every driver
need to enter runtime suspend state in suspend, so the driver should
call the pm_runtime_force_suspend in suspend.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:51:12 +08:00
Shengjiu Wang 9d988eefa3 MLK-17089-5: ASoC: wm8962: restore the CLOCKING2 register
The CLOCKING2 is a volatile register, but some bits should
be restored when resume, for example SYSCLK_SRC. otherwise
the output clock is wrong

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:51:11 +08:00
Shengjiu Wang b28c5d13a1 MLK-17034-5: ASoC: fsl_mqs: Move clock operation to pm runtime function
In imx8 when systerm enter suspend state, the power of subsystem will be
off, The clock enable state will be lost after resume, but the runtime
resume function will be called after resume by pm, so need to move clock
enablement to runtime resume and clock disablement to runtime suspend.
Then after resume the clock enable state can be recovered.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:51:10 +08:00
Shengjiu Wang 8876a263d6 MLK-16350-2: ASoC: fsl_mqs: enable the pm_runtime
enable the pm_runtime, the power domains wil be disabled when
mqs is idle.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2019-11-25 15:51:10 +08:00
Daniel Baluta 6e0e9370a3 ASoC: codecs: fsl_mqs: Add PM support
Save the values of registers at suspend and restore
it at resume.

We don't need to implement runtime PM support because
MQS is already enabled in startup() and disabled in
shutdown().

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:51:09 +08:00
Shengjiu Wang 5eb82ae30f MLK-15340-1: ASoC: wm8962: fix lambda value
According RM, the FLL_LAMBDA must be set to non-zero value in
integer and Franctional modes.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Reviewed-by: Mihai Serban <mihai.serban@nxp.com>
2019-11-25 15:51:09 +08:00
Shengjiu Wang 56b42dc792 MLK-13945-1: ASoC: fsl_mqs: refine the mqs driver for support imx8qm
IOMUXC_GPR2 register is not used for imx8, there is a new register
designed for this usage in imx8, so it also need the ipg clock.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-11-25 15:51:08 +08:00
Shengjiu Wang 0a37960199 MLK-14851: ASoC: wm8962: fix clock issue for S20_3LE (part 1)
There is error log "wm8962 3-001a: Unsupported BCLK ratio 6"
When the bitstream's format is S20_3LE.
The reason is that the pll output is samplerate*256, which
can't divide to clock samplerate*20*2. So in this patch change
the pll output to samplerate*384, and use the physical_width
for S20_3LE to calculate the bclk.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
[ Aisheng: split card changes ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2019-11-25 15:51:08 +08:00
Daniel Baluta f372be5c8a MLK-15028: ASoC: codecs: wm8960: Remove bitclk relax condition
Using a higher bitclk then expected doesn't always work.
Here is an example:

aplay -Dhw:0,0 -d 5 -r 48000 -f S24_LE -c 2 audio48k24b2c.wav

In this case, the required bitclk is 48000 * 24 * 2 = 2304000
but the closest bitclk that can be derived is 3072000.

Now, for format S24_LE, SAI will use slot_width = 24, but since
the clock is faster than expected, it will start to send bytes
from the next channel so the sound will be corrupted.

Thus, remove bitclk relaxation condition which was added mostly
for supporting S20_3LE format which was removed from SAI in
commit 739e6d654b5c0a ("MLK-14870: ASoC: fsl_sai: Remove support
for S20_3LE").

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25 15:51:07 +08:00
Shengjiu Wang 3f64f32f8a MLK-13621: ASoC: codec: wm8960: fix reset failed in probe
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 <shengjiu.wang@freescale.com>
2019-11-25 15:51:06 +08:00
Shengjiu Wang e61cf4622e MLK-13418: ASoC: wm8960: workaround no sound issue in master mode
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 <shengjiu.wang@freescale.com>
2019-11-25 15:51:06 +08:00
Shengjiu Wang 7f3c08bb06 MLK-12464-2: ASoC: wm8960: fix clock is not correct after suspend/resume
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 <shengjiu.wang@freescale.com>
2019-11-25 15:51:06 +08:00
Zidan Wang ee61ae7f87 MLK-11915-10 ASoC: imx_mqs: fix mqs_priv->name overrun issue
fix mqs_priv->name overrun issue. Reported by Coverity.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit ef1c59f93981b15412a0207d5517a26901bb2ecd)
2019-11-25 15:51:05 +08:00
Zidan Wang d77b7dbf6d MLK-10183 ASoC: wm8962: separate ALC Coefficients to four reigsters
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 <zidan.wang@freescale.com>
(cherry picked from commit 5ec8878be12530517b4c8ae307441a0ac16071a3)
2019-11-25 15:51:05 +08:00
Shengjiu Wang 7d0becbfe1 MLK-10899: ASoC: si476x: add startup/shutdown to powerup/down FM
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 <shengjiu.wang@freescale.com>
(cherry picked from commit 796665760605e020e6835f13db6ce49e0a0e03f5)
2019-11-25 15:51:05 +08:00
Shengjiu Wang ebf67d3ab0 MLK-11004-3: ASoC: cs42888: enable PWR in probe for fix pop noise
Delete PWR widget, enable it in probe to fix pop noise

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit 4fdb40165706bba3de6aa47e6328136d1eb597fc)
2019-11-25 15:51:04 +08:00
Shengjiu Wang 0f0a3d8e08 MLK-10515-2: ASoC: fsl_mqs: Move clk get_rate to hw_param
It is too early to put clk get rate in probe, because the rate for
the clock may not be ready.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2019-11-25 15:51:03 +08:00
Shengjiu Wang 723c0b0be0 MLK-9723-4: ASoC: fsl_mqs: add mqs codec driver
Implement codec driver for mqs. mqs is a very simple IP. which support:

Word length: 16bit.
DAI format: Left-Justified, slave mode.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit 9da6bdd2072b850e9bb910512123eff7d80a0e2f)
2019-11-25 15:51:03 +08:00
Takashi Iwai df37d941c4 ASoC: Fixes for v5.4
These are a collection of fixes since v5.4-rc4 that have accumilated,
 they're all driver specific and there's nothing major in here so it's
 probably not essential to actually send them but I'll leave that call to
 you.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl3EETsTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0BJCB/968YQYuvmvJbBify4l+l56rz3O0Qge
 /dkifAsiBLYctwjYKVaqPhrcLts6gaKSZnKwNjF1d5ucjwb9y2cTuJoh65xJw4Z6
 wgOBJiVC0wTdLzLMStVAX6QKFP6oVgWkKuaWRfhWiCbdWMVQesQlZePmu/PYU2IH
 /B60aTN4noSMycFqmdHfyVGXnTX7cONCFr9cfE/EX+uQLCFe+QD7UItCEGl/1uwp
 84mfNdLFkhX72yEEb5SZvGac5k9fyRvy1TPqkO5r+BQeYnePUMCpuA2mZaO9yBUh
 r+6AMDcF300lXt860UtBidugpC5YM9vNUAu/dXMDowP8A+vBg2aquYe+
 =GWKb
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v5.4-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v5.4

These are a collection of fixes since v5.4-rc4 that have accumilated,
they're all driver specific and there's nothing major in here so it's
probably not essential to actually send them but I'll leave that call to
you.
2019-11-07 13:52:17 +01:00
Yong Zhi e44f3d49f9
ASoC: max98373: replace gpio_request with devm_gpio_request
Use devm_gpio_request() to automatic unroll when fails and avoid
resource leaks at error paths.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Link: https://lore.kernel.org/r/1572905399-22402-1-git-send-email-yong.zhi@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-11-05 18:52:41 +00:00
Kai Vehmanen 5dc7d5bc96
ASoC: hdac_hda: fix race in device removal
When ASoC card instance is removed containing a HDA codec,
hdac_hda_codec_remove() may run in parallel with codec resume.
This will cause problems if the HDA link is freed with
snd_hdac_ext_bus_link_put() while the codec is still in
middle of its resume process.

To fix this, change the order such that pm_runtime_disable()
is called before the link is freed. This will ensure any
pending runtime PM action is completed before proceeding
to free the link.

This issue can be easily hit with e.g. SOF driver by loading and
unloading the drivers.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191101170635.26389-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-11-04 13:21:15 +00:00
Jerome Brunet 901af18b6b
ASoC: hdmi-codec: drop mutex locking again
This reverts commit eb1ecadb7f.

This fixes the following warning reported by lockdep and a potential
issue with hibernation

====================================
WARNING: pulseaudio/1297 still has locks held!
5.3.0+ #1826 Not tainted
------------------------------------
1 lock held by pulseaudio/1297:
 #0: ee815308 (&hcp->lock){....}, at: hdmi_codec_startup+0x20/0x130

stack backtrace:
CPU: 0 PID: 1297 Comm: pulseaudio Not tainted 5.3.0+ #1826
Hardware name: Marvell Dove (Cubox)
[<c0017b4c>] (unwind_backtrace) from [<c0014d10>] (show_stack+0x10/0x14)
[<c0014d10>] (show_stack) from [<c00a2d18>] (futex_wait_queue_me+0x13c/0x19c)
[<c00a2d18>] (futex_wait_queue_me) from [<c00a3630>] (futex_wait+0x184/0x24c)
[<c00a3630>] (futex_wait) from [<c00a5e1c>] (do_futex+0x334/0x598)
[<c00a5e1c>] (do_futex) from [<c00a62e8>] (sys_futex_time32+0x118/0x180)
[<c00a62e8>] (sys_futex_time32) from [<c0009000>] (ret_fast_syscall+0x0/0x54)
Exception stack(0xebd31fa8 to 0xebd31ff0)
1fa0:                   00000000 ffffffff 000c8748 00000189 00000001 00000000
1fc0: 00000000 ffffffff 00000000 000000f0 00000000 00000000 00000000 00056200
1fe0: 000000f0 beac03a8 b6d6c835 b6d6f456

Fixes: eb1ecadb7f ("ASoC: hdmi-codec: re-introduce mutex locking")
Reported-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20191023161203.28955-2-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-23 18:20:43 +01:00
Stephan Gerhold 9110d1b0e2
ASoC: msm8916-wcd-analog: Fix RX1 selection in RDAC2 MUX
According to the PM8916 Hardware Register Description,
CDC_D_CDC_CONN_HPHR_DAC_CTL has only a single bit (RX_SEL)
to switch between RX1 (0) and RX2 (1). It is not possible to
disable it entirely to achieve the "ZERO" state.

However, at the moment the "RDAC2 MUX" mixer defines three possible
values ("ZERO", "RX2" and "RX1"). Setting the mixer to "ZERO"
actually configures it to RX1. Setting the mixer to "RX1" has
(seemingly) no effect.

Remove "ZERO" and replace it with "RX1" to fix this.

Fixes: 585e881e5b ("ASoC: codecs: Add msm8916-wcd analog codec")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20191020153007.206070-1-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-21 13:50:01 +01:00
Takashi Iwai c8d2dcb3e9 ASoC: Fixes for v5.4
A collection of fixes that have arrived since the merge window.  There
 are a small number of core fixes here but they are smaller ones around
 error handling.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl2tmNgTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0Mp7B/9TN2O39/jS2Rjg7jUtHHqpBSv2a4Tq
 oyJ6l69C2aeS2HLqJc5PkFRXw2C2pOdMdCjY7XXNC3M02zIC9Eh5b2Y2FlYPhMUz
 LMHVZ69IU0vMgW/9AWi140h7h0pDoNzqagsIpzm1+UDkk0ITH7NORUyc4BKCLJiG
 MzgWtExa7MiakkriS23LPPNDspx05aRKul+wB20GBKCB1W5LjBDiiH5JUmyx9C23
 Gto04TrDbJrRmQeVcJJfuzWQRcQVhocdjqqjI5lrvYPqB8eawBIN+x/DHBkjnmBw
 JOZaQqAlOmCV5sJhkX/KW9nE+SqELPVMDE1LgNIQXspxKL3vXX1OqQ7i
 =EmvC
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v5.4-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v5.4

A collection of fixes that have arrived since the merge window.  There
are a small number of core fixes here but they are smaller ones around
error handling.
2019-10-21 14:05:26 +02:00
Srinivas Kandagatla bcab05880f
ASoC: msm8916-wcd-digital: add missing MIX2 path for RX1/2
This patch adds missing MIX2 path on RX1/2 which take IIR1 and
IIR2 as inputs.

Without this patch sound card fails to intialize with below warning:

 ASoC: no sink widget found for RX1 MIX2 INP1
 ASoC: Failed to add route IIR1 -> IIR1 -> RX1 MIX2 INP1
 ASoC: no sink widget found for RX2 MIX2 INP1
 ASoC: Failed to add route IIR1 -> IIR1 -> RX2 MIX2 INP1
 ASoC: no sink widget found for RX1 MIX2 INP1
 ASoC: Failed to add route IIR2 -> IIR2 -> RX1 MIX2 INP1
 ASoC: no sink widget found for RX2 MIX2 INP1
 ASoC: Failed to add route IIR2 -> IIR2 -> RX2 MIX2 INP1

Reported-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20191009111944.28069-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-09 18:02:18 +01:00
Stuart Henderson 3ae7359c0e
ASoC: wm_adsp: Don't generate kcontrols without READ flags
User space always expects to be able to read ALSA controls, so ensure
no kcontrols are generated without an appropriate READ flag. In the case
of a read of such a control zeros will be returned.

Signed-off-by: Stuart Henderson <stuarth@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20191002084240.21589-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-02 12:56:38 +01:00
Jaska Uimonen 2bdf194e20
ASoC: intel: bytcr_rt5651: add null check to support_button_press
When removing sof module the support_button_press function will oops
because hp_jack pointer is not checked for NULL. So add a check to fix
this.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190927201408.925-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-01 18:33:02 +01:00
Jaska Uimonen a315e76fc5
ASoC: rt5682: add NULL handler to set_jack function
Implement NULL handler in set_jack function to disable
irq's.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190927201408.925-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-01 18:32:35 +01:00
Li Xu 9daf4fd030
ASoC: wm_adsp: Fix theoretical NULL pointer for alg_region
Fix potential NULL pointer dereference for alg_region in
wm_adsp_buffer_parse_legacy. In practice this can never happen as
loading the firmware should have failed at the wm_adsp2_setup_algs
stage, however probably better for the code to be robust against
future changes and this is more helpful for static analysis.

Signed-off-by: Li Xu <li.xu@cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20191001130911.19238-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-01 17:43:36 +01:00
Sathyanarayana Nujella 4bb41984bf
ASoC: max98373: check for device node before parsing
Below Oops is caused in a system which uses ACPI instead of device node:

of_get_named_gpiod_flags: can't parse 'maxim,reset-gpio' property of node '(null)[0]'
BUG: kernel NULL pointer dereference, address: 0000000000000010

This patch avoids NULL pointer deferencing by adding a check before parsing
and initializes to make reset-gpio pin as invalid.

Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Signed-off-by: Jairaj Arava <jairaj.arava@intel.com>
Link: https://lore.kernel.org/r/1569702150-11976-1-git-send-email-sathyanarayana.nujella@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-01 12:45:33 +01:00
Linus Torvalds 3cf7487c5d sound fixes for 5.4-rc1
A few small remaining wrap-up for this merge window.
 
 Most of patches are device-specific (HD-audio and USB-audio quirks,
 FireWire, pcm316a, fsl, rsnd, Atmel, and TI fixes), while there is
 a simple fix (actually two commits) for ASoC core.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAl2KBooOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE9m6xAArBi8tcosiyP34QANb+KMfm6ZkBlVBCsu1YGU
 qr4L0a0PyZYWEmRvc1AETJsIe2DZDNJ5V+GTVxJ7fyQeV+Z/6XyK76ufSYYLWxSX
 vjsQVPnWReJqDYQEXeanC9S3VfZuH1q2JoqLdF2F0s5RhTrGJyz0YKm4dt7O9x84
 1SIp0itxmMGylNNXeemPFKXyem/LbblpRzFRwexjCFwwN/0QGzYsooBV22wm8i5L
 qVyGzaDoorNfS2d3Oyljl55N6uGvXt9KJslV/JSg3iaLUe31rHB2o0bLCqXZOeUm
 WofKsolrMv1CK0Bk+/HgpxT20TDlZ/73QRJVgO7/PydIZxxiqHPFxQV54gUano+a
 tTvnPBwbLyFwx5Xt1RrycL9KdVv48ZF58jZIKZpW3zKDY4pUcOstdKU5UBkiopDD
 ZFITveFPbvviUXXEsOl7EmAbcSaMjI84GDPD3KBFrKCe7J7/vFTPJcJhgoVBGrwb
 XVXVzR3M0tvjdqfYf6OU+EEzKvrg+xYITk3SjqD666DQ0u6DMmj0z/KJkH8ZUy/w
 ByPhoz9O0zh1WbLOO+753zXFS5xS2VLPOJStEmuhWDEtNoNout+T/nWiuOAH36w7
 ziBnqQJVl+TY3m24UaCaswWKEceEFlM7+bLS/WlQtE/ZVZDwdwqbEmFsFNYsh1Ft
 xAqPp8M=
 =mOJY
 -----END PGP SIGNATURE-----

Merge tag 'sound-fix-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A few small remaining wrap-up for this merge window.

  Most of patches are device-specific (HD-audio and USB-audio quirks,
  FireWire, pcm316a, fsl, rsnd, Atmel, and TI fixes), while there is a
  simple fix (actually two commits) for ASoC core"

* tag 'sound-fix-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: usb-audio: Add DSD support for EVGA NU Audio
  ALSA: hda - Add laptop imic fixup for ASUS M9V laptop
  ASoC: ti: fix SND_SOC_DM365_VOICE_CODEC dependencies
  ASoC: pcm3168a: The codec does not support S32_LE
  ASoC: core: use list_del_init and move it back to soc_cleanup_component
  ALSA: hda/realtek - PCI quirk for Medion E4254
  ALSA: hda - Apply AMD controller workaround for Raven platform
  ASoC: rsnd: do error check after rsnd_channel_normalization()
  ASoC: atmel_ssc_dai: Remove wrong spinlock usage
  ASoC: core: delete component->card_list in soc_remove_component only
  ASoC: fsl_sai: Fix noise when using EDMA
  ALSA: usb-audio: Add Hiby device family to quirks for native DSD support
  ALSA: hda/realtek - Fix alienware headset mic
  ALSA: dice: fix wrong packet parameter for Alesis iO26
2019-09-24 16:46:16 -07:00
Sylwester Nawrocki ca2347190a
ASoC: wm8994: Do not register inapplicable controls for WM1811
In case of WM1811 device there are currently being registered controls
referring to registers not existing on that device.
It has been noticed when getting values of "AIF1ADC2 Volume", "AIF1DAC2
Volume" controls was failing during ALSA state restoring at boot time:
 "amixer: Mixer hw:0 load error: Device or resource busy"

Reading some registers through I2C was failing with EBUSY error and
indeed these registers were not available according to the datasheet.

To fix this controls not available on WM1811 are moved to a separate
array and registered only for WM8994 and WM8958.

There are some further differences between WM8994 and WM1811,
e.g. registers 603h, 604h, 605h, which are not covered in this patch.

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Link: https://lore.kernel.org/r/20190920130218.32690-2-s.nawrocki@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-09-23 14:15:26 -07:00
Takashi Iwai 5b8b8f764d ASoC: Fixes for v5.4
A small smattering of ASoC fixes for v5.4 - nothing too exciting
 here, all small standalone things.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl2JCfITHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0GP1B/wImLx7u5jHiiAAzeW9kig7R+m91/wm
 +QMwcguVLsrTiI8qz2YnH8bMEbLU66bHsy7faKl5hG1r6vnSEct6MTw236eM7l5/
 XqLRmnn6W2GtxnpShL/eL3F73i7HYdSUBNsdeV5V9loTMJKehDJ/AqK7k+eMZt0y
 5xxEpkiTZilu1ue+GwWN2bhKHu4HnBmESkmbO2Adsws1ZKUNfuhye+IkorllJFeG
 v9FmP8j37Z5YKMAUaKmdy4uaecvwJZVpWNuaNNS7A02+6OpeIdrYtNUbj4dnPqGF
 U+mOs+Xsnsv09ykBEBdFBk50sKjZnIMeO+cxz/tjT8nL9QI+LCFonf72
 =Ijmx
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v5.4-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v5.4

A small smattering of ASoC fixes for v5.4 - nothing too exciting
here, all small standalone things.
2019-09-23 20:16:13 +02:00
Peter Ujfalusi 7b2db65b59
ASoC: pcm3168a: The codec does not support S32_LE
24 bits is supported in all modes and 16 bit only when the codec is slave
and the DAI is set to RIGHT_J.

Remove the unsupported sample format.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20190919071652.31724-1-peter.ujfalusi@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-09-20 12:06:17 +01:00
Linus Torvalds 32b90daf5c chrome platform changes for v5.4
* CrOS EC / MFD Migration
  - Move cros_ec core driver from mfd into chrome platform.
 
 * Wilco EC:
  - Add batt_ppid_info command to Wilco telemetry driver.
 
 * CrOS EC:
  - cros_ec_rpmsg : Add support to inform EC of suspend/resume status
  - cros_ec_rpmsg : Fix race condition on probe failed
  - cros_ec_chardev : Add a poll handler to receive MKBP events
 
 * Misc:
  - bugfixes in cros_usbpd_logger and cros_ec_ishtp
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQQCtZK6p/AktxXfkOlzbaomhzOwwgUCXYKpygAKCRBzbaomhzOw
 wlkXAP9QCKia7LiNujIl9kh7WXSloxdO0BzL93pgSpNHfUDeSAD+Mlcp+54bDqkB
 WaF2SR14Z2vzAFafroQTl6m41xJTog4=
 =slD7
 -----END PGP SIGNATURE-----

Merge tag 'tag-chrome-platform-for-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux

Pull chrome platform updates from Benson Leung:
 "CrOS EC / MFD Migration:
    - Move cros_ec core driver from mfd into chrome platform.

  Wilco EC:
    - Add batt_ppid_info command to Wilco telemetry driver.

  CrOS EC:
    - cros_ec_rpmsg : Add support to inform EC of suspend/resume status
    - cros_ec_rpmsg : Fix race condition on probe failed
    - cros_ec_chardev : Add a poll handler to receive MKBP events

  Misc:
    - bugfixes in cros_usbpd_logger and cros_ec_ishtp"

* tag 'tag-chrome-platform-for-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
  platform/chrome: cros_usbpd_logger: null check create_singlethread_workqueue
  platform/chrome: cros_ec_chardev: Add a poll handler to receive MKBP events
  platform/chrome: cros_ec_rpmsg: Fix race with host command when probe failed
  platform/chrome: chromeos_tbmc: Report wake events
  mfd: cros_ec: Use mfd_add_hotplug_devices() helper
  mfd: cros_ec: Add convenience struct to define autodetectable CrOS EC subdevices
  mfd: cros_ec: Add convenience struct to define dedicated CrOS EC MCUs
  mfd: cros_ec: Use kzalloc and cros_ec_cmd_xfer_status helper
  mfd / platform: cros_ec: Reorganize platform and mfd includes
  mfd / platform: cros_ec: Rename config to a better name
  mfd: cros_ec: Switch to use the new cros-ec-chardev driver
  mfd / platform: cros_ec: Miscellaneous character device to talk with the EC
  mfd / platform: cros_ec: Move cros-ec core driver out from MFD
  mfd / platform: cros_ec: Handle chained ECs as platform devices
  platform/chrome: cros_ec_rpmsg: Add host command AP sleep state support
  platform/chrome: chromeos_laptop: drop checks of NULL-safe functions
  platform/chrome: wilco_ec: Add batt_ppid_info command to telemetry driver
2019-09-19 14:14:28 -07:00
Mark Brown a54f848572
Merge branch 'asoc-5.4' into asoc-next 2019-09-15 10:31:44 +01:00
Mark Brown 7e0d8442e4
Merge branch 'asoc-5.3' into asoc-linus 2019-09-15 10:31:42 +01:00
Saiyam Doshi d1c9e44a85
ASoC: wcd9335: remove redundant use of ret variable
All these functions declares and initializes variable ret with
'0' and without modifying 'ret' variable, it is returned.

This patch removes this redundancy and returns '0' directly.

Signed-off-by: Saiyam Doshi <saiyamdoshi.in@gmail.com>
Link: https://lore.kernel.org/r/20190909174541.GA22718@SD
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-09-11 11:16:05 +01:00
Cheng-Yi Chiang 6fa5963c37
ASoC: hdmi-codec: Add an op to set callback function for plug event
Add an op in hdmi_codec_ops so codec driver can register callback
function to handle plug event.

Driver in DRM can use this callback function to report connector status.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Link: https://lore.kernel.org/r/20190717083327.47646-2-cychiang@chromium.org
Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-09-09 14:50:03 +01:00
Ben Zhang dfe58f2011
ASoC: rt5677: keep analog power register at SND_SOC_BIAS_OFF
Instead of clearing RT5677_PWR_ANLG2 (MX-64h) to 0 at SND_SOC_BIAS_OFF,
we only clear the RT5677_PWR_CORE bit which is set at SND_SOC_BIAS_PREPARE.
MICBIAS control bits are left unchanged.

This fixed the bug where if MICBIAS1 widget is forced on, MICBIAS
control bits will be cleared at suspend and never turned back on again,
since DAPM thinks the widget is always on.

Signed-off-by: Ben Zhang <benzh@chromium.org>
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/20190906194636.217881-3-cujomalainey@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-09-09 13:22:07 +01:00
Curtis Malainey 33b773dc92
ASoC: rt5677: Remove magic number register writes
In order to simplify understanding what register values are being
written to the codec for debugging more advanced features (such as
hotwording) it is best to remove magic numbers

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/20190906194636.217881-2-cujomalainey@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-09-09 11:04:31 +01:00
Colin Ian King 13ab0d1ab8
ASoC: rt1308: make array pd static const, makes object smaller
Don't populate the array pd on the stack but instead make it
static const. Makes the object code smaller by 82 bytes.

Before:
   text	   data	    bss	    dec	    hex	filename
  26548	   7288	     64	  33900	   846c	sound/soc/codecs/rt1308.o

After:
   text	   data	    bss	    dec	    hex	filename
  26370	   7384	     64	  33818	   841a	sound/soc/codecs/rt1308.o

(gcc version 9.2.1, amd64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190907074634.22144-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-09-09 10:52:07 +01:00
Colin Ian King b61b1e35ed
ASoC: rt1305: make array pd static const, makes object smaller
Don't populate the array pd on the stack but instead make it
static const. Makes the object code smaller by 93 bytes.

Before:
   text	   data	    bss	    dec	    hex	filename
  38961	   9784	     64	  48809	   bea9	sound/soc/codecs/rt1305.o

After:
   text	   data	    bss	    dec	    hex	filename
  38804	   9848	     64	  48716	   be4c	sound/soc/codecs/rt1305.o

(gcc version 9.2.1, amd64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190907074156.21907-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-09-09 10:51:52 +01:00
Colin Ian King 2b70d5776e
ASoC: rt1011: make array pd static const, makes object smaller
Don't populate the array pd on the stack but instead make it
static const. Makes the object code smaller by 100 bytes.

Before:
   text	   data	    bss	    dec	    hex	filename
  51463	  13016	    128	  64607	   fc5f	sound/soc/codecs/rt1011.o

After:
   text	   data	    bss	    dec	    hex	filename
  51299	  13080	    128	  64507	   fbfb	sound/soc/codecs/rt1011.o

(gcc version 9.2.1, amd64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190907073717.21632-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-09-09 10:51:36 +01:00
Colin Ian King 78b93b0477
ASoC: codecs: ad193x: make two arrays static const, makes object smaller
Don't populate the arrays on the stack but instead make them
static const. Makes the object code smaller by 37 bytes.

Before:
   text	   data	    bss	    dec	    hex	filename
  16253	   7200	      0	  23453	   5b9d	sound/soc/codecs/ad193x.o

After:
   text	   data	    bss	    dec	    hex	filename
  16056	   7360	      0	  23416	   5b78	sound/soc/codecs/ad193x.o

(gcc version 9.2.1, amd64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190906161404.1440-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-09-09 10:50:51 +01:00
Katsuhiro Suzuki ebe02a5b9e
ASoC: es8316: support fixed and variable both clock rates
This patch supports some type of machine drivers that set 0 to mclk
when sound device goes to idle state. After applied this patch,
sysclk == 0 means there is no constraint of sound rate and other
values will set constraints which is derived by sysclk setting.

Original code refuses sysclk == 0 setting. But some boards and SoC
(such as RockPro64 and RockChip I2S) has connected SoC MCLK out to
ES8316 MCLK in. In this case, SoC side I2S will choose suitable
frequency of MCLK such as fs * mclk-fs when user starts playing or
capturing.

Bad scenario as follows (mclk-fs = 256):
  - Initialize sysclk by correct value (Ex. 12.288MHz)
    - ES8316 set constraints of PCM rate by sysclk
      48kHz (1/256), 32kHz (1/384), 30.720kHz (1/400),
      24kHz (1/512), 16kHz (1/768), 12kHz (1/1024)
  - Play 48kHz sound, it's acceptable
  - Sysclk is not changed

  - Play 32kHz sound, it's acceptable
  - Set sysclk by 8.192MHz (= fs * mclk-fs = 32k * 256)
    - ES8316 set constraints of PCM rate by sysclk
      32kHz (1/256), 21.33kHz (1/384), 20.48kHz (1/400),
      16kHz (1/512), 10.66kHz (1/768), 8kHz (1/1024)

  - Play 48kHz again, but it's NOT acceptable because constraints
    list does not allow 48kHz

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
Link: https://lore.kernel.org/r/20190907163653.9382-2-katsuhiro@katsuster.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-09-09 10:50:36 +01:00
Katsuhiro Suzuki 0db0c62c88
ASoC: es8316: fix redundant codes of clock
This patch removes redundant null checks for optional MCLK clock.
And fix DT binding document for changing clock property to optional
from required.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
Link: https://lore.kernel.org/r/20190907163653.9382-1-katsuhiro@katsuster.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-09-09 10:50:21 +01:00
YueHaibing 2f302d476c
ASoC: sirf-audio: use devm_platform_ioremap_resource() to simplify code
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190904083412.18700-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-09-04 13:48:31 +01:00
Katsuhiro Suzuki 6dd567dc96
ASoC: es8316: add clock control of MCLK
This patch introduce clock property for MCLK master freq control.
Driver will set rate of MCLK master if set_sysclk is called and
changing sysclk by board driver.

[Modified slightly to apply without an earlier patch in the series due
to context diffs -- broonie]

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
Link: https://lore.kernel.org/r/20190903165322.20791-2-katsuhiro@katsuster.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-09-03 18:58:30 +01:00
Enric Balletbo i Serra 840d9f131f mfd / platform: cros_ec: Reorganize platform and mfd includes
There is a bit of mess between cros-ec mfd includes and platform
includes. For example, we have a linux/mfd/cros_ec.h include that
exports the interface implemented in platform/chrome/cros_ec_proto.c. Or
we have a linux/mfd/cros_ec_commands.h file that is non related to the
multifunction device (in the sense that is not exporting any function of
the mfd device). This causes crossed includes between mfd and
platform/chrome subsystems and makes the code difficult to read, apart
from creating 'curious' situations where a platform/chrome driver includes
a linux/mfd/cros_ec.h file just to get the exported functions that are
implemented in another platform/chrome driver.

In order to have a better separation on what the cros-ec multifunction
driver does and what the cros-ec core provides move and rework the
affected includes doing:

 - Move cros_ec_commands.h to include/linux/platform_data/cros_ec_commands.h
 - Get rid of the parts that are implemented in the platform/chrome/cros_ec_proto.c
   driver from include/linux/mfd/cros_ec.h to a new file
   include/linux/platform_data/cros_ec_proto.h
 - Update all the drivers with the new includes, so
   - Drivers that only need to know about the protocol include
     - linux/platform_data/cros_ec_proto.h
     - linux/platform_data/cros_ec_commands.h
   - Drivers that need to know about the cros-ec mfd device also include
     - linux/mfd/cros_ec.h

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Series changes: 3
- Fix dereferencing pointer to incomplete type 'struct cros_ec_dev' (lkp)
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2019-09-02 11:33:42 +01:00
Enric Balletbo i Serra 47f11e0b40 mfd / platform: cros_ec: Move cros-ec core driver out from MFD
Now, the ChromeOS EC core driver has nothing related to an MFD device, so
move that driver from the MFD subsystem to the platform/chrome subsystem.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2019-09-02 11:33:12 +01:00
Srinivas Kandagatla a8a652bfac
ASoC: wcd9335: Fix primary interpolator max rate
On this codec SLIMBus RX path supports 384000 rate on primary interpolator.
Add this missing rate as supported rate.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20190822095653.7200-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-28 11:55:27 +01:00
Shengjiu Wang b429ca4940
ASoC: cs42xx8: Force suspend/resume during system suspend/resume
Use force_suspend/resume to make sure clocks are disabled/enabled
accordingly during system suspend/resume.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/1566944026-18113-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-27 20:39:46 +01:00
Shuming Fan e9e897d5fd
ASoC: rt1011: add mutex protection to set_fmt/set_tdm_slot
The calibration process at booting will reset registers and bypass cache
to make sure the calibration is done.
We add mutex protection to avoid unexpected settings while
the registration process and calibration are interleaved.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20190826090052.1875-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-27 20:38:42 +01:00
Katsuhiro Suzuki f6e7792196
ASoC: es8316: fix inverted L/R of headphone mixer volume
This patch fixes inverted Left-Right channel of headphone mixer
volume by wrong shift_left, shift_right values.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
Reviewed-by: Daniel Drake <drake@endlessm.com>
Link: https://lore.kernel.org/r/20190826153900.25969-2-katsuhiro@katsuster.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-27 20:38:27 +01:00
Katsuhiro Suzuki f972d02fee
ASoC: es8316: fix headphone mixer volume table
This patch fix setting table of Headphone mixer volume.
Current code uses 4 ... 7 values but these values are prohibited.

Correct settings are the following:
  0000 -12dB
  0001 -10.5dB
  0010 -9dB
  0011 -7.5dB
  0100 -6dB
  1000 -4.5dB
  1001 -3dB
  1010 -1.5dB
  1011 0dB

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
Reviewed-by: Daniel Drake <drake@endlessm.com>
Link: https://lore.kernel.org/r/20190826153900.25969-1-katsuhiro@katsuster.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-27 20:38:12 +01:00
YueHaibing c101fb2973
ASoC: wm8988: fix typo in wm8988_right_line_controls
sound/soc/codecs/wm8988.c:270:30: warning:
 wm8988_rline_enum defined but not used [-Wunused-const-variable=]

wm8988_rline_enum should be used in wm8988_right_line_controls.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 5409fb4e32 ("ASoC: Add WM8988 CODEC driver")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190822143608.59824-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-22 18:28:43 +01:00
Mark Brown dd28d54c24
Merge branch 'asoc-5.3' into asoc-5.4 2019-08-20 18:28:43 +01:00
Michał Mirosław 0a05f2e865
ASoC: wm8904: implement input mode select as a mux
Make '* Capture Mode' a mux. This makes DAPM know that in single-ended
mode only inverting mux paths need to be enabled.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/125cd3c9f298da9b08a4d6002d4c00d70a898950.1566298834.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-20 18:03:02 +01:00
Michał Mirosław 22afe62423
ASoC: wm8904: fix typo in DAPM kcontrol name
Trivial fix for typo in "Capture Inverting Mux"es' name.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/f95ae1085f9f3c137a122c4d95728711613c15f7.1566298834.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-20 18:02:44 +01:00
YueHaibing 12f0bfadf6
ASoC: 88pm860x: remove unused variables 'pcm_switch_controls' and 'aif1_mux'
sound/soc/codecs/88pm860x-codec.c:533:38: warning:
 pcm_switch_controls defined but not used [-Wunused-const-variable=]
sound/soc/codecs/88pm860x-codec.c:560:38: warning:
 aif1_mux defined but not used [-Wunused-const-variable=]

They are never used, so can be removed.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190815092547.29564-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-15 15:07:25 +01:00
YueHaibing e33d565795
ASoC: cs42l56: remove unused variable 'adc_swap_enum'
sound/soc/codecs/cs42l56.c:206:30: warning:
 adc_swap_enum defined but not used [-Wunused-const-variable=]

It is never used, so can be removed.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190815092436.34632-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-15 15:07:07 +01:00
YueHaibing d63887bc4f
ASoC: es8328: Fix copy-paste error in es8328_right_line_controls
It seems 'es8328_rline_enum' should be used
in es8328_right_line_controls

Fixes: 567e4f9892 ("ASoC: add es8328 codec driver")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190815092300.68712-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-15 15:06:49 +01:00
YueHaibing 97d39be9ce
ASoC: es8328: remove unused variable 'pga_tlv'
sound/soc/codecs/es8328.c:102:35: warning:
 pga_tlv defined but not used [-Wunused-const-variable=]

They are never used, so can be removed.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190815092056.28724-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-15 15:06:31 +01:00
YueHaibing 6d6376b143
ASoC: tlv320aic31xx: remove unused variable 'cm_m_enum'
sound/soc/codecs/tlv320aic31xx.c:261:29: warning:
 cm_m_enum defined but not used [-Wunused-const-variable=]

It is never used, so can be removed.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190815091738.21680-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-15 15:06:13 +01:00