Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp17802lfv; Tue, 12 Apr 2022 15:26:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUTYJKnK9zUYlndulTpyTpNieSdUQpb6Lt4WbCapcGSqiaEKYiExZdvwRRg9C0T+CWq6/j X-Received: by 2002:a17:90b:4b06:b0:1c9:9751:cf9b with SMTP id lx6-20020a17090b4b0600b001c99751cf9bmr7437794pjb.0.1649802399339; Tue, 12 Apr 2022 15:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649802399; cv=none; d=google.com; s=arc-20160816; b=neZpB3RriiycG00BVUFECtz0Jx9wSzesCcEdUf/H7cf9HZEP1nYk+rAparT625B5/R 7U/FfLUvt54hyGI0AN/8aAtOf/UbiCfF3WmCBcKidrLCiwHfSTS0Vs8OMX5dnInlt8cG OC8uvVIHeysm1Ymja79EDCzrQK0kJp5Qkhz1oSWiZxZl8uxPoFZyY+gIjTKOfVeJdP8y Q2xp0y2hP9g3jAUtcGiXP2JI4ttrxhJphIYxR2r1iNBnfsytq5AW8kY1GtRXEznjEN3r s3bBjVrCB42539BOcJXtoxyY9KWiLXgFoUf6vCwvLv6TY52SudxPDSAxiWl8CHnKaV7S Ox5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=Wrdhrovfp9igpg1Vn3cvddXhYs7PD/M9oeVuBu/dN1k=; b=DpxvqO0Pz3OWkQ9HhwJbkg6ZqYGo28kz1CMs+r+bEAJbsGl1k78+6WBcjxbC4E4Xlr C5/aatgIFNgns0BPif5Woq3HZgtzHM9aFBdRjg8kun0vBRVtUBiEMzbgx3os5R2hxDFT EtrayLM8DZTMz5Eo4u+rdN2/8XQLjoPFgXAVpHZjGqdKgMJOcAeFXNRk/eTH0DB8qCoo yl8FvFJRDHRLtraQ1PTJl5VP6OvlD8vHG3gIO7GqvbODyMCBBLrNCFGTD+YIhm1yhHPU 6Kkz/3VTzvkHs0RABy5SnaVm99tU/nf1BcpHB0TOJLCQIO+9/qJsbAEWYx4jta3ocg0X zjEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=oHGXztL3; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=trf+dqRu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id ik7-20020a170902ab0700b00153b2d16549si12368328plb.337.2022.04.12.15.26.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 15:26:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=oHGXztL3; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=trf+dqRu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BB63115B87F; Tue, 12 Apr 2022 14:05:01 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356793AbiDLPAn (ORCPT + 99 others); Tue, 12 Apr 2022 11:00:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356788AbiDLPAm (ORCPT ); Tue, 12 Apr 2022 11:00:42 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AAEC53A65 for ; Tue, 12 Apr 2022 07:58:23 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 3AEE0215FE; Tue, 12 Apr 2022 14:58:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1649775502; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Wrdhrovfp9igpg1Vn3cvddXhYs7PD/M9oeVuBu/dN1k=; b=oHGXztL3xxxiG5VbYRn2wMINMpTRQcN5bsirlVHHnK6xpad5OlcIiJc/tbyYzbTdLXhRbE 9G/KxJ3CQRf5oHhMXQXn8FtVQlzQifrJfzuVRG3ewK2EqKZ2GMh26JxNNP0e2m2MrAoGum BMF8R7V/DdKpGtcqFdNDMK1SvhPPtak= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1649775502; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Wrdhrovfp9igpg1Vn3cvddXhYs7PD/M9oeVuBu/dN1k=; b=trf+dqRui6VJjShzcbp73HBkABw4ffcw5D+4InEPmHzM+G/IafSqZ6fkf6e1BBrt7zaPC1 yslxlMFAXATVQqBQ== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 23008A3B8A; Tue, 12 Apr 2022 14:58:22 +0000 (UTC) Date: Tue, 12 Apr 2022 16:58:22 +0200 Message-ID: From: Takashi Iwai To: Stefan Wahren Cc: Adrien Thierry , Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Nicolas Saenz Julienne , Takashi Iwai , Maxime Ripard , linux-staging@lists.linux.dev, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: bcm2835-audio: remove compat ALSA card In-Reply-To: <69de07fb-efdb-5296-f48b-e3af2ac5ef49@i2se.com> References: <20220408150359.26661-1-athierry@redhat.com> <69de07fb-efdb-5296-f48b-e3af2ac5ef49@i2se.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 08 Apr 2022 23:00:52 +0200, Stefan Wahren wrote: > > Hi Adrien, > > [ add Maxime and Takashi ] > > Am 08.04.22 um 17:03 schrieb Adrien Thierry: > > Remove compat ALSA card, which has overlapping functionality with the > > two other cards described by the driver (HDMI and headphones) > > > > This handles TODO item "Revisit multi-cards options and PCM route mixer > > control". > > > > Move the S/PDIF device that was part of the compat ALSA card to the HDMI > > card. > > > > Only enable headphones card by default, because HDMI breaks when using > > both vc4 and bcm2835-audio with HDMI card enabled. > > > > Signed-off-by: Adrien Thierry > > --- > > > > I was able to test PCM output on 3.5mm and HDMI on a Raspberry Pi 4. > > However, I couldn't test the HDMI S/PDIF device since I don't own a S/PDIF > > capable speaker. > > thanks for taking care of this issue. Unfortunately i cannot give a > technical review to this patch. So hoping Maxime or Takashi can do ... I have no longer RPi around me, so cannot actually test, but the code changes (mostly dropping the superfluous part) looks OK. The concern is, though, about the compatibility with the already running setup. But vc04 is still in staging, and that can be an excuse for the possible breakage, I suppose. thanks, Takashi > > Best regards > > > > > .../vc04_services/bcm2835-audio/bcm2835-ctl.c | 86 ++----------------- > > .../vc04_services/bcm2835-audio/bcm2835.c | 33 ++----- > > 2 files changed, 15 insertions(+), 104 deletions(-) > > > > diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c > > index 3703409715da..1c1f040122d7 100644 > > --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c > > +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c > > @@ -117,15 +117,6 @@ static const struct snd_kcontrol_new snd_bcm2835_ctl[] = { > > .get = snd_bcm2835_ctl_get, > > .put = snd_bcm2835_ctl_put, > > }, > > - { > > - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, > > - .name = "PCM Playback Route", > > - .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, > > - .private_value = PCM_PLAYBACK_DEVICE, > > - .info = snd_bcm2835_ctl_info, > > - .get = snd_bcm2835_ctl_get, > > - .put = snd_bcm2835_ctl_put, > > - }, > > }; > > static int snd_bcm2835_spdif_default_info(struct snd_kcontrol > > *kcontrol, > > @@ -220,7 +211,14 @@ static int create_ctls(struct bcm2835_chip *chip, size_t size, > > return 0; > > } > > -int snd_bcm2835_new_ctl(struct bcm2835_chip *chip) > > +int snd_bcm2835_new_headphones_ctl(struct bcm2835_chip *chip) > > +{ > > + strscpy(chip->card->mixername, "Broadcom Mixer", sizeof(chip->card->mixername)); > > + return create_ctls(chip, ARRAY_SIZE(snd_bcm2835_ctl), > > + snd_bcm2835_ctl); > > +} > > + > > +int snd_bcm2835_new_hdmi_ctl(struct bcm2835_chip *chip) > > { > > int err; > > @@ -232,71 +230,3 @@ int snd_bcm2835_new_ctl(struct bcm2835_chip > > *chip) > > snd_bcm2835_spdif); > > } > > -static const struct snd_kcontrol_new snd_bcm2835_headphones_ctl[] > > = { > > - { > > - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, > > - .name = "Headphone Playback Volume", > > - .index = 0, > > - .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | > > - SNDRV_CTL_ELEM_ACCESS_TLV_READ, > > - .private_value = PCM_PLAYBACK_VOLUME, > > - .info = snd_bcm2835_ctl_info, > > - .get = snd_bcm2835_ctl_get, > > - .put = snd_bcm2835_ctl_put, > > - .count = 1, > > - .tlv = {.p = snd_bcm2835_db_scale} > > - }, > > - { > > - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, > > - .name = "Headphone Playback Switch", > > - .index = 0, > > - .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, > > - .private_value = PCM_PLAYBACK_MUTE, > > - .info = snd_bcm2835_ctl_info, > > - .get = snd_bcm2835_ctl_get, > > - .put = snd_bcm2835_ctl_put, > > - .count = 1, > > - } > > -}; > > - > > -int snd_bcm2835_new_headphones_ctl(struct bcm2835_chip *chip) > > -{ > > - strscpy(chip->card->mixername, "Broadcom Mixer", sizeof(chip->card->mixername)); > > - return create_ctls(chip, ARRAY_SIZE(snd_bcm2835_headphones_ctl), > > - snd_bcm2835_headphones_ctl); > > -} > > - > > -static const struct snd_kcontrol_new snd_bcm2835_hdmi[] = { > > - { > > - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, > > - .name = "HDMI Playback Volume", > > - .index = 0, > > - .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | > > - SNDRV_CTL_ELEM_ACCESS_TLV_READ, > > - .private_value = PCM_PLAYBACK_VOLUME, > > - .info = snd_bcm2835_ctl_info, > > - .get = snd_bcm2835_ctl_get, > > - .put = snd_bcm2835_ctl_put, > > - .count = 1, > > - .tlv = {.p = snd_bcm2835_db_scale} > > - }, > > - { > > - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, > > - .name = "HDMI Playback Switch", > > - .index = 0, > > - .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, > > - .private_value = PCM_PLAYBACK_MUTE, > > - .info = snd_bcm2835_ctl_info, > > - .get = snd_bcm2835_ctl_get, > > - .put = snd_bcm2835_ctl_put, > > - .count = 1, > > - } > > -}; > > - > > -int snd_bcm2835_new_hdmi_ctl(struct bcm2835_chip *chip) > > -{ > > - strscpy(chip->card->mixername, "Broadcom Mixer", sizeof(chip->card->mixername)); > > - return create_ctls(chip, ARRAY_SIZE(snd_bcm2835_hdmi), > > - snd_bcm2835_hdmi); > > -} > > - > > diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c > > index 628732d7bf6a..00bc898b0189 100644 > > --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c > > +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c > > @@ -10,17 +10,13 @@ > > #include "bcm2835.h" > > static bool enable_hdmi; > > -static bool enable_headphones; > > -static bool enable_compat_alsa = true; > > +static bool enable_headphones = true; > > static int num_channels = MAX_SUBSTREAMS; > > module_param(enable_hdmi, bool, 0444); > > MODULE_PARM_DESC(enable_hdmi, "Enables HDMI virtual audio device"); > > module_param(enable_headphones, bool, 0444); > > MODULE_PARM_DESC(enable_headphones, "Enables Headphones virtual audio device"); > > -module_param(enable_compat_alsa, bool, 0444); > > -MODULE_PARM_DESC(enable_compat_alsa, > > - "Enables ALSA compatibility virtual audio device"); > > module_param(num_channels, int, 0644); > > MODULE_PARM_DESC(num_channels, "Number of audio channels (default: 8)"); > > @@ -63,19 +59,20 @@ struct bcm2835_audio_driver { > > enum snd_bcm2835_route route; > > }; > > -static int bcm2835_audio_alsa_newpcm(struct bcm2835_chip *chip, > > +static int bcm2835_audio_dual_newpcm(struct bcm2835_chip *chip, > > const char *name, > > enum snd_bcm2835_route route, > > u32 numchannels) > > { > > int err; > > - err = snd_bcm2835_new_pcm(chip, "bcm2835 ALSA", 0, > > AUDIO_DEST_AUTO, > > - numchannels - 1, false); > > + err = snd_bcm2835_new_pcm(chip, name, 0, route, > > + numchannels, false); > > + > > if (err) > > return err; > > - err = snd_bcm2835_new_pcm(chip, "bcm2835 IEC958/HDMI", 1, 0, > > 1, true); > > + err = snd_bcm2835_new_pcm(chip, "IEC958", 1, route, 1, true); > > if (err) > > return err; > > @@ -90,18 +87,6 @@ static int bcm2835_audio_simple_newpcm(struct > > bcm2835_chip *chip, > > return snd_bcm2835_new_pcm(chip, name, 0, route, numchannels, false); > > } > > -static struct bcm2835_audio_driver bcm2835_audio_alsa = { > > - .driver = { > > - .name = "bcm2835_alsa", > > - .owner = THIS_MODULE, > > - }, > > - .shortname = "bcm2835 ALSA", > > - .longname = "bcm2835 ALSA", > > - .minchannels = 2, > > - .newpcm = bcm2835_audio_alsa_newpcm, > > - .newctl = snd_bcm2835_new_ctl, > > -}; > > - > > static struct bcm2835_audio_driver bcm2835_audio_hdmi = { > > .driver = { > > .name = "bcm2835_hdmi", > > @@ -110,7 +95,7 @@ static struct bcm2835_audio_driver bcm2835_audio_hdmi = { > > .shortname = "bcm2835 HDMI", > > .longname = "bcm2835 HDMI", > > .minchannels = 1, > > - .newpcm = bcm2835_audio_simple_newpcm, > > + .newpcm = bcm2835_audio_dual_newpcm, > > .newctl = snd_bcm2835_new_hdmi_ctl, > > .route = AUDIO_DEST_HDMI > > }; > > @@ -134,10 +119,6 @@ struct bcm2835_audio_drivers { > > }; > > static struct bcm2835_audio_drivers children_devices[] = { > > - { > > - .audio_driver = &bcm2835_audio_alsa, > > - .is_enabled = &enable_compat_alsa, > > - }, > > { > > .audio_driver = &bcm2835_audio_hdmi, > > .is_enabled = &enable_hdmi, > > > > base-commit: 1831fed559732b132aef0ea8261ac77e73f7eadf >