History log of /linux-master/sound/soc/amd/acp-da7219-max98357a.c
Revision Date Author Comments
# d4f23dcd 11-Sep-2023 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: amd: convert not to use asoc_xxx()

ASoC is now unified asoc_xxx() into snd_soc_xxx().
This patch convert asoc_xxx() to snd_soc_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878r9cs25b.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 5532a1cf 02-Aug-2023 Alper Nebi Yasak <alpernebiyasak@gmail.com>

ASoC: amd: acp-da7219-max98357a: Map missing jack kcontrols

This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. The DA7219 codec used
here can detect Headphones, Headset Mic and Line Out connections. Expose
each to userspace as kcontrols and add the necessary widgets.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-2-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 4a6aeaeb 08-Jun-2023 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: amd: use use new trigger ordering method

ASoC is now supporting generic trigger ordering method.
This patch switch to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pm66fnzi.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# ba54da32 31-Oct-2022 Cezary Rojewski <cezary.rojewski@intel.com>

ASoC: amd: Drop da7219_aad_jack_det() usage

Do not access the internal function directly, do so through
component->set_jack() instead.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221031160227.2352630-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 19aed2d6 07-Apr-2022 Akihiko Odaki <akihiko.odaki@gmail.com>

ASoC: soc-card: Create jack kcontrol without pins

snd_soc_card_jack_new() allowed to create jack kcontrol without pins,
but did not create kcontrols. The jack would not have kcontrols if pins
were not going to be added.

This renames the old snd_soc_card_jack_new() to
snd_soc_card_jack_new_pins() for use when pins are provided or will be
added later. The new snd_soc_card_jack_new() appropriately creates a
jack for use without pins and adds a kcontrol.

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Link: https://lore.kernel.org/r/20220408041114.6024-1-akihiko.odaki@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 62df2239 15-Sep-2021 Mark Brown <broonie@kernel.org>

ASoC: amd: Convert to new style DAI format definitions

Convert the AMD machine drivers to use the new style defines for clocking
in DAI formats.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210915180957.39996-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 19843302 07-Sep-2021 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ASoC: amd: acp: declare and add prefix to 'bt_uart_enable' symbol

Sparse reports the following warning:

sound/soc/amd/acp-pcm-dma.c:39:6: error: symbol 'bt_uart_enable' was
not declared. Should it be static?

It's not very good practice to export such symbols that can easily
conflict, add the acp_ prefix and add declaration in header file.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210907184216.33067-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 71869335 22-Jul-2021 Mario Limonciello <mario.limonciello@amd.com>

ASoC: amd: Use dev_probe_err helper

Replace the pattern of check for err to match -EPROBE_DEFER and only
output errors to use the dev_err_probe helper instead.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20210722132731.13264-2-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 5434d0dc 22-Jul-2021 Vijendar Mukunda <Vijendar.Mukunda@amd.com>

ASoC: amd: enable stop_dma_first flag for cz_dai_7219_98357 dai link

DMA driver stop sequence should be invoked first before invoking I2S
controller driver stop sequence for Stoneyridge platform.

Enable stop_dma_first flag for cz_dai_7219_98357 dai link structure.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210722130328.23796-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 7883490c 16-Jul-2021 Vijendar Mukunda <vijendar.mukunda@amd.com>

ASoC: amd: reverse stop sequence for stoneyridge platform

For Stoneyridge platform, it is required to invoke DMA driver stop
first rather than invoking DWC I2S controller stop.

Enable dai_link structure stop_dma_fist flag to reverse the stop
sequence.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210716123015.15697-2-vijendar.mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 23f23db2 26-Mar-2021 Vijendar Mukunda <Vijendar.Mukunda@amd.com>

ASoC: amd: update spdx license for acp machine driver

update SPDX license for acp machine driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/1616777074-5151-1-git-send-email-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 7e71b48f 18-Mar-2021 Vijendar Mukunda <Vijendar.Mukunda@amd.com>

ASoC: amd: Add support for RT5682 codec in machine driver

Add support for RT5682 codec in machine driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/1616118056-5506-1-git-send-email-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 95d3befb 03-Dec-2020 Chuhong Yuan <hslester96@gmail.com>

ASoC: amd: change clk_get() to devm_clk_get() and add missed checks

cz_da7219_init() does not check the return values of clk_get(),
while da7219_clk_enable() calls clk_set_rate() to dereference
the pointers.
Add checks to fix the problems.
Also, change clk_get() to devm_clk_get() to avoid data leak after
failures.

Fixes: bb24a31ed584 ("ASoC: AMD: Configure wclk and bclk of master codec")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Link: https://lore.kernel.org/r/20201204063610.513556-1-hslester96@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# ded00543 19-Jul-2020 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: amd: use asoc_substream_to_rtd()

Now we can use asoc_substream_to_rtd() macro,
let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ft9n0ytv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# dc1aff7f 02-Jul-2020 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ASoC: amd: acp-da7219-max98357a: fix 'defined but not used' warning

