All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] BYT/CHT clocks/max98090 updates
@ 2017-09-08  5:13 Pierre-Louis Bossart
  2017-09-08  5:13 ` [PATCH 1/7] ASoC: max98090: reduce verbosity on PLL unlock Pierre-Louis Bossart
                   ` (7 more replies)
  0 siblings, 8 replies; 20+ messages in thread
From: Pierre-Louis Bossart @ 2017-09-08  5:13 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, Pierre-Louis Bossart, liam.r.girdwood, vinod.koul,
	broonie, jarkko.nikula, andriy.shevchenko

This patchset corrects issues with an earlier submission (missing
signoffs, error case not consistent) and enables the cht_bsw_max98090
machine driver on Baytrail. This should help distributions solve
problems with Baytrail Chromebooks which required a specific build.
These patches were tested on Lenovo 100s ('orco'/Baytrail) and Acer
R11 ('cyan'/Cherrytrail), using the same build based on
CONFIG_SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH=m.  Playback on
speakers/headphone and capture from internal mic work fine. UCM files
are available at
https://github.com/plbossart/UCM/tree/master/byt-max98090

Thanks to Jarkko Nikula and Andy Shevchenko for their comments on an
initial version reviewed internally at Intel.

Fang, Yang A (1):
  ASoC: ts3a227e: add acpi table

Pierre-Louis Bossart (5):
  ASoC: max98090: reduce verbosity on PLL unlock
  ASoC: Intel: cht_bsw_max98090: Fix I2S config + unused code
  ASoC: Intel: cht_bsw_max98090: add support for Baytrail
  ASoC: Intel: atom: use cht_bsw_max98090 for Baytrail Chromebooks
  ASoC: Intel: cht_bsw_max98090: add gpio-based jack detection

Thierry Escande (1):
  ASoc: Intel: cht_bsw_max98090_ti: Fix jack initialization

 sound/soc/codecs/max98090.c                  |   2 +-
 sound/soc/codecs/ts3a227e.c                  |  10 ++
 sound/soc/intel/atom/sst/sst_acpi.c          |   8 ++
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 185 ++++++++++++++++++++++++---
 4 files changed, 186 insertions(+), 19 deletions(-)

-- 
2.9.3

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 1/7] ASoC: max98090: reduce verbosity on PLL unlock
  2017-09-08  5:13 [PATCH 0/7] BYT/CHT clocks/max98090 updates Pierre-Louis Bossart
@ 2017-09-08  5:13 ` Pierre-Louis Bossart
  2017-09-19 13:45   ` Applied "ASoC: max98090: reduce verbosity on PLL unlock" to the asoc tree Mark Brown
  2017-09-08  5:13 ` [PATCH 2/7] ASoC: Intel: cht_bsw_max98090: Fix I2S config + unused code Pierre-Louis Bossart
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Pierre-Louis Bossart @ 2017-09-08  5:13 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, Pierre-Louis Bossart, liam.r.girdwood, vinod.koul,
	broonie, jarkko.nikula, andriy.shevchenko

'commit b8a3ee820f7b ("ASoC: max98090: Add recovery for PLL lock failure")'
enabled a workaround PLL unlocked issues, but generates annoying
dev_info "PLL unlocked" messages at a 10ms rate, usually on startup.

Move to dev_info_ratelimited. This issue doesn't seem to impact audio
functionality.  This trace is commented out in the GalliumOS patches,
it's better to keep it to check on potential quality issues

Tested on Lenovo 100s (Baytrail Chromebook)

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/codecs/max98090.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 13bcfb1..f5075d1 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2115,7 +2115,7 @@ static void max98090_pll_work(struct work_struct *work)
 	if (!snd_soc_codec_is_active(codec))
 		return;
 
-	dev_info(codec->dev, "PLL unlocked\n");
+	dev_info_ratelimited(codec->dev, "PLL unlocked\n");
 
 	/* Toggle shutdown OFF then ON */
 	snd_soc_update_bits(codec, M98090_REG_DEVICE_SHUTDOWN,
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 2/7] ASoC: Intel: cht_bsw_max98090: Fix I2S config + unused code
  2017-09-08  5:13 [PATCH 0/7] BYT/CHT clocks/max98090 updates Pierre-Louis Bossart
  2017-09-08  5:13 ` [PATCH 1/7] ASoC: max98090: reduce verbosity on PLL unlock Pierre-Louis Bossart
@ 2017-09-08  5:13 ` Pierre-Louis Bossart
  2017-09-08  5:13 ` [PATCH 3/7] ASoC: Intel: cht_bsw_max98090: add support for Baytrail Pierre-Louis Bossart
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 20+ messages in thread
From: Pierre-Louis Bossart @ 2017-09-08  5:13 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, Pierre-Louis Bossart, liam.r.girdwood, vinod.koul,
	broonie, jarkko.nikula, andriy.shevchenko

This driver probably never worked, the slots are configured
for 2ch 16 bit and the SSP2 as 24 bits, the cpu_dai configured as
LEFT_J and the codec_dai as I2S.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
index 20755ec..455a55a 100644
--- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c
+++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
@@ -160,7 +160,7 @@ static int cht_codec_fixup(struct snd_soc_pcm_runtime *rtd,
 		return ret;
 	}
 
-	fmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_NB_NF
+	fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
 				| SND_SOC_DAIFMT_CBS_CFS;
 
 	ret = snd_soc_dai_set_fmt(rtd->cpu_dai, fmt);
@@ -173,8 +173,8 @@ static int cht_codec_fixup(struct snd_soc_pcm_runtime *rtd,
 	rate->min = rate->max = 48000;
 	channels->min = channels->max = 2;
 
-	/* set SSP2 to 24-bit */
-	params_set_format(params, SNDRV_PCM_FORMAT_S24_LE);
+	/* set SSP2 to 16-bit */
+	params_set_format(params, SNDRV_PCM_FORMAT_S16_LE);
 	return 0;
 }
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 3/7] ASoC: Intel: cht_bsw_max98090: add support for Baytrail
  2017-09-08  5:13 [PATCH 0/7] BYT/CHT clocks/max98090 updates Pierre-Louis Bossart
  2017-09-08  5:13 ` [PATCH 1/7] ASoC: max98090: reduce verbosity on PLL unlock Pierre-Louis Bossart
  2017-09-08  5:13 ` [PATCH 2/7] ASoC: Intel: cht_bsw_max98090: Fix I2S config + unused code Pierre-Louis Bossart
