From patchwork Wed Apr 1 11:30:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 6139591 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A131A9F350 for ; Wed, 1 Apr 2015 11:36:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B6654202EB for ; Wed, 1 Apr 2015 11:36:11 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E93B9202D1 for ; Wed, 1 Apr 2015 11:36:09 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id BC0BC26530C; Wed, 1 Apr 2015 13:36:08 +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 02B962651D8; Wed, 1 Apr 2015 13:35:39 +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 21DE4265253; Wed, 1 Apr 2015 13:35:38 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by alsa0.perex.cz (Postfix) with ESMTP id 208F12651D5 for ; Wed, 1 Apr 2015 13:35:28 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 01 Apr 2015 04:35:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,503,1422950400"; d="scan'208";a="701473265" Received: from vkoul-udesk3.iind.intel.com ([10.223.84.65]) by fmsmga002.fm.intel.com with ESMTP; 01 Apr 2015 04:35:26 -0700 From: Vinod Koul To: alsa-devel@alsa-project.org Date: Wed, 1 Apr 2015 17:00:58 +0530 Message-Id: <1427887862-29054-2-git-send-email-vinod.koul@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1427887862-29054-1-git-send-email-vinod.koul@intel.com> References: <1427887862-29054-1-git-send-email-vinod.koul@intel.com> Cc: tiwai@suse.de, patches.audio@intel.com, Vinod Koul , lgirdwood@gmail.com, Jeeja KP Subject: [alsa-devel] [PATCH v3 1/5] ALSA: hda: add HDA_MAX_CODECS 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 This moves AZX_MAX_CODECS define to HDA_MAX_CODECS so that common code can use this as well Signed-off-by: Jeeja KP Signed-off-by: Vinod Koul --- include/sound/hdaudio.h | 2 ++ sound/pci/hda/hda_controller.c | 4 ++-- sound/pci/hda/hda_controller.h | 9 ++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h index 675614dc2b88..c67dbd3d8afa 100644 --- a/include/sound/hdaudio.h +++ b/include/sound/hdaudio.h @@ -8,6 +8,8 @@ #include #include +#define HDA_MAX_CODECS 8 + /* codec node id */ typedef u16 hda_nid_t; diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c index 26ce990592a0..abb3822f5488 100644 --- a/sound/pci/hda/hda_controller.c +++ b/sound/pci/hda/hda_controller.c @@ -1066,7 +1066,7 @@ static unsigned int azx_command_addr(u32 cmd) { unsigned int addr = cmd >> 28; - if (addr >= AZX_MAX_CODECS) { + if (addr >= HDA_MAX_CODECS) { snd_BUG(); addr = 0; } @@ -1136,7 +1136,7 @@ static void azx_update_rirb(struct azx *chip) res_ex = le32_to_cpu(chip->rirb.buf[rp + 1]); res = le32_to_cpu(chip->rirb.buf[rp]); addr = res_ex & 0xf; - if ((addr >= AZX_MAX_CODECS) || !(chip->codec_mask & (1 << addr))) { + if ((addr >= HDA_MAX_CODECS) || !(chip->codec_mask & (1 << addr))) { dev_err(chip->card->dev, "spurious response %#x:%#x, rp = %d, wp = %d", res, res_ex, chip->rirb.rp, wp); diff --git a/sound/pci/hda/hda_controller.h b/sound/pci/hda/hda_controller.h index be1b7ded8d82..2aa75e34a718 100644 --- a/sound/pci/hda/hda_controller.h +++ b/sound/pci/hda/hda_controller.h @@ -119,9 +119,8 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 }; #define RIRB_INT_MASK 0x05 /* STATESTS int mask: S3,SD2,SD1,SD0 */ -#define AZX_MAX_CODECS 8 #define AZX_DEFAULT_CODECS 4 -#define STATESTS_INT_MASK ((1 << AZX_MAX_CODECS) - 1) +#define STATESTS_INT_MASK ((1 << HDA_MAX_CODECS) - 1) /* SD_CTL bits */ #define SD_CTL_STREAM_RESET 0x01 /* stream reset bit */ @@ -245,8 +244,8 @@ struct azx_rb { dma_addr_t addr; /* physical address of CORB/RIRB buffer */ /* for RIRB */ unsigned short rp, wp; /* read/write pointers */ - int cmds[AZX_MAX_CODECS]; /* number of pending requests */ - u32 res[AZX_MAX_CODECS]; /* last read value */ + int cmds[HDA_MAX_CODECS]; /* number of pending requests */ + u32 res[HDA_MAX_CODECS]; /* last read value */ }; struct azx; @@ -360,7 +359,7 @@ struct azx { unsigned int disabled:1; /* disabled by VGA-switcher */ /* for debugging */ - unsigned int last_cmd[AZX_MAX_CODECS]; + unsigned int last_cmd[HDA_MAX_CODECS]; #ifdef CONFIG_SND_HDA_DSP_LOADER struct azx_dev saved_azx_dev;