Fix W=1 warning

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200702164433.162815-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# b09b22fc 22-Mar-2020 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: amd: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/874kufk5uu.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 756ae8f2 26-Nov-2019 Yu-Hsuan Hsu <yuhsuan@chromium.org>

ASoC: AMD: Enable clk in startup intead of hw_params

Some usages only call startup and shutdown without setting hw_params
(e.g. arecord --dump-hw-params). If we don't enable clk in startup, it
will cause ref count error because the clk will be disabled in shutdown.
For this reason, we should move enabling clk from hw_params to startup.

In addition, the hw_params is fixed in this driver(48000 rate, 2
channels, S16_LE format) so we don't need to change the clk rate after
the hw_params is set.

Signed-off-by: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Acked-by: Akshu Agrawal <akshu.agarawal@amd.com>
Link: https://lore.kernel.org/r/20191126075424.80668-1-yuhsuan@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 48696d0a 05-Jun-2019 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: amd: acp-da7219-max98357a: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# bb24a31e 17-Apr-2019 Agrawal, Akshu <Akshu.Agrawal@amd.com>

ASoC: AMD: Configure wclk and bclk of master codec

With CCF support in da7219, we can now set the correct rate of
wclk and bclk.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# eddb6084 21-Mar-2019 Andi Kleen <ak@linux.intel.com>

ASoC: AMD: Fix incorrect extern

When using bare externs outside include files that types should
at least match. This fixes a type confusion between bool
and int.

Cc: broonie@kernel.org
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 88314902 19-Mar-2019 Adam Thomson <Adam.Thomson.Opensource@diasemi.com>

ASoC: AMD: Update DA7219 DAI clock name to align with codec updates

As the DAI clocks for DA7219 have now been split into BCLK and WCLK,
the clock lookup name needs to be udpated here to select BCLK to
achieve the same functionality as before with regards to DAI clock
gating.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# de363648 27-Oct-2018 Julia Lawall <Julia.Lawall@lip6.fr>

ASoC: AMD: constify regulator_desc structure

The regulator_desc structure can be const as it is only passed as the
second argument of devm_regulator_register and the corresponding
parameter is declared as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 2657c6a9 14-Oct-2018 Akshu Agrawal <akshu.agrawal@amd.com>

ASoC: AMD: Add SND_JACK_LINEOUT jack type

Some 3 pole connectors report impedance greater than threshold of
1000Ohm. Thus, da7219 reports them as LINEOUT.
Adding the SND_JACK_LINEOUT type so that we don't fail to detect
any 3 pole jack type.
Also, changing
SND_JACK_HEADPHONE | SND_JACK_MICROPHONE -> SND_JACK_HEADSET

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 8dcb0c90 10-Sep-2018 Akshu Agrawal <akshu.agrawal@amd.com>

ASoC: AMD: Fix simultaneous playback and capture on different channel

If capture and playback are started on different channel (I2S/BT)
there is a possibilty that channel information passed from machine driver
is overwritten before the configuration is done in dma driver.
Example:
113.597588: cz_max_startup: ---playback sets BT channel
113.597694: cz_dmic1_startup: ---capture sets I2S channel
113.597979: acp_dma_hw_params: ---configures capture for I2S channel
113.598114: acp_dma_hw_params: ---configures playback for I2S channel

This is fixed by having 2 separate instance for playback and capture.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# a1b1e988 20-Aug-2018 Akshu Agrawal <akshu.agrawal@amd.com>

ASoC: AMD: Change MCLK to 48Mhz

25Mhz MCLK which was earlier used was of spread type.
Thus, we were not getting accurate rate. The 48Mhz system
clk is of non-spread type and we are changing to it to get
accurate rate.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# c736cbd3 20-Aug-2018 Akshu Agrawal <akshu.agrawal@amd.com>

ASoC: AMD: Set constraints for DMIC and MAX98357a codec

We support dual channel, 48Khz. This constraint was set only for
da7219. It is being extended to DMIC and MAX98357a.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 76996760 26-Jul-2018 Akshu Agrawal <akshu.agrawal@amd.com>

ASoC: AMD: Fix build warning

Fixes
sound/soc/amd/acp-da7219-max98357a.c: In function 'cz_probe':
sound/soc/amd/acp-da7219-max98357a.c:367:3: warning: 'ret' may
be used uninitialized in this function [-Wmaybe-uninitialized]
dev_err(&pdev->dev, "Failed to register regulator: %d\n",
ret);

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# c183fec1 25-Jul-2018 Akshu Agrawal <akshu.agrawal@amd.com>

ASoC: AMD: Add a fix voltage regulator for DA7219 and ADAU7002

DA7219 for our platform need to be configured for 1.8V.
Hence, we add a volatge regulator with supplies
of 1.8V in the machine driver.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 2718c89a 20-Jun-2018 Akshu Agrawal <akshu.agrawal@amd.com>

