From patchwork Wed Dec 14 15:16:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud POULIQUEN X-Patchwork-Id: 9474471 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9F0A2607EE for ; Wed, 14 Dec 2016 18:14:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 962012872A for ; Wed, 14 Dec 2016 18:14:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 896902872D; Wed, 14 Dec 2016 18:14:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D266028709 for ; Wed, 14 Dec 2016 18:14:04 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id EBF0C2670B6; Wed, 14 Dec 2016 19:13:58 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A2AFA2670BB; Wed, 14 Dec 2016 19:11: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 008CD266FDE; Wed, 14 Dec 2016 16:17:29 +0100 (CET) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by alsa0.perex.cz (Postfix) with ESMTP id 6F396267002 for ; Wed, 14 Dec 2016 16:17:21 +0100 (CET) Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by m0046037.ppops.net (8.16.0.11/8.16.0.11) with SMTP id uBEFEShc006306; Wed, 14 Dec 2016 16:17:21 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-.pphosted.com with ESMTP id 2788bwxbgb-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 14 Dec 2016 16:17:20 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 533F838; Wed, 14 Dec 2016 15:17:18 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1FA1D2688; Wed, 14 Dec 2016 15:17:18 +0000 (GMT) Received: from localhost (10.201.23.162) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.294.0; Wed, 14 Dec 2016 16:17:17 +0100 From: Arnaud Pouliquen To: , Date: Wed, 14 Dec 2016 16:16:43 +0100 Message-ID: <1481728605-22781-3-git-send-email-arnaud.pouliquen@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1481728605-22781-1-git-send-email-arnaud.pouliquen@st.com> References: <1481728605-22781-1-git-send-email-arnaud.pouliquen@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.23.162] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-12-14_10:, , signatures=0 Cc: kernel@stlinux.com, Takashi Iwai , lgirdwood@gmail.com, Jyri Sarha , Takashi Sakamoto , David Airlie , broonie@kernel.org, Daniel Vetter Subject: [alsa-devel] [PATCH v2 2/4] ALSA pcm: allow non constant snd_pcm_chmap_elem 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP For HDMI, channel mapping can be retrieved from ELD. In this case mapping can change during runtime (plug/unplug). This patch suppresses the 'const' property of the struct chmap. Signed-off-by: Arnaud Pouliquen --- include/sound/pcm.h | 4 ++-- sound/core/pcm_lib.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/sound/pcm.h b/include/sound/pcm.h index af1fb37..3b459a3 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -1355,7 +1355,7 @@ struct snd_pcm_chmap { struct snd_pcm *pcm; /* assigned PCM instance */ int stream; /* PLAYBACK or CAPTURE */ struct snd_kcontrol *kctl; - const struct snd_pcm_chmap_elem *chmap; + struct snd_pcm_chmap_elem *chmap; unsigned int max_channels; unsigned int channel_mask; /* optional: active channels bitmask */ void *private_data; /* optional: private data pointer */ @@ -1387,7 +1387,7 @@ extern const struct snd_pcm_chmap_elem snd_pcm_alt_chmaps[]; #define SND_PCM_CHMAP_MASK_2468 (SND_PCM_CHMAP_MASK_246 | (1U << 8)) int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream, - const struct snd_pcm_chmap_elem *chmap, + struct snd_pcm_chmap_elem *chmap, int max_channels, unsigned long private_value, struct snd_pcm_chmap **info_ret); diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index bb12615..252a498 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -2489,7 +2489,7 @@ static int pcm_chmap_ctl_get(struct snd_kcontrol *kcontrol, struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol); unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); struct snd_pcm_substream *substream; - const struct snd_pcm_chmap_elem *map; + struct snd_pcm_chmap_elem *map; if (snd_BUG_ON(!info->chmap)) return -EINVAL; @@ -2519,7 +2519,7 @@ static int pcm_chmap_ctl_tlv(struct snd_kcontrol *kcontrol, int op_flag, unsigned int size, unsigned int __user *tlv) { struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol); - const struct snd_pcm_chmap_elem *map; + struct snd_pcm_chmap_elem *map; unsigned int __user *dst; int c, count = 0; @@ -2578,7 +2578,7 @@ static void pcm_chmap_ctl_private_free(struct snd_kcontrol *kcontrol) * Return: Zero if successful, or a negative error value. */ int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream, - const struct snd_pcm_chmap_elem *chmap, + struct snd_pcm_chmap_elem *chmap, int max_channels, unsigned long private_value, struct snd_pcm_chmap **info_ret)