@ 2017-09-08  5:13 ` Pierre-Louis Bossart
  2017-09-18  7:17   ` Andy Shevchenko
  2017-09-19 13:45   ` Applied "ASoC: Intel: cht_bsw_max98090: add support for Baytrail" to the asoc tree Mark Brown
  2017-09-08  5:13 ` [PATCH 4/7] ASoC: Intel: atom: use cht_bsw_max98090 for Baytrail Chromebooks Pierre-Louis Bossart
                   ` (4 subsequent siblings)
  7 siblings, 2 replies; 20+ messages in thread
From: Pierre-Louis Bossart @ 2017-09-08  5:13 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, Pierre-Louis Bossart, liam.r.girdwood, vinod.koul,
	broonie, jarkko.nikula, andriy.shevchenko

Distributions such as Fedora, Ubuntu and Gallium don't currently
have a means to support Baytrail Chromebooks and other platforms
with the same build [1][2] due to incompatible platform drivers.

Add MCLK management to reuse this machine driver for Baytrail
platforms and solve this coexistence problem at last. UCM files are
provided at [3] and will eventually be submitted to the new repo.

The legacy byt-max98090 machine driver is still maintained but can
only be used when the other Atom/DPCM driver is not compiled in, or
when users don't want to configure extra mixers required by the
Atom/sst driver.

Tested on Lenovo 100s Baytrail Chromebook w/ Mr. Chromebox BOOT_STUB
firmware and Acer R11 Cherrytrail Chromebook

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1335196
[2] http://mailman.alsa-project.org/pipermail/alsa-devel/2016-August/
111641.html
[3] https://github.com/plbossart/UCM/tree/master/byt-max98090

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 78 ++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)

diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
index 455a55a..01bacca 100644
--- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c
+++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
@@ -23,6 +23,7 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/acpi.h>
+#include <linux/clk.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
 #include <sound/soc.h>
@@ -35,15 +36,60 @@
 #define CHT_CODEC_DAI	"HiFi"
 
 struct cht_mc_private {
+	struct clk *mclk;
 	struct snd_soc_jack jack;
 	bool ts3a227e_present;
 };
 
+static inline struct snd_soc_dai *cht_get_codec_dai(struct snd_soc_card *card)
+{
+	struct snd_soc_pcm_runtime *rtd;
+
+	list_for_each_entry(rtd, &card->rtd_list, list) {
+		if (!strncmp(rtd->codec_dai->name, CHT_CODEC_DAI,
+			     strlen(CHT_CODEC_DAI)))
+			return rtd->codec_dai;
+	}
+	return NULL;
+}
+
+static int platform_clock_control(struct snd_soc_dapm_widget *w,
+					  struct snd_kcontrol *k, int  event)
+{
+	struct snd_soc_dapm_context *dapm = w->dapm;
+	struct snd_soc_card *card = dapm->card;
+	struct snd_soc_dai *codec_dai;
+	struct cht_mc_private *ctx = snd_soc_card_get_drvdata(card);
+	int ret;
+
+	codec_dai = cht_get_codec_dai(card);
+	if (!codec_dai) {
+		dev_err(card->dev, "Codec dai not found; Unable to set platform clock\n");
+		return -EIO;
+	}
+
+	if (SND_SOC_DAPM_EVENT_ON(event)) {
+		ret = clk_prepare_enable(ctx->mclk);
+		if (ret < 0) {
+			dev_err(card->dev,
+				"could not configure MCLK state");
+			return ret;
+		}
+	} else {
+		clk_disable_unprepare(ctx->mclk);
+	}
+
+	return 0;
+}
+
 static const struct snd_soc_dapm_widget cht_dapm_widgets[] = {
 	SND_SOC_DAPM_HP("Headphone", NULL),
 	SND_SOC_DAPM_MIC("Headset Mic", NULL),
 	SND_SOC_DAPM_MIC("Int Mic", NULL),
 	SND_SOC_DAPM_SPK("Ext Spk", NULL),
+	SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
+			    platform_clock_control, SND_SOC_DAPM_PRE_PMU |
+			    SND_SOC_DAPM_POST_PMD),
 };
 
 static const struct snd_soc_dapm_route cht_audio_map[] = {
@@ -60,6 +106,10 @@ static const struct snd_soc_dapm_route cht_audio_map[] = {
 	{"codec_in0", NULL, "ssp2 Rx" },
 	{"codec_in1", NULL, "ssp2 Rx" },
 	{"ssp2 Rx", NULL, "HiFi Capture"},
+	{"Headphone", NULL, "Platform Clock"},
+	{"Headset Mic", NULL, "Platform Clock"},
+	{"Int Mic", NULL, "Platform Clock"},
+	{"Ext Spk", NULL, "Platform Clock"},
 };
 
 static const struct snd_kcontrol_new cht_mc_controls[] = {
@@ -141,6 +191,25 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
 	if (ctx->ts3a227e_present)
 		snd_soc_jack_notifier_register(jack, &cht_jack_nb);
 
+	/*
+	 * The firmware might enable the clock at
+	 * boot (this information may or may not
+	 * be reflected in the enable clock register).
+	 * To change the rate we must disable the clock
+	 * first to cover these cases. Due to common
+	 * clock framework restrictions that do not allow
+	 * to disable a clock that has not been enabled,
+	 * we need to enable the clock first.
+	 */
+	ret = clk_prepare_enable(ctx->mclk);
+	if (!ret)
+		clk_disable_unprepare(ctx->mclk);
+
+	ret = clk_set_rate(ctx->mclk, CHT_PLAT_CLK_3_HZ);
+
+	if (ret)
+		dev_err(runtime->dev, "unable to set MCLK rate\n");
+
 	return ret;
 }
 
@@ -294,6 +363,15 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 	/* register the soc card */
 	snd_soc_card_cht.dev = &pdev->dev;
 	snd_soc_card_set_drvdata(&snd_soc_card_cht, drv);
+
+	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);
+	}
+
 	ret_val = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cht);
 	if (ret_val) {
 		dev_err(&pdev->dev,
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 4/7] ASoC: Intel: atom: use cht_bsw_max98090 for Baytrail Chromebooks
  2017-09-08  5:13 [PATCH 0/7] BYT/CHT clocks/max98090 updates Pierre-Louis Bossart
                   ` (2 preceding siblings ...)
  2017-09-08  5:13 ` [PATCH 3/7] ASoC: Intel: cht_bsw_max98090: add support for Baytrail Pierre-Louis Bossart
@ 2017-09-08  5:13 ` Pierre-Louis Bossart
  2017-09-08  5:13 ` [PATCH 5/7] ASoC: ts3a227e: add acpi table Pierre-Louis Bossart
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 20+ messages in thread
From: Pierre-Louis Bossart @ 2017-09-08  5:13 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, Pierre-Louis Bossart, liam.r.girdwood, vinod.koul,
	broonie, jarkko.nikula, andriy.shevchenko

Baytrail Chromebooks used to be managed with legacy driver which
is not compatible with atom/sst drivers. Reuse CHT driver to
handle max98098 codec and allow distributions to support all
Atom platforms with the same build.

The legacy byt-max98090 can still be used but in a build for
Baytrail+max98090 only.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/atom/sst/sst_acpi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c
index 0e928d5..ff4a517 100644
--- a/sound/soc/intel/atom/sst/sst_acpi.c
+++ b/sound/soc/intel/atom/sst/sst_acpi.c
@@ -536,6 +536,14 @@ static struct sst_acpi_mach sst_acpi_bytcr[] = {
 		.board = "cht-bsw",
 		.pdata = &byt_rvp_platform_data
 	},
+	/* use CHT driver to Baytrail Chromebooks */
+	{
+		.id = "193C9890",
+		.drv_name = "cht-bsw-max98090",
+		.fw_filename = "intel/fw_sst_0f28.bin",
+		.board = "cht-bsw",
+		.pdata = &byt_rvp_platform_data
+	},
 #if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH)
 	/*
 	 * This is always last in the table so that it is selected only when
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 5/7] ASoC: ts3a227e: add acpi table
  2017-09-08  5:13 [PATCH 0/7] BYT/CHT clocks/max98090 updates Pierre-Louis Bossart
                   ` (3 preceding siblings ...)
  2017-09-08  5:13 ` [PATCH 4/7] ASoC: Intel: atom: use cht_bsw_max98090 for Baytrail Chromebooks Pierre-Louis Bossart
@ 2017-09-08  5:13 ` Pierre-Louis Bossart
  2017-09-08 13:27   ` Vinod Koul
  2017-09-08  5:13 ` [PATCH 6/7] ASoc: Intel: cht_bsw_max98090_ti: Fix jack initialization Pierre-Louis Bossart
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Pierre-Louis Bossart @ 2017-09-08  5:13 UTC (permalink / raw)
  To: alsa-devel
  Cc: Thierry Escande, tiwai, Fang, Pierre-Louis Bossart,
	liam.r.girdwood, vinod.koul, broonie, jarkko.nikula,
	andriy.shevchenko, Fang, Yang A

From: "Fang, Yang A" <yang.a.fang@intel.com>

