From patchwork Mon Aug 15 14:15:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 104705 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1532329qga; Mon, 15 Aug 2016 09:37:38 -0700 (PDT) X-Received: by 10.28.203.136 with SMTP id b130mr15285757wmg.13.1471279058056; Mon, 15 Aug 2016 09:37:38 -0700 (PDT) Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id h10si20789453wjl.4.2016.08.15.09.37.37; Mon, 15 Aug 2016 09:37:38 -0700 (PDT) Received-SPF: neutral (google.com: 77.48.224.243 is neither permitted nor denied by best guess record for domain of alsa-devel-bounces@alsa-project.org) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=neutral (google.com: 77.48.224.243 is neither permitted nor denied by best guess record for domain of alsa-devel-bounces@alsa-project.org) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0D009266C1B; Mon, 15 Aug 2016 18:37:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.2.4 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 42746266821; Mon, 15 Aug 2016 18:09:43 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id BAE87266814; Mon, 15 Aug 2016 18:09:41 +0200 (CEST) Received: from mezzanine.sirena.org.uk (mezzanine.sirena.org.uk [106.187.55.193]) by alsa0.perex.cz (Postfix) with ESMTP id AB3ED26786D for ; Mon, 15 Aug 2016 16:15:54 +0200 (CEST) Received: from debutante.sirena.org.uk ([2a01:348:6:8808:fab::3] helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bZIgB-0007U1-5m; Mon, 15 Aug 2016 14:15:53 +0000 Received: from broonie by debutante with local (Exim 4.87) (envelope-from ) id 1bZIg8-0007K2-9L; Mon, 15 Aug 2016 15:15:48 +0100 From: Mark Brown To: Pierre-Louis Bossart In-Reply-To: <1471037280-17433-11-git-send-email-pierre-louis.bossart@linux.intel.com> Message-Id: Date: Mon, 15 Aug 2016 15:15:48 +0100 X-SA-Exim-Connect-IP: 2a01:348:6:8808:fab::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Cc: tiwai@suse.de, alsa-devel@alsa-project.org, broonie@kernel.org, irina.tirdea@intel.com Subject: [alsa-devel] Applied "ASoC: Intel: bytcr_rt5640: default routing and quirks on Baytrail-CR" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: Intel: bytcr_rt5640: default routing and quirks on Baytrail-CR 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 e214f5e78aca81080c156a68a263d31d51d0ea17 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Fri, 12 Aug 2016 16:27:53 -0500 Subject: [PATCH] ASoC: Intel: bytcr_rt5640: default routing and quirks on Baytrail-CR Auto routing based on Baytrail/Baytrail-CR detection Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown --- sound/soc/intel/boards/bytcr_rt5640.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) -- 2.8.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c index 42c7bd20f54d..c4a3c5778b38 100644 --- a/sound/soc/intel/boards/bytcr_rt5640.c +++ b/sound/soc/intel/boards/bytcr_rt5640.c @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include #include #include @@ -31,6 +33,7 @@ #include "../../codecs/rt5640.h" #include "../atom/sst-atom-controls.h" #include "../common/sst-acpi.h" +#include "../common/sst-dsp.h" enum { BYT_RT5640_DMIC1_MAP, @@ -189,7 +192,8 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = { }, .driver_data = (unsigned long *)(BYT_RT5640_IN1_MAP | BYT_RT5640_MONO_SPEAKER | - BYT_RT5640_DIFF_MIC + BYT_RT5640_DIFF_MIC | + BYT_RT5640_SSP0_AIF2 ), }, { @@ -464,6 +468,18 @@ static char byt_rt5640_codec_name[16]; /* i2c-:00 with HID being 8 chars */ static char byt_rt5640_codec_aif_name[12]; /* = "rt5640-aif[1|2]" */ static char byt_rt5640_cpu_dai_name[10]; /* = "ssp[0|2]-port" */ +static bool is_valleyview(void) +{ + static const struct x86_cpu_id cpu_ids[] __initconst = { + { X86_VENDOR_INTEL, 6, 55 }, /* Valleyview, Bay Trail */ + {} + }; + + if (!x86_match_cpu(cpu_ids)) + return false; + return true; +} + static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) { int ret_val = 0; @@ -494,6 +510,20 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) byt_rt5640_dais[dai_index].codec_name = byt_rt5640_codec_name; } + /* + * swap SSP0 if bytcr is detected + * (will be overridden if DMI quirk is detected) + */ + if (is_valleyview()) { + struct sst_platform_info *p_info = mach->pdata; + const struct sst_res_info *res_info = p_info->res_info; + + /* TODO: use CHAN package info from BIOS to detect AIF1/AIF2 */ + if (res_info->acpi_ipc_irq_index == 0) { + byt_rt5640_quirk |= BYT_RT5640_SSP0_AIF2; + } + } + /* check quirks before creating card */ dmi_check_system(byt_rt5640_quirk_table);