ASoC: seeed-voicecard: Fix to not use asoc_simple_parse_xxx()
authorHoegeun Kwon <hoegeun.kwon@samsung.com>
Wed, 2 Nov 2022 09:26:56 +0000 (18:26 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Wed, 23 Nov 2022 02:31:04 +0000 (11:31 +0900)
Interface changed since kernel v5.13, modified to not use
asoc_simple_parse_xxx().

Ref patch:
Link: https://lore.kernel.org/r/87pmz0wf9u.wl-kuninori.morimoto.gx@renesas.com
Change-Id: I6131e214b44427f4e9a79e53e36947270599b72e
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
sound/soc/seeed/seeed-voicecard.c

index c24230b..d24c558 100644 (file)
@@ -329,6 +329,7 @@ static int seeed_voice_card_dai_link_of(struct device_node *node,
        char prop[128];
        char *prefix = "";
        int ret, single_cpu;
+       struct snd_soc_dai_link_component *dlc;
 
        /* For single DAI link & old style of DT node */
        if (is_top_level_node)
@@ -397,22 +398,32 @@ static int seeed_voice_card_dai_link_of(struct device_node *node,
 
        #if LINUX_VERSION_CODE <= KERNEL_VERSION(4,10,0)
        ret = asoc_simple_parse_clk_cpu(cpu, dai_link, cpu_dai);
-       #else
+       #elif LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0)
        ret = asoc_simple_parse_clk_cpu(dev, cpu, dai_link, cpu_dai);
+       #else
+       dlc = asoc_link_to_cpu(dai_link, 0);
+       ret = asoc_simple_parse_clk(dev, cpu, cpu_dai, dlc);
        #endif
        if (ret < 0)
                goto dai_link_of_err;
 
        #if LINUX_VERSION_CODE <= KERNEL_VERSION(4,10,0)
        ret = asoc_simple_parse_clk_codec(codec, dai_link, codec_dai);
-       #else
+       #elif LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0)
        ret = asoc_simple_parse_clk_codec(dev, codec, dai_link, codec_dai);
+       #else
+       dlc = asoc_link_to_codec(dai_link, 0);
+       ret = asoc_simple_parse_clk(dev, codec, codec_dai, dlc);
        #endif
        if (ret < 0)
                goto dai_link_of_err;
 
        #if _SINGLE_CODEC
+       #if LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0)
        asoc_simple_canonicalize_platform(dai_link);
+       #else
+       asoc_simple_canonicalize_platform(dai_link->platforms, dai_link->cpus);
+       #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0) */
        #endif
 
        ret = asoc_simple_set_dailink_name(dev, dai_link,
@@ -443,7 +454,11 @@ static int seeed_voice_card_dai_link_of(struct device_node *node,
                #endif
                dai_props->codec_dai.sysclk);
 
+       #if LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0)
        asoc_simple_canonicalize_cpu(dai_link, single_cpu);
+       #else
+       asoc_simple_canonicalize_cpu(dai_link->cpus, single_cpu);
+       #endif
 
 dai_link_of_err:
        of_node_put(cpu);