Commit graph

68 commits

Author SHA1 Message Date
Hin-Tak Leung
f5710e9761 v6.11: platform: Make platform_driver::remove() return void
commit 0edb555a65d1ef047a9805051c36922b52a38a9d
Author:     Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
AuthorDate: Mon Oct 9 12:37:26 2023 +0200
Commit:     Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
CommitDate: Mon May 27 10:34:35 2024 +0200

    platform: Make platform_driver::remove() return void

    struct platform_driver::remove returning an integer made driver authors
    expect that returning an error code was proper error handling. However
    the driver core ignores the error and continues to remove the device
    because there is nothing the core could do anyhow and reentering the
    remove callback again is only calling for trouble.

    To prevent such wrong assumptions, change the return type of the remove
    callback to void. This was prepared by introducing an alternative remove
    callback returning void and converting all drivers to that. So .remove()
    can be changed without further changes in drivers.

    This corresponds to step b) of the plan outlined in commit
    5c5a7680e67b ("platform: Provide a remove callback that returns no value").

    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
2024-10-22 00:02:06 +01:00
Hin-Tak Leung
899fdb1e5b v6.7: perl -pi -e 's(asoc_simple_)(simple_util_)g'
commit b5a95c5bf6d6953d05b2c12acc8c07783232bea9
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Mon Sep 11 23:47:09 2023 +0000

    ASoC: simple_card_utils.h: convert not to use asoc_xxx()

    ASoC is using 2 type of prefix (asoc_xxx() vs snd_soc_xxx()),
    but these are unified into snd_soc_xxx().

    simple_card / audio_graph drivers are historically using
    asoc_xxx() prefix too. simple_card / audio_graph are not
    ASoC framework, so let's use simple_card_xxx_() / audio_graph_xxx()
    for global function prefix.

    This patch has asoc_xxx() as define to keep compatible.
    It will be removed if all drivers were switched to new style.

    Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Link: https://lore.kernel.org/r/87edj4s26a.wl-kuninori.morimoto.gx@renesas.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
2024-02-21 05:25:00 +00:00
Hin-Tak Leung
8448ced150 v6.7: perl -pi -e 's(asoc_rtd_to_)(snd_soc_rtd_to_)g'
commit 1d5a2b5dd0a8d2b2b535b5266699429dbd48e62f
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Mon Sep 11 23:47:02 2023 +0000

    ASoC: soc.h: convert asoc_xxx() to snd_soc_xxx()

    ASoC is using 2 type of prefix (asoc_xxx() vs snd_soc_xxx()), but there
    is no particular reason about that [1].
    To reduce confusing, standarding these to snd_soc_xxx() is sensible.

    This patch adds asoc_xxx() macro to keep compatible for a while.
    It will be removed if all drivers were switched to new style.

    Link: https://lore.kernel.org/r/87h6td3hus.wl-kuninori.morimoto.gx@renesas.com [1]
    Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Link: https://lore.kernel.org/r/87fs3ks26i.wl-kuninori.morimoto.gx@renesas.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
2024-02-21 05:10:49 +00:00
Hin-Tak Leung
cc37c8fb52 v6.5: ASoC: soc-core.c: add index on snd_soc_of_get_dai_name()
commit 3c8b5861850c734add65233e538d4a8c2dff95d9
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Tue Jun 20 02:14:11 2023 +0000

    ASoC: soc-core.c: add index on snd_soc_of_get_dai_name()

    Current snd_soc_of_get_dai_name() doesn't accept index
    for #sound-dai-cells. It is not useful for user.
    This patch adds it.

    Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Link: https://lore.kernel.org/r/87pm5qdgng.wl-kuninori.morimoto.gx@renesas.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
2023-10-04 23:18:04 +01:00
Hin-Tak Leung
a46c3f6324 Re-store support for v6.3 in the v6.4 branch 2023-07-27 02:08:40 +01:00
Hin-Tak Leung
2a40c7dbff v6.4: switch to use c2c_params instead of params
commit 99fddc1618ff64cc71bd51dbf83bd13e74778fe0
Merge: 72456c24c8357 1ea63f29c2771
Author: Mark Brown <broonie@kernel.org>
Date:   Wed Apr 5 16:35:09 2023 +0100

    ASoC: clarify Codec2Codec params

    Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

    ASoC is supporting Codec2Codec, but its parameter name is
    "params" and "num_params" which are very unclear naming.

    This patch-set clarifies it by replacing to c2c_params / num_c2c_params.

commit 1ea63f29c27712d6b9c45af67cd71299d849c5e3
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Sun Apr 2 23:00:17 2023 +0000

    ASoC: soc.h: remove unused params/num_params

    No drivers are using params/num_params any more.
    Let's remove these.

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

