Commit Graph

40858 Commits

Author SHA1 Message Date
Sugar Zhang
77d904ce5f ASoC: rockchip: spdif: Ignore 0hz clk rate
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I491eef9b7729c1a5b0f9d59d5c868e9256a32c19
2022-03-07 10:02:14 +08:00
Binyuan Lan
a212f58bdb ASoC: rockchip: rk817-codec: enable chop and reduce record gain
Signed-off-by: Binyuan Lan <lby@rock-chips.com>
Change-Id: I144cf8845961f3c03d53afd48754d20fe7789a66
2022-02-24 15:53:20 +08:00
Sugar Zhang
5cbd397dce ASoC: rk_codec_digital: Build depends on CPU config
$ ./scripts/bloat-o-meter rk_codec_digital.o.old rk_codec_digital.o
add/remove: 1/10 grow/shrink: 0/1 up/down: 4/-796 (-792)
Function                                     old     new   delta
rv1126_data                                    8       -      -8
rk3588_data                                    8       -      -8
rk3568_data                                    8       -      -8
rv1126_soc_deinit                             28       -     -28
rk3588_soc_deinit                             28       -     -28
rk3568_soc_deinit                             28       -     -28
rv1126_soc_init                               32       -     -32
rk3588_soc_init                               32       -     -32
rk3568_soc_init                               32       -     -32
rcd_of_match                                1176     588    -588
Total: Before=8057, After=7265, chg -9.83%

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I40332029ac33a29cff039ec07ea3a2d0995badac
2022-02-24 11:45:22 +08:00
Sugar Zhang
3d04628d29 ASoC: rk_codec_digital: Add support for rv1106 SoC
This patch adds compatible for rv1106 SoC.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I2b8b716330400c43981494aa0826e92293b07eec
2022-02-24 11:45:03 +08:00
Sugar Zhang
d98628f00f ASoC: rockchip: i2s-tdm: Add compatible for rv1106 SoC
This patch adds compatible for rv1106 SoC.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Iedae362b8af237d539c6259f8d7376cc0e79a4c3
2022-02-24 11:43:18 +08:00
Tao Huang
a6b7505c2b ASoC: rockchip: i2s-tdm: Add HAVE_SYNC_RESET config
$ ./scripts/bloat-o-meter rockchip_i2s_tdm.o.old rockchip_i2s_tdm.o
add/remove: 0/2 grow/shrink: 0/3 up/down: 0/-948 (-948)
Function                                     old     new   delta
rockchip_i2s_tdm_hw_params                  2768    2760      -8
rockchip_i2s_tdm_trigger                    1232    1216     -16
of_i2s_resetid_get                           124       -    -124
rockchip_i2s_tdm_probe                      1676    1496    -180
rockchip_snd_xfer_sync_reset                 620       -    -620
Total: Before=12012, After=11064, chg -7.89%

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I3cffc57ca5fe4271d4a2c9584383777871123f14
2022-02-24 11:37:13 +08:00
Sugar Zhang
1c97242e31 ASoC: rockchip: i2s-tdm: Build depends on CPU config
$ ./scripts/bloat-o-meter rockchip_i2s_tdm.o.old rockchip_i2s_tdm.o
add/remove: 0/8 grow/shrink: 0/1 up/down: 0/-992 (-992)
Function                                     old     new   delta
rk1808_txrx_config                            16       -     -16
px30_txrx_config                              16       -     -16
rk3568_i2s_soc_data                           24       -     -24
rk3308_i2s_soc_data                           24       -     -24
rk1808_i2s_soc_data                           24       -     -24
px30_i2s_soc_data                             24       -     -24
rk3308_txrx_config                            32       -     -32
rk3568_txrx_config                            48       -     -48
rockchip_i2s_tdm_match                      1176     392    -784
Total: Before=13004, After=12012, chg -7.63%