This patch adds the acpi match table for the ts3a227e audio accessory
detection device. This enables headset features like jack plug/unplug
notifications, mic presence, and button pressed events.

Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/codecs/ts3a227e.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sound/soc/codecs/ts3a227e.c b/sound/soc/codecs/ts3a227e.c
index 4356843..738e04b 100644
--- a/sound/soc/codecs/ts3a227e.c
+++ b/sound/soc/codecs/ts3a227e.c
@@ -15,6 +15,7 @@
 #include <linux/module.h>
 #include <linux/of_gpio.h>
 #include <linux/regmap.h>
+#include <linux/acpi.h>
 
 #include <sound/core.h>
 #include <sound/jack.h>
@@ -374,11 +375,20 @@ static const struct of_device_id ts3a227e_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, ts3a227e_of_match);
 
+#ifdef CONFIG_ACPI
+static struct acpi_device_id ts3a227e_acpi_match[] = {
+	{ "104C227E", 0 },
+	{},
+};
+MODULE_DEVICE_TABLE(acpi, ts3a227e_acpi_match);
+#endif
+
 static struct i2c_driver ts3a227e_driver = {
 	.driver = {
 		.name = "ts3a227e",
 		.pm = &ts3a227e_pm,
 		.of_match_table = of_match_ptr(ts3a227e_of_match),
+		.acpi_match_table = ACPI_PTR(ts3a227e_acpi_match),
 	},
 	.probe = ts3a227e_i2c_probe,
 	.id_table = ts3a227e_i2c_ids,
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 6/7] ASoc: Intel: cht_bsw_max98090_ti: Fix jack initialization
  2017-09-08  5:13 [PATCH 0/7] BYT/CHT clocks/max98090 updates Pierre-Louis Bossart
                   ` (4 preceding siblings ...)
  2017-09-08  5:13 ` [PATCH 5/7] ASoC: ts3a227e: add acpi table Pierre-Louis Bossart
@ 2017-09-08  5:13 ` Pierre-Louis Bossart
  2017-09-19 13:45   ` Applied "ASoC: Intel: cht_bsw_max98090_ti: Fix jack initialization" to the asoc tree Mark Brown
  2017-09-08  5:13 ` [PATCH 7/7] ASoC: Intel: cht_bsw_max98090: add gpio-based jack detection Pierre-Louis Bossart
  2017-09-18  3:36 ` [PATCH 0/7] BYT/CHT clocks/max98090 updates Vinod Koul
  7 siblings, 1 reply; 20+ messages in thread
From: Pierre-Louis Bossart @ 2017-09-08  5:13 UTC (permalink / raw)
  To: alsa-devel
  Cc: Thierry Escande, tiwai, Pierre-Louis Bossart, liam.r.girdwood,
	vinod.koul, broonie, jarkko.nikula, andriy.shevchenko

From: Thierry Escande <thierry.escande@collabora.com>

If the ts3a227e audio accessory detection hardware is present and its
driver probed, the jack needs to be created before enabling jack
detection in the ts3a227e driver. With this patch, the jack is
instantiated in the max98090 headset init function if the ts3a227e is
present. This fixes a null pointer dereference as the jack detection
enabling function in the ts3a driver was called before the jack is
created.

[minor correction to keep error handling on jack creation the same
as before by Pierre Bossart]

Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 45 +++++++++++++++++++---------
 1 file changed, 31 insertions(+), 14 deletions(-)

diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
index 01bacca..a1502c7 100644
--- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c
+++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
@@ -166,23 +166,19 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
 	struct cht_mc_private *ctx = snd_soc_card_get_drvdata(runtime->card);
 	struct snd_soc_jack *jack = &ctx->jack;
 
-	/**
-	* TI supports 4 butons headset detection
-	* KEY_MEDIA
-	* KEY_VOICECOMMAND
-	* KEY_VOLUMEUP
-	* KEY_VOLUMEDOWN
-	*/
-	if (ctx->ts3a227e_present)
-		jack_type = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE |
-					SND_JACK_BTN_0 | SND_JACK_BTN_1 |
-					SND_JACK_BTN_2 | SND_JACK_BTN_3;
-	else
-		jack_type = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE;
+	if (ctx->ts3a227e_present) {
+		/*
+		 * The jack has already been created in the
+		 * cht_max98090_headset_init() function.
+		 */
+		snd_soc_jack_notifier_register(jack, &cht_jack_nb);
+		return 0;
+	}
+
+	jack_type = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE;
 
 	ret = snd_soc_card_jack_new(runtime->card, "Headset Jack",
 					jack_type, jack, NULL, 0);
-
 	if (ret) {
 		dev_err(runtime->dev, "Headset Jack creation failed %d\n", ret);
 		return ret;
@@ -257,6 +253,27 @@ static int cht_max98090_headset_init(struct snd_soc_component *component)
 {
 	struct snd_soc_card *card = component->card;
 	struct cht_mc_private *ctx = snd_soc_card_get_drvdata(card);
+	struct snd_soc_jack *jack = &ctx->jack;
+	int jack_type;
+	int ret;
+
+	/*
+	 * TI supports 4 butons headset detection
+	 * KEY_MEDIA
+	 * KEY_VOICECOMMAND
+	 * KEY_VOLUMEUP
+	 * KEY_VOLUMEDOWN
+	 */
+	jack_type = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE |
+		    SND_JACK_BTN_0 | SND_JACK_BTN_1 |
+		    SND_JACK_BTN_2 | SND_JACK_BTN_3;
+
+	ret = snd_soc_card_jack_new(card, "Headset Jack", jack_type,
+				    jack, NULL, 0);
+	if (ret) {
+		dev_err(card->dev, "Headset Jack creation failed %d\n", ret);
+		return ret;
+	}
 
 	return ts3a227e_enable_jack_detect(component, &ctx->jack);
 }
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 7/7] ASoC: Intel: cht_bsw_max98090: add gpio-based jack detection
  2017-09-08  5:13 [PATCH 0/7] BYT/CHT clocks/max98090 updates Pierre-Louis Bossart
                   ` (5 preceding siblings ...)
  2017-09-08  5:13 ` [PATCH 6/7] ASoc: Intel: cht_bsw_max98090_ti: Fix jack initialization Pierre-Louis Bossart
