Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp604977iob; Tue, 3 May 2022 06:02:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyv+JWpxImNcwdGXlxyJ02s4aCRXwG5b2rIZpP3SuOWvXf6yz/D78UapU8L19QQSGtTtfCK X-Received: by 2002:a05:6638:3391:b0:32b:2407:8594 with SMTP id h17-20020a056638339100b0032b24078594mr6401622jav.283.1651582947409; Tue, 03 May 2022 06:02:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651582947; cv=none; d=google.com; s=arc-20160816; b=XVqbGVsufMsF60mTpoXvm+n0/OznGF5InSOWKjh7WGSdl/3zYYpxPTXlaUWiuKepzm 9ho+knGTr6BMAFVt+HJlECSEtN+LqziFsz47/LFkpteRU9ly+4delWV65rd73QCCmT4H EcUPsNhJGcp1RKr5NUntcMn/v3EIdSX2K4Kz0vJcPMY9oPY6rdBGmjUqkwvc8xoXJ28o fcNt1UpPpOc0EUf/dBeznHfsCT8D+oJBB8rrYJP0RhX4GCHvSGxL25YEcuchLz1gTsBP qamwx7k1z/BXmUKZHqq8wG8TWKNH3E0qI7nMpIQ3BAP8SCz/lPUWAwiPDaEE4goRBLd4 l7AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=BzAECZIEHCc0MWNfVYa4bChSwxuC5HSH+DCEkLNcaNM=; b=On3YAd0b/44x/MsyRa3G9QOPOUgqiUxKgcu/xNiv6Tz5eoS4OLs/KbDvbaHiUSftyT IKqYE7AWzW3G9y8qJdElcZ+gGRJIDxUwU3y8jqQ6asfxUYJsKZ/ae78/RIv6/reiTrq6 hb/zGIgWK+TrdpgBQEXwa9QtFB80q3jPrHr6CRvHpvPUDvWvkbjJZSYZXsOtdWbT2uNm Qmn6byT/pcZcd6eL6g737Hcu+k3T9A9J8Ahqe6yWVDLfGgILWSUcAwvLa8DOQcLBXxn/ /qXAX5cO6ytZl9Wt7nOX9zvYTHEm9NF0kSO3MRXOUQsX7FzDwgaKk1y/WMRPm2wL1lJ/ FzWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b="CDf/p+7u"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=c0gNCcsB; 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=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m7-20020a056e02158700b002cd81096657si9817877ilu.155.2022.05.03.06.02.08; Tue, 03 May 2022 06:02:27 -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=@cerno.tech header.s=fm3 header.b="CDf/p+7u"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=c0gNCcsB; 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=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229690AbiECImf (ORCPT + 99 others); Tue, 3 May 2022 04:42:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbiECImd (ORCPT ); Tue, 3 May 2022 04:42:33 -0400 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EFBF340ED for ; Tue, 3 May 2022 01:39:00 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id A79C732009F3; Tue, 3 May 2022 04:38:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 03 May 2022 04:38:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1651567137; x=1651653537; bh=BzAECZIEHC c0MWNfVYa4bChSwxuC5HSH+DCEkLNcaNM=; b=CDf/p+7ulMxSnPaS/Fsq4RY9u7 EFFOSKyyilt4W7gLiMnXK8IasANlvZdhrEElFG2IpdqxqtTOiea5ajZ0smItnWjz HBXQhSIfA678dmO750PHfFXv7GPB645kWm2wFthLuOA+6MB/rV3kaauqahsFqLK7 dAfonHkIt9TSkkd+958T4ZM7R0ti0NXJ7qvQ1BhC9qwcM4DuLjTuEvG5IFn2iv93 Moko+fQZgstF76TS4xEBFThoxBuZKsV1eOI9RR3kcwwyRc8H3msu7HTld4oba/7e 8u7L0+ZHi1YGbJ13tdOfg/eXkp3lvkCThEQRJAXEZpjXAskeR/4yYwLbQfPw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1651567137; x= 1651653537; bh=BzAECZIEHCc0MWNfVYa4bChSwxuC5HSH+DCEkLNcaNM=; b=c 0gNCcsBOndSK74KDP3QyeWMqPZMnZzbKJ+ts34mmKlHpEgovc8zgwu0fjx8c325R o7JYWern9ApalkHN9+cGgWkN/lcz5B0IuGUCwG0601MYl7+kJP0kYS7Pl5vkqOMY 5Bn2Ww8zIUmjsQnGBMRbJFPqGyvBMj56T/9zVBRvrg8L++i35i1+6X9BaBcGl9ns 7cOtDUH9stxSAlV6zDI12azeUng5Q8yP7W+GVAqzRwci0tmu+sWVoM7xTcTooYLA bTOQqjgEb0CXp9hxumDL3YdYjGB+0ACj5U+qzDIx+unjH3hHb+IjBM0goQORxZvO DXU9ld1colPzuDwx1HlUA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdejgddtiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepteefffefgfektdefgfeludfgtdejfeejvddttdekteeiffejvdfgheehfffh vedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 3 May 2022 04:38:54 -0400 (EDT) Date: Tue, 3 May 2022 10:38:52 +0200 From: Maxime Ripard To: Sugar Zhang Cc: broonie@kernel.org, Dmitry Osipenko , Jaroslav Kysela , Jiapeng Chong , Kuninori Morimoto , Liam Girdwood , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] ASoC: hdmi-codec: Add option for ELD bypass Message-ID: <20220503083852.be2aihvkd3gestdw@houat> References: <20220430134006.v2.1.Ide2a04ad0c123cc6990a63632e6f9bb7d7f9be13@changeid> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="vsmb6pic4bsb7zjz" Content-Disposition: inline In-Reply-To: <20220430134006.v2.1.Ide2a04ad0c123cc6990a63632e6f9bb7d7f9be13@changeid> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 --vsmb6pic4bsb7zjz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Sat, Apr 30, 2022 at 01:41:18PM +0800, Sugar Zhang wrote: > This patch allow users to enable "ELD Bypass" who don't > care anything from EDID Link Data. >=20 > Currently, this driver gets ELD(from EDID) to constraint > channels and rates. >=20 > Unfortunately, EDID is not always valid, maybe caused by > the fragile HDMI port or cable, in this situation, the max > features are limited to 48kHz stereo. >=20 > So, add this option to allow user to select the manual way > to output audio as expected. such as multi-channels LPCM(7.1), > or HBR bitstream for these sink devices. >=20 > Signed-off-by: Sugar Zhang I think some more documentation is needed there to describe how it's going to be used. Like, you mention that it's relevant when the EDID is not valid. But if the EDID is valid, is bypass still allowed or not? > --- >=20 > Changes in v2: > - Use MACRO SOC_SINGLE_BOOL_EXT to simplify code. > Fix event_missing checked by mixer-test. > Add suffix "Switch" for "ELD Bypass". >=20 > sound/soc/codecs/hdmi-codec.c | 32 ++++++++++++++++++++++++++++++-- > 1 file changed, 30 insertions(+), 2 deletions(-) >=20 > diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c > index b07607a..be46fbd 100644 > --- a/sound/soc/codecs/hdmi-codec.c > +++ b/sound/soc/codecs/hdmi-codec.c > @@ -275,6 +275,7 @@ struct hdmi_codec_priv { > unsigned int chmap_idx; > struct mutex lock; > bool busy; > + bool eld_bypass; > struct snd_soc_jack *jack; > unsigned int jack_status; > u8 iec_status[AES_IEC958_STATUS_SIZE]; > @@ -427,6 +428,31 @@ static int hdmi_codec_iec958_mask_get(struct snd_kco= ntrol *kcontrol, > return 0; > } > =20 > +static int hdmi_codec_eld_bypass_get(struct snd_kcontrol *kcontrol, > + struct snd_ctl_elem_value *ucontrol) > +{ > + struct snd_soc_component *component =3D snd_kcontrol_chip(kcontrol); > + struct hdmi_codec_priv *hcp =3D snd_soc_component_get_drvdata(component= ); > + > + ucontrol->value.integer.value[0] =3D hcp->eld_bypass; > + > + return 0; > +} > + > +static int hdmi_codec_eld_bypass_put(struct snd_kcontrol *kcontrol, > + struct snd_ctl_elem_value *ucontrol) > +{ > + struct snd_soc_component *component =3D snd_kcontrol_chip(kcontrol); > + struct hdmi_codec_priv *hcp =3D snd_soc_component_get_drvdata(component= ); > + > + if (hcp->eld_bypass =3D=3D ucontrol->value.integer.value[0]) > + return 0; > + > + hcp->eld_bypass =3D ucontrol->value.integer.value[0]; > + > + return 1; > +} If the ELD bypass is set, how does it affect the hdmi_codec_params being passed to the codec? Also, what is being returned to the userspace by hdmi_eld_ctl_get once the bypass is enabled? And shouldn't we call get_eld when we remove the bypass? Maxime --vsmb6pic4bsb7zjz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYnDqHAAKCRDj7w1vZxhR xYFvAQC7m4KBlm36tbwsjZTfWnJesyZYJ5lan8/tRFKlZRiidwD/QD7WXOeCP25C zFR2E3NRujtrrAzaMkv3nHKGNcZWsQw= =QLIB -----END PGP SIGNATURE----- --vsmb6pic4bsb7zjz--