Change-Id: Iaedb9e9b11b38255a7a5b57a9a77c1523fc9d515
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2022-02-24 11:34:50 +08:00
Sugar Zhang
646d6556ee ASoC: rockchip: i2s: Build depends on CPU config
$ ./scripts/bloat-o-meter rockchip_i2s.o.old rockchip_i2s.o
add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-1968 (-1968)
Function                                     old     new   delta
rk3399_i2s_pins                                8       -      -8
rockchip_i2s_match                          2548     588   -1960
Total: Before=8656, After=6688, chg -22.74%

Change-Id: Iabb0a00ab27ce5623164d40de6b379272a81e4e5
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2022-02-24 11:33:59 +08:00
Sugar Zhang
b12cc7fd53 ASoC: rockchip: spdif: Add support for set mclk rate
This patch allow to set mclk rate from machine driver.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Id1e713c7021cb644eeb32fb98d384a6fd320f31d
2022-01-21 19:13:17 +08:00
Shunhua Lan
e9a70c503e ASoC: codecs: add aw87xxx amp
Change-Id: Ieb1f7af778a6cc4966efd0878d363a4a1f3a9d54
Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
2022-01-17 14:58:57 +08:00
Shunhua Lan
0f3345f410 ASoC: rockchip: hdmi: support dts specified daifmt
In hdmirx audio the cpu dai may act as slave
And there also will be multi dai cells to select

Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
Change-Id: I9b68a064204bb443b7e1e6fdc6e7f9e23b70e902
2022-01-17 11:35:59 +08:00
Shunhua Lan
a33052cd79 ASoC: es8323: cache sync registers when doing suspend/resume
Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
Change-Id: I88df09eb772fe2d59dc531974859a9b2a081bcbd
2022-01-07 14:02:25 +08:00
XiaoTan Luo
ffdc12a182 ASoC: rockchip: multicodecs: Fix panic when get adc error
[   30.670500] Internal error: Oops: 96000005 [#1] SMP
[   30.670947] Modules linked in:
[   30.671257] CPU: 0 PID: 105 Comm: kworker/u16:1 Not tainted 5.10.66 #172
[   30.671866] Hardware name: Rockchip RK3588 EVB1 LP4 V10 Board (DT)
[   30.672447] Workqueue: events_power_efficient adc_jack_handler
[   30.672989] pstate: 60c00009 (nZCv daif +PAN +UAO -TCO BTYPE=--)
[   30.673548] pc : iio_read_channel_processed+0x28/0xdc
[   30.674023] lr : adc_jack_handler+0xc8/0x188
[   30.674418] sp : ffffffc012783d50
[   30.674731] x29: ffffffc012783d50 x28: 0000000000000000
[   30.675240] x27: ffffffc011cc9960 x26: 0000000000000000
[   30.675735] x25: ffffffc011a17980 x24: 0000000000000000
[   30.676232] x23: ffffff840002e100 x22: ffffffc011cc99a0
[   30.676728] x21: ffffffc012783da4 x20: ffffffffffffffed
[   30.677234] x19: ffffff8402c6c880 x18: 0000000000000000
[   30.677730] x17: 0000000000000000 x16: 0000000000000000
[   30.678236] x15: 0000000000000000 x14: 0000000000000000
[   30.678742] x13: 0000000000000000 x12: 0000000000000000
[   30.679247] x11: 0000000000000000 x10: 0000000000000db0
[   30.679753] x9 : ffffffc010b90a58 x8 : ffffff840098da7c
[   30.680259] x7 : fefefefefefefeff x6 : 0000746e65696369
[   30.680765] x5 : 0000000000000018 x4 : ffffff840098da6c
[   30.681262] x3 : ffffff8400f15000 x2 : 0000000000000000
[   30.681758] x1 : ffffffc012783da4 x0 : ffffffffffffffed
[   31.074520] Call trace:
[   31.074764]  iio_read_channel_processed+0x28/0xdc
[   31.075205]  adc_jack_handler+0xc8/0x188
[   31.075576]  process_one_work+0x1e0/0x298
[   31.075955]  worker_thread+0x1e4/0x27c
[   31.076310]  kthread+0xf8/0x108
[   31.076609]  ret_from_fork+0x10/0x30
[   31.076957] Code: a90153f3 aa0003f4 f90013f5 aa010

Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
Change-Id: I974d757819c3ffdd801711dc6561753ee2ee455a
2021-12-27 11:10:58 +08:00
Tao Huang
f6909c028f Merge tag 'ASB-2021-12-05_12-5.10' of https://android.googlesource.com/kernel/common
https://source.android.com/security/bulletin/2021-12-01
CVE-2021-33909
CVE-2021-38204
CVE-2021-0961

* tag 'ASB-2021-12-05_12-5.10': (3010 commits)
  ANDROID: workqueue: export symbol of the function wq_worker_comm()
  ANDROID: GKI: Update symbols to symbol list
  ANDROID: vendor_hooks: Add hooks for binder proc transaction
  ANDROID: GKI: Add symbols abi for USB IP kernel modules.
  ANDROID: GKI: Fix file mode on mtk abi file
  UPSTREAM: erofs: fix deadlock when shrink erofs slab
  ANDROID: init_task: Init android vendor and oem data
  UPSTREAM: sched/core: Mitigate race cpus_share_cache()/update_top_cache_domain()
  ANDROID: Update symbol list for mtk
  UPSTREAM: erofs: fix unsafe pagevec reuse of hooked pclusters
  UPSTREAM: erofs: remove the occupied parameter from z_erofs_pagevec_enqueue()
  UPSTREAM: usb: dwc3: gadget: Fix null pointer exception
  ANDROID: fips140: support "evaluation testing" builds via build.sh
  FROMGIT: sched/scs: Reset task stack state in bringup_cpu()
  ANDROID: dma-buf: heaps: fix dma-buf heap pool pages stat
  ANDROID: ABI: Add several spi_mem related symbols
  UPSTREAM: spi: spi-mem: add spi_mem_dtr_supports_op()
  ANDROID: gki_defconfig: enable CONFIG_SPI_MEM
  ANDROID: ABI: Add several iio related symbols
  ANDROID: ABI: Update symbol list for IMX
  ...

Change-Id: I09cddc92fa34553b944e62cc5cbbba94a84e5437

Conflicts:
	arch/arm/boot/dts/rk322x.dtsi
	arch/arm64/boot/dts/rockchip/rk3399.dtsi
	drivers/dma-buf/heaps/system_heap.c
	drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
	drivers/gpu/drm/rockchip/rockchip_drm_vop.c
	drivers/gpu/drm/rockchip/rockchip_lvds.c
	drivers/gpu/drm/rockchip/rockchip_vop_reg.c
	drivers/mtd/nand/spi/core.c
	drivers/pci/controller/pcie-rockchip-host.c
	drivers/soc/rockchip/Kconfig
	drivers/usb/dwc3/core.c
	drivers/usb/dwc3/core.h
2021-12-14 17:09:02 +08:00
XiaoTan Luo
f08221c208 ASoC: rockchip: multicodecs: add headset key button detect
Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
Change-Id: I320546bbb0c9c47695e9614aba4e222ce305299e
2021-12-13 15:51:45 +08:00
XiaoTan Luo
191b628750 ASoC: es8323: remove HP/Headset detect and HP/SPK controls
and to do these in machine driver

Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
Change-Id: Ic95b7329700d65164651b519c9f9bfac81f3e800
2021-12-09 15:20:38 +08:00
Xing Zheng
32f68af611 ASoC: rk3308_codec: Decoupling and dependence on the JACK of rk3308 codec
Don't need to direct callback via rk3308 jack detect, since
the sound component supports to set jack.

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Change-Id: Ibdf86d06f69bd0a8885de753f632236b43b5800c
2021-12-08 10:49:30 +08:00
XiaoTan Luo
1273641575 ASoC: rockchip: multicodecs: add gpio/adc jack for detecting headphone && headset mic
Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
Change-Id: Ide67943515ecafd348fa224132699caa5bd170ea
2021-12-08 09:58:25 +08:00
Xing Zheng
91c28f12e7 ASoC: es8326: add support es8326 codec driver
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Change-Id: I5e7f02b18f377c270ce6f3e1fc3a527624663a00
2021-12-07 19:07:56 +08:00
XiaoTan Luo
4ef5723d99 ASoC: es8323: fixed dapm route error
Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
Change-Id: Idde66be4fc3a32a5d1c496795d5cbf3a49464ea6
2021-11-26 20:47:44 +08:00
Sugar Zhang
0e48a7ef3c ASoC: hdmi-codec: Fix mismatch channel status array
Fixes:
[smatch] sound/soc/codecs/hdmi-codec.c:504 hdmi_codec_hw_params()
error: memcpy() 'hcp->iec_status' too small (5 vs 24)

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I6dfa154c95159fa7563faf52a6fdbd87e0f398a9
2021-11-25 14:21:23 +08:00
Sugar Zhang
4142064c7f ASoC: rockchip: i2s: Add support for IEC958
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I58243b194cd15b7d57e9b580d6917c2e054a1e67
2021-11-25 14:20:56 +08:00
Jiapeng Chong
4f24b11139 UPSTREAM: ASoC: hdmi-codec: make hdmi_codec_controls static
This symbol is not used outside of hdmi-codec.c, so marks it static.

Fix the following sparse warning:

sound/soc/codecs/hdmi-codec.c:750:25: warning: symbol
'hdmi_codec_controls' was not declared. Should it be static?

Change-Id: I6569284ef557fee683afb9031e5cc1b5684a1c30
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/1623822941-3077-1-git-send-email-jiapeng.chong@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
(cherry picked from commit e99d7c69fd)
2021-11-24 11:08:47 +08:00
Maxime Ripard
84f06abd7c UPSTREAM: ASoC: hdmi-codec: Add a prepare hook
The IEC958 status bit is usually set by the userspace after hw_params
has been called, so in order to use whatever is set by the userspace, we
need to implement the prepare hook. Let's add it to the hdmi_codec_ops,
and mandate that either prepare or hw_params is implemented.

Change-Id: I06ccde5d8185955bb60783b597f0205811460968
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210525132354.297468-6-maxime@cerno.tech
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
(cherry picked from commit 2fef64eec2)
2021-11-24 11:08:24 +08:00
Maxime Ripard
973d962119 UPSTREAM: ASoC: hdmi-codec: Add iec958 controls
The IEC958 status bits can be exposed and modified by the userspace
through dedicated ALSA controls.

This patch implements those controls for the hdmi-codec driver. It
relies on a default value being setup at probe time that can later be
overridden by the control put.

The hw_params callback is then called with a buffer filled with the
proper bits for the current parameters being passed on so the underlying
driver can just reuse those bits as is.

Change-Id: I99f37b7e74655687e73a75ba19fd2de8041f8646
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210525132354.297468-5-maxime@cerno.tech
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
(cherry picked from commit 7a8e1d4421)
2021-11-24 11:08:24 +08:00
Maxime Ripard
e2a4fcdc4f UPSTREAM: ASoC: hdmi-codec: Rework to support more controls
We're going to add more controls to support the IEC958 output, so let's
rework the control registration a bit to support more of them.

Change-Id: Ia8c0bf8c997638b5a121ae7356fa1eb27746036f
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210525132354.297468-4-maxime@cerno.tech
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
(cherry picked from commit 366b45b974)
2021-11-24 11:08:24 +08:00
Maxime Ripard
57e2bdf0f3 UPSTREAM: ALSA: iec958: Split status creation and fill
In some situations, like a codec probe, we need to provide an IEC status
default but don't have access to the sampling rate and width yet since
no stream has been configured yet.

Each and every driver has its own default, whereas the core iec958 code
also has some buried in the snd_pcm_create_iec958_consumer functions.

Let's split these functions in two to provide a default that doesn't
rely on the sampling rate and width, and another function to fill them
when available.

Change-Id: I277899145367b219b337bc796f2faee8c4917082
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210525132354.297468-3-maxime@cerno.tech
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
(cherry picked from commit 9eafc11f92)
2021-11-24 11:08:24 +08:00
Pierre-Louis Bossart
c1499e956d UPSTREAM: ASoC: hdmi-codec: remove unused spk_mask member
fix cppcheck warning:

sound/soc/codecs/hdmi-codec.c:25:16: style: struct member
'hdmi_codec_channel_map_table::spk_mask' is never
used. [unusedStructMember]
 unsigned long spk_mask;  /* speaker position bit mask */
               ^

Change-Id: I235b7757db88bfbd059ad0f9795908fbfbb1cfdb
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
(cherry picked from commit 9ad869fee5)
2021-11-24 11:08:24 +08:00
Pierre-Louis Bossart
7a38a05259 UPSTREAM: ASoC: hdmi-codec: remove useless initialization
Fix cppcheck warning:

sound/soc/codecs/hdmi-codec.c:745:5: style: Redundant initialization
for 'cf'. The initialized value is overwritten before it is
read. [redundantInitialization]
 cf = dai->playback_dma_data;
    ^
sound/soc/codecs/hdmi-codec.c:738:31: note: cf is initialized
 struct hdmi_codec_daifmt *cf = dai->playback_dma_data;
                              ^
sound/soc/codecs/hdmi-codec.c:745:5: note: cf is overwritten
 cf = dai->playback_dma_data;
    ^

Change-Id: Ia903635862e043207929827afcaeb531e6344283
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
(cherry picked from commit 3c011ef344)
2021-11-24 11:08:24 +08:00
Sia Jee Heng
a916d4e8d3 UPSTREAM: ASoC: codec: hdmi-codec: Support IEC958 encoded PCM format
Existing hdmi-codec driver only support standard pcm format.
Support of IEC958 encoded format pass from ALSA IEC958 plugin is needed
so that the IEC958 encoded data can be streamed to the HDMI chip.

Change-Id: I01516e34605e380995b5312273035a0d000d36f1
Signed-off-by: Sia Jee Heng <jee.heng.sia@intel.com>
Link: https://lore.kernel.org/r/20210204014258.10197-2-jee.heng.sia@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
(cherry picked from commit 28785f548d)
2021-11-24 11:08:24 +08:00
Stephan Gerhold
71e6844b4a UPSTREAM: ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack()
Sound is broken on the DragonBoard 410c (apq8016_sbc) since 5.10:

  hdmi-audio-codec hdmi-audio-codec.1.auto: ASoC: error at snd_soc_component_set_jack on hdmi-audio-codec.1.auto: -95
  qcom-apq8016-sbc 7702000.sound: Failed to set jack: -95
  ADV7533: ASoC: error at snd_soc_link_init on ADV7533: -95
  hdmi-audio-codec hdmi-audio-codec.1.auto: ASoC: error at snd_soc_component_set_jack on hdmi-audio-codec.1.auto: -95
  qcom-apq8016-sbc: probe of 7702000.sound failed with error -95

This happens because apq8016_sbc calls snd_soc_component_set_jack() on
all codec DAIs and attempts to ignore failures with return code -ENOTSUPP.
-ENOTSUPP is also excluded from error logging in soc_component_ret().

However, hdmi_codec_set_jack() returns -E*OP*NOTSUPP if jack detection
is not supported, which is not handled in apq8016_sbc and soc_component_ret().
Make it return -ENOTSUPP instead to fix sound and silence the errors.

Cc: Cheng-Yi Chiang <cychiang@chromium.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Fixes: 55c5cc63ab ("ASoC: hdmi-codec: Use set_jack ops to set jack")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20210107165131.2535-1-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 2a0435df96)

