All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	alsa-devel@alsa-project.org
Cc: tiwai@suse.de, broonie@kernel.org
Subject: Re: [PATCH 01/14] ASoC: Intel: boards: use devm_clk_get() unconditionally
Date: Wed, 23 Aug 2017 17:22:11 +0300	[thread overview]
Message-ID: <1503498131.25945.66.camel@linux.intel.com> (raw)
In-Reply-To: <20170822203239.19891-2-pierre-louis.bossart@linux.intel.com>

On Tue, 2017-08-22 at 15:32 -0500, Pierre-Louis Bossart wrote:
> The clock framework was only used in Baytrail, on Cherrytrail
> the firmware takes care of the MCLK/plt_clk_3.
> 
> With the fix in 'commit d31fd43c0f9a
> ("clk: x86: Do not gate clocks enabled by the firmware")'
> 
> the firmware-managed clocks are not impacted by enable/disable
> requests make at the driver level, and the rates are identical.
> 
> Remove all checks for Baytrail and use devm_clk_get()
> unconditionally. Tested on Asus T100HA (CHT) and Asus T100TAF (BYT)
> 
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Pierre-Louis Bossart <pierre-
> louis.bossart@linux.intel.com>

It's a good clean up! (I believe it had been tested on CHT platforms as
well)

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

P.S. Shouldn't the corresponding asm/cpu_device_id.h header, or some
other(s), be removed from inclusion as well?

