.. | .. |
---|
420 | 420 | } |
---|
421 | 421 | EXPORT_SYMBOL_GPL(uniphier_aio_dai_remove); |
---|
422 | 422 | |
---|
423 | | -int uniphier_aio_dai_suspend(struct snd_soc_dai *dai) |
---|
| 423 | +static void uniphier_aio_dai_suspend(struct snd_soc_dai *dai) |
---|
424 | 424 | { |
---|
425 | 425 | struct uniphier_aio *aio = uniphier_priv(dai); |
---|
| 426 | + |
---|
| 427 | + if (!snd_soc_dai_active(dai)) |
---|
| 428 | + return; |
---|
426 | 429 | |
---|
427 | 430 | aio->chip->num_wup_aios--; |
---|
428 | 431 | if (!aio->chip->num_wup_aios) { |
---|
429 | 432 | reset_control_assert(aio->chip->rst); |
---|
430 | 433 | clk_disable_unprepare(aio->chip->clk); |
---|
431 | 434 | } |
---|
| 435 | +} |
---|
432 | 436 | |
---|
| 437 | +static int uniphier_aio_suspend(struct snd_soc_component *component) |
---|
| 438 | +{ |
---|
| 439 | + struct snd_soc_dai *dai; |
---|
| 440 | + |
---|
| 441 | + for_each_component_dais(component, dai) |
---|
| 442 | + uniphier_aio_dai_suspend(dai); |
---|
433 | 443 | return 0; |
---|
434 | 444 | } |
---|
435 | | -EXPORT_SYMBOL_GPL(uniphier_aio_dai_suspend); |
---|
436 | 445 | |
---|
437 | | -int uniphier_aio_dai_resume(struct snd_soc_dai *dai) |
---|
| 446 | +static int uniphier_aio_dai_resume(struct snd_soc_dai *dai) |
---|
438 | 447 | { |
---|
439 | 448 | struct uniphier_aio *aio = uniphier_priv(dai); |
---|
440 | 449 | int ret, i; |
---|
| 450 | + |
---|
| 451 | + if (!snd_soc_dai_active(dai)) |
---|
| 452 | + return 0; |
---|
441 | 453 | |
---|
442 | 454 | if (!aio->chip->active) |
---|
443 | 455 | return 0; |
---|
.. | .. |
---|
484 | 496 | |
---|
485 | 497 | return ret; |
---|
486 | 498 | } |
---|
487 | | -EXPORT_SYMBOL_GPL(uniphier_aio_dai_resume); |
---|
| 499 | + |
---|
| 500 | +static int uniphier_aio_resume(struct snd_soc_component *component) |
---|
| 501 | +{ |
---|
| 502 | + struct snd_soc_dai *dai; |
---|
| 503 | + int ret = 0; |
---|
| 504 | + |
---|
| 505 | + for_each_component_dais(component, dai) |
---|
| 506 | + ret |= uniphier_aio_dai_resume(dai); |
---|
| 507 | + return ret; |
---|
| 508 | +} |
---|
488 | 509 | |
---|
489 | 510 | static int uniphier_aio_vol_info(struct snd_kcontrol *kcontrol, |
---|
490 | 511 | struct snd_ctl_elem_info *uinfo) |
---|
.. | .. |
---|
596 | 617 | .name = "uniphier-aio", |
---|
597 | 618 | .controls = uniphier_aio_controls, |
---|
598 | 619 | .num_controls = ARRAY_SIZE(uniphier_aio_controls), |
---|
| 620 | + .suspend = uniphier_aio_suspend, |
---|
| 621 | + .resume = uniphier_aio_resume, |
---|
599 | 622 | }; |
---|
600 | 623 | |
---|
601 | 624 | int uniphier_aio_probe(struct platform_device *pdev) |
---|