From patchwork Fri Nov 28 11:20:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jie, Yang" X-Patchwork-Id: 5402891 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 42C019F47A for ; Fri, 28 Nov 2014 11:20:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5286920145 for ; Fri, 28 Nov 2014 11:20:27 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 104302011E for ; Fri, 28 Nov 2014 11:20:25 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0A6E2260446; Fri, 28 Nov 2014 12:20:22 +0100 (CET) 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 CA4A926044B; Fri, 28 Nov 2014 12:20:12 +0100 (CET) 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 EC20D26044C; Fri, 28 Nov 2014 12:20:10 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by alsa0.perex.cz (Postfix) with ESMTP id D42CD260446 for ; Fri, 28 Nov 2014 12:20:01 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 28 Nov 2014 03:12:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="422626575" Received: from keyon-u1310.sh.intel.com ([10.239.13.7]) by FMSMGA003.fm.intel.com with ESMTP; 28 Nov 2014 03:10:01 -0800 From: Jie Yang To: broonie@kernel.org Date: Fri, 28 Nov 2014 19:20:43 +0800 Message-Id: <1417173643-25331-1-git-send-email-yang.jie@intel.com> X-Mailer: git-send-email 1.9.1 Cc: alsa-devel@alsa-project.org, liam.r.girdwood@intel.com Subject: [alsa-devel] [PATCH] ASoC: Intel: Move capture PCM pin to PCM0 for Broadwell 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 Move capture PCM pin from PCM4 to PCM0 for Broadwell. This will allow us to integrate with pulseaudio better for usually default device is set to 0. Signed-off-by: Jie Yang --- sound/soc/intel/broadwell.c | 15 ++------------- sound/soc/intel/sst-haswell-pcm.c | 34 ++++++++++++++++------------------ 2 files changed, 18 insertions(+), 31 deletions(-) diff --git a/sound/soc/intel/broadwell.c b/sound/soc/intel/broadwell.c index 52cb764..c256764 100644 --- a/sound/soc/intel/broadwell.c +++ b/sound/soc/intel/broadwell.c @@ -171,7 +171,7 @@ static struct snd_soc_dai_link broadwell_rt286_dais[] = { /* Front End DAI links */ { .name = "System PCM", - .stream_name = "System Playback", + .stream_name = "System Playback/Capture", .cpu_dai_name = "System Pin", .platform_name = "haswell-pcm-audio", .dynamic = 1, @@ -180,6 +180,7 @@ static struct snd_soc_dai_link broadwell_rt286_dais[] = { .init = broadwell_rtd_init, .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, .dpcm_playback = 1, + .dpcm_capture = 1, }, { .name = "Offload0", @@ -214,18 +215,6 @@ static struct snd_soc_dai_link broadwell_rt286_dais[] = { .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, .dpcm_capture = 1, }, - { - .name = "Capture PCM", - .stream_name = "Capture", - .cpu_dai_name = "Capture Pin", - .platform_name = "haswell-pcm-audio", - .dynamic = 1, - .codec_name = "snd-soc-dummy", - .codec_dai_name = "snd-soc-dummy-dai", - .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, - .dpcm_capture = 1, - }, - /* Back End DAI links */ { /* SSP0 - Codec */ diff --git a/sound/soc/intel/sst-haswell-pcm.c b/sound/soc/intel/sst-haswell-pcm.c index 5f70d81..0180b38 100644 --- a/sound/soc/intel/sst-haswell-pcm.c +++ b/sound/soc/intel/sst-haswell-pcm.c @@ -309,7 +309,7 @@ static const struct snd_kcontrol_new hsw_volume_controls[] = { ARRAY_SIZE(volume_map) - 1, 0, hsw_stream_volume_get, hsw_stream_volume_put, hsw_vol_tlv), /* Mic Capture volume */ - SOC_DOUBLE_EXT_TLV("Mic Capture Volume", 4, 0, 8, + SOC_DOUBLE_EXT_TLV("Mic Capture Volume", 0, 0, 8, ARRAY_SIZE(volume_map) - 1, 0, hsw_stream_volume_get, hsw_stream_volume_put, hsw_vol_tlv), }; @@ -396,8 +396,14 @@ static int hsw_pcm_hw_params(struct snd_pcm_substream *substream, /* DSP stream type depends on DAI ID */ switch (rtd->cpu_dai->id) { case 0: - stream_type = SST_HSW_STREAM_TYPE_SYSTEM; - module_id = SST_HSW_MODULE_PCM_SYSTEM; + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + stream_type = SST_HSW_STREAM_TYPE_SYSTEM; + module_id = SST_HSW_MODULE_PCM_SYSTEM; + } + else { + stream_type = SST_HSW_STREAM_TYPE_CAPTURE; + module_id = SST_HSW_MODULE_PCM_CAPTURE; + } break; case 1: case 2: @@ -410,10 +416,6 @@ static int hsw_pcm_hw_params(struct snd_pcm_substream *substream, path_id = SST_HSW_STREAM_PATH_SSP0_OUT; module_id = SST_HSW_MODULE_PCM_REFERENCE; break; - case 4: - stream_type = SST_HSW_STREAM_TYPE_CAPTURE; - module_id = SST_HSW_MODULE_PCM_CAPTURE; - break; default: dev_err(rtd->dev, "error: invalid DAI ID %d\n", rtd->cpu_dai->id); @@ -779,6 +781,13 @@ static struct snd_soc_dai_driver hsw_dais[] = { .rates = SNDRV_PCM_RATE_48000, .formats = SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE, }, + .capture = { + .stream_name = "Analog Capture", + .channels_min = 2, + .channels_max = 4, + .rates = SNDRV_PCM_RATE_48000, + .formats = SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE, + }, }, { /* PCM */ @@ -815,17 +824,6 @@ static struct snd_soc_dai_driver hsw_dais[] = { .formats = SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE, }, }, - { - .name = "Capture Pin", - .id = HSW_PCM_DAI_ID_CAPTURE, - .capture = { - .stream_name = "Analog Capture", - .channels_min = 2, - .channels_max = 4, - .rates = SNDRV_PCM_RATE_48000, - .formats = SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE, - }, - }, }; static const struct snd_soc_dapm_widget widgets[] = {