@ 2017-09-08  5:13 ` Pierre-Louis Bossart
  2017-09-19 13:45   ` Applied "ASoC: Intel: cht_bsw_max98090: add gpio-based jack detection" to the asoc tree Mark Brown
  2017-09-18  3:36 ` [PATCH 0/7] BYT/CHT clocks/max98090 updates Vinod Koul
  7 siblings, 1 reply; 20+ messages in thread
From: Pierre-Louis Bossart @ 2017-09-08  5:13 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, Pierre-Louis Bossart, liam.r.girdwood, vinod.koul,
	broonie, jarkko.nikula, andriy.shevchenko

Jacks are created but only enabled when the external TI chip is
present, this probably never worked as well. Forklift the gpio-based
code from the legacy byt-max98090 driver, with however a less strict
error check. It's fine to let users enjoy their device even if
jack detection doesn't work - it almost never does without quirks...

Tested on Lenovo100s

CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 56 +++++++++++++++++++++++++++-
 1 file changed, 55 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
index a1502c7..74c047a 100644
--- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c
+++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
@@ -159,6 +159,40 @@ static struct notifier_block cht_jack_nb = {
 	.notifier_call = cht_ti_jack_event,
 };
 
+static struct snd_soc_jack_pin hs_jack_pins[] = {
+	{
+		.pin	= "Headphone",
+		.mask	= SND_JACK_HEADPHONE,
+	},
+	{
+		.pin	= "Headset Mic",
+		.mask	= SND_JACK_MICROPHONE,
+	},
+};
+
+static struct snd_soc_jack_gpio hs_jack_gpios[] = {
+	{
+		.name		= "hp",
+		.report		= SND_JACK_HEADPHONE | SND_JACK_LINEOUT,
+		.debounce_time	= 200,
+	},
+	{
+		.name		= "mic",
+		.invert		= 1,
+		.report		= SND_JACK_MICROPHONE,
+		.debounce_time	= 200,
+	},
+};
+
+static const struct acpi_gpio_params hp_gpios = { 0, 0, false };
+static const struct acpi_gpio_params mic_gpios = { 1, 0, false };
+
+static const struct acpi_gpio_mapping acpi_max98090_gpios[] = {
+	{ "hp-gpios", &hp_gpios, 1 },
+	{ "mic-gpios", &mic_gpios, 1 },
+	{},
+};
+
 static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
 {
 	int ret;
@@ -178,15 +212,29 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
 	jack_type = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE;
 
 	ret = snd_soc_card_jack_new(runtime->card, "Headset Jack",
-					jack_type, jack, NULL, 0);
+				    jack_type, jack,
+				    hs_jack_pins, ARRAY_SIZE(hs_jack_pins));
 	if (ret) {
 		dev_err(runtime->dev, "Headset Jack creation failed %d\n", ret);
 		return ret;
 	}
 
+
 	if (ctx->ts3a227e_present)
 		snd_soc_jack_notifier_register(jack, &cht_jack_nb);
 
+	ret = snd_soc_jack_add_gpiods(runtime->card->dev->parent, jack,
+				      ARRAY_SIZE(hs_jack_gpios),
+				      hs_jack_gpios);
+	if (ret) {
+		/*
+		 * flag error but don't bail if jack detect is broken
+		 * due to platform issues or bad BIOS/configuration
+		 */
+		dev_err(runtime->dev,
+			"jack detection gpios not added, error %d\n", ret);
+	}
+
 	/*
 	 * The firmware might enable the clock at
 	 * boot (this information may or may not
@@ -363,6 +411,7 @@ static struct snd_soc_card snd_soc_card_cht = {
 
 static int snd_cht_mc_probe(struct platform_device *pdev)
 {
+	struct device *dev = &pdev->dev;
 	int ret_val = 0;
 	struct cht_mc_private *drv;
 
@@ -375,6 +424,11 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 		/* no need probe TI jack detection chip */
 		snd_soc_card_cht.aux_dev = NULL;
 		snd_soc_card_cht.num_aux_devs = 0;
+
+		ret_val = devm_acpi_dev_add_driver_gpios(dev->parent,
+							 acpi_max98090_gpios);
+		if (ret_val)
+			dev_dbg(dev, "Unable to add GPIO mapping table\n");
 	}
 
 	/* register the soc card */
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH 5/7] ASoC: ts3a227e: add acpi table
  2017-09-08  5:13 ` [PATCH 5/7] ASoC: ts3a227e: add acpi table Pierre-Louis Bossart
@ 2017-09-08 13:27   ` Vinod Koul
  2017-09-08 13:30     ` Pierre-Louis Bossart
  0 siblings, 1 reply; 20+ messages in thread
From: Vinod Koul @ 2017-09-08 13:27 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: alsa-devel, Thierry Escande, tiwai, Fang, liam.r.girdwood, Fang,
	Yang A, broonie, jarkko.nikula, andriy.shevchenko

On Fri, Sep 08, 2017 at 12:13:07AM -0500, Pierre-Louis Bossart wrote:
> From: "Fang, Yang A" <yang.a.fang@intel.com>
> 
> This patch adds the acpi match table for the ts3a227e audio accessory
> detection device. This enables headset features like jack plug/unplug
> notifications, mic presence, and button pressed events.
> 
> Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
> Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> ---
>  sound/soc/codecs/ts3a227e.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/sound/soc/codecs/ts3a227e.c b/sound/soc/codecs/ts3a227e.c
> index 4356843..738e04b 100644
> --- a/sound/soc/codecs/ts3a227e.c
> +++ b/sound/soc/codecs/ts3a227e.c
> @@ -15,6 +15,7 @@
>  #include <linux/module.h>
>  #include <linux/of_gpio.h>
>  #include <linux/regmap.h>
> +#include <linux/acpi.h>
>  
>  #include <sound/core.h>
>  #include <sound/jack.h>
> @@ -374,11 +375,20 @@ static const struct of_device_id ts3a227e_of_match[] = {
>  };
>  MODULE_DEVICE_TABLE(of, ts3a227e_of_match);
>  
> +#ifdef CONFIG_ACPI
> +static struct acpi_device_id ts3a227e_acpi_match[] = {
> +	{ "104C227E", 0 },
> +	{},
> +};
> +MODULE_DEVICE_TABLE(acpi, ts3a227e_acpi_match);
> +#endif

so this is not present for non ACPI system,... fine

