From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, broonie@kernel.org,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
irina.tirdea@intel.com
Subject: [PATCH 02/17] ASoC: Intel: bytcr_rt5640: quirk for mono speaker
Date: Fri, 12 Aug 2016 16:27:45 -0500 [thread overview]
Message-ID: <1471037280-17433-3-git-send-email-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <1471037280-17433-1-git-send-email-pierre-louis.bossart@linux.intel.com>
Some Baytrail devices only have a mono speaker, add quirk and enable
it for T100TAF.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
sound/soc/intel/boards/bytcr_rt5640.c | 33 ++++++++++++++++++++++++++++-----
1 file changed, 28 insertions(+), 5 deletions(-)
diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c
index 2d3441d..421a53c 100644
--- a/sound/soc/intel/boards/bytcr_rt5640.c
+++ b/sound/soc/intel/boards/bytcr_rt5640.c
@@ -40,6 +40,7 @@ enum {
#define BYT_RT5640_MAP(quirk) ((quirk) & 0xff)
#define BYT_RT5640_DMIC_EN BIT(16)
+#define BYT_RT5640_MONO_SPEAKER BIT(17)
static unsigned long byt_rt5640_quirk = BYT_RT5640_DMIC1_MAP |
BYT_RT5640_DMIC_EN;
@@ -63,10 +64,6 @@ static const struct snd_soc_dapm_route byt_rt5640_audio_map[] = {
{"IN2P", NULL, "Headset Mic"},
{"Headphone", NULL, "HPOL"},
{"Headphone", NULL, "HPOR"},
- {"Speaker", NULL, "SPOLP"},
- {"Speaker", NULL, "SPOLN"},
- {"Speaker", NULL, "SPORP"},
- {"Speaker", NULL, "SPORN"},
};
static const struct snd_soc_dapm_route byt_rt5640_intmic_dmic1_map[] = {
@@ -82,6 +79,18 @@ static const struct snd_soc_dapm_route byt_rt5640_intmic_in1_map[] = {
{"IN1P", NULL, "Internal Mic"},
};
+static const struct snd_soc_dapm_route byt_rt5640_stereo_spk_map[] = {
+ {"Speaker", NULL, "SPOLP"},
+ {"Speaker", NULL, "SPOLN"},
+ {"Speaker", NULL, "SPORP"},
+ {"Speaker", NULL, "SPORN"},
+};
+
+static const struct snd_soc_dapm_route byt_rt5640_mono_spk_map[] = {
+ {"Speaker", NULL, "SPOLP"},
+ {"Speaker", NULL, "SPOLN"},
+};
+
static const struct snd_kcontrol_new byt_rt5640_controls[] = {
SOC_DAPM_PIN_SWITCH("Headphone"),
SOC_DAPM_PIN_SWITCH("Headset Mic"),
@@ -138,7 +147,9 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TAF"),
},
- .driver_data = (unsigned long *)BYT_RT5640_IN1_MAP,
+ .driver_data = (unsigned long *)(BYT_RT5640_IN1_MAP |
+ BYT_RT5640_MONO_SPEAKER
+ ),
},
{
.callback = byt_rt5640_quirk_cb,
@@ -200,6 +211,18 @@ static int byt_rt5640_init(struct snd_soc_pcm_runtime *runtime)
if (ret)
return ret;
+ if (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) {
+ ret = snd_soc_dapm_add_routes(&card->dapm,
+ byt_rt5640_mono_spk_map,
+ ARRAY_SIZE(byt_rt5640_mono_spk_map));
+ } else {
+ ret = snd_soc_dapm_add_routes(&card->dapm,
+ byt_rt5640_stereo_spk_map,
+ ARRAY_SIZE(byt_rt5640_stereo_spk_map));
+ }
+ if (ret)
+ return ret;
+
if (byt_rt5640_quirk & BYT_RT5640_DMIC_EN) {
ret = rt5640_dmic_enable(codec, 0, 0);
if (ret)
--
2.5.0
next prev parent reply other threads:[~2016-08-12 21:28 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-12 21:27 [PATCH 00/17] Baytrail audio fixes Pierre-Louis Bossart
2016-08-12 21:27 ` [PATCH 01/17] ASoC: Intel: bytcr-rt5640: add Asus T100TAF quirks Pierre-Louis Bossart
2016-08-15 14:16 ` Applied "ASoC: Intel: bytcr-rt5640: add Asus T100TAF quirks" to the asoc tree Mark Brown
2016-08-12 21:27 ` Pierre-Louis Bossart [this message]
2016-08-15 14:16 ` Applied "ASoC: Intel: bytcr_rt5640: quirk for mono speaker" " Mark Brown
2016-08-12 21:27 ` [PATCH 03/17] ASoC: Intel: bytcr_rt5640: enable differential mic quirk Pierre-Louis Bossart
2016-08-15 14:16 ` Applied "ASoC: Intel: bytcr_rt5640: enable differential mic quirk" to the asoc tree Mark Brown
2016-08-12 21:27 ` [PATCH 04/17] ASoC: Intel: Atom: auto-detection of Baytrail-CR Pierre-Louis Bossart
2016-08-15 14:16 ` Applied "ASoC: Intel: Atom: auto-detection of Baytrail-CR" to the asoc tree Mark Brown
2016-08-12 21:27 ` [PATCH 05/17] ASoC: Intel: Atom: add definitions for modem/SSP0 interface Pierre-Louis Bossart
2016-08-15 14:16 ` Applied "ASoC: Intel: Atom: add definitions for modem/SSP0 interface" to the asoc tree Mark Brown
2016-08-12 21:27 ` [PATCH 06/17] ASoC: Intel: atom: enable configuration of SSP0 Pierre-Louis Bossart
2016-08-15 14:16 ` Applied "ASoC: Intel: atom: enable configuration of SSP0" to the asoc tree Mark Brown
2016-08-12 21:27 ` [PATCH 07/17] ASoC: Intel: bytcr_rt5640: add SSP2_AIF2 routing Pierre-Louis Bossart
2016-08-15 14:15 ` Applied "ASoC: Intel: bytcr_rt5640: add SSP2_AIF2 routing" to the asoc tree Mark Brown
2016-08-12 21:27 ` [PATCH 08/17] ASoC: Intel: bytcr_rt56040: additional routing quirks Pierre-Louis Bossart
2016-08-15 14:15 ` Applied "ASoC: Intel: bytcr_rt56040: additional routing quirks" to the asoc tree Mark Brown
2016-08-12 21:27 ` [PATCH 09/17] ASoC: Intel: bytcr_rt5640: fix dai/clock setup for SSP0 routing Pierre-Louis Bossart
2016-08-15 14:15 ` Applied "ASoC: Intel: bytcr_rt5640: fix dai/clock setup for SSP0 routing" to the asoc tree Mark Brown
2016-08-12 21:27 ` [PATCH 10/17] ASoC: Intel: bytcr_rt5640: default routing and quirks on Baytrail-CR Pierre-Louis Bossart
2016-08-15 14:15 ` Applied "ASoC: Intel: bytcr_rt5640: default routing and quirks on Baytrail-CR" to the asoc tree Mark Brown
2016-08-12 21:27 ` [PATCH 11/17] ASoC: Intel: bytcr_rt5640: add IN3 map Pierre-Louis Bossart
2016-08-15 14:15 ` Applied "ASoC: Intel: bytcr_rt5640: add IN3 map" to the asoc tree Mark Brown
2016-08-12 21:27 ` [PATCH 12/17] ASoC: rt5640: add internal clock source support Pierre-Louis Bossart
2016-08-15 14:11 ` Applied "ASoC: rt5640: add internal clock source support" to the asoc tree Mark Brown
2016-08-12 21:27 ` [PATCH 13/17] clk: x86: Add Atom PMC platform clocks Pierre-Louis Bossart
2016-08-12 21:27 ` [PATCH 14/17] ASoC: Intel: bytcr_rt5640: add MCLK support Pierre-Louis Bossart
2016-08-15 14:15 ` Applied "ASoC: Intel: bytcr_rt5640: add MCLK support" to the asoc tree Mark Brown
2016-08-12 21:27 ` [PATCH 15/17] AsoC: Intel: Add quirks for MinnowBoard MAX Pierre-Louis Bossart
2016-08-15 14:15 ` Applied "AsoC: Intel: Add quirks for MinnowBoard MAX" to the asoc tree Mark Brown
2016-08-12 21:27 ` [PATCH 16/17] ASoC: bytcr_rt5640: Add quirk for Teclast X98 Air 3G tablet Pierre-Louis Bossart
2016-08-15 14:15 ` Applied "ASoC: Intel: bytcr_rt5640: Add quirk for Teclast X98 Air 3G tablet" to the asoc tree Mark Brown
2016-08-12 21:28 ` [PATCH 17/17] ASoC: Intel: bytcr_rt5640: log quirks Pierre-Louis Bossart
2016-08-15 14:15 ` Applied "ASoC: Intel: bytcr_rt5640: log quirks" to the asoc tree Mark Brown
2016-08-15 14:56 ` [PATCH 00/17] Baytrail audio fixes Pierre-Louis Bossart
2016-08-17 10:50 ` Mark Brown
2016-08-17 18:26 ` Pierre-Louis Bossart
2016-08-18 9:29 ` Mark Brown
2016-08-18 16:22 ` Pierre-Louis Bossart
2016-08-18 16:35 ` Mark Brown
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=1471037280-17433-3-git-send-email-pierre-louis.bossart@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=irina.tirdea@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).