[alsa-devel] [PATCH 2/2] ASoC: add Component level suspend/resume

Lars-Peter Clausen lars at metafoo.de
Tue Oct 25 11:44:07 CEST 2016


On 10/25/2016 03:21 AM, Kuninori Morimoto wrote:
> 
> From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
> 
> In current ALSA SoC, Codec only has suspend/resume feature.
> But it should be supported on Component level. This patch adds it.
> This patch replaces current codec_dev_list to component_dev_list.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>


This looks good, but can you move the removal of the codec_dev_list to a
separate patch. This will make it more clear what is going on. One patch to
move suspend to component, one patch to cleanup and remove codec_dev_list.

> ---
>  include/sound/soc.h                     |  9 ++--
>  sound/soc/intel/boards/broadwell.c      | 10 +++--
>  sound/soc/intel/boards/cht_bsw_rt5672.c | 10 +++--
>  sound/soc/soc-core.c                    | 73 +++++++++++++++++++--------------
>  4 files changed, 59 insertions(+), 43 deletions(-)
[...]
>  static int broadwell_suspend(struct snd_soc_card *card){
> -	struct snd_soc_codec *codec;
> +	struct snd_soc_component *component;
>  
> -	list_for_each_entry(codec, &card->codec_dev_list, card_list) {
> +	list_for_each_entry(component, &card->component_dev_list, card_list) {
> +		struct snd_soc_codec *codec = snd_soc_component_to_codec(component);

The case should happen after the name has been matched, otherwise we are
casting components that are not CODECs. Same for the other similar places.

>  		if (!strcmp(codec->component.name, "i2c-INT343A:00")) {
>  			dev_dbg(codec->dev, "disabling jack detect before going to suspend.\n");
>  			rt286_mic_detect(codec, NULL);
> @@ -233,9 +234,10 @@ static int broadwell_suspend(struct snd_soc_card *card){
>  }



More information about the Alsa-devel mailing list