> +
>  static struct i2c_driver ts3a227e_driver = {
>  	.driver = {
>  		.name = "ts3a227e",
>  		.pm = &ts3a227e_pm,
>  		.of_match_table = of_match_ptr(ts3a227e_of_match),
> +		.acpi_match_table = ACPI_PTR(ts3a227e_acpi_match),

but then this would give compiler error on those systems as .acpi_match_table is
defined in driver core... can you compile this on non acpi and check

struct device_driver {
	const char		*name;
	struct bus_type		*bus;

	struct module		*owner;
	const char		*mod_name;	/* used for built-in modules */

	bool suppress_bind_attrs;	/* disables bind/unbind via sysfs */
	enum probe_type probe_type;

	const struct of_device_id	*of_match_table;
	const struct acpi_device_id	*acpi_match_table;

	int (*probe) (struct device *dev);
	int (*remove) (struct device *dev);
	void (*shutdown) (struct device *dev);
	int (*suspend) (struct device *dev, pm_message_t state);
	int (*resume) (struct device *dev);
	const struct attribute_group **groups;

	const struct dev_pm_ops *pm;

	struct driver_private *p;
};

-- 
~Vinod

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 5/7] ASoC: ts3a227e: add acpi table
  2017-09-08 13:27   ` Vinod Koul
@ 2017-09-08 13:30     ` Pierre-Louis Bossart
  2017-09-12 14:54       ` Mark Brown
  2017-09-18  3:36       ` Vinod Koul
  0 siblings, 2 replies; 20+ messages in thread
From: Pierre-Louis Bossart @ 2017-09-08 13:30 UTC (permalink / raw)
  To: Vinod Koul
  Cc: alsa-devel, Thierry Escande, tiwai, liam.r.girdwood, broonie,
	jarkko.nikula, andriy.shevchenko


>> +#ifdef CONFIG_ACPI
>> +static struct acpi_device_id ts3a227e_acpi_match[] = {
>> +	{ "104C227E", 0 },
>> +	{},
>> +};
>> +MODULE_DEVICE_TABLE(acpi, ts3a227e_acpi_match);
>> +#endif
> 
> so this is not present for non ACPI system,... fine
> 
>> +
>>   static struct i2c_driver ts3a227e_driver = {
>>   	.driver = {
>>   		.name = "ts3a227e",
>>   		.pm = &ts3a227e_pm,
>>   		.of_match_table = of_match_ptr(ts3a227e_of_match),
>> +		.acpi_match_table = ACPI_PTR(ts3a227e_acpi_match),
> 
> but then this would give compiler error on those systems as .acpi_match_table is
> defined in driver core... can you compile this on non acpi and check

This is not any different from what is done for other codecs.

static struct i2c_driver rt5677_i2c_driver = {
	.driver = {
		.name = "rt5677",
		.of_match_table = rt5677_of_match,
		.acpi_match_table = ACPI_PTR(rt5677_acpi_match),
	},

And the 0day checks did not report any issues, probably because the 
pre-processor takes the table out when CONFIG_ACPI is not enabled:

#define ACPI_PTR(_ptr)	(NULL)

so no change...

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 5/7] ASoC: ts3a227e: add acpi table
  2017-09-08 13:30     ` Pierre-Louis Bossart
@ 2017-09-12 14:54       ` Mark Brown
  2017-09-18  3:36       ` Vinod Koul
  1 sibling, 0 replies; 20+ messages in thread
From: Mark Brown @ 2017-09-12 14:54 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: alsa-devel, Thierry Escande, Vinod Koul, liam.r.girdwood, tiwai,
	jarkko.nikula, andriy.shevchenko


[-- Attachment #1.1: Type: text/plain, Size: 685 bytes --]

On Fri, Sep 08, 2017 at 08:30:37AM -0500, Pierre-Louis Bossart wrote:

> > >   		.of_match_table = of_match_ptr(ts3a227e_of_match),
> > > +		.acpi_match_table = ACPI_PTR(ts3a227e_acpi_match),

> > but then this would give compiler error on those systems as .acpi_match_table is
> > defined in driver core... can you compile this on non acpi and check

> This is not any different from what is done for other codecs.

> And the 0day checks did not report any issues, probably because the
> pre-processor takes the table out when CONFIG_ACPI is not enabled:

> #define ACPI_PTR(_ptr)	(NULL)

> so no change...

Right, this is the whole point of the of_match_ptr() and ACPI_PTR()
macros.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 5/7] ASoC: ts3a227e: add acpi table
  2017-09-08 13:30     ` Pierre-Louis Bossart
  2017-09-12 14:54       ` Mark Brown
@ 2017-09-18  3:36       ` Vinod Koul
  1 sibling, 0 replies; 20+ messages in thread
From: Vinod Koul @ 2017-09-18  3:36 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: alsa-devel, Thierry Escande, tiwai, liam.r.girdwood, broonie,
	jarkko.nikula, andriy.shevchenko

On Fri, Sep 08, 2017 at 08:30:37AM -0500, Pierre-Louis Bossart wrote:
> 
> >>+#ifdef CONFIG_ACPI
> >>+static struct acpi_device_id ts3a227e_acpi_match[] = {
> >>+	{ "104C227E", 0 },
> >>+	{},
> >>+};
> >>+MODULE_DEVICE_TABLE(acpi, ts3a227e_acpi_match);
> >>+#endif
> >
> >so this is not present for non ACPI system,... fine
> >
> >>+
> >>  static struct i2c_driver ts3a227e_driver = {
> >>  	.driver = {
> >>  		.name = "ts3a227e",
> >>  		.pm = &ts3a227e_pm,
> >>  		.of_match_table = of_match_ptr(ts3a227e_of_match),
> >>+		.acpi_match_table = ACPI_PTR(ts3a227e_acpi_match),
> >
> >but then this would give compiler error on those systems as .acpi_match_table is
> >defined in driver core... can you compile this on non acpi and check
> 
> This is not any different from what is done for other codecs.
> 
> static struct i2c_driver rt5677_i2c_driver = {
> 	.driver = {
> 		.name = "rt5677",
> 		.of_match_table = rt5677_of_match,
> 		.acpi_match_table = ACPI_PTR(rt5677_acpi_match),
> 	},
> 
> And the 0day checks did not report any issues, probably because the
> pre-processor takes the table out when CONFIG_ACPI is not enabled:
> 
> #define ACPI_PTR(_ptr)	(NULL)

Yeah thanks for pointing, missed this one :)

> so no change...

yup :)

-- 
~Vinod

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 0/7] BYT/CHT clocks/max98090 updates
  2017-09-08  5:13 [PATCH 0/7] BYT/CHT clocks/max98090 updates Pierre-Louis Bossart
                   ` (6 preceding siblings ...)
  2017-09-08  5:13 ` [PATCH 7/7] ASoC: Intel: cht_bsw_max98090: add gpio-based jack detection Pierre-Louis Bossart
@ 2017-09-18  3:36 ` Vinod Koul
  7 siblings, 0 replies; 20+ messages in thread
From: Vinod Koul @ 2017-09-18  3:36 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: alsa-devel, tiwai, liam.r.girdwood, broonie, jarkko.nikula,
	andriy.shevchenko

On Fri, Sep 08, 2017 at 12:13:02AM -0500, Pierre-Louis Bossart wrote:
> This patchset corrects issues with an earlier submission (missing
> signoffs, error case not consistent) and enables the cht_bsw_max98090
> machine driver on Baytrail. This should help distributions solve
> problems with Baytrail Chromebooks which required a specific build.
> These patches were tested on Lenovo 100s ('orco'/Baytrail) and Acer
> R11 ('cyan'/Cherrytrail), using the same build based on
> CONFIG_SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH=m.  Playback on
> speakers/headphone and capture from internal mic work fine. UCM files
> are available at
> https://github.com/plbossart/UCM/tree/master/byt-max98090
> 
> Thanks to Jarkko Nikula and Andy Shevchenko for their comments on an
> initial version reviewed internally at Intel.

Acked-By: Vinod Koul <vinod.koul@intel.com>

> 
> Fang, Yang A (1):
>   ASoC: ts3a227e: add acpi table
> 
> Pierre-Louis Bossart (5):
>   ASoC: max98090: reduce verbosity on PLL unlock
>   ASoC: Intel: cht_bsw_max98090: Fix I2S config + unused code
>   ASoC: Intel: cht_bsw_max98090: add support for Baytrail
>   ASoC: Intel: atom: use cht_bsw_max98090 for Baytrail Chromebooks
>   ASoC: Intel: cht_bsw_max98090: add gpio-based jack detection
> 
> Thierry Escande (1):
>   ASoc: Intel: cht_bsw_max98090_ti: Fix jack initialization
> 
>  sound/soc/codecs/max98090.c                  |   2 +-
>  sound/soc/codecs/ts3a227e.c                  |  10 ++
>  sound/soc/intel/atom/sst/sst_acpi.c          |   8 ++
>  sound/soc/intel/boards/cht_bsw_max98090_ti.c | 185 ++++++++++++++++++++++++---
>  4 files changed, 186 insertions(+), 19 deletions(-)
> 
> -- 
> 2.9.3
> 

-- 
~Vinod

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/7] ASoC: Intel: cht_bsw_max98090: add support for Baytrail
  2017-09-08  5:13 ` [PATCH 3/7] ASoC: Intel: cht_bsw_max98090: add support for Baytrail Pierre-Louis Bossart
@ 2017-09-18  7:17   ` Andy Shevchenko
  2017-09-18 17:14     ` Pierre-Louis Bossart
  2017-09-19 13:45   ` Applied "ASoC: Intel: cht_bsw_max98090: add support for Baytrail" to the asoc tree Mark Brown
  1 sibling, 1 reply; 20+ messages in thread
From: Andy Shevchenko @ 2017-09-18  7:17 UTC (permalink / raw)
  To: Pierre-Louis Bossart, alsa-devel
  Cc: tiwai, liam.r.girdwood, broonie, jarkko.nikula, vinod.koul

On Fri, 2017-09-08 at 00:13 -0500, Pierre-Louis Bossart wrote:
> Distributions such as Fedora, Ubuntu and Gallium don't currently
> have a means to support Baytrail Chromebooks and other platforms
> with the same build [1][2] due to incompatible platform drivers.
> 
> Add MCLK management to reuse this machine driver for Baytrail
> platforms and solve this coexistence problem at last. UCM files are
> provided at [3] and will eventually be submitted to the new repo.
> 
> The legacy byt-max98090 machine driver is still maintained but can
> only be used when the other Atom/DPCM driver is not compiled in, or
> when users don't want to configure extra mixers required by the
> Atom/sst driver.
> 
> Tested on Lenovo 100s Baytrail Chromebook w/ Mr. Chromebox BOOT_STUB
> firmware and Acer R11 Cherrytrail Chromebook
> 
> [1] https://bugzilla.redhat.com/show_bug.cgi?id=1335196
> [2] http://mailman.alsa-project.org/pipermail/alsa-devel/2016-August/
> 111641.html
> [3] https://github.com/plbossart/UCM/tree/master/byt-max98090
> 
> 

>  
> +static inline struct snd_soc_dai *cht_get_codec_dai(struct
> snd_soc_card *card)
> +{
> +	struct snd_soc_pcm_runtime *rtd;
> +
> +	list_for_each_entry(rtd, &card->rtd_list, list) {
> +		if (!strncmp(rtd->codec_dai->name, CHT_CODEC_DAI,
> +			     strlen(CHT_CODEC_DAI)))

Same comments as per another patch series wrt str_n_cmp() use.

> +			return rtd->codec_dai;
> +	}
> +	return NULL;


-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/7] ASoC: Intel: cht_bsw_max98090: add support for Baytrail
  2017-09-18  7:17   ` Andy Shevchenko
@ 2017-09-18 17:14     ` Pierre-Louis Bossart
  2017-09-19  9:51       ` Andy Shevchenko
  0 siblings, 1 reply; 20+ messages in thread
From: Pierre-Louis Bossart @ 2017-09-18 17:14 UTC (permalink / raw)
  To: Andy Shevchenko, alsa-devel
  Cc: tiwai, liam.r.girdwood, broonie, jarkko.nikula, vinod.koul

On 9/18/17 2:17 AM, Andy Shevchenko wrote:
> On Fri, 2017-09-08 at 00:13 -0500, Pierre-Louis Bossart wrote:
>> Distributions such as Fedora, Ubuntu and Gallium don't currently
>> have a means to support Baytrail Chromebooks and other platforms
>> with the same build [1][2] due to incompatible platform drivers.
>>
>> Add MCLK management to reuse this machine driver for Baytrail
>> platforms and solve this coexistence problem at last. UCM files are
>> provided at [3] and will eventually be submitted to the new repo.
>>
>> The legacy byt-max98090 machine driver is still maintained but can
>> only be used when the other Atom/DPCM driver is not compiled in, or
>> when users don't want to configure extra mixers required by the
>> Atom/sst driver.
>>
>> Tested on Lenovo 100s Baytrail Chromebook w/ Mr. Chromebox BOOT_STUB
>> firmware and Acer R11 Cherrytrail Chromebook
>>
>> [1] https://bugzilla.redhat.com/show_bug.cgi?id=1335196
>> [2] http://mailman.alsa-project.org/pipermail/alsa-devel/2016-August/
>> 111641.html
>> [3] https://github.com/plbossart/UCM/tree/master/byt-max98090
>>
>>
> 
>>   
>> +static inline struct snd_soc_dai *cht_get_codec_dai(struct
>> snd_soc_card *card)
>> +{
>> +	struct snd_soc_pcm_runtime *rtd;
>> +
>> +	list_for_each_entry(rtd, &card->rtd_list, list) {
>> +		if (!strncmp(rtd->codec_dai->name, CHT_CODEC_DAI,
>> +			     strlen(CHT_CODEC_DAI)))
> 
> Same comments as per another patch series wrt str_n_cmp() use.

Yes, if that's alright with you I'll clean this up in all Intel machine 
drivers in one patch since this is all copy-paste. I just need a clear 
indication on what the preferred means of string comparisons is...

> 
>> +			return rtd->codec_dai;
>> +	}
>> +	return NULL;
> 
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/7] ASoC: Intel: cht_bsw_max98090: add support for Baytrail
  2017-09-18 17:14     ` Pierre-Louis Bossart
@ 2017-09-19  9:51       ` Andy Shevchenko
  0 siblings, 0 replies; 20+ messages in thread
From: Andy Shevchenko @ 2017-09-19  9:51 UTC (permalink / raw)
  To: Pierre-Louis Bossart, alsa-devel
  Cc: tiwai, liam.r.girdwood, broonie, jarkko.nikula, vinod.koul

On Mon, 2017-09-18 at 12:14 -0500, Pierre-Louis Bossart wrote:
> On 9/18/17 2:17 AM, Andy Shevchenko wrote:
> > On Fri, 2017-09-08 at 00:13 -0500, Pierre-Louis Bossart wrote:
> > >   
> > > +static inline struct snd_soc_dai *cht_get_codec_dai(struct
> > > snd_soc_card *card)
> > > +{
> > > +	struct snd_soc_pcm_runtime *rtd;
> > > +
> > > +	list_for_each_entry(rtd, &card->rtd_list, list) {
> > > +		if (!strncmp(rtd->codec_dai->name, CHT_CODEC_DAI,
> > > +			     strlen(CHT_CODEC_DAI)))
> > 
> > Same comments as per another patch series wrt str_n_cmp() use.
> 
> Yes, if that's alright with you I'll clean this up in all Intel
> machine 
> drivers in one patch since this is all copy-paste.

Yep, I agree on your other comment to clean up all Intel ASoC drivers at
once.

>  I just need a clear 
> indication on what the preferred means of string comparisons is...

Here just a rule of common sense. No need to use str_n_* variants on top
of constant literals especially followed by strlen().

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Applied "ASoC: Intel: cht_bsw_max98090: add gpio-based jack detection" to the asoc tree
  2017-09-08  5:13 ` [PATCH 7/7] ASoC: Intel: cht_bsw_max98090: add gpio-based jack detection Pierre-Louis Bossart
@ 2017-09-19 13:45   ` Mark Brown
  0 siblings, 0 replies; 20+ messages in thread
From: Mark Brown @ 2017-09-19 13:45 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: alsa-devel, tiwai, liam.r.girdwood, vinod.koul, broonie,
	jarkko.nikula, andriy.shevchenko

The patch

   ASoC: Intel: cht_bsw_max98090: add gpio-based jack detection

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

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 355b3552d59f471bfaf41cf7c6cc0a6fa193b303 Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Date: Fri, 8 Sep 2017 00:13:09 -0500
Subject: [PATCH] ASoC: Intel: cht_bsw_max98090: add gpio-based jack detection

Jacks are created but only enabled when the external TI chip is
present, this probably never worked as well. Forklift the gpio-based
code from the legacy byt-max98090 driver, with however a less strict
error check. It's fine to let users enjoy their device even if
jack detection doesn't work - it almost never does without quirks...

Tested on Lenovo100s

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 56 +++++++++++++++++++++++++++-
 1 file changed, 55 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
index e5da091abe48..6519604b9577 100644
--- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c
+++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
@@ -159,6 +159,40 @@ static struct notifier_block cht_jack_nb = {
 	.notifier_call = cht_ti_jack_event,
 };
 
+static struct snd_soc_jack_pin hs_jack_pins[] = {
+	{
+		.pin	= "Headphone",
+		.mask	= SND_JACK_HEADPHONE,
+	},
+	{
+		.pin	= "Headset Mic",
+		.mask	= SND_JACK_MICROPHONE,
+	},
+};
+
+static struct snd_soc_jack_gpio hs_jack_gpios[] = {
+	{
+		.name		= "hp",
+		.report		= SND_JACK_HEADPHONE | SND_JACK_LINEOUT,
+		.debounce_time	= 200,
+	},
+	{
+		.name		= "mic",
+		.invert		= 1,
+		.report		= SND_JACK_MICROPHONE,
+		.debounce_time	= 200,
+	},
+};
+
+static const struct acpi_gpio_params hp_gpios = { 0, 0, false };
+static const struct acpi_gpio_params mic_gpios = { 1, 0, false };
+
+static const struct acpi_gpio_mapping acpi_max98090_gpios[] = {
+	{ "hp-gpios", &hp_gpios, 1 },
+	{ "mic-gpios", &mic_gpios, 1 },
+	{},
+};
+
 static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
 {
 	int ret;
@@ -178,15 +212,29 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
 	jack_type = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE;
 
 	ret = snd_soc_card_jack_new(runtime->card, "Headset Jack",
-					jack_type, jack, NULL, 0);
+				    jack_type, jack,
+				    hs_jack_pins, ARRAY_SIZE(hs_jack_pins));
 	if (ret) {
 		dev_err(runtime->dev, "Headset Jack creation failed %d\n", ret);
 		return ret;
 	}
 
+
 	if (ctx->ts3a227e_present)
 		snd_soc_jack_notifier_register(jack, &cht_jack_nb);
 
+	ret = snd_soc_jack_add_gpiods(runtime->card->dev->parent, jack,
+				      ARRAY_SIZE(hs_jack_gpios),
+				      hs_jack_gpios);
+	if (ret) {
+		/*
+		 * flag error but don't bail if jack detect is broken
+		 * due to platform issues or bad BIOS/configuration
+		 */
+		dev_err(runtime->dev,
+			"jack detection gpios not added, error %d\n", ret);
+	}
+
 	/*
 	 * The firmware might enable the clock at
 	 * boot (this information may or may not
@@ -363,6 +411,7 @@ static struct snd_soc_card snd_soc_card_cht = {
 
 static int snd_cht_mc_probe(struct platform_device *pdev)
 {
+	struct device *dev = &pdev->dev;
 	int ret_val = 0;
 	struct cht_mc_private *drv;
 
@@ -375,6 +424,11 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 		/* no need probe TI jack detection chip */
 		snd_soc_card_cht.aux_dev = NULL;
 		snd_soc_card_cht.num_aux_devs = 0;
+
+		ret_val = devm_acpi_dev_add_driver_gpios(dev->parent,
+							 acpi_max98090_gpios);
+		if (ret_val)
+			dev_dbg(dev, "Unable to add GPIO mapping table\n");
 	}
 
 	/* register the soc card */
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Applied "ASoC: Intel: cht_bsw_max98090_ti: Fix jack initialization" to the asoc tree
  2017-09-08  5:13 ` [PATCH 6/7] ASoc: Intel: cht_bsw_max98090_ti: Fix jack initialization Pierre-Louis Bossart
@ 2017-09-19 13:45   ` Mark Brown
  0 siblings, 0 replies; 20+ messages in thread
From: Mark Brown @ 2017-09-19 13:45 UTC (permalink / raw)
  To: Thierry Escande
  Cc: alsa-devel, tiwai, Pierre-Louis Bossart, liam.r.girdwood,
	vinod.koul, broonie, jarkko.nikula, andriy.shevchenko

The patch

   ASoC: Intel: cht_bsw_max98090_ti: Fix jack initialization

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

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 3bbda5a38601f7675a214be2044e41d7749e6c7b Mon Sep 17 00:00:00 2001
From: Thierry Escande <thierry.escande@collabora.com>
Date: Fri, 8 Sep 2017 00:13:08 -0500
Subject: [PATCH] ASoC: Intel: cht_bsw_max98090_ti: Fix jack initialization

If the ts3a227e audio accessory detection hardware is present and its
driver probed, the jack needs to be created before enabling jack
detection in the ts3a227e driver. With this patch, the jack is
instantiated in the max98090 headset init function if the ts3a227e is
present. This fixes a null pointer dereference as the jack detection
enabling function in the ts3a driver was called before the jack is
created.

[minor correction to keep error handling on jack creation the same
as before by Pierre Bossart]

Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 45 +++++++++++++++++++---------
 1 file changed, 31 insertions(+), 14 deletions(-)

diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
index 442a81bf17b4..e5da091abe48 100644
--- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c
+++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
@@ -166,23 +166,19 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
 	struct cht_mc_private *ctx = snd_soc_card_get_drvdata(runtime->card);
 	struct snd_soc_jack *jack = &ctx->jack;
 
-	/**
-	* TI supports 4 butons headset detection
-	* KEY_MEDIA
-	* KEY_VOICECOMMAND
-	* KEY_VOLUMEUP
-	* KEY_VOLUMEDOWN
-	*/
-	if (ctx->ts3a227e_present)
-		jack_type = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE |
-					SND_JACK_BTN_0 | SND_JACK_BTN_1 |
-					SND_JACK_BTN_2 | SND_JACK_BTN_3;
-	else
-		jack_type = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE;
+	if (ctx->ts3a227e_present) {
+		/*
+		 * The jack has already been created in the
+		 * cht_max98090_headset_init() function.
+		 */
+		snd_soc_jack_notifier_register(jack, &cht_jack_nb);
+		return 0;
+	}
+
+	jack_type = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE;
 
 	ret = snd_soc_card_jack_new(runtime->card, "Headset Jack",
 					jack_type, jack, NULL, 0);
-
 	if (ret) {
 		dev_err(runtime->dev, "Headset Jack creation failed %d\n", ret);
 		return ret;
@@ -257,6 +253,27 @@ static int cht_max98090_headset_init(struct snd_soc_component *component)
 {
 	struct snd_soc_card *card = component->card;
 	struct cht_mc_private *ctx = snd_soc_card_get_drvdata(card);
+	struct snd_soc_jack *jack = &ctx->jack;
+	int jack_type;
+	int ret;
+
+	/*
+	 * TI supports 4 butons headset detection
+	 * KEY_MEDIA
+	 * KEY_VOICECOMMAND
+	 * KEY_VOLUMEUP
+	 * KEY_VOLUMEDOWN
+	 */
+	jack_type = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE |
+		    SND_JACK_BTN_0 | SND_JACK_BTN_1 |
+		    SND_JACK_BTN_2 | SND_JACK_BTN_3;
+
+	ret = snd_soc_card_jack_new(card, "Headset Jack", jack_type,
+				    jack, NULL, 0);
+	if (ret) {
+		dev_err(card->dev, "Headset Jack creation failed %d\n", ret);
+		return ret;
+	}
 
 	return ts3a227e_enable_jack_detect(component, &ctx->jack);
 }
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Applied "ASoC: Intel: cht_bsw_max98090: add support for Baytrail" to the asoc tree
  2017-09-08  5:13 ` [PATCH 3/7] ASoC: Intel: cht_bsw_max98090: add support for Baytrail Pierre-Louis Bossart
  2017-09-18  7:17   ` Andy Shevchenko
@ 2017-09-19 13:45   ` Mark Brown
  1 sibling, 0 replies; 20+ messages in thread
From: Mark Brown @ 2017-09-19 13:45 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: alsa-devel, tiwai, liam.r.girdwood, vinod.koul, broonie,
	jarkko.nikula, andriy.shevchenko

The patch

   ASoC: Intel: cht_bsw_max98090: add support for Baytrail

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

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 299bad365b900223cded22a6f66dbb3763da4235 Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Date: Fri, 8 Sep 2017 00:13:05 -0500
Subject: [PATCH] ASoC: Intel: cht_bsw_max98090: add support for Baytrail

Distributions such as Fedora, Ubuntu and Gallium don't currently
have a means to support Baytrail Chromebooks and other platforms
with the same build [1][2] due to incompatible platform drivers.

Add MCLK management to reuse this machine driver for Baytrail
platforms and solve this coexistence problem at last. UCM files are
provided at [3] and will eventually be submitted to the new repo.

The legacy byt-max98090 machine driver is still maintained but can
only be used when the other Atom/DPCM driver is not compiled in, or
when users don't want to configure extra mixers required by the
Atom/sst driver.

Tested on Lenovo 100s Baytrail Chromebook w/ Mr. Chromebox BOOT_STUB
firmware and Acer R11 Cherrytrail Chromebook

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1335196
[2] http://mailman.alsa-project.org/pipermail/alsa-devel/2016-August/
111641.html
[3] https://github.com/plbossart/UCM/tree/master/byt-max98090

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 78 ++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)

diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
index 20755ecc7f9e..442a81bf17b4 100644
--- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c
+++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
@@ -23,6 +23,7 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/acpi.h>
+#include <linux/clk.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
 #include <sound/soc.h>
@@ -35,15 +36,60 @@
 #define CHT_CODEC_DAI	"HiFi"
 
 struct cht_mc_private {
+	struct clk *mclk;
 	struct snd_soc_jack jack;
 	bool ts3a227e_present;
 };
 
+static inline struct snd_soc_dai *cht_get_codec_dai(struct snd_soc_card *card)
+{
+	struct snd_soc_pcm_runtime *rtd;
+
+	list_for_each_entry(rtd, &card->rtd_list, list) {
+		if (!strncmp(rtd->codec_dai->name, CHT_CODEC_DAI,
+			     strlen(CHT_CODEC_DAI)))
+			return rtd->codec_dai;
+	}
+	return NULL;
+}
+
+static int platform_clock_control(struct snd_soc_dapm_widget *w,
+					  struct snd_kcontrol *k, int  event)
+{
+	struct snd_soc_dapm_context *dapm = w->dapm;
+	struct snd_soc_card *card = dapm->card;
+	struct snd_soc_dai *codec_dai;
+	struct cht_mc_private *ctx = snd_soc_card_get_drvdata(card);
+	int ret;
+
+	codec_dai = cht_get_codec_dai(card);
+	if (!codec_dai) {
+		dev_err(card->dev, "Codec dai not found; Unable to set platform clock\n");
+		return -EIO;
+	}
+
+	if (SND_SOC_DAPM_EVENT_ON(event)) {
+		ret = clk_prepare_enable(ctx->mclk);
+		if (ret < 0) {
+			dev_err(card->dev,
+				"could not configure MCLK state");
+			return ret;
+		}
+	} else {
+		clk_disable_unprepare(ctx->mclk);
+	}
+
+	return 0;
+}
+
 static const struct snd_soc_dapm_widget cht_dapm_widgets[] = {
 	SND_SOC_DAPM_HP("Headphone", NULL),
 	SND_SOC_DAPM_MIC("Headset Mic", NULL),
 	SND_SOC_DAPM_MIC("Int Mic", NULL),
 	SND_SOC_DAPM_SPK("Ext Spk", NULL),
+	SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
+			    platform_clock_control, SND_SOC_DAPM_PRE_PMU |
+			    SND_SOC_DAPM_POST_PMD),
 };
 
 static const struct snd_soc_dapm_route cht_audio_map[] = {
@@ -60,6 +106,10 @@ static const struct snd_soc_dapm_route cht_audio_map[] = {
 	{"codec_in0", NULL, "ssp2 Rx" },
 	{"codec_in1", NULL, "ssp2 Rx" },
 	{"ssp2 Rx", NULL, "HiFi Capture"},
+	{"Headphone", NULL, "Platform Clock"},
+	{"Headset Mic", NULL, "Platform Clock"},
+	{"Int Mic", NULL, "Platform Clock"},
+	{"Ext Spk", NULL, "Platform Clock"},
 };
 
 static const struct snd_kcontrol_new cht_mc_controls[] = {
@@ -141,6 +191,25 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
 	if (ctx->ts3a227e_present)
 		snd_soc_jack_notifier_register(jack, &cht_jack_nb);
 
+	/*
+	 * The firmware might enable the clock at
+	 * boot (this information may or may not
+	 * be reflected in the enable clock register).
+	 * To change the rate we must disable the clock
+	 * first to cover these cases. Due to common
+	 * clock framework restrictions that do not allow
+	 * to disable a clock that has not been enabled,
+	 * we need to enable the clock first.
+	 */
+	ret = clk_prepare_enable(ctx->mclk);
+	if (!ret)
+		clk_disable_unprepare(ctx->mclk);
+
+	ret = clk_set_rate(ctx->mclk, CHT_PLAT_CLK_3_HZ);
+
+	if (ret)
+		dev_err(runtime->dev, "unable to set MCLK rate\n");
+
 	return ret;
 }
 
@@ -294,6 +363,15 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 	/* register the soc card */
 	snd_soc_card_cht.dev = &pdev->dev;
 	snd_soc_card_set_drvdata(&snd_soc_card_cht, drv);
+
+	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);
+	}
+
 	ret_val = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cht);
 	if (ret_val) {
 		dev_err(&pdev->dev,
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Applied "ASoC: max98090: reduce verbosity on PLL unlock" to the asoc tree
  2017-09-08  5:13 ` [PATCH 1/7] ASoC: max98090: reduce verbosity on PLL unlock Pierre-Louis Bossart
@ 2017-09-19 13:45   ` Mark Brown
  0 siblings, 0 replies; 20+ messages in thread
From: Mark Brown @ 2017-09-19 13:45 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: alsa-devel, tiwai, liam.r.girdwood, vinod.koul, broonie,
	jarkko.nikula, andriy.shevchenko

The patch

   ASoC: max98090: reduce verbosity on PLL unlock

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

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 d10a7d3e2af98e639e74c64185f910915a560f07 Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Date: Fri, 8 Sep 2017 00:13:03 -0500
Subject: [PATCH] ASoC: max98090: reduce verbosity on PLL unlock

'commit b8a3ee820f7b ("ASoC: max98090: Add recovery for PLL lock failure")'
enabled a workaround PLL unlocked issues, but generates annoying
dev_info "PLL unlocked" messages at a 10ms rate, usually on startup.

Move to dev_info_ratelimited. This issue doesn't seem to impact audio
functionality.  This trace is commented out in the GalliumOS patches,
it's better to keep it to check on potential quality issues

Tested on Lenovo 100s (Baytrail Chromebook)

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/max98090.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 13bcfb1ef9b4..f5075d1f79e6 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2115,7 +2115,7 @@ static void max98090_pll_work(struct work_struct *work)
 	if (!snd_soc_codec_is_active(codec))
 		return;
 
-	dev_info(codec->dev, "PLL unlocked\n");
+	dev_info_ratelimited(codec->dev, "PLL unlocked\n");
 
 	/* Toggle shutdown OFF then ON */
 	snd_soc_update_bits(codec, M98090_REG_DEVICE_SHUTDOWN,
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2017-09-19 13:45 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-08  5:13 [PATCH 0/7] BYT/CHT clocks/max98090 updates Pierre-Louis Bossart
2017-09-08  5:13 ` [PATCH 1/7] ASoC: max98090: reduce verbosity on PLL unlock Pierre-Louis Bossart
2017-09-19 13:45   ` Applied "ASoC: max98090: reduce verbosity on PLL unlock" to the asoc tree Mark Brown
2017-09-08  5:13 ` [PATCH 2/7] ASoC: Intel: cht_bsw_max98090: Fix I2S config + unused code Pierre-Louis Bossart
2017-09-08  5:13 ` [PATCH 3/7] ASoC: Intel: cht_bsw_max98090: add support for Baytrail Pierre-Louis Bossart
2017-09-18  7:17   ` Andy Shevchenko
2017-09-18 17:14     ` Pierre-Louis Bossart
2017-09-19  9:51       ` Andy Shevchenko
2017-09-19 13:45   ` Applied "ASoC: Intel: cht_bsw_max98090: add support for Baytrail" to the asoc tree Mark Brown
2017-09-08  5:13 ` [PATCH 4/7] ASoC: Intel: atom: use cht_bsw_max98090 for Baytrail Chromebooks Pierre-Louis Bossart
2017-09-08  5:13 ` [PATCH 5/7] ASoC: ts3a227e: add acpi table Pierre-Louis Bossart
2017-09-08 13:27   ` Vinod Koul
2017-09-08 13:30     ` Pierre-Louis Bossart
2017-09-12 14:54       ` Mark Brown
2017-09-18  3:36       ` Vinod Koul
2017-09-08  5:13 ` [PATCH 6/7] ASoc: Intel: cht_bsw_max98090_ti: Fix jack initialization Pierre-Louis Bossart
2017-09-19 13:45   ` Applied "ASoC: Intel: cht_bsw_max98090_ti: Fix jack initialization" to the asoc tree Mark Brown
2017-09-08  5:13 ` [PATCH 7/7] ASoC: Intel: cht_bsw_max98090: add gpio-based jack detection Pierre-Louis Bossart
2017-09-19 13:45   ` Applied "ASoC: Intel: cht_bsw_max98090: add gpio-based jack detection" to the asoc tree Mark Brown
2017-09-18  3:36 ` [PATCH 0/7] BYT/CHT clocks/max98090 updates Vinod Koul

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.