commit e7a73b05542d82e209af450dd90b730255f6e775
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Sun Apr 2 23:00:07 2023 +0000

    ASoC: samsung: switch to use c2c_params instead of params

    ASoC is now using c2c_params instead of params. This patch replace it.
    num_c2c_params (was num_params) was not mandatory before,
    but let's set it by this patch.

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

commit 433f4a1697fae78c34377de1ef3abd26aec8214e
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Sun Apr 2 22:59:57 2023 +0000

    ASoC: meson: switch to use c2c_params instead of params

    ASoC is now using c2c_params instead of params. This patch replace it.
    num_c2c_params (was num_params) was not mandatory before,
    but let's set it by this patch.

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

commit 7ddc7f91beb285246e926e3adf0b292b071aea33
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Sun Apr 2 22:59:35 2023 +0000

    ASoC: soc.h: clarify Codec2Codec params

    snd_soc_dai_link has params/num_params, but it is unclear that
    params for what. This patch clarify it is params for Codec2Codec.

    Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Link: https://lore.kernel.org/r/87o7o5c2lk.wl-kuninori.morimoto.gx@renesas.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-27 01:52:33 +01:00
Hin-Tak Leung
a03624a0ce v6.3: cleanup Playback/Capture data for snd_soc_dai
commit 3653480c68120dc16ebfeb80e529200dbbd98f92
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Tue Jan 31 02:02:04 2023 +0000

    ASoC: soc-dai.h: cleanup Playback/Capture data for snd_soc_dai

    Current snd_soc_dai has data for Playback/Capture, but it is very
    random. Someone is array (A), someone is playback/capture (B),
    and someone is tx/rx (C);

            struct snd_soc_dai {
                    ...
    (A)             unsigned int stream_active[SNDRV_PCM_STREAM_LAST + 1];

    (B)             struct snd_soc_dapm_widget *playback_widget;
    (B)             struct snd_soc_dapm_widget *capture_widget;

    (B)             void *playback_dma_data;
    (B)             void *capture_dma_data;

                    ...

    (C)             unsigned int tx_mask;
    (C)             unsigned int rx_mask;
            };

    Because of it, the code was very complicated.
    This patch creates new data structure to merge these into one,
    and tidyup the code.

    Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
    Link: https://lore.kernel.org/r/87cz6vea1v.wl-kuninori.morimoto.gx@renesas.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-16 23:49:29 +01:00
Hin-Tak Leung
99bbf880e9 v6.0: ASoC: simple-card-utils: Move snd_soc_component_is_codec to be local
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>
2022-10-30 22:45:19 +00:00
Hin-Tak Leung
8dbe3726b7 v6.0: ASoC: simple-card-utils: Make asoc_simple_clean_reference() return void
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>
2022-10-30 22:37:13 +00:00
Hin-Tak Leung
a8ee041f21 v5.16: ASoC: soc-component: add snd_soc_component_is_codec()
commit 01e90ee15e81f57d309d0ce1f0e16869e011b800
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Mon Oct 18 11:05:24 2021 +0900

    ASoC: soc-component: add snd_soc_component_is_codec()

    Checking .non_legacy_dai_naming is not readable.
    Let's add new snd_soc_component_is_codec().

    Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Link: https://lore.kernel.org/r/87h7dft7dn.wl-kuninori.morimoto.gx@renesas.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
2022-10-30 22:25:19 +00:00
Hin-Tak Leung
6bf1dbd04e v5.13: cope with multi-support at asoc_simple_canonicalize_*()
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.
2021-10-09 00:55:55 +01:00
Hin-Tak Leung
b093f59250 v5.13: Conditionally re-adding asoc_simple_parse_xxx()
commit e25704f84ca2b586e8e65d1b2ab686205b3076fe
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Mon Apr 12 08:52:13 2021 +0900

    ASoC: simple-card-utils: remove asoc_simple_parse_xxx()

    ASoC is now supporting multi DAI, but, current
    simple-card / audio-graph are assuming fixed single DAI.

    Now, asoc_simple_parse_xxx() macro is assuming single DAI.
    To support multi-CPU/Codec, this patch unpack asoc_simple_parse_xxx()
    macro, and uses "&dai_link->cpus[i]" instead of "dai_link->cpus".