ASoC: AMD: Configure channel 1 or channel 0 for capture

ST/CZ SoC have 2 channels for capture in the I2SSP path.
The DMA though these channels is done using the same dma
descriptors.
We configure the channel and enable it on the basis of
channel selected by machine driver. Machine driver knows
which codec sits on which channel and thus sends the information
to dma driver.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 3bec6fa3 20-Jun-2018 Agrawal, Akshu <Akshu.Agrawal@amd.com>

ASoC: AMD: Change codec to channel link as per hardware redesign

This is a correction to match acutal hardware configuration.
The hardware configuration looks like:
I2S_BT -> SPK(Max) + DMIC(Adau)
I2S_SP -> DA7219 Headset

No actual products have been shipped with previous configuration.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# ccfbb4f5 07-May-2018 Mukunda, Vijendar <Vijendar.Mukunda@amd.com>

ASoC: amd: dma driver changes for bt i2s instance

With in ACP, There are three I2S controllers can be
configured/enabled ( I2S SP, I2S MICSP, I2S BT).
Default enabled I2S controller instance is I2S SP.
This patch provides required changes to support I2S BT
controller Instance.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 839a12c7 07-May-2018 Akshu Agrawal <akshu.agrawal@amd.com>

ASoC: AMD: Add const to snd_soc_ops instances

Marking snd_soc_ops instances const

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 6e554074 07-May-2018 Akshu Agrawal <akshu.agrawal@amd.com>

ASoC: AMD: Fix clocks in CZ DA7219 machine driver

System clock on the platform is 25Mhz and not 24Mhz.

PLL_OUT for da7219 codec to use DA7219_PLL_FREQ_OUT_98304
as it is for 48KHz SR.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# e9716ff3 07-May-2018 Akshu Agrawal <akshu.agrawal@amd.com>

ASoC: AMD: Move clk enable from hw_params/free to startup/shutdown

hw_param can be called multiple times and thus we can have
more clk enable. The clk may not get diabled due to refcounting.
startup/shutdown ensures single clk enable/disable call.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# dc29f581 28-Mar-2018 Wei Yongjun <weiyongjun1@huawei.com>

ASoC: amd: acp-da7219-max98357: Make symbol da7219_dai_clk static

Fixes the following sparse warning:

sound/soc/amd/acp-da7219-max98357a.c:46:12: warning:
symbol 'da7219_dai_clk' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# ede1d353 28-Mar-2018 Wei Yongjun <weiyongjun1@huawei.com>

ASoC: amd: acp-da7219-max98357: Make symbol da7219_dai_clk static

Fixes the following sparse warning:

sound/soc/amd/acp-da7219-max98357a.c:46:12: warning:
symbol 'da7219_dai_clk' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 923859e3 12-Apr-2018 Agrawal, Akshu <Akshu.Agrawal@amd.com>

ASoC: AMD: Support headset button on Stoney DA7219

Adds headset button support.

TEST=Tested Volume UP/Down, Play/Pause functionality

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 4c50e1e3 27-Mar-2018 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: amd: don't use codec anymore

commit c88d31153356 ("ASoC: amd: Enable da7219 master clock using common
clock framework") is using rtd->codec, but codec is replaced to component.
Let's use component

Fixes: c88d31153356 ("ASoC: amd: Enable da7219 master clock using common clock framework")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# c88d3115 18-Mar-2018 Akshu Agrawal <akshu.agrawal@amd.com>

ASoC: amd: Enable da7219 master clock using common clock framework

DA7219 is clock master for other codecs. DA7219 has exposed clock
control by using common clock framework and same is used to enable
and disable clock for all codecs in the system.

TEST=aplay -D hw:0,0 -vv <file>
arecord -D hw:0,0 -f dat -d 5 -vv <file>
aplay -D hw:0,1 -vv <file>

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# f155181d 18-Mar-2018 Akshu Agrawal <akshu.agrawal@amd.com>

ASoC: amd: Use single dai for da7219 playback and capture

BT I2S is a bi-directional dai, we will use the same
cpu dai for playback and capture.

TEST=aplay -D hw:0,0 -vv <file>
arecord -D hw:0,0 -f dat -d 5 -vv <file>

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 9a60cde2 18-Feb-2018 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: amd: acp-da7219-max98357: replace codec to component

Now we can replace Codec to Component. Let's do it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 608a300f 16-Feb-2018 Akshu Agrawal <akshu.agrawal@amd.com>

ASoC: AMD: Add machine driver for ST DA7219 MAX98357

The driver is used for AMD board using DA7219 and MAX98357 codec.

TEST=Build, apply grunt_mixer_settings:
iotools mmio_write32 0xfed80e40 0x040c40c0
iotools mmio_write32 0xfed80e28 0x10000
iotools mmio_write8 0xfed816de 0xc0
aplay -D plughw:0,0 ./sample_48000.wav -vv
aplay -D plughw:0,0 ./sample_44100.wav -vv

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>