From patchwork Tue May 13 04:35:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lin, Mengdong" X-Patchwork-Id: 4162261 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 1A97A9F271 for ; Tue, 13 May 2014 04:34:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4CFC220306 for ; Tue, 13 May 2014 04:34:37 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 1654C202FF for ; Tue, 13 May 2014 04:34:36 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5DDDF265311; Tue, 13 May 2014 06:34:34 +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 99F9626530D; Tue, 13 May 2014 06:34:23 +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 BECE826530E; Tue, 13 May 2014 06:34:22 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by alsa0.perex.cz (Postfix) with ESMTP id 2C8462652F1 for ; Tue, 13 May 2014 06:34:13 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 12 May 2014 21:34:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="4.97,1041,1389772800"; d="scan'208"; a="530881305" Received: from amanda-hsw-pc.sh.intel.com ([10.239.37.27]) by fmsmga001.fm.intel.com with ESMTP; 12 May 2014 21:34:10 -0700 From: mengdong.lin@intel.com To: alsa-devel@alsa-project.org, tiwai@suse.de Date: Tue, 13 May 2014 12:35:59 +0800 Message-Id: <1399955759-3171-1-git-send-email-mengdong.lin@intel.com> X-Mailer: git-send-email 1.8.1.2 Cc: Mengdong Lin Subject: [alsa-devel] [PATCH 1/2] ALSA: hda - allow to mask a buggy stream DMA by setting it as opened 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 From: Mengdong Lin The function azx_init_stream() can accept a bit mask parameter. If the bit for a stream DMA is set, that stream device will be masked by setting it as opened and so it will never be assigned to any PCM stream. Signed-off-by: Mengdong Lin diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c index 248b90a..378fed7 100644 --- a/sound/pci/hda/hda_controller.c +++ b/sound/pci/hda/hda_controller.c @@ -2004,7 +2004,7 @@ EXPORT_SYMBOL_GPL(azx_mixer_create); /* initialize SD streams */ -int azx_init_stream(struct azx *chip) +int azx_init_stream(struct azx *chip, unsigned int mask) { int i; @@ -2022,6 +2022,9 @@ int azx_init_stream(struct azx *chip) /* stream tag: must be non-zero and unique */ azx_dev->index = i; azx_dev->stream_tag = i + 1; + /* mask a buggy stream DMA by setting it as opened */ + if (mask & (1 << i)) + azx_dev->opened = 1; } return 0; diff --git a/sound/pci/hda/hda_controller.h b/sound/pci/hda/hda_controller.h index baf0e77..2fd8e6d 100644 --- a/sound/pci/hda/hda_controller.h +++ b/sound/pci/hda/hda_controller.h @@ -48,6 +48,6 @@ int azx_codec_create(struct azx *chip, const char *model, int *power_save_to); int azx_codec_configure(struct azx *chip); int azx_mixer_create(struct azx *chip); -int azx_init_stream(struct azx *chip); +int azx_init_stream(struct azx *chip, unsigned int mask); #endif /* __SOUND_HDA_CONTROLLER_H */ diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index d6bca62..377c3a5 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1364,7 +1364,7 @@ static int azx_first_init(struct azx *chip) return err; /* initialize streams */ - azx_init_stream(chip); + azx_init_stream(chip, 0); /* initialize chip */ azx_init_pci(chip);