diff options
| author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2026-05-27 06:45:52 +0000 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-06-08 18:54:59 +0100 |
| commit | 325fea33e141a9c131475c97fb8e040f63fa4cab (patch) | |
| tree | 716e62f5f797182434e68d00137be2ba94c94542 | |
| parent | deadb855b694dd9174d8760223b62de2ee808821 (diff) | |
| download | lwn-325fea33e141a9c131475c97fb8e040f63fa4cab.tar.gz lwn-325fea33e141a9c131475c97fb8e040f63fa4cab.zip | |
ASoC: simple-card: remove platform data style
Simple-Card has created for "platform data" style first, and expanded
to "DT style". Current Simple-Card "platform data" style should not
work during almost 10 years, but no one reported it.
No one is using "platform data" style. Let's remove its support.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87v7c9e4f4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | include/sound/simple_card.h | 26 | ||||
| -rw-r--r-- | sound/soc/generic/simple-card.c | 61 |
2 files changed, 6 insertions, 81 deletions
diff --git a/include/sound/simple_card.h b/include/sound/simple_card.h deleted file mode 100644 index 2e999916dbd7..000000000000 --- a/include/sound/simple_card.h +++ /dev/null @@ -1,26 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 - * - * ASoC simple sound card support - * - * Copyright (C) 2012 Renesas Solutions Corp. - * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> - */ - -#ifndef __SIMPLE_CARD_H -#define __SIMPLE_CARD_H - -#include <sound/soc.h> -#include <sound/simple_card_utils.h> - -struct simple_util_info { - const char *name; - const char *card; - const char *codec; - const char *platform; - - unsigned int daifmt; - struct simple_util_dai cpu_dai; - struct simple_util_dai codec_dai; -}; - -#endif /* __SIMPLE_CARD_H */ diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index b24ba1330896..b4957e025211 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -13,9 +13,9 @@ #include <linux/of_platform.h> #include <linux/platform_device.h> #include <linux/string.h> -#include <sound/simple_card.h> -#include <sound/soc-dai.h> +#include <sound/simple_card_utils.h> #include <sound/soc.h> +#include <sound/soc-dai.h> #define DPCM_SELECTABLE 1 @@ -708,7 +708,6 @@ static int simple_probe(struct platform_device *pdev) { struct simple_util_priv *priv; struct device *dev = &pdev->dev; - struct device_node *np = dev->of_node; struct snd_soc_card *card; int ret; @@ -740,58 +739,10 @@ static int simple_probe(struct platform_device *pdev) if (ret < 0) goto end; - if (np && of_device_is_available(np)) { - - ret = simple_parse_of(priv, li); - if (ret < 0) { - dev_err_probe(dev, ret, "parse error\n"); - goto err; - } - - } else { - struct simple_util_info *cinfo; - struct snd_soc_dai_link_component *cpus; - struct snd_soc_dai_link_component *codecs; - struct snd_soc_dai_link_component *platform; - struct snd_soc_dai_link *dai_link = priv->dai_link; - struct simple_dai_props *dai_props = priv->dai_props; - - ret = -EINVAL; - - cinfo = dev->platform_data; - if (!cinfo) { - dev_err(dev, "no info for asoc-simple-card\n"); - goto err; - } - - if (!cinfo->name || - !cinfo->codec_dai.name || - !cinfo->codec || - !cinfo->platform || - !cinfo->cpu_dai.name) { - dev_err(dev, "insufficient simple_util_info settings\n"); - goto err; - } - - cpus = dai_link->cpus; - cpus->dai_name = cinfo->cpu_dai.name; - - codecs = dai_link->codecs; - codecs->name = cinfo->codec; - codecs->dai_name = cinfo->codec_dai.name; - - platform = dai_link->platforms; - platform->name = cinfo->platform; - - card->name = (cinfo->card) ? cinfo->card : cinfo->name; - dai_link->name = cinfo->name; - dai_link->stream_name = cinfo->name; - dai_link->dai_fmt = cinfo->daifmt; - dai_link->init = simple_util_dai_init; - memcpy(dai_props->cpu_dai, &cinfo->cpu_dai, - sizeof(*dai_props->cpu_dai)); - memcpy(dai_props->codec_dai, &cinfo->codec_dai, - sizeof(*dai_props->codec_dai)); + ret = simple_parse_of(priv, li); + if (ret < 0) { + dev_err_probe(dev, ret, "parse error\n"); + goto err; } snd_soc_card_set_drvdata(card, priv); |
