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: 9477139 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 0EEF960825 for ; Fri, 16 Dec 2016 00:33:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C05628888 for ; Fri, 16 Dec 2016 00:33:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2050288A3; Fri, 16 Dec 2016 00:33:24 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 56F8528888 for ; Fri, 16 Dec 2016 00:33:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2961D6EAB9; Fri, 16 Dec 2016 00:32:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1C4CC6E834 for ; Wed, 14 Dec 2016 15:17:35 +0000 (UTC) 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: , Subject: [PATCH v2 2/4] ALSA pcm: allow non constant snd_pcm_chmap_elem 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 X-Mailman-Approved-At: Fri, 16 Dec 2016 00:32:30 +0000 Cc: kernel@stlinux.com, lgirdwood@gmail.com, Jyri Sarha , Takashi Sakamoto , broonie@kernel.org, Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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)