commit 28086d05ada6d03daa886aad0e469854b811311c
Author: Charles Keepax <ckeepax@opensource.cirrus.com>
Date: Thu May 19 16:43:18 2022 +0100
ASoC: simple-card-utils: Move snd_soc_component_is_codec to be local
The helper function snd_soc_component_is_codec is based off the
presence of the non_legacy_dai_naming flag. This isn't super robust
as CPU side components may also specify this flag, and indeed the
kernel already contains a couple that do. After componentisation there
isn't really a totally robust solution to identifying what is a CODEC
driver, without introducing a flag specifically for that purpose, and
really the desirable direction to move in is that the distinction
doesn't matter.
This patch does two things to try to mitigate these problems. Firstly,
now that all the other users of the helper function have been removed,
it makes the helper function local to the driver rather, than being
part of the core. This should help to discourage any new code from
being created that depends on the CODEC driver distinction. Secondly,
it updates the helper function itself to use the endianness flag
rather than the non_legacy_dai_naming flag. The endianness flag is
definitely invalid on a CPU side component, so it a more reliable
indicator that the device is definitely a CODEC. The vast majority of
buses require the CODEC to set the endianness flag, so the number of
corner cases should be fairly minimal. It is worth noting that CODECs
sending audio over SPI, or built into the CPU CODECs are potential
corner cases, however the hope is that in most cases those types of
devices do not consitute a simple audio card.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220519154318.2153729-57-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
commit e6f08af6340eaf88e9eeff71bd4533eee9a04119
Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Sun Jun 5 17:35:37 2022 +0200
ASoC: simple-card-utils: Make asoc_simple_clean_reference() return void
asoc_simple_clean_reference() returns zero unconditionally. Letting it
return void instead makes it easier to see in the caller that there is no
error to handle.
This is a preparation for making platform remove callbacks return void.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220605153537.26591-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
commit c826ec0391c83f06354a4ebb25c7b2480c18f33a
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Mon Apr 12 08:52:45 2021 +0900
ASoC: simple-card-utils: multi support at asoc_simple_canonicalize_cpu/platform()
Current asoc_simple_canonicalize_cpu/platform() is assuming single CPU,
single Platform, but we want to support Multi support.
This patch is prepare for it.
The idea is the same as the previous attempt: calls ac101_trigger() just
before set_clock(1).
https://github.com/respeaker/seeed-voicecard/issues/290
6mics / linear 4 mics: fails to record against v5.10 kernel
https://github.com/raspberrypi/linux/issues/4279
[regression] alsa system call blocks on record between 5.4.83 and 5.5.19
In v5.5,
commit 4378f1fbe924054a09ff0d4e39e1a581b9245252
Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
Date: Fri Sep 27 10:16:46 2019 +0300
ASoC: soc-pcm: Use different sequence for start/stop trigger
On stream stop currently we stop the DMA first followed by the CPU DAI.
This can cause underflow (playback) or overflow (capture) on the DAI side
as the DMA is no longer feeding data while the DAI is still active.
It can be observed easily if the DAI side does not have FIFO (or it is
disabled) to survive the time while the DMA is stopped, but still can
happen on relatively slow CPUs when relatively high sampling rate is used:
the FIFO is drained between the time the DMA is stopped and the DAI is
stopped.
It can only fixed by using different sequence within trigger for 'stop' and
'start':
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
Trigger order: dai_link, DMA, CPU DAI then the codec
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
Trigger order: codec, CPU DAI, DMA then dai_link
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190927071646.22319-1-peter.ujfalusi@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Need to revisit, and do in a different way.
https://github.com/respeaker/seeed-voicecard/issues/290
6mics / linear 4 mics: fails to record against v5.10 kernel
https://github.com/raspberrypi/linux/issues/4279
[regression] alsa system call blocks on record between 5.4.83 and 5.5.19
In v5.5,
commit 4378f1fbe924054a09ff0d4e39e1a581b9245252
Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
Date: Fri Sep 27 10:16:46 2019 +0300
ASoC: soc-pcm: Use different sequence for start/stop trigger
On stream stop currently we stop the DMA first followed by the CPU DAI.
This can cause underflow (playback) or overflow (capture) on the DAI side
as the DMA is no longer feeding data while the DAI is still active.
It can be observed easily if the DAI side does not have FIFO (or it is
disabled) to survive the time while the DMA is stopped, but still can
happen on relatively slow CPUs when relatively high sampling rate is used:
the FIFO is drained between the time the DMA is stopped and the DAI is
stopped.
It can only fixed by using different sequence within trigger for 'stop' and
'start':
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
Trigger order: dai_link, DMA, CPU DAI then the codec
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
Trigger order: codec, CPU DAI, DMA then dai_link
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190927071646.22319-1-peter.ujfalusi@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
commit fe7ed4dec2e6289eab81dd18c0d613c0851d85a1
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Mon Jan 21 16:40:59 2019 +0900
ASoC: simple-card: rename to asoc_simple_card_canonicalize_platform()
Current simple-card is using asoc_simple_card_canonicalize_dailink().
Its naming is "dailink", but is for "platform".
We already have asoc_simple_card_canonicalize_cpu() for "cpu",
let's follow same naming rule.
It never return error, so, void function is better idea.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
commit 95cfc0a0aaf575207152dd7601e782702565a6f1
Author: Samuel Holland <samuel@sholland.org>
Date: Wed Mar 4 23:11:43 2020 -0600
ASoC: simple-card: Add support for codec2codec DAI links
Following the example in cb2cf0de1174 ("ASoC: soc-core: care Codec <->
Codec case by non_legacy_dai_naming"), determine if a DAI link contains
only codec DAIs by examining the non_legacy_dai_naming flag in each
DAI's component.
For now, we assume there is only one or a small set of valid PCM stream
parameters, so num_params == 1 is good enough. We also assume that the
same params are valid for all supported streams. params is set to the
subset of parameters common among all DAIs, and then the existing code
automatically chooses the highest quality of the remaining values when
the link is brought up.
commit 0580dde59438686d60762b6da9229ebec693b94f
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed Mar 20 13:54:42 2019 +0900
ASoC: simple-card-utils: add asoc_simple_debug_info()
Current simple-card-utils has dev_dbg(), but people want to
add #define DEBUG at simple-card/audio-graph, not simple-card-utils.
And, people want to get all information.
This patch adds new asoc_simple_debug_info() to indicates information.
See, for example,
commit b78b30e32a19f1ac79c26e0a3e9f7bc7385a02a2
Author: j-schambacher <joerg@i2audio.com>
Date: Tue May 19 13:56:17 2020 +0200
Switch to snd_soc_dai_set_bclk_ratio
Replaces obsolete function snd_soc_dai_set_tdm_slot
The "sysclk = 24000000" value is supposed to come from the "clock-frequency"
field of ac108_mclk / ac10x_mclk, but somehow it isn't on 5.4 (vs 4.19). This
is a temporary work-around. For some strange unknown reasons, this affects
only the square 4-mic device, but not the linear 4-mic nor the 6-mics device.
The other two devices have two ac108's, and seem to work fine without it.
In v4.19:
seeed_voice_card_probe [snd_soc_seeed_voicecard]
-> devm_snd_soc_register_card [snd_soc_core]
-> snd_soc_register_card [snd_soc_core]
-> seeed_voice_card_dai_init [snd_soc_seeed_voicecard]
-> asoc_simple_card_init_dai [snd_soc_simple_card_utils]
-> snd_soc_dai_set_sysclk [snd_soc_core]
-> ac108_set_sysclk [snd_soc_ac108]
In 5.4:
seeed_voice_card_probe [snd_soc_seeed_voicecard]
-> devm_snd_soc_register_card [snd_soc_core]
-> snd_soc_register_card [snd_soc_core]
-> snd_soc_instantiate_card [snd_soc_core]
-> seeed_voice_card_dai_init [snd_soc_seeed_voicecard]
-> asoc_simple_init_dai.part.0 [snd_soc_seeed_voicecard]
-> snd_soc_dai_set_sysclk [snd_soc_core]
-> ac108_set_sysclk [snd_soc_ac108]
Which results in the "ac108_set_sysclk :24000000" kernel message.
Note the extra snd_soc_instantiate_card(), and the copied/renamed
asoc_simple_init_dai() - it became static and not-available to other drivers
in v5.x.
See https://github.com/respeaker/seeed-voicecard/issues/246
It was made private in v5.2:
commit ad934ca8010843482d61fda46786449a9bc99e10
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed Mar 20 13:55:52 2019 +0900
ASoC: simple-card-utils: share asoc_simple_dai_init()
The init code was extracted into asoc_simple_card_init_priv(), with
additional comments.
commit 65a5056b21202eff7f54243e587183f4bb6ed352
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed Mar 20 13:56:26 2019 +0900
ASoC: simple-card-utils: share asoc_simple_card_init_priv()
The difference between simple-card / audio-graph are just using
OF graph style, or not. In other words, other things should be same.
This means, simple-card/audio-graph common functions should be
implemented at simple-card-utils, and its own functions should be
implemented at each files.
Current simple-card / audio-graph are initializing each priv,
but it is same operation.
This patch adds new asoc_simple_card_init_priv() and initialize
priv by same operation.
commit f107294c6422e772773b53dbf802186175b6289e
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Thu Jun 6 13:07:35 2019 +0900
ASoC: simple-card: support snd_soc_dai_link_component style for cpu
ASoC supports modern style dai_link (= snd_soc_dai_link_component) for
CPU. legacy style dai_link (= cpu_dai_name, cpu_name, cpu_of_node) are
no longer needed.
This patch switches to modern style.
commit 910fdcabedd2354d161b1beab6ad7dc7e859651d
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Mon Jan 21 09:32:32 2019 +0900
ASoC: soc-core: add .num_platform for dai_link
Current snd_soc_dai_link is starting to use snd_soc_dai_link_component
(= modern) style for Platform, but it is still assuming single Platform
so far. We will need to have multi Platform support in the not far
future.
Currently only simple card is using it as sound card driver,
and other drivers are converted to it from legacy style by
snd_soc_init_platform().
To avoid future problem of multi Platform support, let's add
num_platforms before it is too late.
In the same time, to make it same naming mothed, "platform" should
be "platforms". This patch fixup it too.
commit e58f41e41185c6906bd11c73c4e76aa5fc3ea685
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Fri Aug 31 03:10:33 2018 +0000
ASoC: simple-card: support snd_soc_dai_link_component style for platform
Current ASoC is supporting snd_soc_dai_link_component for binding,
it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs).
CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component
style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-card for platform.
commit 710af9196ce614ee02185c2ec55e617a71843183
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Fri Aug 31 03:08:24 2018 +0000
ASoC: simple-card: support snd_soc_dai_link_component style for codec
Current ASoC is supporting snd_soc_dai_link_component for binding,
it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs).
CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component
style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-card for codec.
It was made private in v5.2:
commit ad934ca8010843482d61fda46786449a9bc99e10
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed Mar 20 13:55:52 2019 +0900
ASoC: simple-card-utils: share asoc_simple_dai_init()
The init code was extracted into asoc_simple_card_init_priv(), with
additional comments.
commit 65a5056b21202eff7f54243e587183f4bb6ed352
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed Mar 20 13:56:26 2019 +0900
ASoC: simple-card-utils: share asoc_simple_card_init_priv()
The difference between simple-card / audio-graph are just using
OF graph style, or not. In other words, other things should be same.
This means, simple-card/audio-graph common functions should be
implemented at simple-card-utils, and its own functions should be
implemented at each files.
Current simple-card / audio-graph are initializing each priv,
but it is same operation.
This patch adds new asoc_simple_card_init_priv() and initialize
priv by same operation.
commit f107294c6422e772773b53dbf802186175b6289e
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Thu Jun 6 13:07:35 2019 +0900
ASoC: simple-card: support snd_soc_dai_link_component style for cpu
ASoC supports modern style dai_link (= snd_soc_dai_link_component) for
CPU. legacy style dai_link (= cpu_dai_name, cpu_name, cpu_of_node) are
no longer needed.
This patch switches to modern style.
commit 910fdcabedd2354d161b1beab6ad7dc7e859651d
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Mon Jan 21 09:32:32 2019 +0900
ASoC: soc-core: add .num_platform for dai_link
Current snd_soc_dai_link is starting to use snd_soc_dai_link_component
(= modern) style for Platform, but it is still assuming single Platform
so far. We will need to have multi Platform support in the not far
future.
Currently only simple card is using it as sound card driver,
and other drivers are converted to it from legacy style by
snd_soc_init_platform().
To avoid future problem of multi Platform support, let's add
num_platforms before it is too late.
In the same time, to make it same naming mothed, "platform" should
be "platforms". This patch fixup it too.
commit e58f41e41185c6906bd11c73c4e76aa5fc3ea685
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Fri Aug 31 03:10:33 2018 +0000
ASoC: simple-card: support snd_soc_dai_link_component style for platform
Current ASoC is supporting snd_soc_dai_link_component for binding,
it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs).
CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component
style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-card for platform.
commit 710af9196ce614ee02185c2ec55e617a71843183
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Fri Aug 31 03:08:24 2018 +0000
ASoC: simple-card: support snd_soc_dai_link_component style for codec
Current ASoC is supporting snd_soc_dai_link_component for binding,
it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs).
CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component
style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-card for codec.
perl -pi -e 's(->capture_active)(->stream_active\[SNDRV_PCM_STREAM_CAPTURE\])g' *.c
perl -pi -e 's(->playback_active)(->stream_active\[SNDRV_PCM_STREAM_PLAYBACK\])g' *.c
commit 0f6011fd79a2fb92cb80177fd6bdc8aac3a3cd93
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Mon Feb 17 17:28:15 2020 +0900
ASoC: soc-pcm: merge playback/cature_active into stream_active
DAI has playback_active and capture_active to care usage count.
OTOH, we have SNDRV_PCM_STREAM_PLAYBACK/CAPTURE.
But because of this kind of implementation mismatch,
ALSA SoC has many verbose code.
To solve this issue, this patch merge playback_active/capture_active
into stream_active[2];
Towards the end of the series in asoc-v5.2:
commit 8f7f298a333761a528e103cda3b42f3a416ad1ee
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed Mar 20 13:56:36 2019 +0900
ASoC: simple-card-utils: separate asoc_simple_card_parse_dai()
The difference between simple-card / audio-graph are just using
OF graph style, or not. In other words, other things should be same.
This means, simple-card/audio-graph common functions should be
implemented at simple-card-utils, and its own functions should be
implemented at each files.
Current simple-card / audio-graph are using
asoc_simple_card_parse_dai() which is different implementation.
But, these are implemanted at simple-card-utils.
It should be implemanted at each files.
This patch separate these into each files.
$ git log --format=oneline 0580dde59438686d60762b6da9229ebec693b94f^..ad11e59f52d6fc75037ac3cb66dc711b83c1bbf8
ad11e59f52d6fc75037ac3cb66dc711b83c1bbf8 ASoC: simple-card-utils: rename asoc_simple_card_xxx() to asoc_simple_()
8f7f298a333761a528e103cda3b42f3a416ad1ee ASoC: simple-card-utils: separate asoc_simple_card_parse_dai()
65a5056b21202eff7f54243e587183f4bb6ed352 ASoC: simple-card-utils: share asoc_simple_card_init_priv()
629f75440a68220a78aef9d8569831824890c47d ASoC: simple-card-utils: share asoc_simple_be_hw_params_fixup()
ad934ca8010843482d61fda46786449a9bc99e10 ASoC: simple-card-utils: share asoc_simple_dai_init()
f48dcbb6d47d870cf3a03f453c923dd262158c66 ASoC: simple-card-utils: share asoc_simple_hw_param()
686911b46fb5a08df142fe22b6c06dc6fbd3ba65 ASoC: simple-card-utils: share asoc_simple_shutdown()
f38df5bf0c9cb905fa9d5abc86c3a00128cdbba5 ASoC: simple-card-utils: share asoc_simple_startup()
e59289cda8dec0153fa396864c8ba8092ec3b80d ASoC: simple_card_utils: share common priv for simple-card/audio-graph
0580dde59438686d60762b6da9229ebec693b94f ASoC: simple-card-utils: add asoc_simple_debug_info()