Change-Id: Id38ce1cdfc80daaac7d77212cecd29dd6fa4e877
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-11-24 11:08:24 +08:00
Shengjiu Wang
57f647c6cb UPSTREAM: ASoC: hdmi-codec: Add RX support
HDMI interface can also be used as receiver, this patch is to
add such support. The most difference compare with TX is that RX
don't need to get edid information.

Change-Id: Ib5f9f347cd50abe95fa9c8a4856bd1a91117ca67
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1606372608-2329-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
(cherry picked from commit 144f836646)
2021-11-24 11:08:24 +08:00
Cheng-Yi Chiang
cf648c7c0f UPSTREAM: ASoC: hdmi-codec: Get ELD in before reporting plugged event
In plugged callback, ELD should be updated from display driver so that
user space can query information from ELD immediately after receiving jack
plugged event.

When jack is unplugged, clear ELD buffer so that user space does not get
obsolete information of unplugged HDMI.

Change-Id: I2245de6e6f7dbc64863267db864dafdd3af95747
Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Link: https://lore.kernel.org/r/20201118043852.1338877-1-cychiang@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
(cherry picked from commit 25ce4f2b35)
2021-11-24 11:08:24 +08:00
Shunhua Lan
267e9b4290 ASoC: es7202: add supply voltage recognizing and set channels_max to 8
Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
Change-Id: Icda031758b217c1b7c3524d6fe9ffd6a542f8bcf
2021-11-23 15:15:08 +08:00
XiaoTan Luo
e03ac60bd0 ASoC: rockchip: add machine driver for hdmi audio
this patch is used for rockchip HDMI audio output.

Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
Change-Id: I577179e7563ad241014d023da12af1e622e84c9a
2021-11-23 10:43:12 +08:00
Shunhua Lan
ec1a0d929d ASoC: es8323: enable route config
Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
Change-Id: Ia18a01afbd72195871d847ee3a17e7a7f9dca1c2
2021-11-17 11:16:54 +08:00
Sugar Zhang
53a3ef7353 ASoC: rockchip: Add support for multicodecs machine driver
This patch adds support for sound which link multiple codecs
to the same cpu dai.

