ASoC: meson: aiu: simplify component addition
Now that the component name is unique within ASoC, there is no need to hack the debugfs prefix to add more than one ASoC component to a linux device. Remove the unnecessary function and use snd_soc_register_component() directly. Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Link: https://lore.kernel.org/r/20200217092019.433402-1-jbrunet@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
f07980d4ed
commit
0247142233
@ -197,8 +197,7 @@ static const struct snd_soc_component_driver aiu_acodec_ctrl_component = {
|
|||||||
|
|
||||||
int aiu_acodec_ctrl_register_component(struct device *dev)
|
int aiu_acodec_ctrl_register_component(struct device *dev)
|
||||||
{
|
{
|
||||||
return aiu_add_component(dev, &aiu_acodec_ctrl_component,
|
return snd_soc_register_component(dev, &aiu_acodec_ctrl_component,
|
||||||
aiu_acodec_ctrl_dai_drv,
|
aiu_acodec_ctrl_dai_drv,
|
||||||
ARRAY_SIZE(aiu_acodec_ctrl_dai_drv),
|
ARRAY_SIZE(aiu_acodec_ctrl_dai_drv));
|
||||||
"acodec");
|
|
||||||
}
|
}
|
||||||
|
@ -144,9 +144,8 @@ static const struct snd_soc_component_driver aiu_hdmi_ctrl_component = {
|
|||||||
|
|
||||||
int aiu_hdmi_ctrl_register_component(struct device *dev)
|
int aiu_hdmi_ctrl_register_component(struct device *dev)
|
||||||
{
|
{
|
||||||
return aiu_add_component(dev, &aiu_hdmi_ctrl_component,
|
return snd_soc_register_component(dev, &aiu_hdmi_ctrl_component,
|
||||||
aiu_hdmi_ctrl_dai_drv,
|
aiu_hdmi_ctrl_dai_drv,
|
||||||
ARRAY_SIZE(aiu_hdmi_ctrl_dai_drv),
|
ARRAY_SIZE(aiu_hdmi_ctrl_dai_drv));
|
||||||
"hdmi");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,26 +71,6 @@ int aiu_of_xlate_dai_name(struct snd_soc_component *component,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int aiu_add_component(struct device *dev,
|
|
||||||
const struct snd_soc_component_driver *component_driver,
|
|
||||||
struct snd_soc_dai_driver *dai_drv,
|
|
||||||
int num_dai,
|
|
||||||
const char *debugfs_prefix)
|
|
||||||
{
|
|
||||||
struct snd_soc_component *component;
|
|
||||||
|
|
||||||
component = devm_kzalloc(dev, sizeof(*component), GFP_KERNEL);
|
|
||||||
if (!component)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_FS
|
|
||||||
component->debugfs_prefix = debugfs_prefix;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return snd_soc_add_component(dev, component, component_driver,
|
|
||||||
dai_drv, num_dai);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int aiu_cpu_of_xlate_dai_name(struct snd_soc_component *component,
|
static int aiu_cpu_of_xlate_dai_name(struct snd_soc_component *component,
|
||||||
struct of_phandle_args *args,
|
struct of_phandle_args *args,
|
||||||
const char **dai_name)
|
const char **dai_name)
|
||||||
|
@ -11,9 +11,7 @@ struct clk;
|
|||||||
struct clk_bulk_data;
|
struct clk_bulk_data;
|
||||||
struct device;
|
struct device;
|
||||||
struct of_phandle_args;
|
struct of_phandle_args;
|
||||||
struct snd_soc_component_driver;
|
|
||||||
struct snd_soc_dai;
|
struct snd_soc_dai;
|
||||||
struct snd_soc_dai_driver;
|
|
||||||
struct snd_soc_dai_ops;
|
struct snd_soc_dai_ops;
|
||||||
|
|
||||||
enum aiu_clk_ids {
|
enum aiu_clk_ids {
|
||||||
@ -45,12 +43,6 @@ int aiu_of_xlate_dai_name(struct snd_soc_component *component,
|
|||||||
const char **dai_name,
|
const char **dai_name,
|
||||||
unsigned int component_id);
|
unsigned int component_id);
|
||||||
|
|
||||||
int aiu_add_component(struct device *dev,
|
|
||||||
const struct snd_soc_component_driver *component_driver,
|
|
||||||
struct snd_soc_dai_driver *dai_drv,
|
|
||||||
int num_dai,
|
|
||||||
const char *debugfs_prefix);
|
|
||||||
|
|
||||||
int aiu_hdmi_ctrl_register_component(struct device *dev);
|
int aiu_hdmi_ctrl_register_component(struct device *dev);
|
||||||
int aiu_acodec_ctrl_register_component(struct device *dev);
|
int aiu_acodec_ctrl_register_component(struct device *dev);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user