From patchwork Wed Mar 2 12:03:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Subhransu S. Prusty" X-Patchwork-Id: 8480411 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 29E919F2F0 for ; Wed, 2 Mar 2016 12:04:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0BCBA20383 for ; Wed, 2 Mar 2016 12:04:23 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 1545A20377 for ; Wed, 2 Mar 2016 12:04:17 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2FA8A2666F8; Wed, 2 Mar 2016 13:04:16 +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, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0876C2652E6; Wed, 2 Mar 2016 13:03:38 +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 07B44261566; Wed, 2 Mar 2016 13:03:31 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by alsa0.perex.cz (Postfix) with ESMTP id 1B7902651E4 for ; Wed, 2 Mar 2016 13:03:22 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 02 Mar 2016 04:03:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,528,1449561600"; d="scan'208";a="927878792" Received: from subhransu-desktop.iind.intel.com ([10.223.96.24]) by fmsmga002.fm.intel.com with ESMTP; 02 Mar 2016 04:03:04 -0800 From: "Subhransu S. Prusty" To: alsa-devel@alsa-project.org Date: Wed, 2 Mar 2016 17:33:24 +0530 Message-Id: <1456920208-1172-4-git-send-email-subhransu.s.prusty@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1456920208-1172-1-git-send-email-subhransu.s.prusty@intel.com> References: <1456920208-1172-1-git-send-email-subhransu.s.prusty@intel.com> Cc: tiwai@suse.de, lgirdwood@gmail.com, patches.audio@intel.com, broonie@kernel.org, Vinod Koul , "Subhransu S. Prusty" Subject: [alsa-devel] [PATCH v2 3/7] ALSA: hda - Use hdmi name space for CEA spk alloc structure 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 Signed-off-by: Subhransu S. Prusty Signed-off-by: Vinod Koul --- include/sound/hdmi_chmap.h | 6 +++--- sound/pci/hda/patch_hdmi.c | 26 ++++++++++++++------------ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/include/sound/hdmi_chmap.h b/include/sound/hdmi_chmap.h index c7702ef9..937ddb2 100644 --- a/include/sound/hdmi_chmap.h +++ b/include/sound/hdmi_chmap.h @@ -7,7 +7,7 @@ #include -struct cea_channel_speaker_allocation { +struct hdmi_cea_channel_speaker_allocation { int ca_index; int speakers[8]; @@ -23,9 +23,9 @@ struct hdmi_chmap_ops { * for devices that have non-standard mapping requirements. */ int (*chmap_cea_alloc_validate_get_type)(struct hdmi_chmap *chmap, - struct cea_channel_speaker_allocation *cap, int channels); + struct hdmi_cea_channel_speaker_allocation *cap, int channels); void (*cea_alloc_to_tlv_chmap) - (struct cea_channel_speaker_allocation *cap, + (struct hdmi_cea_channel_speaker_allocation *cap, unsigned int *chmap, int channels); /* check that the user-given chmap is supported */ diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index ed51d0d..5219484 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -297,7 +297,7 @@ static int hdmi_channel_mapping[0x32][8] = { * The preceding ones have better chances to be selected by * hdmi_channel_allocation(). */ -static struct cea_channel_speaker_allocation channel_allocations[] = { +static struct hdmi_cea_channel_speaker_allocation channel_allocations[] = { /* channel: 7 6 5 4 3 2 1 0 */ { .ca_index = 0x00, .speakers = { 0, 0, 0, 0, 0, 0, FR, FL } }, /* 2.1 */ @@ -683,7 +683,7 @@ static inline void eld_proc_free(struct hdmi_spec_per_pin *per_pin) static void init_channel_allocations(void) { int i, j; - struct cea_channel_speaker_allocation *p; + struct hdmi_cea_channel_speaker_allocation *p; for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) { p = channel_allocations + i; @@ -791,7 +791,7 @@ static void hdmi_std_setup_channel_mapping(struct hda_codec *codec, int ca) { struct hdmi_spec *spec = codec->spec; - struct cea_channel_speaker_allocation *ch_alloc; + struct hdmi_cea_channel_speaker_allocation *ch_alloc; int i; int err; int order; @@ -2358,7 +2358,7 @@ static int hdmi_chmap_ctl_info(struct snd_kcontrol *kcontrol, } static int hdmi_chmap_cea_alloc_validate_get_type(struct hdmi_chmap *chmap, - struct cea_channel_speaker_allocation *cap, int channels) + struct hdmi_cea_channel_speaker_allocation *cap, int channels) { /* If the speaker allocation matches the channel count, it is OK.*/ if (cap->channels != channels) @@ -2368,8 +2368,9 @@ static int hdmi_chmap_cea_alloc_validate_get_type(struct hdmi_chmap *chmap, return SNDRV_CTL_TLVT_CHMAP_VAR; } -static void hdmi_cea_alloc_to_tlv_chmap(struct cea_channel_speaker_allocation *cap, - unsigned int *chmap, int channels) +static void hdmi_cea_alloc_to_tlv_chmap( + struct hdmi_cea_channel_speaker_allocation *cap, + unsigned int *chmap, int channels) { int count = 0; int c; @@ -2439,7 +2440,7 @@ static int hdmi_chmap_ctl_tlv(struct snd_kcontrol *kcontrol, int op_flag, dst = tlv + 2; for (chs = 2; chs <= chmap->channels_max; chs++) { int i; - struct cea_channel_speaker_allocation *cap; + struct hdmi_cea_channel_speaker_allocation *cap; cap = channel_allocations; for (i = 0; i < ARRAY_SIZE(channel_allocations); i++, cap++) { int chs_bytes = chs * 4; @@ -3519,7 +3520,7 @@ static int patch_nvhdmi_8ch_7x(struct hda_codec *codec) * - 0x10de0040 */ static int nvhdmi_chmap_cea_alloc_validate_get_type(struct hdmi_chmap *chmap, - struct cea_channel_speaker_allocation *cap, int channels) + struct hdmi_cea_channel_speaker_allocation *cap, int channels) { if (cap->ca_index == 0x00 && channels == 2) return SNDRV_CTL_TLVT_CHMAP_FIXED; @@ -3803,7 +3804,7 @@ static int atihdmi_paired_swap_fc_lfe(int pos) static int atihdmi_paired_chmap_validate(int ca, int chs, unsigned char *map) { - struct cea_channel_speaker_allocation *cap; + struct hdmi_cea_channel_speaker_allocation *cap; int i, j; /* check that only channel pairs need to be remapped on old pre-rev3 ATI/AMD */ @@ -3914,7 +3915,7 @@ static int atihdmi_pin_get_slot_channel(struct hda_codec *codec, hda_nid_t pin_n static int atihdmi_paired_chmap_cea_alloc_validate_get_type( struct hdmi_chmap *chmap, - struct cea_channel_speaker_allocation *cap, + struct hdmi_cea_channel_speaker_allocation *cap, int channels) { int c; @@ -3942,8 +3943,9 @@ static int atihdmi_paired_chmap_cea_alloc_validate_get_type( return SNDRV_CTL_TLVT_CHMAP_PAIRED; } -static void atihdmi_paired_cea_alloc_to_tlv_chmap(struct cea_channel_speaker_allocation *cap, - unsigned int *chmap, int channels) +static void atihdmi_paired_cea_alloc_to_tlv_chmap( + struct hdmi_cea_channel_speaker_allocation *cap, + unsigned int *chmap, int channels) { /* produce paired maps for pre-rev3 ATI/AMD codecs */ int count = 0;