[alsa-devel] [PATCH 0/2] rt5651: Enable platforms with int mic on IN2
From: Carlo Caione carlo@endlessm.com
While working on enabling a cherry-trail laptop shipping the rt5651 codec I realized that the machine driver needed some fixup.
In particular the laptop I'm working on (KIANO SlimNote 14.2) has the internal mic connected to the IN2 port.
All the laptop-specific work with the related quirks will follow.
Carlo Caione (2): ASoC: intel: byt: Enable quirk logic for custom maps ASoC: intel: byt: Introduce new custom IN2 map
sound/soc/intel/boards/bytcr_rt5651.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
From: Carlo Caione carlo@endlessm.com
Enable again the quirk logic for the custom dapm routes.
Signed-off-by: Carlo Caione carlo@endlessm.com --- sound/soc/intel/boards/bytcr_rt5651.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c index 4a3516b38c2c..ec84454a232d 100644 --- a/sound/soc/intel/boards/bytcr_rt5651.c +++ b/sound/soc/intel/boards/bytcr_rt5651.c @@ -142,6 +142,12 @@ static int byt_rt5651_init(struct snd_soc_pcm_runtime *runtime) num_routes = ARRAY_SIZE(byt_rt5651_intmic_dmic1_map); }
+ ret = snd_soc_dapm_add_routes(&card->dapm, custom_map, num_routes); + if (ret) { + dev_err(card->dev, "unable to add custom routes map\n"); + return ret; + } + ret = snd_soc_add_card_controls(card, byt_rt5651_controls, ARRAY_SIZE(byt_rt5651_controls)); if (ret) {
From: Carlo Caione carlo@endlessm.com
Introduce a new custom dapm routes map to quirk platforms with the internal mic connected to IN2P.
Signed-off-by: Carlo Caione carlo@endlessm.com --- sound/soc/intel/boards/bytcr_rt5651.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c index ec84454a232d..a8a9c83dfcc0 100644 --- a/sound/soc/intel/boards/bytcr_rt5651.c +++ b/sound/soc/intel/boards/bytcr_rt5651.c @@ -47,7 +47,6 @@ static const struct snd_soc_dapm_route byt_rt5651_audio_map[] = { {"ssp2 Rx", NULL, "AIF1 Capture"},
{"Headset Mic", NULL, "micbias1"}, /* lowercase for rt5651 */ - {"IN2P", NULL, "Headset Mic"}, {"Headphone", NULL, "HPOL"}, {"Headphone", NULL, "HPOR"}, {"Speaker", NULL, "LOUTL"}, @@ -55,22 +54,32 @@ static const struct snd_soc_dapm_route byt_rt5651_audio_map[] = { };
static const struct snd_soc_dapm_route byt_rt5651_intmic_dmic1_map[] = { + {"IN2P", NULL, "Headset Mic"}, {"DMIC1", NULL, "Internal Mic"}, };
static const struct snd_soc_dapm_route byt_rt5651_intmic_dmic2_map[] = { + {"IN2P", NULL, "Headset Mic"}, {"DMIC2", NULL, "Internal Mic"}, };
static const struct snd_soc_dapm_route byt_rt5651_intmic_in1_map[] = { {"Internal Mic", NULL, "micbias1"}, {"IN1P", NULL, "Internal Mic"}, + {"IN2P", NULL, "Headset Mic"}, +}; + +static const struct snd_soc_dapm_route byt_rt5651_intmic_in2_map[] = { + {"Internal Mic", NULL, "micbias1"}, + {"IN2P", NULL, "Internal Mic"}, + {"IN1P", NULL, "Headset Mic"}, };
enum { BYT_RT5651_DMIC1_MAP, BYT_RT5651_DMIC2_MAP, BYT_RT5651_IN1_MAP, + BYT_RT5651_IN2_MAP, };
#define BYT_RT5651_MAP(quirk) ((quirk) & 0xff) @@ -133,6 +142,10 @@ static int byt_rt5651_init(struct snd_soc_pcm_runtime *runtime) custom_map = byt_rt5651_intmic_in1_map; num_routes = ARRAY_SIZE(byt_rt5651_intmic_in1_map); break; + case BYT_RT5651_IN2_MAP: + custom_map = byt_rt5651_intmic_in2_map; + num_routes = ARRAY_SIZE(byt_rt5651_intmic_in2_map); + break; case BYT_RT5651_DMIC2_MAP: custom_map = byt_rt5651_intmic_dmic2_map; num_routes = ARRAY_SIZE(byt_rt5651_intmic_dmic2_map);
On 10/18/17 11:07 AM, Carlo Caione wrote:
From: Carlo Caione carlo@endlessm.com
While working on enabling a cherry-trail laptop shipping the rt5651 codec I realized that the machine driver needed some fixup.
In particular the laptop I'm working on (KIANO SlimNote 14.2) has the internal mic connected to the IN2 port.
All the laptop-specific work with the related quirks will follow.
Nice, thanks for the work. You'll have to rebase and resubmit to fix conflicts. I provided changes to simplify DMIC quirks (there is a single interface, not 2 on this chip) that aren't reflected in your patches and the addition of MCLK support. Mark's for-next branch already took the changes this morning. Also let me know if you want the UCM files to be updated.
Carlo Caione (2): ASoC: intel: byt: Enable quirk logic for custom maps ASoC: intel: byt: Introduce new custom IN2 map
sound/soc/intel/boards/bytcr_rt5651.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
On Wed, Oct 18, 2017 at 5:19 PM, Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com wrote:
On 10/18/17 11:07 AM, Carlo Caione wrote:
From: Carlo Caione carlo@endlessm.com
While working on enabling a cherry-trail laptop shipping the rt5651 codec I realized that the machine driver needed some fixup.
In particular the laptop I'm working on (KIANO SlimNote 14.2) has the internal mic connected to the IN2 port.
All the laptop-specific work with the related quirks will follow.
Nice, thanks for the work. You'll have to rebase and resubmit to fix conflicts. I provided changes to simplify DMIC quirks (there is a single interface, not 2 on this chip) that aren't reflected in your patches and the addition of MCLK support. Mark's for-next branch already took the changes this morning.
Ups, missed that for a few hours. I'll prepare a new PR.
Also let me know if you want the UCM files to be updated.
I have a UCM file already that seems to work fine on this laptop. I'll prepare a PR also for that once all the kernel pieces are in place.
Thank you,
participants (3)
-
Carlo Caione
-
Carlo Caione
-
Pierre-Louis Bossart