Message ID | 20230730180803.22570-3-jiaxin.yu@mediatek.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1636781vqg; Sun, 30 Jul 2023 12:35:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlHBRYiAyRCGKXaVUenoHumaxfCpS1FIkAmxYzQ6OfPbTWPiFQ7cjolqIRVW372paregEKW7 X-Received: by 2002:a17:902:d88d:b0:1b6:af1a:7dd3 with SMTP id b13-20020a170902d88d00b001b6af1a7dd3mr7028877plz.23.1690745751685; Sun, 30 Jul 2023 12:35:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690745751; cv=none; d=google.com; s=arc-20160816; b=OVOKvhI2CrTci3THbyfFVXGt6D8l7O1glQeomgRha4jYN9bz5pCTh/ZSFXWrZVERQS heI2GIOqsR3GwWsOSqgfLAxHO8eSfozuKn9NP1ZbOo1riwse5rrF8RfnGMgLOW72DNs9 3D+Cahh9BlXEPcwyiJeaz2bGBNwxVEV+tpZsIciDDsYPbzRxrORBZ0EDSKwRJ4ic5cco 7aFZJO2PON2Sq6MTRS64p+icJOwKEDA4HivsltQm6dTieYePaVYrRzJu09v8Y4GL9Y19 o1Dv2bJLDwI3Tlmh4LSL/irAnPNy9fYc9p89hMlAG/pCL4Nr3c/kSu2XEBNdLq0Ifef3 v5oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5st1uPVswkp7Jf2ahEjpIkqtcT+MrlPvHk5P9itktPg=; fh=PV8s9uuis6v9nPhVaqeaRHRAQOvSp23GyZG3Jql0P2k=; b=yd5cWFxjjT24Y1GOVwEJPu1Av+zY/9jtZz5R0HFy7VgzVifZurdByJNehxrx0QMGSX IN9StdwvS8JTlwL0v3UqOm8DNamoccag+6uyBWB288VkrGGvOdq/0TV/VokK+ASEuaAl 3YKWOc0Lc8OF48BSWbN0F+9Etkr2fpKYi4bv7OGZCSnPMLkBai9eZCk4ZVM6729QgKVT 1e9CHhLxo72xApNJlp6tGNidsZ4PFhavZ9MnOTAo0XhpJ/qndkc8QvjyT2JlUUdu+VKQ EPTvOpaSW/9efWfgaRlK4X84cq38raSrLF5q9A+i/0oXuTVBU1gfgcIZfVIHMGiyWBkE fztQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=XCpqvtcR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z14-20020a1709027e8e00b001bb96a30e21si6319836pla.70.2023.07.30.12.35.38; Sun, 30 Jul 2023 12:35:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=XCpqvtcR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229912AbjG3SIY (ORCPT <rfc822;dengxinlin2429@gmail.com> + 99 others); Sun, 30 Jul 2023 14:08:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbjG3SIW (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 30 Jul 2023 14:08:22 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFF691B4 for <linux-kernel@vger.kernel.org>; Sun, 30 Jul 2023 11:08:14 -0700 (PDT) X-UUID: 0a6b3bc22f0411ee9cb5633481061a41-20230731 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=5st1uPVswkp7Jf2ahEjpIkqtcT+MrlPvHk5P9itktPg=; b=XCpqvtcR49Ekyqaj7sAPwu6zR1S5zAS56kjN8ujQwO+8eZQRAaqLKMdkmBfcklrskHsu6MyfypY1QpbElk9rS2uj5B2bN08BcKfwYtof1H7wyrliX7sI5ooC+szcEjudR9RzkcP7Ld5vul740MRN4C+uv3Scu4k7M2m35OOsZcU=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.30,REQID:adef8156-e62f-4c36-81d0-e74ade193316,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:1fcc6f8,CLOUDID:9b94f2b3-a467-4aa9-9e04-f584452e3794,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO, DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 0a6b3bc22f0411ee9cb5633481061a41-20230731 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw01.mediatek.com (envelope-from <jiaxin.yu@mediatek.com>) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1055043603; Mon, 31 Jul 2023 02:08:09 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by MTKMBS14N1.mediatek.inc (172.21.101.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Mon, 31 Jul 2023 02:08:08 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Mon, 31 Jul 2023 02:08:07 +0800 From: Jiaxin Yu <jiaxin.yu@mediatek.com> To: <broonie@kernel.org>, <andrzej.hajda@intel.com>, <neil.armstrong@linaro.org>, <robert.foss@linaro.org>, <Laurent.pinchart@ideasonboard.com>, <kuninori.morimoto.gx@renesas.com>, <angelogioacchino.delregno@collabora.com>, <nfraprado@collabora.com> CC: <chunxu.li@mediatek.com>, <ajye_huang@compal.corp-partner.google.com>, <allen-kh.cheng@mediatek.com>, <dri-devel@lists.freedesktop.org>, <alsa-devel@alsa-project.org>, <linux-arm-kernel@lists.infradead.org>, <linux-mediatek@lists.infradead.org>, <linux-kernel@vger.kernel.org>, <Project_Global_Chrome_Upstream_Group@mediatek.com>, Jiaxin Yu <jiaxin.yu@mediatek.com> Subject: [v3 2/3] ASoC: mediatek: mt8186: correct the HDMI widgets Date: Mon, 31 Jul 2023 02:08:02 +0800 Message-ID: <20230730180803.22570-3-jiaxin.yu@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230730180803.22570-1-jiaxin.yu@mediatek.com> References: <20230730180803.22570-1-jiaxin.yu@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772875417576015127 X-GMAIL-MSGID: 1772875417576015127 |
Series |
ASoC: mediatek:mt8186: fix both the speaker and hdmi
|
|
Commit Message
Jiaxin Yu (俞家鑫)
July 30, 2023, 6:08 p.m. UTC
Use SND_SOC_DAPM_LINE instead of SND_SOC_DAPM_OUTPUT to trigger
DAPM events to hdmi-codec when userspace control the DPAM pin.
Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
---
sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c | 2 +-
sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Comments
On Mon, Jul 31, 2023 at 02:08:02AM +0800, Jiaxin Yu wrote: > Use SND_SOC_DAPM_LINE instead of SND_SOC_DAPM_OUTPUT to trigger > DAPM events to hdmi-codec when userspace control the DPAM pin. Why?
On Mon, 2023-07-31 at 12:50 +0100, Mark Brown wrote: > On Mon, Jul 31, 2023 at 02:08:02AM +0800, Jiaxin Yu wrote: > > > Use SND_SOC_DAPM_LINE instead of SND_SOC_DAPM_OUTPUT to trigger > > DAPM events to hdmi-codec when userspace control the DPAM pin. > > Why? I have defined an SOC_DAPM_PIN_SWITCH that named as "HDMI1", if I use SND_SOC_DAPM_OUTPUT, it can't be controlled by HDMI1's PIN_SWITCH. 994 static const struct snd_kcontrol_new 995 mt8186_mt6366_da7219_max98357_controls[] = { 996 SOC_DAPM_PIN_SWITCH("Speakers"), 997 SOC_DAPM_PIN_SWITCH("Headphones"), 998 SOC_DAPM_PIN_SWITCH("Headset Mic"), 999 SOC_DAPM_PIN_SWITCH("HDMI1"), I think SND_SOC_DAPM_OUTPUT must be judged as ep, so I want to define HDMI1 as a snd_soc_dapm_spk's widget. From the perspective of hardware connection, their relationship is indeed equal, so I find SOC_SOC_DAPM_LINE to define HDMI1. ==> hdmi-codec ==> it6505(HDMI output) DL1(FE) ==> I2S3(BE) ==> rt1015p(SPEAKER output) 2738 static void dapm_update_widget_flags(struct snd_soc_dapm_widget *w) 2739 { 2740 enum snd_soc_dapm_direction dir; 2741 struct snd_soc_dapm_path *p; 2742 unsigned int ep; 2743 ... 2760 case snd_soc_dapm_output: 2761 /* On a fully routed card a output is never a sink */ 2762 if (w->dapm->card->fully_routed) 2763 return; 2764 ep = SND_SOC_DAPM_EP_SINK; 2765 snd_soc_dapm_widget_for_each_sink_path(w, p) { 2766 if (p->sink->id == snd_soc_dapm_spk || 2767 p->sink->id == snd_soc_dapm_hp || 2768 p->sink->id == snd_soc_dapm_line || 2769 p->sink->id == snd_soc_dapm_input) { 2770 ep = 0; 2771 break; 2772 } 2773 } 2774 break;
On Wed, Aug 02, 2023 at 02:52:57PM +0000, Jiaxin Yu (俞家鑫) wrote: > On Mon, 2023-07-31 at 12:50 +0100, Mark Brown wrote: > > On Mon, Jul 31, 2023 at 02:08:02AM +0800, Jiaxin Yu wrote: > > > Use SND_SOC_DAPM_LINE instead of SND_SOC_DAPM_OUTPUT to trigger > > > DAPM events to hdmi-codec when userspace control the DPAM pin. > > Why? > I have defined an SOC_DAPM_PIN_SWITCH that named as "HDMI1", if I use > SND_SOC_DAPM_OUTPUT, it can't be controlled by HDMI1's PIN_SWITCH. ... > 2762 if (w->dapm->card->fully_routed) > 2763 return; > 2764 ep = SND_SOC_DAPM_EP_SINK; > 2765 snd_soc_dapm_widget_for_each_sink_path(w, p) { > 2766 if (p->sink->id == snd_soc_dapm_spk || > 2767 p->sink->id == snd_soc_dapm_hp || > 2768 p->sink->id == snd_soc_dapm_line > || > 2769 p->sink->id == snd_soc_dapm_input) > { > 2770 ep = 0; The expectation here is that you'll connect the output to a widget that corresponds to the physical output on your board and put the pin switch on that, ideally with a label that corresponds to case markings or what the physical output is called on the board.
On Wed, 2023-08-02 at 17:38 +0100, Mark Brown wrote: > On Wed, Aug 02, 2023 at 02:52:57PM +0000, Jiaxin Yu (俞家鑫) wrote: > > On Mon, 2023-07-31 at 12:50 +0100, Mark Brown wrote: > > > On Mon, Jul 31, 2023 at 02:08:02AM +0800, Jiaxin Yu wrote: > > > > Use SND_SOC_DAPM_LINE instead of SND_SOC_DAPM_OUTPUT to trigger > > > > DAPM events to hdmi-codec when userspace control the DPAM pin. > > > Why? > > I have defined an SOC_DAPM_PIN_SWITCH that named as "HDMI1", if I > > use > > SND_SOC_DAPM_OUTPUT, it can't be controlled by HDMI1's PIN_SWITCH. > > ... > > > 2762 if (w->dapm->card->fully_routed) > > 2763 return; > > 2764 ep = SND_SOC_DAPM_EP_SINK; > > 2765 snd_soc_dapm_widget_for_each_sink_path(w, p) { > > 2766 if (p->sink->id == snd_soc_dapm_spk || > > 2767 p->sink->id == snd_soc_dapm_hp > > || > > 2768 p->sink->id == > > snd_soc_dapm_line > > > > > > > > 2769 p->sink->id == > > snd_soc_dapm_input) > > { > > 2770 ep = 0; > > The expectation here is that you'll connect the output to a widget > that > corresponds to the physical output on your board and put the pin > switch > on that, ideally with a label that corresponds to case markings or > what > the physical output is called on the board. Dear brown, I agree with you, in fact the speaker is indeed doing this way. But about the hdmi that on the board, I did not find a defination link snd_soc_dapm_hdmi, so I use snd_soc_dapm_line to replace. The purpose is to control it link speaker. Or what do you suggest I should do? Thank you very much.
On Thu, Aug 03, 2023 at 07:20:15AM +0000, Jiaxin Yu (俞家鑫) wrote: > I agree with you, in fact the speaker is indeed doing this way. But > about the hdmi that on the board, I did not find a defination link > snd_soc_dapm_hdmi, so I use snd_soc_dapm_line to replace. The purpose > is to control it link speaker. Or what do you suggest I should do? I think the sensible thing here is to define a DIGITAL_OUTPUT() which can be used for HDMI, S/PDIF and anything else that comes up and isn't clearly wrong like reusing one of the analog descriptions is.
Il 03/08/23 21:33, Mark Brown ha scritto: > On Thu, Aug 03, 2023 at 07:20:15AM +0000, Jiaxin Yu (俞家鑫) wrote: > >> I agree with you, in fact the speaker is indeed doing this way. But >> about the hdmi that on the board, I did not find a defination link >> snd_soc_dapm_hdmi, so I use snd_soc_dapm_line to replace. The purpose >> is to control it link speaker. Or what do you suggest I should do? > > I think the sensible thing here is to define a DIGITAL_OUTPUT() which > can be used for HDMI, S/PDIF and anything else that comes up and isn't > clearly wrong like reusing one of the analog descriptions is. Hello Jiaxin, the MT8186 Corsola Chromebooks are broken upstream without this series. Are you still interested in upstreaming this one? Thanks, Angelo
On Wed, 2024-01-31 at 12:42 +0100, AngeloGioacchino Del Regno wrote: > Il 03/08/23 21:33, Mark Brown ha scritto: > > On Thu, Aug 03, 2023 at 07:20:15AM +0000, Jiaxin Yu (俞家鑫) wrote: > > > > > I agree with you, in fact the speaker is indeed doing this way. > > > But > > > about the hdmi that on the board, I did not find a defination > > > link > > > snd_soc_dapm_hdmi, so I use snd_soc_dapm_line to replace. The > > > purpose > > > is to control it link speaker. Or what do you suggest I should > > > do? > > > > I think the sensible thing here is to define a DIGITAL_OUTPUT() > > which > > can be used for HDMI, S/PDIF and anything else that comes up and > > isn't > > clearly wrong like reusing one of the analog descriptions is. > > Hello Jiaxin, > > the MT8186 Corsola Chromebooks are broken upstream without this > series. > > Are you still interested in upstreaming this one? > > Thanks, > Angelo Hello Angelo, No, I'm still interesting in upstream this series. It's just that I have less time recently. I'm considering revisiting this issue next mouth. Do you have any suggestions for this? Thanks, Jiaxin.Yu
Il 31/01/24 13:25, Jiaxin Yu (俞家鑫) ha scritto: > On Wed, 2024-01-31 at 12:42 +0100, AngeloGioacchino Del Regno wrote: >> Il 03/08/23 21:33, Mark Brown ha scritto: >>> On Thu, Aug 03, 2023 at 07:20:15AM +0000, Jiaxin Yu (俞家鑫) wrote: >>> >>>> I agree with you, in fact the speaker is indeed doing this way. >>>> But >>>> about the hdmi that on the board, I did not find a defination >>>> link >>>> snd_soc_dapm_hdmi, so I use snd_soc_dapm_line to replace. The >>>> purpose >>>> is to control it link speaker. Or what do you suggest I should >>>> do? >>> >>> I think the sensible thing here is to define a DIGITAL_OUTPUT() >>> which >>> can be used for HDMI, S/PDIF and anything else that comes up and >>> isn't >>> clearly wrong like reusing one of the analog descriptions is. >> >> Hello Jiaxin, >> >> the MT8186 Corsola Chromebooks are broken upstream without this >> series. >> >> Are you still interested in upstreaming this one? >> >> Thanks, >> Angelo > > Hello Angelo, > > No, I'm still interesting in upstream this series. It's just that I > have less time recently. I'm considering revisiting this issue next > mouth. Do you have any suggestions for this? > Nothing on top of Mark's suggestions. Angelo
diff --git a/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c b/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c index 0432f9d89020..ae51d70e2c0b 100644 --- a/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c +++ b/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c @@ -964,7 +964,7 @@ mt8186_mt6366_da7219_max98357_widgets[] = { SND_SOC_DAPM_SPK("Speakers", NULL), SND_SOC_DAPM_HP("Headphones", NULL), SND_SOC_DAPM_MIC("Headset Mic", NULL), - SND_SOC_DAPM_OUTPUT("HDMI1"), + SND_SOC_DAPM_LINE("HDMI1", NULL), SND_SOC_DAPM_MIXER(SOF_DMA_DL1, SND_SOC_NOPM, 0, 0, NULL, 0), SND_SOC_DAPM_MIXER(SOF_DMA_DL2, SND_SOC_NOPM, 0, 0, NULL, 0), SND_SOC_DAPM_MIXER(SOF_DMA_UL1, SND_SOC_NOPM, 0, 0, NULL, 0), diff --git a/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c b/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c index 9c11016f032c..a39e37fa4e02 100644 --- a/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c +++ b/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c @@ -1032,7 +1032,7 @@ mt8186_mt6366_rt1019_rt5682s_widgets[] = { SND_SOC_DAPM_SPK("Speakers", NULL), SND_SOC_DAPM_HP("Headphone", NULL), SND_SOC_DAPM_MIC("Headset Mic", NULL), - SND_SOC_DAPM_OUTPUT("HDMI1"), + SND_SOC_DAPM_LINE("HDMI1", NULL), SND_SOC_DAPM_MIXER(SOF_DMA_DL1, SND_SOC_NOPM, 0, 0, NULL, 0), SND_SOC_DAPM_MIXER(SOF_DMA_DL2, SND_SOC_NOPM, 0, 0, NULL, 0), SND_SOC_DAPM_MIXER(SOF_DMA_UL1, SND_SOC_NOPM, 0, 0, NULL, 0),