$ git log --format=oneline v5.12..v5.13 -- include/sound/simple_card_utils.h
f6fcc820e0c96664e2f21c0d6bb60630243ef36a ASoC: audio-graph: move audio_graph_remove() to simple-card-utils.c
1a456b1c6be13514a8fc5c1a99e6763f491d17e9 ASoC: audio-graph: move audio_graph_card_probe() to simple-card-utils.c
343e55e71877415a23372388b3e0c59a9bba42f6 ASoC: simple-card-utils: Increase maximum number of links to 128
fcfd763bef4ff7f6371790979a6ceac9c4ac425a ASoC: simple-card-utils: tidyup asoc_simple_parse_convert()
3919249e80995ed5f125f94d05fcb6171f79e732 ASoC: simple-card-utils: tidyup dev_dbg() to use 1 line
33cd6b191f1cdb5f332717a80ce26f661f53e924 ASoC: simple-card-utils: tidyup debug info for clock
c826ec0391c83f06354a4ebb25c7b2480c18f33a ASoC: simple-card-utils: multi support at asoc_simple_canonicalize_cpu/platform()
9830d3e99f51fc1c1c6ab8be7778fd205af198ad ASoC: simple-card-utils: add simple_props_to_xxx() macro
40d8cbe70e71be170e0a4fe6ab112d9aaa9cfb18 ASoC: simple-card-utils: indicate missing CPU/Codec numbers for debug
ac813c625ad5c3ee98a99e1b37659a0d85178978 ASoC: simple-card-utils: indicate dai_fmt if exist
e25704f84ca2b586e8e65d1b2ab686205b3076fe ASoC: simple-card-utils: remove asoc_simple_parse_xxx()
fafc05aadd4b6ce5c161135de9d3a653fc054543 ASoC: simple-card-utils: use for_each_prop_xxx()
f899006d558546a8ee39c93f816eb3847c5bc6c0 ASoC: simple-card-utils: remove li->dais/li->conf
205eb17eddb473c3159743c7d3aaf68db37b7231 ASoC: simple-card-utils: share dummy DAI and reduce memory
f2138aed231c88d5c4fa8d06aa15ad19685087c2 ASoC: simple-card-utils: enable flexible CPU/Codec/Platform
050c7950fd706fec229af9f30e8ce254cea9b675 ASoC: simple-card-utils: alloc dai_link information for CPU/Codec/Platform
2021-10-09 00:45:09 +01:00
Hin-Tak Leung
c5f3836dd8 missed one simple_priv_to_card() to seeed_priv_to_card() earlier 2021-04-27 15:48:33 +01:00
Hin-Tak Leung
19067f3333 Second/Alternative change to correct for 5.5+ change in trigger order
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>
2021-04-27 02:49:25 +01:00
Hin-Tak Leung
5793cf6bf0 Revert "Operational change to correct for 5.5+ change in trigger order; REVISIT!"
This reverts commit e553d4f851.
2021-04-27 02:49:08 +01:00
Hin-Tak Leung
e553d4f851 Operational change to correct for 5.5+ change in trigger order; REVISIT!
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>
2021-04-25 00:13:42 +01:00
Hin-Tak Leung
de70691526 v5.7: this code was added with 5.7 - "for_each_rtd_components"
The correct incantation is:

git log 95cfc0a0aaf575207152dd7601e782702565a6f1 ^v5.7
2021-04-25 00:13:42 +01:00
Hin-Tak Leung
1774a54301 Additional debug code to where the *_trigger()'s finish. 2021-04-25 00:13:42 +01:00
Hin-Tak Leung
9796ad49ff Additional debug statement 2021-04-25 00:13:42 +01:00
Hin-Tak Leung
fdd67ea2c4 Move call to asoc_simple_canonicalize_platform() later to match upstream - likely does not matter.
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>
2021-04-25 00:13:28 +01:00
Hin-Tak Leung
f8d47b5c64 2nd parameter of asoc_simple_init_dai_link_params() not used 2021-04-24 20:50:05 +01:00
Hin-Tak Leung
47d09dba0e v5.6: codec2codec DAI links
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.
2021-04-24 20:49:53 +01:00
Hin-Tak Leung
d692927067 adjust asoc_simple_debug_info() for seeed priv structures 2021-04-24 20:49:36 +01:00
Hin-Tak Leung
14317817f8 v5.1 "ASoC: simple-card-utils: add asoc_simple_debug_info()"
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.
2021-04-24 20:49:19 +01:00
Hin-Tak Leung
e2529f9eee Merge branch 'v5.7' into v5.8 2020-09-14 14:56:27 +01:00
Hin-Tak Leung
6aff6e0b33 Merge branch 'v5.5' into v5.7 2020-09-14 14:55:59 +01:00
Hin-Tak Leung
edddb2fbe4 Apparently, snd_soc_dai_set_bclk_ratio should be used where snd_soc_dai_set_tdm_slot is.
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
2020-09-14 14:48:18 +01:00
Hin-Tak Leung
955707d944 Revert "temporary work-around for not being able to read sysclk from dts for ac10x"
This reverts commit 138d22226e.
2020-09-14 14:26:40 +01:00
Hin-Tak Leung
ec5fc9d9b8 Merge remote-tracking branch 'origin/v5.7' into v5.8 2020-09-04 23:52:34 +01:00
Hin-Tak Leung
bb1422182b Merge remote-tracking branch 'origin/v5.5' into v5.7 2020-09-04 23:50:14 +01:00
Hin-Tak Leung
138d22226e temporary work-around for not being able to read sysclk from dts for ac10x
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
2020-09-04 20:44:32 +01:00
Hin-Tak Leung
a24da444df v5.8: snd_soc_pcm_runtime->cpu_dai/codec_dai/cpu_dais/codec_dais removed
perl -pi -e 's/rtd->cpu_dai/asoc_rtd_to_cpu\(rtd, 0\)/' seeed-voicecard.c
perl -pi -e 's/rtd->codec_dai/asoc_rtd_to_codec\(rtd, 0\)/' seeed-voicecard.c