> ---
>  sound/soc/intel/boards/bytcr_rt5640.c   |  2 +-
>  sound/soc/intel/boards/cht_bsw_rt5645.c | 14 ++++++--------
>  sound/soc/intel/boards/cht_bsw_rt5672.c | 26 ++++++----------------
> ----
>  3 files changed, 13 insertions(+), 29 deletions(-)
> 
> diff --git a/sound/soc/intel/boards/bytcr_rt5640.c
> b/sound/soc/intel/boards/bytcr_rt5640.c
> index 4a76b09..15b1e29 100644
> --- a/sound/soc/intel/boards/bytcr_rt5640.c
> +++ b/sound/soc/intel/boards/bytcr_rt5640.c
> @@ -891,7 +891,7 @@ static int snd_byt_rt5640_mc_probe(struct
> platform_device *pdev)
>  			byt_rt5640_cpu_dai_name;
>  	}
>  
> -	if ((byt_rt5640_quirk & BYT_RT5640_MCLK_EN) &&
> (is_valleyview())) {
> +	if (byt_rt5640_quirk & BYT_RT5640_MCLK_EN) {
>  		priv->mclk = devm_clk_get(&pdev->dev,
> "pmc_plt_clk_3");
>  		if (IS_ERR(priv->mclk)) {
>  			ret_val = PTR_ERR(priv->mclk);
> diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c
> b/sound/soc/intel/boards/cht_bsw_rt5645.c
> index 5bcde01..d553e2b 100644
> --- a/sound/soc/intel/boards/cht_bsw_rt5645.c
> +++ b/sound/soc/intel/boards/cht_bsw_rt5645.c
> @@ -682,14 +682,12 @@ static int snd_cht_mc_probe(struct
> platform_device *pdev)
>  			cht_rt5645_cpu_dai_name;
>  	}
>  
> -	if (is_valleyview()) {
> -		drv->mclk = devm_clk_get(&pdev->dev,
> "pmc_plt_clk_3");
> -		if (IS_ERR(drv->mclk)) {
> -			dev_err(&pdev->dev,
> -				"Failed to get MCLK from
> pmc_plt_clk_3: %ld\n",
> -				PTR_ERR(drv->mclk));
> -			return PTR_ERR(drv->mclk);
> -		}
> +	drv->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");
> +	if (IS_ERR(drv->mclk)) {
> +		dev_err(&pdev->dev,
> +			"Failed to get MCLK from pmc_plt_clk_3:
> %ld\n",
> +			PTR_ERR(drv->mclk));
> +		return PTR_ERR(drv->mclk);
>  	}
>  
>  	snd_soc_card_set_drvdata(card, drv);
> diff --git a/sound/soc/intel/boards/cht_bsw_rt5672.c
> b/sound/soc/intel/boards/cht_bsw_rt5672.c
> index f597d55..ad2f27e 100644
> --- a/sound/soc/intel/boards/cht_bsw_rt5672.c
> +++ b/sound/soc/intel/boards/cht_bsw_rt5672.c
> @@ -394,18 +394,6 @@ static struct snd_soc_card snd_soc_card_cht = {
>  	.resume_post = cht_resume_post,
>  };
>  
> -static bool is_valleyview(void)
> -{
> -	static const struct x86_cpu_id cpu_ids[] = {
> -		{ X86_VENDOR_INTEL, 6, 55 }, /* Valleyview, Bay Trail
> */
> -		{}
> -	};
> -
> -	if (!x86_match_cpu(cpu_ids))
> -		return false;
> -	return true;
> -}
> -
>  #define RT5672_I2C_DEFAULT	"i2c-10EC5670:00"
>  
>  static int snd_cht_mc_probe(struct platform_device *pdev)
> @@ -439,14 +427,12 @@ static int snd_cht_mc_probe(struct
> platform_device *pdev)
>  		}
>  	}
>  
> -	if (is_valleyview()) {
> -		drv->mclk = devm_clk_get(&pdev->dev,
> "pmc_plt_clk_3");
> -		if (IS_ERR(drv->mclk)) {
> -			dev_err(&pdev->dev,
> -				"Failed to get MCLK from
> pmc_plt_clk_3: %ld\n",
> -				PTR_ERR(drv->mclk));
> -			return PTR_ERR(drv->mclk);
> -		}
> +	drv->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");
> +	if (IS_ERR(drv->mclk)) {
> +		dev_err(&pdev->dev,
> +			"Failed to get MCLK from pmc_plt_clk_3:
> %ld\n",
> +			PTR_ERR(drv->mclk));
> +		return PTR_ERR(drv->mclk);
>  	}
>  	snd_soc_card_set_drvdata(&snd_soc_card_cht, drv);
>  

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2017-08-23 14:23 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-22 20:32 [PATCH 00/14] BYT/CHT codec/machine drivers update Pierre-Louis Bossart
2017-08-22 20:32 ` [PATCH 01/14] ASoC: Intel: boards: use devm_clk_get() unconditionally Pierre-Louis Bossart
2017-08-23 14:22   ` Andy Shevchenko [this message]
2017-08-22 20:32 ` [PATCH 02/14] ASoC: intel: cht_bsw_max98090: add support for clock framework Pierre-Louis Bossart
2017-08-22 20:32 ` [PATCH 03/14] ASoC: Intel: cht_bsw_max98090: Fix I2S config + unused code Pierre-Louis Bossart
2017-09-19 13:45   ` Applied "ASoC: Intel: cht_bsw_max98090: Fix I2S config + unused code" to the asoc tree Mark Brown
2017-08-22 20:32 ` [PATCH 04/14] ASoc: cht_bsw_max98090_ti: Fix jack initialization Pierre-Louis Bossart
2017-08-22 20:32 ` [PATCH 05/14] ASoC: ts3a227e: add acpi table Pierre-Louis Bossart
2017-08-23 11:19   ` Mark Brown
2017-08-22 20:32 ` [PATCH 06/14] ASoC: Intel: atom: add support for Baytrail Chromebooks Pierre-Louis Bossart
2017-09-19 13:45   ` Applied "ASoC: Intel: atom: use cht_bsw_max98090 for Baytrail Chromebooks" to the asoc tree Mark Brown
2017-08-22 20:32 ` [PATCH 07/14] ASoC: Intel: bytcr-rt5651: fix capture routes Pierre-Louis Bossart
2017-09-19 13:46   ` Applied "ASoC: Intel: bytcr-rt5651: fix capture routes" to the asoc tree Mark Brown
2017-08-22 20:32 ` [PATCH 08/14] ASoC: Intel: bytcr_rt5651: add MCLK support Pierre-Louis Bossart
2017-08-22 20:32 ` [PATCH 09/14] ASoC: Intel: bytcr_rt5651: filter codec name Pierre-Louis Bossart
2017-08-22 20:32 ` [PATCH 10/14] ASoC: codecs: rt5645: add quirks for Asus T100HA Pierre-Louis Bossart
2017-08-23 11:24   ` Applied "ASoC: codecs: rt5645: add quirks for Asus T100HA" to the asoc tree Mark Brown
2017-08-22 20:32 ` [PATCH 11/14] ASoC: Intel: bytcr_rt5640: simplify MCLK quirk tests Pierre-Louis Bossart
2017-09-19 13:45   ` Applied "ASoC: Intel: bytcr_rt5640: simplify MCLK quirk tests" to the asoc tree Mark Brown
2017-08-22 20:32 ` [PATCH 12/14] ASoC: codecs: rt5670: add jack detection quirk for Dell Venue 5585 Pierre-Louis Bossart
2017-08-23 11:24   ` Applied "ASoC: codecs: rt5670: add jack detection quirk for Dell Venue 5585" to the asoc tree Mark Brown
2017-08-22 20:32 ` [PATCH 13/14] ASoC: Intel: cht_bsw_rt5672: use actual HID in suspend/resume Pierre-Louis Bossart
2017-09-25 16:16   ` Applied "ASoC: Intel: cht_bsw_rt5672: use actual HID in suspend/resume" to the asoc tree Mark Brown
2017-08-22 20:32 ` [PATCH 14/14] ASoC: Intel: cht_bsw_rt5672: fix card name Pierre-Louis Bossart
2017-09-25 16:16   ` Applied "ASoC: Intel: cht_bsw_rt5672: fix card name" to the asoc tree Mark Brown
2017-08-28 11:38 ` [PATCH 00/14] BYT/CHT codec/machine drivers update Pierre-Louis Bossart
2017-08-29 18:34   ` Mark Brown
2017-08-29 18:51     ` Pierre-Louis Bossart

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=1503498131.25945.66.camel@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.