From patchwork Wed Oct 1 12:08:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 5011591 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8F9C4BEEA6 for ; Wed, 1 Oct 2014 12:09:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AF55C20165 for ; Wed, 1 Oct 2014 12:09:27 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 698062016C for ; Wed, 1 Oct 2014 12:09:26 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2B9FF2614C2; Wed, 1 Oct 2014 14:09:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 099DE2604A9; Wed, 1 Oct 2014 14:08:44 +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 0F20D260486; Wed, 1 Oct 2014 14:08:43 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by alsa0.perex.cz (Postfix) with ESMTP id 4AC68260486 for ; Wed, 1 Oct 2014 14:08:33 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 01 Oct 2014 05:08:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="394062823" Received: from mylly.fi.intel.com (HELO mylly.fi.intel.com.) ([10.237.72.51]) by FMSMGA003.fm.intel.com with ESMTP; 01 Oct 2014 05:02:05 -0700 From: Jarkko Nikula To: alsa-devel@alsa-project.org Date: Wed, 1 Oct 2014 15:08:15 +0300 Message-Id: <1412165295-24229-2-git-send-email-jarkko.nikula@linux.intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1412165295-24229-1-git-send-email-jarkko.nikula@linux.intel.com> References: <1412165295-24229-1-git-send-email-jarkko.nikula@linux.intel.com> Cc: Mark Brown , Jarkko Nikula , Liam Girdwood Subject: [alsa-devel] [PATCH 2/2] ASoC: Intel: byt-rt5640: Enable DMIC interface for default DAPM route 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 X-Virus-Scanned: ClamAV using ClamSMTP It turned out DMIC interface wasn't enabled/disabled runtime for active DMIC route in the rt5640 codec driver anymore after commit 71d97a794301 ("ASoC: rt5640: Use the platform data for DMIC settings"). Since DMIC interface must be enabled explicitly either by passing platform data to rt5640 codec driver or by calling new rt5640_dmic_enable() this patch adds a DMI quirk flag that is used to conditionally enable DMIC interface during sound card init time. Signed-off-by: Jarkko Nikula --- Goes on top of ("ASoC: Intel: byt-rt5640: Add quirk for Asus T100") --- sound/soc/intel/byt-rt5640.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sound/soc/intel/byt-rt5640.c b/sound/soc/intel/byt-rt5640.c index c323a101214e..8392c160d9e2 100644 --- a/sound/soc/intel/byt-rt5640.c +++ b/sound/soc/intel/byt-rt5640.c @@ -59,7 +59,11 @@ enum { BYT_RT5640_IN1_MAP, }; -static unsigned long byt_rt5640_custom_map = BYT_RT5640_DMIC1_MAP; +#define BYT_RT5640_MAP(quirk) ((quirk) & 0xff) +#define BYT_RT5640_DMIC_EN BIT(16) + +static unsigned long byt_rt5640_quirk = BYT_RT5640_DMIC1_MAP | + BYT_RT5640_DMIC_EN; static const struct snd_kcontrol_new byt_rt5640_controls[] = { SOC_DAPM_PIN_SWITCH("Headphone"), @@ -94,7 +98,7 @@ static int byt_rt5640_hw_params(struct snd_pcm_substream *substream, static int byt_rt5640_quirk_cb(const struct dmi_system_id *id) { - byt_rt5640_custom_map = (unsigned long)id->driver_data; + byt_rt5640_quirk = (unsigned long)id->driver_data; return 1; } @@ -129,7 +133,7 @@ static int byt_rt5640_init(struct snd_soc_pcm_runtime *runtime) } dmi_check_system(byt_rt5640_quirk_table); - switch (byt_rt5640_custom_map) { + switch (BYT_RT5640_MAP(byt_rt5640_quirk)) { case BYT_RT5640_IN1_MAP: custom_map = byt_rt5640_intmic_in1_map; num_routes = ARRAY_SIZE(byt_rt5640_intmic_in1_map); @@ -143,6 +147,12 @@ static int byt_rt5640_init(struct snd_soc_pcm_runtime *runtime) if (ret) return ret; + if (byt_rt5640_quirk & BYT_RT5640_DMIC_EN) { + ret = rt5640_dmic_enable(codec, 0, 0); + if (ret) + return ret; + } + snd_soc_dapm_ignore_suspend(dapm, "HPOL"); snd_soc_dapm_ignore_suspend(dapm, "HPOR");