diff options
Diffstat (limited to 'sound/soc/codecs/ad193x.c')
-rw-r--r-- | sound/soc/codecs/ad193x.c | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c index d10988eec0c1..4b60ebee491d 100644 --- a/sound/soc/codecs/ad193x.c +++ b/sound/soc/codecs/ad193x.c @@ -130,7 +130,7 @@ static inline bool ad193x_has_adc(const struct ad193x_priv *ad193x) static int ad193x_mute(struct snd_soc_dai *dai, int mute) { - struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(dai->codec); + struct ad193x_priv *ad193x = snd_soc_component_get_drvdata(dai->component); if (mute) regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL2, @@ -146,7 +146,7 @@ static int ad193x_mute(struct snd_soc_dai *dai, int mute) static int ad193x_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, unsigned int rx_mask, int slots, int width) { - struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(dai->codec); + struct ad193x_priv *ad193x = snd_soc_component_get_drvdata(dai->component); unsigned int channels; switch (slots) { @@ -179,7 +179,7 @@ static int ad193x_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, static int ad193x_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) { - struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(codec_dai->codec); + struct ad193x_priv *ad193x = snd_soc_component_get_drvdata(codec_dai->component); unsigned int adc_serfmt = 0; unsigned int adc_fmt = 0; unsigned int dac_fmt = 0; @@ -257,8 +257,8 @@ static int ad193x_set_dai_fmt(struct snd_soc_dai *codec_dai, static int ad193x_set_dai_sysclk(struct snd_soc_dai *codec_dai, int clk_id, unsigned int freq, int dir) { - struct snd_soc_codec *codec = codec_dai->codec; - struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = codec_dai->component; + struct ad193x_priv *ad193x = snd_soc_component_get_drvdata(component); switch (freq) { case 12288000: case 18432000: @@ -275,8 +275,8 @@ static int ad193x_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { int word_len = 0, master_rate = 0; - struct snd_soc_codec *codec = dai->codec; - struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct ad193x_priv *ad193x = snd_soc_component_get_drvdata(component); /* bit size */ switch (params_width(params)) { @@ -351,10 +351,10 @@ static struct snd_soc_dai_driver ad193x_dai = { .ops = &ad193x_dai_ops, }; -static int ad193x_codec_probe(struct snd_soc_codec *codec) +static int ad193x_component_probe(struct snd_soc_component *component) { - struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(codec); - struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); + struct ad193x_priv *ad193x = snd_soc_component_get_drvdata(component); + struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); int num, ret; /* default setting for ad193x */ @@ -382,7 +382,7 @@ static int ad193x_codec_probe(struct snd_soc_codec *codec) if (ad193x_has_adc(ad193x)) { /* add adc controls */ num = ARRAY_SIZE(ad193x_adc_snd_controls); - ret = snd_soc_add_codec_controls(codec, + ret = snd_soc_add_component_controls(component, ad193x_adc_snd_controls, num); if (ret) @@ -408,16 +408,18 @@ static int ad193x_codec_probe(struct snd_soc_codec *codec) return 0; } -static const struct snd_soc_codec_driver soc_codec_dev_ad193x = { - .probe = ad193x_codec_probe, - .component_driver = { - .controls = ad193x_snd_controls, - .num_controls = ARRAY_SIZE(ad193x_snd_controls), - .dapm_widgets = ad193x_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(ad193x_dapm_widgets), - .dapm_routes = audio_paths, - .num_dapm_routes = ARRAY_SIZE(audio_paths), - }, +static const struct snd_soc_component_driver soc_component_dev_ad193x = { + .probe = ad193x_component_probe, + .controls = ad193x_snd_controls, + .num_controls = ARRAY_SIZE(ad193x_snd_controls), + .dapm_widgets = ad193x_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(ad193x_dapm_widgets), + .dapm_routes = audio_paths, + .num_dapm_routes = ARRAY_SIZE(audio_paths), + .idle_bias_on = 1, + .use_pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; const struct regmap_config ad193x_regmap_config = { @@ -442,7 +444,7 @@ int ad193x_probe(struct device *dev, struct regmap *regmap, dev_set_drvdata(dev, ad193x); - return snd_soc_register_codec(dev, &soc_codec_dev_ad193x, + return devm_snd_soc_register_component(dev, &soc_component_dev_ad193x, &ad193x_dai, 1); } EXPORT_SYMBOL_GPL(ad193x_probe); |