commit 1729025b04b9f242dca37f50dba8dd3705eb1ea1
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Mon Mar 30 10:48:27 2020 +0900

    ASoC: soc-core: remove cpu_dai/codec_dai/cpu_dais/codec_dais

    No-one is using cpu_dai/codec_dai/cpu_dais/codec_dais.
    Let's remove these from snd_soc_pcm_runtime

commit c2233a266178f8937cc26a84cd7672334b5424b7
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Mon Mar 30 10:47:37 2020 +0900

    ASoC: soc: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
2020-08-30 19:20:19 +01:00
Hin-Tak Leung
131ee8187d Merge branch 'v5.7' into v5.7 2020-08-05 06:26:08 +01:00
Hin-Tak Leung
ed615d2318 Merge remote-tracking branch 'origin/v5.5' into v5.7 2020-08-05 06:20:32 +01:00
Hin-Tak Leung
a6db04e724 Merge branch 'wrong-initialization-fix' into v5.5
Conflicts:
	seeed-voicecard.c
2020-08-05 05:59:37 +01:00
Hin-Tak Leung
0be1de9750 Revert previous over-zealous "rename asoc_simple_card_xxx() to asoc_simple_()"
Two of them should not have been changed, as they were protected and intended
for older kernels.
2020-08-05 05:45:31 +01:00
Hin-Tak Leung
fcbc3b6d6b copy asoc_simple_card_init_dai() from v5.7:sound/soc/generic/simple-card-utils.c
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()
2020-08-05 05:45:31 +01:00
Hin-Tak Leung
c2b419c286 Revert "asoc_simple_card_init_dai is not exported, but asoc_simple_dai_init is, and does more"
This reverts commit de22f92298.

That commit was wrong: seeed_priv_to_props() is not identical to simple_priv_props().

Conflicts:
	seeed-voicecard.c
2020-08-05 05:45:31 +01:00
Hin-Tak Leung
ed094dece5 v5.2: comments
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.
2020-08-05 05:45:31 +01:00
Hin-Tak Leung
51966603da v5.3: support snd_soc_dai_link_component style for cpu
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.
2020-08-05 05:45:31 +01:00
Hin-Tak Leung
6afe18224a v5.1: add .num_platform for dai_link
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.
2020-08-05 05:45:31 +01:00
Hin-Tak Leung
953fa50f4f v4.20: support snd_soc_dai_link_component style for platform
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.
2020-08-05 05:45:31 +01:00
Hin-Tak Leung
4396e4f834 v4.20: support snd_soc_dai_link_component style for codec
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.
2020-08-05 05:45:31 +01:00
Hin-Tak Leung
26754b0821 Revert previous over-zealous "rename asoc_simple_card_xxx() to asoc_simple_()"
Two of them should not have been changed, as they were protected and intended
for older kernels.
2020-08-05 05:26:01 +01:00
Hin-Tak Leung
af8668ff97 copy asoc_simple_card_init_dai() from v5.7:sound/soc/generic/simple-card-utils.c
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()
2020-08-05 04:54:46 +01:00
Hin-Tak Leung
2d08bb0b35 Revert "asoc_simple_card_init_dai is not exported, but asoc_simple_dai_init is, and does more"
This reverts commit de22f92298.

That commit was wrong: seeed_priv_to_props() is not identical to simple_priv_props().

Conflicts:
	seeed-voicecard.c
2020-08-05 04:54:46 +01:00
Hin-Tak Leung
c2f81c1f23 v5.2: comments
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.
2020-08-05 04:54:38 +01:00
Hin-Tak Leung
63fa92db39 v5.3: support snd_soc_dai_link_component style for cpu
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.
2020-08-05 02:37:32 +01:00
Hin-Tak Leung
d2c0f1b5c9 v5.1: add .num_platform for dai_link
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.
2020-08-05 02:18:23 +01:00
Hin-Tak Leung
775005d865 v4.20: support snd_soc_dai_link_component style for platform
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.
2020-08-05 02:07:32 +01:00