Change-Id: I77d3e9c10d03c2b8809c6d82b5268dba279ee6f0
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-11-14 14:27:56 +08:00
Sugar Zhang
513946019c ASoC: rockchip: Add support for Voice Activity Detection
- Drop duplicated PCM_RUNTIME_CHECK
- Replace rtd->x to macro asoc_rtd_to_x

Change-Id: I6ae63b4d36f2f9b24f0fdf352fdc385ec425b330
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-11-14 14:24:43 +08:00
Sugar Zhang
e811780873 ASoC: rockchip: vad: Add support for rk3588 SoC
This patch adds support for rk3588 SoC.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Ic5488967f7147c84700849d2d38e419ab707327a
2021-11-14 14:16:15 +08:00
Sugar Zhang
800034979c ASoC: rk_codec_digital: Make clk_adc optional
It's optional on RK3588 platform which support dsm only.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I3cbe3a3bb7789eab2a279403d359a58f1fd85c7b
2021-11-12 21:50:07 +08:00
Sugar Zhang
07be6306d9 ASoC: es7202: provide configuration for i2c_bus_num/mic_max_channels
Configuration is flexible than hard code, and minimal changes.

Change-Id: I15835fcbf198252410feb3feb6080ca047388ce1
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-11-12 21:00:39 +08:00
Sugar Zhang
9277538e2b ASoC: rockchip: pdm: Fix signoff for rk3588 pdm
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I75efb9ea38d2a5fe86c3797896d44fb0dd179f2c
2021-11-12 20:59:51 +08:00
Shunhua Lan
1ab474fdf8 ASoC: es8323: 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.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
Link: https://lore.kernel.org/r/20190903165322.20791-2-katsuhiro@katsuster.ne

Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
Change-Id: If0a478f0cb46fa502cdf0d4e017ac2f36166055a
2021-11-12 16:20:52 +08:00
Sugar Zhang
1e94be3e6e ASoC: es8323: Fix NULL pointer dereference when shutdown
Component is null when sound card link failed. So, switch to use regmap
directly in shutdown path.

