Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Cezary Rojewski <cezary.rojewski@intel.com>,
	alsa-devel@alsa-project.org,  broonie@kernel.org
Cc: hdegoede@redhat.com, tiwai@suse.com, amadeuszx.slawinski@linux.intel.com
Subject: Re: [PATCH 09/17] ASoC: Intel: bdw_rt286: Reword prefixes of all driver members
Date: Fri, 10 Jun 2022 11:34:23 -0500	[thread overview]
Message-ID: <59f2fd76-ac1e-9fdf-401b-2c09e5be8cc8@linux.intel.com> (raw)
In-Reply-To: <20220610123627.1339985-10-cezary.rojewski@intel.com>



On 6/10/22 07:36, Cezary Rojewski wrote:
> Replace ambiguous 'broadwell_rt286_' prefixes in favour of 'card_',
> 'link_' and other similar strings to clearly state which object given
> member implements behavior for.
> 
> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
> Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>

This doesn't apply or assumes something else was applied already?

> ---
>  sound/soc/intel/boards/bdw_rt286.c | 96 +++++++++++++++---------------
>  1 file changed, 48 insertions(+), 48 deletions(-)
> 
> diff --git a/sound/soc/intel/boards/bdw_rt286.c b/sound/soc/intel/boards/bdw_rt286.c
> index b29d77dfb281..092bc9a45548 100644
> --- a/sound/soc/intel/boards/bdw_rt286.c
> +++ b/sound/soc/intel/boards/bdw_rt286.c
> @@ -16,9 +16,9 @@
>  
>  #include "../../codecs/rt286.h"
>  
> -static struct snd_soc_jack broadwell_headset;
> +static struct snd_soc_jack card_headset;
>  /* Headset jack detection DAPM pins */
> -static struct snd_soc_jack_pin broadwell_headset_pins[] = {
> +static struct snd_soc_jack_pin card_headset_pins[] = {
>  	{
>  		.pin = "Mic Jack",
>  		.mask = SND_JACK_MICROPHONE,
> @@ -29,12 +29,12 @@ static struct snd_soc_jack_pin broadwell_headset_pins[] = {
>  	},
>  };
>  
> -static const struct snd_kcontrol_new broadwell_controls[] = {
> +static const struct snd_kcontrol_new card_controls[] = {
>  	SOC_DAPM_PIN_SWITCH("Speaker"),
>  	SOC_DAPM_PIN_SWITCH("Headphone Jack"),
>  };
>  
> -static const struct snd_soc_dapm_widget broadwell_widgets[] = {
> +static const struct snd_soc_dapm_widget card_widgets[] = {
>  	SND_SOC_DAPM_HP("Headphone Jack", NULL),
>  	SND_SOC_DAPM_SPK("Speaker", NULL),
>  	SND_SOC_DAPM_MIC("Mic Jack", NULL),
> @@ -43,7 +43,7 @@ static const struct snd_soc_dapm_widget broadwell_widgets[] = {
>  	SND_SOC_DAPM_LINE("Line Jack", NULL),
>  };
>  
> -static const struct snd_soc_dapm_route broadwell_rt286_map[] = {
> +static const struct snd_soc_dapm_route card_routes[] = {
>  
>  	/* speaker */
>  	{"Speaker", NULL, "SPOR"},
> @@ -65,22 +65,22 @@ static const struct snd_soc_dapm_route broadwell_rt286_map[] = {
>  	{"AIF1 Playback", NULL, "SSP0 CODEC OUT"},
>  };
>  
> -static int broadwell_rt286_codec_init(struct snd_soc_pcm_runtime *rtd)
> +static int codec_link_init(struct snd_soc_pcm_runtime *rtd)
>  {
>  	struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
>  	int ret = 0;
>  	ret = snd_soc_card_jack_new_pins(rtd->card, "Headset",
> -		SND_JACK_HEADSET | SND_JACK_BTN_0, &broadwell_headset,
> -		broadwell_headset_pins, ARRAY_SIZE(broadwell_headset_pins));
> +		SND_JACK_HEADSET | SND_JACK_BTN_0, &card_headset,
> +		card_headset_pins, ARRAY_SIZE(card_headset_pins));
>  	if (ret)
>  		return ret;
>  
> -	rt286_mic_detect(component, &broadwell_headset);
> +	rt286_mic_detect(component, &card_headset);
>  	return 0;
>  }
>  
>  
> -static int broadwell_ssp0_fixup(struct snd_soc_pcm_runtime *rtd,
> +static int codec_link_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
>  			struct snd_pcm_hw_params *params)
>  {
>  	struct snd_interval *rate = hw_param_interval(params,
> @@ -97,7 +97,7 @@ static int broadwell_ssp0_fixup(struct snd_soc_pcm_runtime *rtd,
>  	return 0;
>  }
>  
> -static int broadwell_rt286_hw_params(struct snd_pcm_substream *substream,
> +static int codec_link_hw_params(struct snd_pcm_substream *substream,
>  	struct snd_pcm_hw_params *params)
>  {
>  	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
> @@ -115,8 +115,8 @@ static int broadwell_rt286_hw_params(struct snd_pcm_substream *substream,
>  	return ret;
>  }
>  
> -static const struct snd_soc_ops broadwell_rt286_ops = {
> -	.hw_params = broadwell_rt286_hw_params,
> +static const struct snd_soc_ops codec_link_ops = {
> +	.hw_params = codec_link_hw_params,
>  };
>  
>  static const unsigned int channels[] = {
> @@ -129,7 +129,7 @@ static const struct snd_pcm_hw_constraint_list constraints_channels = {
>  	.mask = 0,
>  };
>  
> -static int broadwell_fe_startup(struct snd_pcm_substream *substream)
> +static int bdw_rt286_fe_startup(struct snd_pcm_substream *substream)
>  {
>  	struct snd_pcm_runtime *runtime = substream->runtime;
>  
> @@ -140,8 +140,8 @@ static int broadwell_fe_startup(struct snd_pcm_substream *substream)
>  					  &constraints_channels);
>  }
>  
> -static const struct snd_soc_ops broadwell_fe_ops = {
> -	.startup = broadwell_fe_startup,
> +static const struct snd_soc_ops bdw_rt286_fe_ops = {
> +	.startup = bdw_rt286_fe_startup,
>  };
>  
>  SND_SOC_DAILINK_DEF(system,
> @@ -169,7 +169,7 @@ SND_SOC_DAILINK_DEF(ssp0_port,
>  	    DAILINK_COMP_ARRAY(COMP_CPU("ssp0-port")));
>  
>  /* broadwell digital audio interface glue - connects codec <--> CPU */
> -static struct snd_soc_dai_link broadwell_rt286_dais[] = {
> +static struct snd_soc_dai_link card_dai_links[] = {
>  	/* Front End DAI links */
>  	{
>  		.name = "System PCM",
> @@ -177,7 +177,7 @@ static struct snd_soc_dai_link broadwell_rt286_dais[] = {
>  		.nonatomic = 1,
>  		.dynamic = 1,
>  		.trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
> -		.ops = &broadwell_fe_ops,
> +		.ops = &bdw_rt286_fe_ops,
>  		.dpcm_playback = 1,
>  		.dpcm_capture = 1,
>  		SND_SOC_DAILINK_REG(system, dummy, platform),
> @@ -215,12 +215,12 @@ static struct snd_soc_dai_link broadwell_rt286_dais[] = {
>  		.name = "Codec",
>  		.id = 0,
>  		.no_pcm = 1,
> -		.init = broadwell_rt286_codec_init,
> +		.init = codec_link_init,
>  		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
>  			SND_SOC_DAIFMT_CBC_CFC,
>  		.ignore_pmdown_time = 1,
> -		.be_hw_params_fixup = broadwell_ssp0_fixup,
> -		.ops = &broadwell_rt286_ops,
> +		.be_hw_params_fixup = codec_link_hw_params_fixup,
> +		.ops = &codec_link_ops,
>  		.dpcm_playback = 1,
>  		.dpcm_capture = 1,
>  		SND_SOC_DAILINK_REG(ssp0_port, codec, platform),
> @@ -241,21 +241,21 @@ static void broadwell_disable_jack(struct snd_soc_card *card)
>  	}
>  }
>  
> -static int broadwell_suspend(struct snd_soc_card *card)
> +static int card_suspend_pre(struct snd_soc_card *card)
>  {
>  	broadwell_disable_jack(card);
>  
>  	return 0;
>  }
>  
> -static int broadwell_resume(struct snd_soc_card *card){
> +static int card_resume_post(struct snd_soc_card *card){
>  	struct snd_soc_component *component;
>  
>  	for_each_card_components(card, component) {
>  		if (!strcmp(component->name, "i2c-INT343A:00")) {
>  
>  			dev_dbg(component->dev, "enabling jack detect for resume.\n");
> -			rt286_mic_detect(component, &broadwell_headset);
> +			rt286_mic_detect(component, &card_headset);
>  			break;
>  		}
>  	}
> @@ -270,48 +270,48 @@ static int broadwell_resume(struct snd_soc_card *card){
>  #define DRIVER_NAME NULL /* card name will be used for driver name */
>  
>  /* broadwell audio machine driver for WPT + RT286S */
> -static struct snd_soc_card broadwell_rt286 = {
> +static struct snd_soc_card bdw_rt286_card = {
>  	.owner = THIS_MODULE,
> -	.dai_link = broadwell_rt286_dais,
> -	.num_links = ARRAY_SIZE(broadwell_rt286_dais),
> -	.controls = broadwell_controls,
> -	.num_controls = ARRAY_SIZE(broadwell_controls),
> -	.dapm_widgets = broadwell_widgets,
> -	.num_dapm_widgets = ARRAY_SIZE(broadwell_widgets),
> -	.dapm_routes = broadwell_rt286_map,
> -	.num_dapm_routes = ARRAY_SIZE(broadwell_rt286_map),
> +	.dai_link = card_dai_links,
> +	.num_links = ARRAY_SIZE(card_dai_links),
> +	.controls = card_controls,
> +	.num_controls = ARRAY_SIZE(card_controls),
> +	.dapm_widgets = card_widgets,
> +	.num_dapm_widgets = ARRAY_SIZE(card_widgets),
> +	.dapm_routes = card_routes,
> +	.num_dapm_routes = ARRAY_SIZE(card_routes),
>  	.fully_routed = true,
> -	.suspend_pre = broadwell_suspend,
> -	.resume_post = broadwell_resume,
> +	.suspend_pre = card_suspend_pre,
> +	.resume_post = card_resume_post,
>  };
>  
> -static int broadwell_audio_probe(struct platform_device *pdev)
> +static int bdw_rt286_probe(struct platform_device *pdev)
>  {
>  	struct snd_soc_acpi_mach *mach;
>  	int ret;
>  
> -	broadwell_rt286.dev = &pdev->dev;
> +	bdw_rt286_card.dev = &pdev->dev;
>  
>  	/* override platform name, if required */
>  	mach = pdev->dev.platform_data;
> -	ret = snd_soc_fixup_dai_links_platform_name(&broadwell_rt286,
> +	ret = snd_soc_fixup_dai_links_platform_name(&bdw_rt286_card,
>  						    mach->mach_params.platform);
>  	if (ret)
>  		return ret;
>  
>  	/* set card and driver name */
>  	if (snd_soc_acpi_sof_parent(&pdev->dev)) {
> -		broadwell_rt286.name = SOF_CARD_NAME;
> -		broadwell_rt286.driver_name = SOF_DRIVER_NAME;
> +		bdw_rt286_card.name = SOF_CARD_NAME;
> +		bdw_rt286_card.driver_name = SOF_DRIVER_NAME;
>  	} else {
> -		broadwell_rt286.name = CARD_NAME;
> -		broadwell_rt286.driver_name = DRIVER_NAME;
> +		bdw_rt286_card.name = CARD_NAME;
> +		bdw_rt286_card.driver_name = DRIVER_NAME;
>  	}
>  
> -	return devm_snd_soc_register_card(&pdev->dev, &broadwell_rt286);
> +	return devm_snd_soc_register_card(&pdev->dev, &bdw_rt286_card);
>  }
>  
> -static int broadwell_audio_remove(struct platform_device *pdev)
> +static int bdw_rt286_remove(struct platform_device *pdev)
>  {
>  	struct snd_soc_card *card = platform_get_drvdata(pdev);
>  
> @@ -320,16 +320,16 @@ static int broadwell_audio_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static struct platform_driver broadwell_audio = {
> -	.probe = broadwell_audio_probe,
> -	.remove = broadwell_audio_remove,
> +static struct platform_driver bdw_rt286_driver = {
> +	.probe = bdw_rt286_probe,
> +	.remove = bdw_rt286_remove,
>  	.driver = {
>  		.name = "broadwell-audio",
>  		.pm = &snd_soc_pm_ops
>  	},
>  };
>  
> -module_platform_driver(broadwell_audio)
> +module_platform_driver(bdw_rt286_driver)
>  
>  /* Module information */
>  MODULE_AUTHOR("Liam Girdwood, Xingchao Wang");

  reply	other threads:[~2022-06-10 16:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10 12:36 [PATCH 00/17] ASoC: Intel: haswell and broadwell boards update Cezary Rojewski
2022-06-10 12:36 ` [PATCH 01/17] ASoC: Intel: Rename haswell source file to hsw_rt5640 Cezary Rojewski
2022-06-10 12:36 ` [PATCH 02/17] ASoC: Intel: hsw_rt5640: Reword prefixes of all driver members Cezary Rojewski
2022-06-10 13:11   ` Cezary Rojewski
2022-06-10 12:36 ` [PATCH 03/17] ASoC: Intel: hsw_rt5640: Reword driver name Cezary Rojewski
2022-06-10 12:36 ` [PATCH 04/17] ASoC: Intel: hsw_rt5640: Update code indentation Cezary Rojewski
2022-06-10 12:36 ` [PATCH 05/17] ASoC: Intel: hsw_rt5640: Update file comments Cezary Rojewski
2022-06-10 12:36 ` [PATCH 06/17] ASoC: Intel: hsw_rt5640: Improve probe() function quality Cezary Rojewski
2022-06-10 12:36 ` [PATCH 07/17] ASoC: Intel: hsw_rt5640: Improve hw_params() debug-ability Cezary Rojewski
2022-06-10 12:36 ` [PATCH 08/17] ASoC: Intel: Rename broadwell source file to bdw_rt286 Cezary Rojewski
2022-06-10 12:36 ` [PATCH 09/17] ASoC: Intel: bdw_rt286: Reword prefixes of all driver members Cezary Rojewski
2022-06-10 16:34   ` Pierre-Louis Bossart [this message]
2022-06-10 17:25     ` Cezary Rojewski
2022-06-10 12:36 ` [PATCH 10/17] ASoC: Intel: bdw_rt286: Reword driver name Cezary Rojewski
2022-06-10 12:36 ` [PATCH 11/17] ASoC: Intel: bdw_rt286: Update code indentation Cezary Rojewski
2022-06-10 12:36 ` [PATCH 12/17] ASoC: Intel: bdw_rt286: Update file comments Cezary Rojewski
2022-06-10 12:36 ` [PATCH 13/17] ASoC: Intel: bdw_rt286: Improve probe() function quality Cezary Rojewski
2022-06-10 12:36 ` [PATCH 14/17] ASoC: Intel: bdw_rt286: Improve hw_params() debug-ability Cezary Rojewski
2022-06-10 12:36 ` [PATCH 15/17] ASoC: Intel: bdw_rt286: Improve codec_init() quality Cezary Rojewski
2022-06-10 12:36 ` [PATCH 16/17] ASoC: Intel: bdw_rt286: Refactor suspend/resume Cezary Rojewski
2022-06-10 12:36 ` [PATCH 17/17] ASoC: Intel: bdw_rt286: Remove FE DAI ops Cezary Rojewski
2022-06-10 17:33 ` [PATCH 00/17] ASoC: Intel: haswell and broadwell boards update Cezary Rojewski
2022-06-10 18:48   ` Pierre-Louis Bossart
2022-06-13  9:52     ` Cezary Rojewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=59f2fd76-ac1e-9fdf-401b-2c09e5be8cc8@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=hdegoede@redhat.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox