ASoC: Intel: cht_bsw_rt5645: Add quirk for boards using pmc_plt_clk_0
Subsystems (3)
PATCH v2 1/1 ASoC: Intel: cht_bsw_rt5645: Add quirk for boards using pmc_plt_clk_0
As of commit 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL"), the cht_bsw_rt5645 driver needs to enable the clock it's using for the codec's mclk. It does this from commit 7735bce05a9c ("ASoC: Intel: boards: use devm_clk_get() unconditionally"), enabling pmc_plt_clk_3. However, Strago family Chromebooks use pmc_plt_clk_0 for the codec mclk, resulting in white noise with some digital microphones. Add a DMI-based quirk for Strago family Chromebooks to use pmc_plt_clk_0 instead - mirroring the changes made to cht_bsw_max98090_ti in commit a182ecd3809c ("ASoC: intel: cht_bsw_max98090_ti: Add quirk for boards using pmc_plt_clk_0") and making use of the existing dmi_check_system() call and related infrastructure added in commit 22af29114eb4 ("ASoC: Intel: cht-bsw-rt5645: add quirks for SSP0/AIF1/AIF2 routing").
---
Changes in v2:
- Added to the description references to more related commits (similar cht_bsw_max98090_ti clock quirks inspiring this change and and the cht_bsw_rt5645 quirks setup)
sound/soc/intel/boards/cht_bsw_rt5645.c | 26 +++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-)
sound/soc/intel/boards/cht_bsw_rt5645.c +20 -6
@@ -48,6 +48,7 @@ struct cht_mc_private {#define CHT_RT5645_SSP2_AIF2 BIT(16)/* default is using AIF1 */ #define CHT_RT5645_SSP0_AIF1 BIT(17)#define CHT_RT5645_SSP0_AIF2 BIT(18) +#define CHT_RT5645_PMC_PLT_CLK_0 BIT(19)static unsigned long cht_rt5645_quirk =0 ;
@@ -59,6 +60,8 @@ static void log_quirks(struct device *dev)dev_info (dev,"quirk SSP0_AIF1 enabled" );if (cht_rt5645_quirk &CHT_RT5645_SSP0_AIF2 )dev_info (dev,"quirk SSP0_AIF2 enabled" ); +if (cht_rt5645_quirk &CHT_RT5645_PMC_PLT_CLK_0 ) +dev_info (dev,"quirk PMC_PLT_CLK_0 enabled" ); } static int platform_clock_control(struct snd_soc_dapm_widget *w,
@@ -226,15 +229,21 @@ static int cht_aif1_hw_params(struct snd_pcm_substream *substream,return 0 ; } -/* uncomment when we have a real quirk static int cht_rt5645_quirk_cb (const struct dmi_system_id *id) { cht_rt5645_quirk = (unsigned long )id->driver_data;return 1 ; } -*/ static const struct dmi_system_id cht_rt5645_quirk_table[] = { + { +/* Strago family Chromebooks */ + .callback = cht_rt5645_quirk_cb, + .matches = { +DMI_MATCH (DMI_PRODUCT_FAMILY ,"Intel_Strago" ), + }, + .driver_data = (void *)CHT_RT5645_PMC_PLT_CLK_0 , + }, { }, };
@@ -526,6 +535,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)int dai_index =0 ;int ret_val =0 ;int i; +const char *mclk_name; drv =devm_kzalloc (&pdev->dev,sizeof (*drv),GFP_KERNEL );if (!drv)
@@ -662,11 +672,15 @@ static int snd_cht_mc_probe(struct platform_device *pdev)if (ret_val)return ret_val; - drv->mclk =devm_clk_get (&pdev->dev,"pmc_plt_clk_3" ); +if (cht_rt5645_quirk &CHT_RT5645_PMC_PLT_CLK_0 ) + mclk_name ="pmc_plt_clk_0" ; +else + mclk_name ="pmc_plt_clk_3" ; + + drv->mclk =devm_clk_get (&pdev->dev, mclk_name);if (IS_ERR (drv->mclk)) { -dev_err (&pdev->dev, -"Failed to get MCLK from pmc_plt_clk_3: %ld\n" , -PTR_ERR (drv->mclk)); +dev_err (&pdev->dev,"Failed to get MCLK from %s: %ld\n" , + mclk_name,PTR_ERR (drv->mclk));return PTR_ERR (drv->mclk); }
Signature · 6 lines
2.23.0.237.gc6a4ce50a0-goog _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Quoted 14 lines · Sam McNally
As of commit
648e921888ad("clk: x86: Stop marking clocks asCLK_IS_CRITICAL"), thecht_bsw_rt5645driver needs to enable the clock it's using for the codec's mclk. It does this from commit7735bce05a9c("ASoC: Intel: boards: usedevm_clk_get()unconditionally"), enablingpmc_plt_clk_3. However, Strago family Chromebooks usepmc_plt_clk_0for the codec mclk, resulting in white noise with some digital microphones. Add a DMI-based quirk for Strago family Chromebooks to usepmc_plt_clk_0instead - mirroring the changes made tocht_bsw_max98090_tiin commita182ecd3809c("ASoC: intel:cht_bsw_max98090_ti: Add quirk for boards usingpmc_plt_clk_0") and making use of the existingdmi_check_system()call and related infrastructure added in commit22af29114eb4("ASoC: Intel: cht-bsw-rt5645: add quirks for SSP0/AIF1/AIF2 routing").
Quoted 1 line
Signed-off-by Sam McNally <[email protected]>
Looks good to me, thanks for the patch
Quoted 74 lines
---
Changes in v2:
- Added to the description references to more related commits (similarcht_bsw_max98090_ticlock quirks inspiring this change and and thecht_bsw_rt5645quirks setup)sound/soc/intel/boards/cht_bsw_rt5645.c | 26 +++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-)sound/soc/intel/boards/cht_bsw_rt5645.c +17
-3@@ -48,6 +48,7 @@ struct cht_mc_private {#define CHT_RT5645_SSP2_AIF2 BIT(16)/* default is using AIF1 */ #define CHT_RT5645_SSP0_AIF1 BIT(17)#define CHT_RT5645_SSP0_AIF2 BIT(18) +#define CHT_RT5645_PMC_PLT_CLK_0 BIT(19)static unsigned long cht_rt5645_quirk =0 ;@@ -59,6 +60,8 @@ static void log_quirks(struct device *dev)dev_info (dev,"quirk SSP0_AIF1 enabled" );if (cht_rt5645_quirk &CHT_RT5645_SSP0_AIF2 )dev_info (dev,"quirk SSP0_AIF2 enabled" ); +if (cht_rt5645_quirk &CHT_RT5645_PMC_PLT_CLK_0 ) +dev_info (dev,"quirk PMC_PLT_CLK_0 enabled" ); } static int platform_clock_control(struct snd_soc_dapm_widget *w,@@ -226,15 +229,21 @@ static int cht_aif1_hw_params(struct snd_pcm_substream *substream,return 0 ; } -/* uncomment when we have a real quirk static int cht_rt5645_quirk_cb (const struct dmi_system_id *id) { cht_rt5645_quirk = (unsigned long )id->driver_data;return 1 ; } -*/ static const struct dmi_system_id cht_rt5645_quirk_table[] = { + { +/* Strago family Chromebooks */ + .callback = cht_rt5645_quirk_cb, + .matches = { +DMI_MATCH (DMI_PRODUCT_FAMILY ,"Intel_Strago" ), + }, + .driver_data = (void *)CHT_RT5645_PMC_PLT_CLK_0 , + }, { }, };@@ -526,6 +535,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)int dai_index =0 ;int ret_val =0 ;int i; +const char *mclk_name; drv =devm_kzalloc (&pdev->dev,sizeof (*drv),GFP_KERNEL );if (!drv)@@ -662,11 +672,15 @@ static int snd_cht_mc_probe(struct platform_device *pdev)if (ret_val)return ret_val; - drv->mclk =devm_clk_get (&pdev->dev,"pmc_plt_clk_3" ); +if (cht_rt5645_quirk &CHT_RT5645_PMC_PLT_CLK_0 ) + mclk_name ="pmc_plt_clk_0" ; +else + mclk_name ="pmc_plt_clk_3" ; +
sound/soc/intel/boards/cht_bsw_rt5645.c static int snd_cht_mc_probe(struct platform_device *pdev) · line 686
Quoted 10 lines
sound/soc/intel/boards/cht_bsw_rt5645.c +3
-3+ drv->mclk =devm_clk_get (&pdev->dev, mclk_name);if (IS_ERR (drv->mclk)) { -dev_err (&pdev->dev, -"Failed to get MCLK from pmc_plt_clk_3: %ld\n" , -PTR_ERR (drv->mclk)); +dev_err (&pdev->dev,"Failed to get MCLK from %s: %ld\n" , + mclk_name,PTR_ERR (drv->mclk));return PTR_ERR (drv->mclk); }
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainer[alsa-devel] Applied "ASoC: Intel: cht_bsw_rt5645: Add quirk for boards using pmc_plt_clk_0" to the asoc tree
In reply to Sam McNallyThe patch
ASoC: Intel: cht_bsw_rt5645: Add quirk for boards using pmc_plt_clk_0
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.5
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
From adebb11139029ddf1fba6f796c4a476f17eacddc Mon Sep 17 00:00:00 2001
From: Sam McNally <[email protected]>
Date: Tue, 17 Sep 2019 15:49:33 +1000
Subject: [PATCH] ASoC: Intel: cht_bsw_rt5645: Add quirk for boards using
pmc_plt_clk_0
As of commit 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL"), the cht_bsw_rt5645 driver needs to enable the clock it's using for the codec's mclk. It does this from commit 7735bce05a9c ("ASoC: Intel: boards: use devm_clk_get() unconditionally"), enabling pmc_plt_clk_3. However, Strago family Chromebooks use pmc_plt_clk_0 for the codec mclk, resulting in white noise with some digital microphones. Add a DMI-based quirk for Strago family Chromebooks to use pmc_plt_clk_0 instead - mirroring the changes made to cht_bsw_max98090_ti in commit a182ecd3809c ("ASoC: intel: cht_bsw_max98090_ti: Add quirk for boards using pmc_plt_clk_0") and making use of the existing dmi_check_system() call and related infrastructure added in commit 22af29114eb4 ("ASoC: Intel: cht-bsw-rt5645: add quirks for SSP0/AIF1/AIF2 routing").
--- sound/soc/intel/boards/cht_bsw_rt5645.c | 26 +++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-)
sound/soc/intel/boards/cht_bsw_rt5645.c +20 -6
@@ -48,6 +48,7 @@ struct cht_mc_private {#define CHT_RT5645_SSP2_AIF2 BIT(16)/* default is using AIF1 */ #define CHT_RT5645_SSP0_AIF1 BIT(17)#define CHT_RT5645_SSP0_AIF2 BIT(18) +#define CHT_RT5645_PMC_PLT_CLK_0 BIT(19)static unsigned long cht_rt5645_quirk =0 ;
@@ -59,6 +60,8 @@ static void log_quirks(struct device *dev)dev_info (dev,"quirk SSP0_AIF1 enabled" );if (cht_rt5645_quirk &CHT_RT5645_SSP0_AIF2 )dev_info (dev,"quirk SSP0_AIF2 enabled" ); +if (cht_rt5645_quirk &CHT_RT5645_PMC_PLT_CLK_0 ) +dev_info (dev,"quirk PMC_PLT_CLK_0 enabled" ); } static int platform_clock_control(struct snd_soc_dapm_widget *w,
@@ -226,15 +229,21 @@ static int cht_aif1_hw_params(struct snd_pcm_substream *substream,return 0 ; } -/* uncomment when we have a real quirk static int cht_rt5645_quirk_cb (const struct dmi_system_id *id) { cht_rt5645_quirk = (unsigned long )id->driver_data;return 1 ; } -*/ static const struct dmi_system_id cht_rt5645_quirk_table[] = { + { +/* Strago family Chromebooks */ + .callback = cht_rt5645_quirk_cb, + .matches = { +DMI_MATCH (DMI_PRODUCT_FAMILY ,"Intel_Strago" ), + }, + .driver_data = (void *)CHT_RT5645_PMC_PLT_CLK_0 , + }, { }, };
@@ -526,6 +535,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)int dai_index =0 ;int ret_val =0 ;int i; +const char *mclk_name; drv =devm_kzalloc (&pdev->dev,sizeof (*drv),GFP_KERNEL );if (!drv)
@@ -662,11 +672,15 @@ static int snd_cht_mc_probe(struct platform_device *pdev)if (ret_val)return ret_val; - drv->mclk =devm_clk_get (&pdev->dev,"pmc_plt_clk_3" ); +if (cht_rt5645_quirk &CHT_RT5645_PMC_PLT_CLK_0 ) + mclk_name ="pmc_plt_clk_0" ; +else + mclk_name ="pmc_plt_clk_3" ; + + drv->mclk =devm_clk_get (&pdev->dev, mclk_name);if (IS_ERR (drv->mclk)) { -dev_err (&pdev->dev, -"Failed to get MCLK from pmc_plt_clk_3: %ld\n" , -PTR_ERR (drv->mclk)); +dev_err (&pdev->dev,"Failed to get MCLK from %s: %ld\n" , + mclk_name,PTR_ERR (drv->mclk));return PTR_ERR (drv->mclk); }
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel