diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2018-01-28 23:35:34 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-02-12 05:01:16 -0500 |
commit | 755d440bcfdf5ff38a14a326d6dd78126466ef1f (patch) | |
tree | a3157028fa749a042ab1b871f0a388fe90efc48e | |
parent | 7928b2cbe55b2a410a0f5c1f154610059c57b1b2 (diff) |
ASoC: zx_aud96p22: replace codec to component
Now we can replace Codec to Component. Let's do it.
Note:
xxx_codec_xxx() -> xxx_component_xxx()
.idle_bias_off = 0 -> .idle_bias_on = 1
.ignore_pmdown_time = 0 -> .use_pmdown_time = 1
- -> .endianness = 1
- -> .non_legacy_dai_naming = 1
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/zx_aud96p22.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/sound/soc/codecs/zx_aud96p22.c b/sound/soc/codecs/zx_aud96p22.c index ca1932d13738..7a2d6eaf1786 100644 --- a/sound/soc/codecs/zx_aud96p22.c +++ b/sound/soc/codecs/zx_aud96p22.c | |||
@@ -57,8 +57,8 @@ struct aud96p22_priv { | |||
57 | static int aud96p22_adc_event(struct snd_soc_dapm_widget *w, | 57 | static int aud96p22_adc_event(struct snd_soc_dapm_widget *w, |
58 | struct snd_kcontrol *kcontrol, int event) | 58 | struct snd_kcontrol *kcontrol, int event) |
59 | { | 59 | { |
60 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); | 60 | struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); |
61 | struct aud96p22_priv *priv = snd_soc_codec_get_drvdata(codec); | 61 | struct aud96p22_priv *priv = snd_soc_component_get_drvdata(component); |
62 | struct regmap *regmap = priv->regmap; | 62 | struct regmap *regmap = priv->regmap; |
63 | 63 | ||
64 | if (event != SND_SOC_DAPM_POST_PMU) | 64 | if (event != SND_SOC_DAPM_POST_PMU) |
@@ -74,8 +74,8 @@ static int aud96p22_adc_event(struct snd_soc_dapm_widget *w, | |||
74 | static int aud96p22_dac_event(struct snd_soc_dapm_widget *w, | 74 | static int aud96p22_dac_event(struct snd_soc_dapm_widget *w, |
75 | struct snd_kcontrol *kcontrol, int event) | 75 | struct snd_kcontrol *kcontrol, int event) |
76 | { | 76 | { |
77 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); | 77 | struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); |
78 | struct aud96p22_priv *priv = snd_soc_codec_get_drvdata(codec); | 78 | struct aud96p22_priv *priv = snd_soc_component_get_drvdata(component); |
79 | struct regmap *regmap = priv->regmap; | 79 | struct regmap *regmap = priv->regmap; |
80 | 80 | ||
81 | if (event != SND_SOC_DAPM_POST_PMU) | 81 | if (event != SND_SOC_DAPM_POST_PMU) |
@@ -261,20 +261,22 @@ static const struct snd_soc_dapm_route aud96p22_dapm_routes[] = { | |||
261 | { "LINEOUTMN", NULL, "LD2" }, | 261 | { "LINEOUTMN", NULL, "LD2" }, |
262 | }; | 262 | }; |
263 | 263 | ||
264 | static const struct snd_soc_codec_driver aud96p22_driver = { | 264 | static const struct snd_soc_component_driver aud96p22_driver = { |
265 | .component_driver = { | 265 | .controls = aud96p22_snd_controls, |
266 | .controls = aud96p22_snd_controls, | 266 | .num_controls = ARRAY_SIZE(aud96p22_snd_controls), |
267 | .num_controls = ARRAY_SIZE(aud96p22_snd_controls), | 267 | .dapm_widgets = aud96p22_dapm_widgets, |
268 | .dapm_widgets = aud96p22_dapm_widgets, | 268 | .num_dapm_widgets = ARRAY_SIZE(aud96p22_dapm_widgets), |
269 | .num_dapm_widgets = ARRAY_SIZE(aud96p22_dapm_widgets), | 269 | .dapm_routes = aud96p22_dapm_routes, |
270 | .dapm_routes = aud96p22_dapm_routes, | 270 | .num_dapm_routes = ARRAY_SIZE(aud96p22_dapm_routes), |
271 | .num_dapm_routes = ARRAY_SIZE(aud96p22_dapm_routes), | 271 | .idle_bias_on = 1, |
272 | }, | 272 | .use_pmdown_time = 1, |
273 | .endianness = 1, | ||
274 | .non_legacy_dai_naming = 1, | ||
273 | }; | 275 | }; |
274 | 276 | ||
275 | static int aud96p22_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) | 277 | static int aud96p22_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) |
276 | { | 278 | { |
277 | struct aud96p22_priv *priv = snd_soc_codec_get_drvdata(dai->codec); | 279 | struct aud96p22_priv *priv = snd_soc_component_get_drvdata(dai->component); |
278 | struct regmap *regmap = priv->regmap; | 280 | struct regmap *regmap = priv->regmap; |
279 | unsigned int val; | 281 | unsigned int val; |
280 | 282 | ||
@@ -367,9 +369,9 @@ static int aud96p22_i2c_probe(struct i2c_client *i2c, | |||
367 | 369 | ||
368 | i2c_set_clientdata(i2c, priv); | 370 | i2c_set_clientdata(i2c, priv); |
369 | 371 | ||
370 | ret = snd_soc_register_codec(dev, &aud96p22_driver, &aud96p22_dai, 1); | 372 | ret = devm_snd_soc_register_component(dev, &aud96p22_driver, &aud96p22_dai, 1); |
371 | if (ret) { | 373 | if (ret) { |
372 | dev_err(dev, "failed to register codec: %d\n", ret); | 374 | dev_err(dev, "failed to register component: %d\n", ret); |
373 | return ret; | 375 | return ret; |
374 | } | 376 | } |
375 | 377 | ||
@@ -378,7 +380,6 @@ static int aud96p22_i2c_probe(struct i2c_client *i2c, | |||
378 | 380 | ||
379 | static int aud96p22_i2c_remove(struct i2c_client *i2c) | 381 | static int aud96p22_i2c_remove(struct i2c_client *i2c) |
380 | { | 382 | { |
381 | snd_soc_unregister_codec(&i2c->dev); | ||
382 | return 0; | 383 | return 0; |
383 | } | 384 | } |
384 | 385 | ||