ASoC: twl6040: Convert to table based init
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Родитель
6f25e4eed9
Коммит
a175fce01b
|
@ -1183,18 +1183,6 @@ static const struct snd_soc_dapm_route intercon[] = {
|
||||||
{"AUXR", NULL, "AUXR Playback"},
|
{"AUXR", NULL, "AUXR Playback"},
|
||||||
};
|
};
|
||||||
|
|
||||||
static int twl6040_add_widgets(struct snd_soc_codec *codec)
|
|
||||||
{
|
|
||||||
struct snd_soc_dapm_context *dapm = &codec->dapm;
|
|
||||||
|
|
||||||
snd_soc_dapm_new_controls(dapm, twl6040_dapm_widgets,
|
|
||||||
ARRAY_SIZE(twl6040_dapm_widgets));
|
|
||||||
snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon));
|
|
||||||
snd_soc_dapm_new_widgets(dapm);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int twl6040_set_bias_level(struct snd_soc_codec *codec,
|
static int twl6040_set_bias_level(struct snd_soc_codec *codec,
|
||||||
enum snd_soc_bias_level level)
|
enum snd_soc_bias_level level)
|
||||||
{
|
{
|
||||||
|
@ -1503,16 +1491,10 @@ static int twl6040_probe(struct snd_soc_codec *codec)
|
||||||
|
|
||||||
/* power on device */
|
/* power on device */
|
||||||
ret = twl6040_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
|
ret = twl6040_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
|
||||||
if (ret)
|
if (!ret)
|
||||||
goto bias_err;
|
return 0;
|
||||||
|
|
||||||
snd_soc_add_controls(codec, twl6040_snd_controls,
|
/* Error path */
|
||||||
ARRAY_SIZE(twl6040_snd_controls));
|
|
||||||
twl6040_add_widgets(codec);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
bias_err:
|
|
||||||
free_irq(priv->plug_irq, codec);
|
free_irq(priv->plug_irq, codec);
|
||||||
plugirq_err:
|
plugirq_err:
|
||||||
destroy_workqueue(priv->workqueue);
|
destroy_workqueue(priv->workqueue);
|
||||||
|
@ -1544,6 +1526,13 @@ static struct snd_soc_codec_driver soc_codec_dev_twl6040 = {
|
||||||
.reg_cache_size = ARRAY_SIZE(twl6040_reg),
|
.reg_cache_size = ARRAY_SIZE(twl6040_reg),
|
||||||
.reg_word_size = sizeof(u8),
|
.reg_word_size = sizeof(u8),
|
||||||
.reg_cache_default = twl6040_reg,
|
.reg_cache_default = twl6040_reg,
|
||||||
|
|
||||||
|
.controls = twl6040_snd_controls,
|
||||||
|
.num_controls = ARRAY_SIZE(twl6040_snd_controls),
|
||||||
|
.dapm_widgets = twl6040_dapm_widgets,
|
||||||
|
.num_dapm_widgets = ARRAY_SIZE(twl6040_dapm_widgets),
|
||||||
|
.dapm_routes = intercon,
|
||||||
|
.num_dapm_routes = ARRAY_SIZE(intercon),
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __devinit twl6040_codec_probe(struct platform_device *pdev)
|
static int __devinit twl6040_codec_probe(struct platform_device *pdev)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче