aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2018-01-28 23:47:19 -0500
committerMark Brown <broonie@kernel.org>2018-02-12 06:09:14 -0500
commitf12df6614bee36c11ba0b3fb2d74b7d47b955434 (patch)
tree04f39fa53cfb4532adb1bee872acbc520469fa85
parent7928b2cbe55b2a410a0f5c1f154610059c57b1b2 (diff)
ASoC: uniphier: evea: 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/uniphier/evea.c67
1 files changed, 33 insertions, 34 deletions
diff --git a/sound/soc/uniphier/evea.c b/sound/soc/uniphier/evea.c
index 0cc9efff1d9a..cad7e60de21d 100644
--- a/sound/soc/uniphier/evea.c
+++ b/sound/soc/uniphier/evea.c
@@ -220,8 +220,8 @@ static void evea_update_switch_all(struct evea_priv *evea)
220static int evea_get_switch_lin(struct snd_kcontrol *kcontrol, 220static int evea_get_switch_lin(struct snd_kcontrol *kcontrol,
221 struct snd_ctl_elem_value *ucontrol) 221 struct snd_ctl_elem_value *ucontrol)
222{ 222{
223 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); 223 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
224 struct evea_priv *evea = snd_soc_codec_get_drvdata(codec); 224 struct evea_priv *evea = snd_soc_component_get_drvdata(component);
225 225
226 ucontrol->value.integer.value[0] = evea->switch_lin; 226 ucontrol->value.integer.value[0] = evea->switch_lin;
227 227
@@ -231,8 +231,8 @@ static int evea_get_switch_lin(struct snd_kcontrol *kcontrol,
231static int evea_set_switch_lin(struct snd_kcontrol *kcontrol, 231static int evea_set_switch_lin(struct snd_kcontrol *kcontrol,
232 struct snd_ctl_elem_value *ucontrol) 232 struct snd_ctl_elem_value *ucontrol)
233{ 233{
234 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); 234 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
235 struct evea_priv *evea = snd_soc_codec_get_drvdata(codec); 235 struct evea_priv *evea = snd_soc_component_get_drvdata(component);
236 236
237 if (evea->switch_lin == ucontrol->value.integer.value[0]) 237 if (evea->switch_lin == ucontrol->value.integer.value[0])
238 return 0; 238 return 0;
@@ -245,8 +245,8 @@ static int evea_set_switch_lin(struct snd_kcontrol *kcontrol,
245static int evea_get_switch_lo(struct snd_kcontrol *kcontrol, 245static int evea_get_switch_lo(struct snd_kcontrol *kcontrol,
246 struct snd_ctl_elem_value *ucontrol) 246 struct snd_ctl_elem_value *ucontrol)
247{ 247{
248 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); 248 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
249 struct evea_priv *evea = snd_soc_codec_get_drvdata(codec); 249 struct evea_priv *evea = snd_soc_component_get_drvdata(component);
250 250
251 ucontrol->value.integer.value[0] = evea->switch_lo; 251 ucontrol->value.integer.value[0] = evea->switch_lo;
252 252
@@ -256,8 +256,8 @@ static int evea_get_switch_lo(struct snd_kcontrol *kcontrol,
256static int evea_set_switch_lo(struct snd_kcontrol *kcontrol, 256static int evea_set_switch_lo(struct snd_kcontrol *kcontrol,
257 struct snd_ctl_elem_value *ucontrol) 257 struct snd_ctl_elem_value *ucontrol)
258{ 258{
259 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); 259 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
260 struct evea_priv *evea = snd_soc_codec_get_drvdata(codec); 260 struct evea_priv *evea = snd_soc_component_get_drvdata(component);
261 261
262 if (evea->switch_lo == ucontrol->value.integer.value[0]) 262 if (evea->switch_lo == ucontrol->value.integer.value[0])
263 return 0; 263 return 0;
@@ -270,8 +270,8 @@ static int evea_set_switch_lo(struct snd_kcontrol *kcontrol,
270static int evea_get_switch_hp(struct snd_kcontrol *kcontrol, 270static int evea_get_switch_hp(struct snd_kcontrol *kcontrol,
271 struct snd_ctl_elem_value *ucontrol) 271 struct snd_ctl_elem_value *ucontrol)
272{ 272{
273 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); 273 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
274 struct evea_priv *evea = snd_soc_codec_get_drvdata(codec); 274 struct evea_priv *evea = snd_soc_component_get_drvdata(component);
275 275
276 ucontrol->value.integer.value[0] = evea->switch_hp; 276 ucontrol->value.integer.value[0] = evea->switch_hp;
277 277
@@ -281,8 +281,8 @@ static int evea_get_switch_hp(struct snd_kcontrol *kcontrol,
281static int evea_set_switch_hp(struct snd_kcontrol *kcontrol, 281static int evea_set_switch_hp(struct snd_kcontrol *kcontrol,
282 struct snd_ctl_elem_value *ucontrol) 282 struct snd_ctl_elem_value *ucontrol)
283{ 283{
284 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); 284 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
285 struct evea_priv *evea = snd_soc_codec_get_drvdata(codec); 285 struct evea_priv *evea = snd_soc_component_get_drvdata(component);
286 286
287 if (evea->switch_hp == ucontrol->value.integer.value[0]) 287 if (evea->switch_hp == ucontrol->value.integer.value[0])
288 return 0; 288 return 0;
@@ -301,9 +301,9 @@ static const struct snd_kcontrol_new eva_controls[] = {
301 evea_get_switch_hp, evea_set_switch_hp), 301 evea_get_switch_hp, evea_set_switch_hp),
302}; 302};
303 303
304static int evea_codec_probe(struct snd_soc_codec *codec) 304static int evea_codec_probe(struct snd_soc_component *component)
305{ 305{
306 struct evea_priv *evea = snd_soc_codec_get_drvdata(codec); 306 struct evea_priv *evea = snd_soc_component_get_drvdata(component);
307 307
308 evea->switch_lin = 1; 308 evea->switch_lin = 1;
309 evea->switch_lo = 1; 309 evea->switch_lo = 1;
@@ -315,9 +315,9 @@ static int evea_codec_probe(struct snd_soc_codec *codec)
315 return 0; 315 return 0;
316} 316}
317 317
318static int evea_codec_suspend(struct snd_soc_codec *codec) 318static int evea_codec_suspend(struct snd_soc_component *component)
319{ 319{
320 struct evea_priv *evea = snd_soc_codec_get_drvdata(codec); 320 struct evea_priv *evea = snd_soc_component_get_drvdata(component);
321 321
322 evea_set_power_state_off(evea); 322 evea_set_power_state_off(evea);
323 323
@@ -331,9 +331,9 @@ static int evea_codec_suspend(struct snd_soc_codec *codec)
331 return 0; 331 return 0;
332} 332}
333 333
334static int evea_codec_resume(struct snd_soc_codec *codec) 334static int evea_codec_resume(struct snd_soc_component *component)
335{ 335{
336 struct evea_priv *evea = snd_soc_codec_get_drvdata(codec); 336 struct evea_priv *evea = snd_soc_component_get_drvdata(component);
337 int ret; 337 int ret;
338 338
339 ret = clk_prepare_enable(evea->clk); 339 ret = clk_prepare_enable(evea->clk);
@@ -376,19 +376,20 @@ err_out_clock:
376 return ret; 376 return ret;
377} 377}
378 378
379static struct snd_soc_codec_driver soc_codec_evea = { 379static struct snd_soc_component_driver soc_codec_evea = {
380 .probe = evea_codec_probe, 380 .probe = evea_codec_probe,
381 .suspend = evea_codec_suspend, 381 .suspend = evea_codec_suspend,
382 .resume = evea_codec_resume, 382 .resume = evea_codec_resume,
383 383 .dapm_widgets = evea_widgets,
384 .component_driver = { 384 .num_dapm_widgets = ARRAY_SIZE(evea_widgets),
385 .dapm_widgets = evea_widgets, 385 .dapm_routes = evea_routes,
386 .num_dapm_widgets = ARRAY_SIZE(evea_widgets), 386 .num_dapm_routes = ARRAY_SIZE(evea_routes),
387 .dapm_routes = evea_routes, 387 .controls = eva_controls,
388 .num_dapm_routes = ARRAY_SIZE(evea_routes), 388 .num_controls = ARRAY_SIZE(eva_controls),
389 .controls = eva_controls, 389 .idle_bias_on = 1,
390 .num_controls = ARRAY_SIZE(eva_controls), 390 .use_pmdown_time = 1,
391 }, 391 .endianness = 1,
392 .non_legacy_dai_naming = 1,
392}; 393};
393 394
394static struct snd_soc_dai_driver soc_dai_evea[] = { 395static struct snd_soc_dai_driver soc_dai_evea[] = {
@@ -505,7 +506,7 @@ static int evea_probe(struct platform_device *pdev)
505 506
506 platform_set_drvdata(pdev, evea); 507 platform_set_drvdata(pdev, evea);
507 508
508 ret = snd_soc_register_codec(&pdev->dev, &soc_codec_evea, 509 ret = devm_snd_soc_register_component(&pdev->dev, &soc_codec_evea,
509 soc_dai_evea, ARRAY_SIZE(soc_dai_evea)); 510 soc_dai_evea, ARRAY_SIZE(soc_dai_evea));
510 if (ret) 511 if (ret)
511 goto err_out_reset_adamv; 512 goto err_out_reset_adamv;
@@ -534,8 +535,6 @@ static int evea_remove(struct platform_device *pdev)
534{ 535{
535 struct evea_priv *evea = platform_get_drvdata(pdev); 536 struct evea_priv *evea = platform_get_drvdata(pdev);
536 537
537 snd_soc_unregister_codec(&pdev->dev);
538
539 reset_control_assert(evea->rst_adamv); 538 reset_control_assert(evea->rst_adamv);
540 reset_control_assert(evea->rst_exiv); 539 reset_control_assert(evea->rst_exiv);
541 reset_control_assert(evea->rst); 540 reset_control_assert(evea->rst);