From patchwork Fri Jan 16 21:14:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Clemens Ladisch X-Patchwork-Id: 5650321 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 97A30C058D for ; Fri, 16 Jan 2015 21:15:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C842E20306 for ; Fri, 16 Jan 2015 21:15:36 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E663920304 for ; Fri, 16 Jan 2015 21:15:35 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1B6392604F2; Fri, 16 Jan 2015 22:15:29 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 1F97F2604F2; Fri, 16 Jan 2015 22:15:23 +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 A8247260555; Fri, 16 Jan 2015 22:15:20 +0100 (CET) Received: from dehamd003.servertools24.de (dehamd003.servertools24.de [31.47.254.18]) by alsa0.perex.cz (Postfix) with ESMTP id A2C1C2604F2 for ; Fri, 16 Jan 2015 22:15:13 +0100 (CET) Received: from [192.168.42.72] (tmo-103-137.customers.d1-online.com [80.187.103.137]) by dehamd003.servertools24.de (Postfix) with ESMTPSA id 1F419F8011; Fri, 16 Jan 2015 22:10:32 +0100 (CET) Message-ID: <54B97F2A.60309@ladisch.de> Date: Fri, 16 Jan 2015 22:14:18 +0100 From: Clemens Ladisch User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Takashi Iwai References: <54B97EEB.8060108@ladisch.de> In-Reply-To: <54B97EEB.8060108@ladisch.de> X-PPP-Message-ID: <20150116211032.168888.48896@dehamd003.servertools24.de> X-PPP-Vhost: ladisch.de Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 1/4] ALSA: oxygen: do not create useless S/PDIF controls 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 Cards without S/PDIF output do not need those controls. Signed-off-by: Clemens Ladisch --- sound/pci/oxygen/oxygen_mixer.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c index 5988e04..2f698a9 100644 --- a/sound/pci/oxygen/oxygen_mixer.c +++ b/sound/pci/oxygen/oxygen_mixer.c @@ -786,6 +786,9 @@ static const struct snd_kcontrol_new controls[] = { .get = upmix_get, .put = upmix_put, }, +}; + +static const struct snd_kcontrol_new spdif_output_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, SWITCH), @@ -1073,6 +1076,12 @@ int oxygen_mixer_init(struct oxygen *chip) err = add_controls(chip, controls, ARRAY_SIZE(controls)); if (err < 0) return err; + if (chip->model.device_config & PLAYBACK_1_TO_SPDIF) { + err = add_controls(chip, spdif_output_controls, + ARRAY_SIZE(spdif_output_controls)); + if (err < 0) + return err; + } if (chip->model.device_config & CAPTURE_1_FROM_SPDIF) { err = add_controls(chip, spdif_input_controls, ARRAY_SIZE(spdif_input_controls));