mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
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>
This commit is contained in:
parent
deadb855b6
commit
325fea33e1
|
|
@ -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 */
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user