Unable to handle kernel NULL pointer dereference at virtual address 0000000000000090
Mem abort info:
  ESR = 0x96000005
  EC = 0x25: DABT (current EL), IL = 32 bits
  SET = 0, FnV = 0
  EA = 0, S1PTW = 0
Data abort info:
  ISV = 0, ISS = 0x00000005
  CM = 0, WnR = 0
user pgtable: 4k pages, 39-bit VAs, pgdp=0000000005ff2000
[0000000000000090] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000
Internal error: Oops: 96000005 [#1] PREEMPT SMP
Modules linked in:
CPU: 2 PID: 1 Comm: init Not tainted 5.10.43 #110
Hardware name: Rockchip RK3588 EVB1 LP4 V10 Board (DT)
pstate: 20400009 (nzCv daif +PAN -UAO -TCO BTYPE=--)
pc : mutex_lock+0x2c/0x64
lr : snd_soc_component_write+0x30/0xd0
sp : ffffffc011e2bc10
x29: ffffffc011e2bc10 x28: ffffff8002200000
x27: 0000000000000000 x26: ffffffc011cf1000
x25: ffffffc011dac000 x24: ffffff80046128c0
x23: ffffff8004612828 x22: 0000000000000001
x21: 0000000000000058 x20: 0000000000000000
x19: 0000000000000090 x18: ffffffc011e25058
x17: 000000000000000a x16: 0000000000000001
x15: 0000000000000000 x14: 0000000000000400
x13: 000000000000276a x12: 0000000029aaaaf0
x11: 0000000001000c2b x10: 0000000007ae1850
x9 : 0000000000000000 x8 : 0000000000000090
x7 : 0000000000000000 x6 : 0000000000000000
x5 : ffffffc011e2bb40 x4 : 0000000000000000
x3 : 0000000000000000 x2 : ffffff8002200000
x1 : 0000000000000000 x0 : 0000000000000090
Call trace:
 mutex_lock+0x2c/0x64
 snd_soc_component_write+0x30/0xd0
 es8323_i2c_shutdown+0x13c/0x1f0
 i2c_device_shutdown+0x44/0x54
 device_shutdown+0x174/0x214
 kernel_restart+0x44/0x110
 __arm64_sys_reboot+0x148/0x21c
 el0_svc_common+0xa4/0x180
 do_el0_svc+0x28/0x88
 el0_svc+0x14/0x24
 el0_sync_handler+0x88/0xec
 el0_sync+0x1a8/0x1c0

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I978764678bd36321d0e3f8ac8e487c328eb7a720
2021-11-12 11:34:31 +08:00
Sugar Zhang
b161f411c3 ASoC: rockchip: i2s-tdm: Make property 'grf' optional
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: If50451ec8e4e7b872e4101551bc4c5063ac4e3b8
2021-11-12 09:35:16 +08:00
Sugar Zhang
a7143c71a5 ASoC: es8323: Fix headphone irq err
It's optional, so, do nothing when this gpio-irq omitted.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: If82c6ef3610aa47e1be3266b485305514bb1717d
2021-11-11 21:44:18 +08:00
Shunhua Lan
86d67c794f ASoC: codecs: es8323: add hp-con-gpio control and extcon notifier for headset detect
Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
Change-Id: I1d0314ce8185df38ff138f2f2d0d3b0f0fae3707
2021-11-11 14:20:11 +08:00
Sugar Zhang
aafa66673b ASoC: rockchip: i2s: Fix unbalanced hclk handle in error paths
Fix warning:

rockchip_i2s_probe() warn: 'i2s->hclk' not released on lines: 719,724,731.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Ic3aeb86a2880aae0d004030b802aec187b74b6c6
2021-11-03 18:56:04 +08:00
Sugar Zhang
c804bc7cf4 ASoC: rockchip: i2s-tdm: Add support for rk3588 SoC
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Ib613813d75660c8771ed4dc248f8c9837a2a9d53
2021-11-02 18:03:40 +08:00
Sugar Zhang
0e5036c7b4 ASoC: rockchip: Add support for spdif receiver
The SPDIF receiver is a self-clocking, serial, unidirectional
interface for the interconnection of digital audio equipment
for consumer and professional applications.

Change-Id: Ic73337671b37c8c45352e523a875281edd552d1b
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-11-02 15:24:42 +08:00