From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DC3AC35242 for ; Mon, 17 Feb 2020 06:56:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E063520679 for ; Mon, 17 Feb 2020 06:56:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726397AbgBQG42 (ORCPT ); Mon, 17 Feb 2020 01:56:28 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:41053 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725958AbgBQG42 (ORCPT ); Mon, 17 Feb 2020 01:56:28 -0500 Received: by mail-ed1-f68.google.com with SMTP id c26so19413103eds.8 for ; Sun, 16 Feb 2020 22:56:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/WHKaTGOgOAJM+VcnF+6HFOUNwxgDydG90xB7o+8lGE=; b=jXQp69LB0cB/N1kZW4yXSK6cIBtY0cp8pVznQvztgfPxz9EMERsO933ikeQTImq+VC MM3JyREm2sqxM+5cQ83Wok0p/iPMY0hJqhXj+jdaseLj59cs2Se/J0y/DBRAEZrWUtJf EppIi/sUtuKj81aBpKXBchxJ94F6hmXg1rXPk0FnNsaUaYao9DbL1cOYv7SheNtJbQAV p483oOkngvfr6c/HkfnWJ74XVGGqlSh7AAm6qbEJvIT6cWgmAkOC9YhmSdGhyrb417Jm WB8T6OxSKEth9xtVGQ04ebrwCAXOqIzYrPsraFyqeaEhatv2DXPGGNFMKK7xXoQ5TGFo OJdA== X-Gm-Message-State: APjAAAVJ4nSbppsBwk2NDDbAs+jbty861h0nYlrBj8EnPlkURbExQ1Bj 12cx82ObBeTHEB4K2gjcv53Hqad0Jgc= X-Google-Smtp-Source: APXvYqzUjZnEUwvNaponYrgyXHew2v1fs32vxQmuJIW6DH/cNLwrmHVTVTmMFevviQATUx/Aembcqg== X-Received: by 2002:a05:6402:387:: with SMTP id o7mr13364154edv.84.1581922586164; Sun, 16 Feb 2020 22:56:26 -0800 (PST) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com. [209.85.128.54]) by smtp.gmail.com with ESMTPSA id x6sm811596ejw.84.2020.02.16.22.56.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 16 Feb 2020 22:56:25 -0800 (PST) Received: by mail-wm1-f54.google.com with SMTP id p17so17121508wma.1 for ; Sun, 16 Feb 2020 22:56:25 -0800 (PST) X-Received: by 2002:a05:600c:10d2:: with SMTP id l18mr20086133wmd.122.1581922585072; Sun, 16 Feb 2020 22:56:25 -0800 (PST) MIME-Version: 1.0 References: <20200217021813.53266-1-samuel@sholland.org> <20200217021813.53266-5-samuel@sholland.org> In-Reply-To: From: Chen-Yu Tsai Date: Mon, 17 Feb 2020 14:56:14 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 4/8] ASoC: sun50i-codec-analog: Make headphone routes stereo To: Samuel Holland Cc: Mark Brown , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Maxime Ripard , Vasily Khoruzhick , Luca Weiss , Linux-ALSA , linux-arm-kernel , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 17, 2020 at 11:57 AM Samuel Holland wrote: > > Hello, > > On 2/16/20 9:48 PM, Chen-Yu Tsai wrote: > > Hi, > > > > On Mon, Feb 17, 2020 at 10:18 AM Samuel Holland wrote: > >> > >> This matches the hardware more accurately, and is necessary for > >> including the (stereo) headphone mute switch in the DAPM graph. > >> > >> Signed-off-by: Samuel Holland > >> --- > >> sound/soc/sunxi/sun50i-codec-analog.c | 28 +++++++++++++++++++-------- > >> 1 file changed, 20 insertions(+), 8 deletions(-) > >> > >> diff --git a/sound/soc/sunxi/sun50i-codec-analog.c b/sound/soc/sunxi/sun50i-codec-analog.c > >> index 17165f1ddb63..f98851067f97 100644 > >> --- a/sound/soc/sunxi/sun50i-codec-analog.c > >> +++ b/sound/soc/sunxi/sun50i-codec-analog.c > >> @@ -311,9 +311,15 @@ static const struct snd_soc_dapm_widget sun50i_a64_codec_widgets[] = { > >> */ > >> > >> SND_SOC_DAPM_REGULATOR_SUPPLY("cpvdd", 0, 0), > >> - SND_SOC_DAPM_MUX("Headphone Source Playback Route", > >> + SND_SOC_DAPM_MUX("Left Headphone Source", > >> SND_SOC_NOPM, 0, 0, sun50i_codec_hp_src), > >> - SND_SOC_DAPM_OUT_DRV("Headphone Amp", SUN50I_ADDA_HP_CTRL, > >> + SND_SOC_DAPM_MUX("Right Headphone Source", > > > > Please don't remove the widget suffix. The suffix was chosen to work with > > alsa-lib's control parsing code. The term "Playback Route" is appropriate > > because it is playback only, and it is a routing switch, not a source or > > sink. > > Removing the suffix here doesn't affect the control name as seen by userspace, > because the control is shared between multiple widgets (Left and Right). You're right. > > Also, what's wrong with just having a single "stereo" widget instead of > > two "mono" widgets? I added stereo (2-channel) support to DAPM quite > > some time ago. You just have to have two routes in and out. > > If you have any completed path through a widget, the widget is turned on. A > stereo mute switch is logically two separate paths. So if I break one path by > muting one channel, that lets me turn off everything before and after in the > path (e.g. turning off the right side of the DAC lets DAPM turn off the right > mixer, the right side of the output amp, even the right side of the AIF or the > ADC if that was the only input. That only works if there are separate Left/Right > widgets. Looks like that's the case indeed. Might be worth revisiting the core DAPM code later on if I can find the time. Since the widgets and routes changed are internal to the codec, there won't be any issue if we rework this stuff later on. So for now, Reviewed-by: Chen-Yu Tsai From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD0E6C7619B for ; Mon, 17 Feb 2020 07:05:05 +0000 (UTC) Received: from alsa0.perex.cz (unknown [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4AF802070B for ; Mon, 17 Feb 2020 07:05:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4AF802070B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csie.org Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9CC8C1723; Mon, 17 Feb 2020 08:04:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9CC8C1723 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1581923103; bh=g/tH0fZsPNi10O/dzWjsRuZyE3qqFVOMslIVVN5Vvn8=; h=References:In-Reply-To:From:Date:To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=CqmpMhzFannS+lej9kEtcML2FAJJ7c+EwZhhW0WJQp2YWqa2oFoPCHH2t2UZh08jy 9ORvExS+axE8xjrTeDv5yD2MU+rq+HsVfSsxB6/MXYO3GG+Un3o22dEQHnIoeyGqQt j+UbE7FTQXSr1kKvejU5HPtvc9jLJHWV0bELB+6M= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 67D92F800C4; Mon, 17 Feb 2020 07:56:35 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C193AF8015E; Mon, 17 Feb 2020 07:56:33 +0100 (CET) Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4C87CF80172 for ; Mon, 17 Feb 2020 07:56:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4C87CF80172 Received: by mail-ed1-f67.google.com with SMTP id v28so19392428edw.12 for ; Sun, 16 Feb 2020 22:56:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/WHKaTGOgOAJM+VcnF+6HFOUNwxgDydG90xB7o+8lGE=; b=p9pgF/RsOi1EH1MNpUoFQcTRACCwWHkwvEO+VJSCWhJeSTX1pMxeveaUTso12ezECT xT1kO2c6QqoCmuaYSPd6iCY8w54WGN27v5CGQc+RpDokyqbta7yK5d635dQOJ8MbUX1T CZ3NBcyhyNPFKimOr3Y7SuqvMCNGwJ/4rHcQ+VgZAVOi0OLzrgjXWyex6nkHXl02aWul VaD/IlbVFEV4pbW2p+OB4MaUDxcO7Op7D3ai4c0LSZBNeBoQAlkn8bkdnpQLQTGhP7MM fdZKaSpdS44Lx44SuTQH19AYJWXv/7fSAyKdJA1yoE5BnaJ4QQ042t//EFjqaIJrvWul S5Qg== X-Gm-Message-State: APjAAAW2my/sgQB3ue3Pn1OeLVd06i/g0Cx9uyiX1rl66V9rvXW+P/oj iSxHhjieKIb9XpRIQGMH/lslfcVFrlg= X-Google-Smtp-Source: APXvYqzp2Fa6dSwTKVhdr50HrsrA8NsGOymgkeYBIzhfEZkCX2ilZ94yMT3AvjBRgpNzGi7GLib3ig== X-Received: by 2002:a05:6402:797:: with SMTP id d23mr13239952edy.138.1581922586046; Sun, 16 Feb 2020 22:56:26 -0800 (PST) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com. [209.85.128.53]) by smtp.gmail.com with ESMTPSA id 29sm793756ejb.4.2020.02.16.22.56.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 16 Feb 2020 22:56:25 -0800 (PST) Received: by mail-wm1-f53.google.com with SMTP id a9so17119302wmj.3 for ; Sun, 16 Feb 2020 22:56:25 -0800 (PST) X-Received: by 2002:a05:600c:10d2:: with SMTP id l18mr20086133wmd.122.1581922585072; Sun, 16 Feb 2020 22:56:25 -0800 (PST) MIME-Version: 1.0 References: <20200217021813.53266-1-samuel@sholland.org> <20200217021813.53266-5-samuel@sholland.org> In-Reply-To: From: Chen-Yu Tsai Date: Mon, 17 Feb 2020 14:56:14 +0800 X-Gmail-Original-Message-ID: Message-ID: To: Samuel Holland Cc: Luca Weiss , Linux-ALSA , linux-kernel , Takashi Iwai , Maxime Ripard , Liam Girdwood , Vasily Khoruzhick , Mark Brown , linux-arm-kernel Subject: Re: [alsa-devel] [PATCH 4/8] ASoC: sun50i-codec-analog: Make headphone routes stereo X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Mon, Feb 17, 2020 at 11:57 AM Samuel Holland wrote: > > Hello, > > On 2/16/20 9:48 PM, Chen-Yu Tsai wrote: > > Hi, > > > > On Mon, Feb 17, 2020 at 10:18 AM Samuel Holland wrote: > >> > >> This matches the hardware more accurately, and is necessary for > >> including the (stereo) headphone mute switch in the DAPM graph. > >> > >> Signed-off-by: Samuel Holland > >> --- > >> sound/soc/sunxi/sun50i-codec-analog.c | 28 +++++++++++++++++++-------- > >> 1 file changed, 20 insertions(+), 8 deletions(-) > >> > >> diff --git a/sound/soc/sunxi/sun50i-codec-analog.c b/sound/soc/sunxi/sun50i-codec-analog.c > >> index 17165f1ddb63..f98851067f97 100644 > >> --- a/sound/soc/sunxi/sun50i-codec-analog.c > >> +++ b/sound/soc/sunxi/sun50i-codec-analog.c > >> @@ -311,9 +311,15 @@ static const struct snd_soc_dapm_widget sun50i_a64_codec_widgets[] = { > >> */ > >> > >> SND_SOC_DAPM_REGULATOR_SUPPLY("cpvdd", 0, 0), > >> - SND_SOC_DAPM_MUX("Headphone Source Playback Route", > >> + SND_SOC_DAPM_MUX("Left Headphone Source", > >> SND_SOC_NOPM, 0, 0, sun50i_codec_hp_src), > >> - SND_SOC_DAPM_OUT_DRV("Headphone Amp", SUN50I_ADDA_HP_CTRL, > >> + SND_SOC_DAPM_MUX("Right Headphone Source", > > > > Please don't remove the widget suffix. The suffix was chosen to work with > > alsa-lib's control parsing code. The term "Playback Route" is appropriate > > because it is playback only, and it is a routing switch, not a source or > > sink. > > Removing the suffix here doesn't affect the control name as seen by userspace, > because the control is shared between multiple widgets (Left and Right). You're right. > > Also, what's wrong with just having a single "stereo" widget instead of > > two "mono" widgets? I added stereo (2-channel) support to DAPM quite > > some time ago. You just have to have two routes in and out. > > If you have any completed path through a widget, the widget is turned on. A > stereo mute switch is logically two separate paths. So if I break one path by > muting one channel, that lets me turn off everything before and after in the > path (e.g. turning off the right side of the DAC lets DAPM turn off the right > mixer, the right side of the output amp, even the right side of the AIF or the > ADC if that was the only input. That only works if there are separate Left/Right > widgets. Looks like that's the case indeed. Might be worth revisiting the core DAPM code later on if I can find the time. Since the widgets and routes changed are internal to the codec, there won't be any issue if we rework this stuff later on. So for now, Reviewed-by: Chen-Yu Tsai _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9F59C7619F for ; Mon, 17 Feb 2020 06:56:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 92AC32070B for ; Mon, 17 Feb 2020 06:56:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EjBxCXmG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92AC32070B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csie.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6OgTZwVB9ztYpNjnj4Q+X6ybdtTYEGh8iERCQDAEvbE=; b=EjBxCXmGnmXTP8 xBXAugAKkw9YHD2pqUs9VC2Sc7z+yyTBt+Qjbz4sBJfGwvd/0puatOUhcXTftS0konOjvApVc5CLu gbRRw0Pv4qur0Lwbu7GpQijpeYP3EQNmfYGbtGfKKqXnilTA0GL3k7EPsr2BiNym5qSywpsBZ3lTD tMqpJcrIdTORKqh7lb4Vq8L8YeIlY+q0dMIgv3UEziuhh13RD6xmjpj/GAwJ6PzyqmwTC8oPuOVQA PCgO1I1GDTEcX614qRxdh4UXyxWpdANlNaT7Z2FhyNrMR5l5Ni+66umQUcu1BdqPS6OvwLRnlF6CB +bTn9RXi8QTAGACSrmhg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j3aKX-0000bD-Km; Mon, 17 Feb 2020 06:56:33 +0000 Received: from mail-ed1-f65.google.com ([209.85.208.65]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j3aKT-0000aG-Ke for linux-arm-kernel@lists.infradead.org; Mon, 17 Feb 2020 06:56:31 +0000 Received: by mail-ed1-f65.google.com with SMTP id m13so19419075edb.6 for ; Sun, 16 Feb 2020 22:56:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/WHKaTGOgOAJM+VcnF+6HFOUNwxgDydG90xB7o+8lGE=; b=p0WGWedBg/z9ltxv9uAhkYO9DuL6LoSaBGYPuNlWtwFQcw01rIuhnT4x6fLoguWOwe e0jyc7HXG+yB7u0sXbGxXMPCcuUnk0ctUH62XmVzNd/Akt1BzNMX/6BE162zzhAhnjwE +/F4j+eCAybQ85X3m6D/fg7azyajgKMRuXePEktlhq7u2ox5qxH6BHzED47gbigi5/Lz QS9b/wUUCAFtdA9jIsi5yLsZath3SMkDYpREQ4UDmTwaEikEtbQ5b+m/EQaJqcaTTQhB +i2bvqUPHz03G7pRMw3EDTL7cN7Fk0Bgzz8BD48vU5RmF7PEmBbo/jOV5kt8zolr5Thc A0Kw== X-Gm-Message-State: APjAAAVMh+TV62H44+Rf72VZnL8dv5CWfP7nSkPMO3Abam6lRhBrX3IL m2IcqkzkWPTpCwgxMwR2aSCB9IgQFN8= X-Google-Smtp-Source: APXvYqwQSq+jPlLOtQkWq+bVP1wHaMLg2kUUjaBdG/xVYH1vn3jXvMiRKo9vkwCg/YoZSoXjJqEdQQ== X-Received: by 2002:a05:6402:1764:: with SMTP id da4mr13230705edb.24.1581922586295; Sun, 16 Feb 2020 22:56:26 -0800 (PST) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com. [209.85.128.41]) by smtp.gmail.com with ESMTPSA id x12sm837219eje.52.2020.02.16.22.56.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 16 Feb 2020 22:56:25 -0800 (PST) Received: by mail-wm1-f41.google.com with SMTP id a6so17131208wme.2 for ; Sun, 16 Feb 2020 22:56:25 -0800 (PST) X-Received: by 2002:a05:600c:10d2:: with SMTP id l18mr20086133wmd.122.1581922585072; Sun, 16 Feb 2020 22:56:25 -0800 (PST) MIME-Version: 1.0 References: <20200217021813.53266-1-samuel@sholland.org> <20200217021813.53266-5-samuel@sholland.org> In-Reply-To: From: Chen-Yu Tsai Date: Mon, 17 Feb 2020 14:56:14 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 4/8] ASoC: sun50i-codec-analog: Make headphone routes stereo To: Samuel Holland X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200216_225629_681442_0AFACD86 X-CRM114-Status: GOOD ( 24.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Luca Weiss , Linux-ALSA , linux-kernel , Takashi Iwai , Maxime Ripard , Liam Girdwood , Mark Brown , Jaroslav Kysela , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Feb 17, 2020 at 11:57 AM Samuel Holland wrote: > > Hello, > > On 2/16/20 9:48 PM, Chen-Yu Tsai wrote: > > Hi, > > > > On Mon, Feb 17, 2020 at 10:18 AM Samuel Holland wrote: > >> > >> This matches the hardware more accurately, and is necessary for > >> including the (stereo) headphone mute switch in the DAPM graph. > >> > >> Signed-off-by: Samuel Holland > >> --- > >> sound/soc/sunxi/sun50i-codec-analog.c | 28 +++++++++++++++++++-------- > >> 1 file changed, 20 insertions(+), 8 deletions(-) > >> > >> diff --git a/sound/soc/sunxi/sun50i-codec-analog.c b/sound/soc/sunxi/sun50i-codec-analog.c > >> index 17165f1ddb63..f98851067f97 100644 > >> --- a/sound/soc/sunxi/sun50i-codec-analog.c > >> +++ b/sound/soc/sunxi/sun50i-codec-analog.c > >> @@ -311,9 +311,15 @@ static const struct snd_soc_dapm_widget sun50i_a64_codec_widgets[] = { > >> */ > >> > >> SND_SOC_DAPM_REGULATOR_SUPPLY("cpvdd", 0, 0), > >> - SND_SOC_DAPM_MUX("Headphone Source Playback Route", > >> + SND_SOC_DAPM_MUX("Left Headphone Source", > >> SND_SOC_NOPM, 0, 0, sun50i_codec_hp_src), > >> - SND_SOC_DAPM_OUT_DRV("Headphone Amp", SUN50I_ADDA_HP_CTRL, > >> + SND_SOC_DAPM_MUX("Right Headphone Source", > > > > Please don't remove the widget suffix. The suffix was chosen to work with > > alsa-lib's control parsing code. The term "Playback Route" is appropriate > > because it is playback only, and it is a routing switch, not a source or > > sink. > > Removing the suffix here doesn't affect the control name as seen by userspace, > because the control is shared between multiple widgets (Left and Right). You're right. > > Also, what's wrong with just having a single "stereo" widget instead of > > two "mono" widgets? I added stereo (2-channel) support to DAPM quite > > some time ago. You just have to have two routes in and out. > > If you have any completed path through a widget, the widget is turned on. A > stereo mute switch is logically two separate paths. So if I break one path by > muting one channel, that lets me turn off everything before and after in the > path (e.g. turning off the right side of the DAC lets DAPM turn off the right > mixer, the right side of the output amp, even the right side of the AIF or the > ADC if that was the only input. That only works if there are separate Left/Right > widgets. Looks like that's the case indeed. Might be worth revisiting the core DAPM code later on if I can find the time. Since the widgets and routes changed are internal to the codec, there won't be any issue if we rework this stuff later on. So for now, Reviewed-by: Chen-Yu Tsai _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel