From patchwork Sat Dec 21 09:26:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Walklin X-Patchwork-Id: 13917746 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 454801F2383; Sat, 21 Dec 2024 09:41:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734774105; cv=none; b=Sbmh9fFxHrvyf7BFEV3sffzASyokA8fCMwl8iR/GBnjFBaCXzKAtKQX15ALA3yHZlPCGhwAkbV5SlomkGjhiq2ss/0ZxOaiyavscGwLb6vRL8Iqrwi+sSyKt0juPCie4+Joe62DN3TGxyH1X8z65CkT25HddP+aSOclA/9lbUX0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734774105; c=relaxed/simple; bh=mSk6wrsBbCBSa5Zmg7q18JEfXb98cH8pMkr4+XwOYac=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Yjuavf7COAF22ClXAMiw1Y01S+fPT5miLHTqsXvSnkMzz2awPVutLiCtVm7x/VOC8Tate8t0gyzVdBHXVRi/Cguivt9WLuDvLR4avbZ+eiDFFmLYqO2+TNE3vTIebIJKOdBdcqOyr0IdkOQQ0q653mRB8p2cMy6pdiwLU9tmI3k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=testtoast.com; spf=pass smtp.mailfrom=testtoast.com; dkim=pass (2048-bit key) header.d=testtoast.com header.i=@testtoast.com header.b=Mhpx/LR0; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=sSh9lzRm; arc=none smtp.client-ip=103.168.172.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=testtoast.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=testtoast.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=testtoast.com header.i=@testtoast.com header.b="Mhpx/LR0"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="sSh9lzRm" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 595A4138012B; Sat, 21 Dec 2024 04:41:42 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Sat, 21 Dec 2024 04:41:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=testtoast.com; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1734774102; x= 1734860502; bh=ktgkOKk/4MreY3cyjWCANXcTqGH2vZ5XorZkiep5peg=; b=M hpx/LR09UiuhX/iWlvujHHjIko6U19/Z4xAzhEVteiK9jZa24JeqzRQdlalPaiIm oOn1jNZT7shr6aBjNGvVYDKSs5Mok0CIi5RrCo1bLxBtlOE3M3J7j7PFwaO6ufs/ MaGJqlGS5ZBMh9W/LRp0FcwoR2DH/oL88Ech98EhMN0O7ZqIAceGVh4dk4G67aoj Gzf7Ntv2EKs92+PsLxSTl9X8DraSq8w+HXhvyUeoY20lUyufJEEI2f/WYUQIZA04 qz1n0AQcJVVTxRpVRlKOrkAOgLaNRGBSgGz3ieIwlfL9PKiBxaC6wqHXb64gO77N TqrKJTcees4pICQNvSYqQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1734774102; x=1734860502; bh=k tgkOKk/4MreY3cyjWCANXcTqGH2vZ5XorZkiep5peg=; b=sSh9lzRmbPvvIbUlJ VKUg0dBHunGRdqXY9HipfhSINqwGAfc7DU1KnNRGgee8AGdk1WoqiwlEEn4rsXEs aH6fFlzT0LNQzc1ZA3ssoKnA48rsds0dfoWKEC3Vd4PZ3TIPirWWfs/QFgGWgKEr 8yp2HV+xnsdrQqji0YLM/Ahpfr0uAjQibkZShZE80sK/3CblO/g5DQr/RWpGjNuK KzqdzogSEXEdTn5UxfGBR4mN27RT/dLrHEzKFbjZi71GPlOijlM33SpP7Dh6EvY1 ZxE0V0P6sBnbWt6C6LXtGlFCfDx4n64uvVBkXOrzCmaT2g7bbrsU3ymmppXLFD9S 1vBEg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddtgedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttden ucfhrhhomheptfihrghnucghrghlkhhlihhnuceorhihrghnsehtvghsthhtohgrshhtrd gtohhmqeenucggtffrrghtthgvrhhnpeffheeiffegtdfgffejteevgeefkeelieelkeev ueetffetteduffevgeeiieehteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehrhigrnhesthgvshhtthhorghsthdrtghomhdpnhgspghrtghp thhtohepudefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehlghhirhgufihooh gusehgmhgrihhlrdgtohhmpdhrtghpthhtohepsghrohhonhhivgeskhgvrhhnvghlrdho rhhgpdhrtghpthhtohepphgvrhgvgiesphgvrhgvgidrtgiipdhrtghpthhtohepthhifi grihesshhushgvrdgtohhmpdhrtghpthhtohepfigvnhhssegtshhivgdrohhrghdprhgt phhtthhopehjvghrnhgvjhdrshhkrhgrsggvtgesghhmrghilhdrtghomhdprhgtphhtth hopehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgpdhrtghpthhtoheplhhinhhugidq shhouhhnugesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqd grrhhmqdhkvghrnhgvlheslhhishhtshdrihhnfhhrrgguvggrugdrohhrgh X-ME-Proxy: Feedback-ID: idc0145fc:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 21 Dec 2024 04:41:37 -0500 (EST) From: Ryan Walklin To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, devicetree@vger.kernel.org, Chris Morgan , Ryan Walklin Subject: [PATCH 1/3] ASoC: dt-bindings: sun4i-a10-codec: add hp-det-gpios Date: Sat, 21 Dec 2024 22:26:32 +1300 Message-ID: <20241221094122.27325-2-ryan@testtoast.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241221094122.27325-1-ryan@testtoast.com> References: <20241221094122.27325-1-ryan@testtoast.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chris Morgan Devices integrating Allwinner SoCs may use line-out or headphone jacks with jack detection circuits attached to a GPIO. Support defining these in DTs. A number of Anbernic devices featuring the H700 SoC use this mechanism to switch between a headphone jack and an internal speaker, so add these to the allowed routing items. Signed-off-by: Chris Morgan Signed-off-by: Ryan Walklin --- .../bindings/sound/allwinner,sun4i-a10-codec.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-codec.yaml b/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-codec.yaml index ebc9097f936ad..b4b711e80b65a 100644 --- a/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-codec.yaml +++ b/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-codec.yaml @@ -98,6 +98,10 @@ properties: maxItems: 1 description: GPIO to enable the external amplifier + allwinner,hp-det-gpios: + maxItems: 1 + description: GPIO for headphone/line-out detection + required: - "#sound-dai-cells" - compatible @@ -247,8 +251,10 @@ allOf: allwinner,audio-routing: items: enum: + - Headphone - LINEOUT - Line Out + - Speaker dmas: items: From patchwork Sat Dec 21 09:26:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Walklin X-Patchwork-Id: 13917747 Received: from fhigh-a3-smtp.messagingengine.com (fhigh-a3-smtp.messagingengine.com [103.168.172.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B84751F0E44; Sat, 21 Dec 2024 09:41:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.154 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734774109; cv=none; b=IJ2ahQ6XyF409BeeCS5N3JLjrgpd8jrCvuunHamB+RTq/EUzTXMgxJ8t/qwkbcs5GBtO0ZkPrem12kwVQW36eWU1h/2iq/ZY5sCFth6fhYuftm0L7Rp0ImaH/npqIPTvDUlU/SJsit9zI11LnUDfglg/6S/2BlKQbLf+/YFlMtY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734774109; c=relaxed/simple; bh=/96xyJvoHR7TUxDjQdtUcVpAy6Aoo9Hj8EQRv8xaj0k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KLWRqVqzxMIcPyW/fudUCuLzQ2H9R2VJc244PX4p21EilZn+/X193etQOufrM6An9fWKNJ1m3/8mOKoozzg85j4P5ncnBCgniR+uOy+vvWWe6CJSXT1PWCCMIBeOPkPwsB15z95R4cggPILQwTcaKnPo4gJZ0/1ZKvJtgSx1UD8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=testtoast.com; spf=pass smtp.mailfrom=testtoast.com; dkim=pass (2048-bit key) header.d=testtoast.com header.i=@testtoast.com header.b=ebgzXI65; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=XuI+IoOq; arc=none smtp.client-ip=103.168.172.154 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=testtoast.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=testtoast.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=testtoast.com header.i=@testtoast.com header.b="ebgzXI65"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="XuI+IoOq" Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfhigh.phl.internal (Postfix) with ESMTP id D9D071140157; Sat, 21 Dec 2024 04:41:46 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Sat, 21 Dec 2024 04:41:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=testtoast.com; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1734774106; x= 1734860506; bh=ic+OZ7nYn48w9tiM8ZxAJ9YbDge6f3PVBtso/XTbadU=; b=e bgzXI655/AIg2Jj1OWoYkYKVJYJhN/tLS5q7DRj8xYoNfyqCTw46HMYUvle3dVIG 5VD825ytUSYqk0jgESSUB1nJH2Skt8yeNvzyXe82DSPh01+gB065l73ziahiC4r8 UY+qpbSpoa1IdgsOcS9HvKUFnHOCZHbX/sF44BirGqMG+W4W8UbQm6PUQgtP8DlQ 7uH0hb/A5F8LkPZO0hLXisWf7kJKVcltd3sdZx4dcXsc8sg1JNwiQxNq3+rNkyy2 aPPVkfZmFj1pn4RyjGD+cqNmhgQ9ezNj2LtWBOj+Le8M84ntEJtLQucBbuvWTVqf PH9OOI+EYkutNo7Xr9JeQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1734774106; x=1734860506; bh=i c+OZ7nYn48w9tiM8ZxAJ9YbDge6f3PVBtso/XTbadU=; b=XuI+IoOqTm6F4rpY3 Frbl3nUg/U3+1dYsAxgpcrr8xtyLWhPoT+3lDPJYKHPkmdVTth5l3eP1PufKaHqb vYrn0+qPEEWJxXs71CaCTTLuNGOKXoJ/1D1cPV9ej1DiwmnQazUwbE3sLa+wlV45 qCCDHH5oOb/xnsYTCoVN3O2J/Q9msbH/C2ZGAcsp9C+WmaSbS1fzTaS/k1HIAeOf CM5OS4a+0mMlvSA4FLsTXWJ1PzPT1Qq0P/DvTMhAE6a+XPOGhZyKuVF7YWPGGEVo ilEBAdNsuYoZrCWluALHdNmhpb/j9diCcTW4LK4gBoGCiwnGiQc6WLKti+BfGer2 cNi3Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddtgedgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttden ucfhrhhomheptfihrghnucghrghlkhhlihhnuceorhihrghnsehtvghsthhtohgrshhtrd gtohhmqeenucggtffrrghtthgvrhhnpeffheeiffegtdfgffejteevgeefkeelieelkeev ueetffetteduffevgeeiieehteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehrhigrnhesthgvshhtthhorghsthdrtghomhdpnhgspghrtghp thhtohepudefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehlghhirhgufihooh gusehgmhgrihhlrdgtohhmpdhrtghpthhtohepsghrohhonhhivgeskhgvrhhnvghlrdho rhhgpdhrtghpthhtohepphgvrhgvgiesphgvrhgvgidrtgiipdhrtghpthhtohepthhifi grihesshhushgvrdgtohhmpdhrtghpthhtohepfigvnhhssegtshhivgdrohhrghdprhgt phhtthhopehjvghrnhgvjhdrshhkrhgrsggvtgesghhmrghilhdrtghomhdprhgtphhtth hopehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgpdhrtghpthhtoheplhhinhhugidq shhouhhnugesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqd grrhhmqdhkvghrnhgvlheslhhishhtshdrihhnfhhrrgguvggrugdrohhrgh X-ME-Proxy: Feedback-ID: idc0145fc:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 21 Dec 2024 04:41:42 -0500 (EST) From: Ryan Walklin To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, devicetree@vger.kernel.org, Chris Morgan , Ryan Walklin Subject: [PATCH 2/3] ASoC: sun4i-codec: support hp-det-gpios property Date: Sat, 21 Dec 2024 22:26:33 +1300 Message-ID: <20241221094122.27325-3-ryan@testtoast.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241221094122.27325-1-ryan@testtoast.com> References: <20241221094122.27325-1-ryan@testtoast.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chris Morgan Add support for GPIO headphone detection with the hp-det-gpios property. In order for this to properly disable the path upon removal of headphones, the output must be labelled Headphone which is a common sink in the driver. Note this patch also adds the output of Headphone for the H616 codec. Signed-off-by: Chris Morgan Signed-off-by: Ryan Walklin --- sound/soc/sunxi/sun4i-codec.c | 59 +++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 933a0913237c8..5f718dd3fcf0a 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -272,6 +273,7 @@ struct sun4i_codec { struct clk *clk_module; struct reset_control *rst; struct gpio_desc *gpio_pa; + struct gpio_desc *gpio_hp; /* ADC_FIFOC register is at different offset on different SoCs */ struct regmap_field *reg_adc_fifoc; @@ -1302,6 +1304,49 @@ static struct snd_soc_dai_driver dummy_cpu_dai = { .ops = &dummy_dai_ops, }; +static struct snd_soc_jack sun4i_headphone_jack; + +static struct snd_soc_jack_pin sun4i_headphone_jack_pins[] = { + { .pin = "Headphone", .mask = SND_JACK_HEADPHONE}, +}; + +static struct snd_soc_jack_gpio sun4i_headphone_jack_gpio = { + .name = "hp-det", + .report = SND_JACK_HEADPHONE, + .debounce_time = 150, +}; + +static int sun4i_codec_machine_init(struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_card *card = rtd->card; + struct sun4i_codec *scodec = snd_soc_card_get_drvdata(card); + int ret; + + if (scodec->gpio_hp) { + ret = snd_soc_card_jack_new_pins(card, "Headphone Jack", + SND_JACK_HEADPHONE, + &sun4i_headphone_jack, + sun4i_headphone_jack_pins, + ARRAY_SIZE(sun4i_headphone_jack_pins)); + if (ret) { + dev_err(rtd->dev, + "Headphone jack creation failed: %d\n", ret); + return ret; + } + + sun4i_headphone_jack_gpio.desc = scodec->gpio_hp; + ret = snd_soc_jack_add_gpios(&sun4i_headphone_jack, 1, + &sun4i_headphone_jack_gpio); + + if (ret) { + dev_err(rtd->dev, "Headphone GPIO not added: %d\n", ret); + return ret; + } + } + + return 0; +} + static struct snd_soc_dai_link *sun4i_codec_create_link(struct device *dev, int *num_links) { @@ -1327,6 +1372,7 @@ static struct snd_soc_dai_link *sun4i_codec_create_link(struct device *dev, link->codecs->name = dev_name(dev); link->platforms->name = dev_name(dev); link->dai_fmt = SND_SOC_DAIFMT_I2S; + link->init = sun4i_codec_machine_init; *num_links = 1; @@ -1635,10 +1681,11 @@ static const struct snd_soc_component_driver sun50i_h616_codec_codec = { }; static const struct snd_kcontrol_new sun50i_h616_card_controls[] = { - SOC_DAPM_PIN_SWITCH("LINEOUT"), + SOC_DAPM_PIN_SWITCH("Speaker"), }; static const struct snd_soc_dapm_widget sun50i_h616_codec_card_dapm_widgets[] = { + SND_SOC_DAPM_HP("Headphone", NULL), SND_SOC_DAPM_LINE("Line Out", NULL), SND_SOC_DAPM_SPK("Speaker", sun4i_codec_spk_event), }; @@ -1684,7 +1731,7 @@ static struct snd_soc_card *sun50i_h616_codec_create_card(struct device *dev) card->dev = dev; card->owner = THIS_MODULE; - card->name = "H616 Audio Codec"; + card->name = "h616-audio-codec"; card->driver_name = "sun4i-codec"; card->controls = sun50i_h616_card_controls; card->num_controls = ARRAY_SIZE(sun50i_h616_card_controls); @@ -1940,6 +1987,14 @@ static int sun4i_codec_probe(struct platform_device *pdev) return ret; } + scodec->gpio_hp = devm_gpiod_get_optional(&pdev->dev, "allwinner,hp-det", + GPIOD_IN); + if (IS_ERR(scodec->gpio_hp)) { + ret = PTR_ERR(scodec->gpio_hp); + dev_err_probe(&pdev->dev, ret, "Failed to get hp-det gpio\n"); + return ret; + } + /* reg_field setup */ scodec->reg_adc_fifoc = devm_regmap_field_alloc(&pdev->dev, scodec->regmap, From patchwork Sat Dec 21 09:26:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Walklin X-Patchwork-Id: 13917748 Received: from fhigh-a3-smtp.messagingengine.com (fhigh-a3-smtp.messagingengine.com [103.168.172.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB5171F2376; Sat, 21 Dec 2024 09:41:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.154 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734774114; cv=none; b=Q3tou64ZrfOVuD0WWNXbemQSanyE53xvrgVMud+jq+iVmFjmum4hIuZMPjSrMWony8vPdHVtuWcoNUVEpOrihajJrN8QoYENdXQJEdNTlAkjQSWBeWIV4dkBIhSisKOuM+8cOpXKku/lUtaBYh8jP4/VTicJkpAGWi1gsEWiWDE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734774114; c=relaxed/simple; bh=DGrV/7xDz1EtsRZ3zoVcTQuXkzKFCbXYvC5jf2hqMc4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rZsfP6NDp0CREjeLowRjt6Oz8xXrJpOlOH7CkOsya2iFeKyS+hnCuwNbWxnBn7CWxAkeYbiBgv8/cYkESKSnXf2SWp4xJhIynHq+6wuBqNqZcXnRunX1whvkJMGYxMN3T/dWov4CNW1rCsUmMROXgBhPEhTM3U3k+3/hFSDbf5Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=testtoast.com; spf=pass smtp.mailfrom=testtoast.com; dkim=pass (2048-bit key) header.d=testtoast.com header.i=@testtoast.com header.b=Wnzpz9fy; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=CRzB1uub; arc=none smtp.client-ip=103.168.172.154 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=testtoast.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=testtoast.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=testtoast.com header.i=@testtoast.com header.b="Wnzpz9fy"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="CRzB1uub" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id C8C34114015D; Sat, 21 Dec 2024 04:41:50 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Sat, 21 Dec 2024 04:41:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=testtoast.com; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1734774110; x= 1734860510; bh=0OV1c1wd+nT/3ZS1AtoSVY2W29WK/RpQm1k0fyOO9Mc=; b=W nzpz9fyZzLsGnKMZ4ufMLEy/boUvkDC4ENK9CUIn+2AIy7eHXirP5D0GCDD+8j4E 9eJ58CXjVM0TR7vfO8HoAbuIu8w75tnY4DF8kH6vmmcRkLUmlbhDjpWOO/7joQiD OkltuUC8EpDDcShAYkiFRdpcjFywbCu5qPYP27ggpQKokLdIFevtP2wxVHPtO2d0 d6S7pdlOFFHhJUY+tKoglrxrFaegPD+cBu2Yq4N0C1BShLmRp7GPZyLrRw3VDUp6 +BsSJBZF298Fnt9n27jMZlisG1RgoU5QZsG80Leg/dZ62jacddsU/lX5xT0OwgN3 1XJ/HsSrxePwr9XTCCVkw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1734774110; x=1734860510; bh=0 OV1c1wd+nT/3ZS1AtoSVY2W29WK/RpQm1k0fyOO9Mc=; b=CRzB1uubsdHrS0sXs i23slcdvtKzdrSNlGG/E8vyYDUkgewP2VV63WyxfJTxcDCNosGnrnHI9pASQQjD1 mnJqWtP5V22IAxmDGgrgDszqI20sWpWWXIfu6qdtuAln/4d/DcRRXUk2wo5zMpqz rEGMsxF/MD2j1xu0KLJtPmLu4mTAzO0lbdV1dP3UrAG2Iy9YHiBCrMg4tHYc+vE6 q4oSODQq9GvLTnxMwSoBz2dUTmvbZW3ZELm60buGvVRz2cOsagzRjJ8kWST55GrE Q0POmqFvh+C860EtFolyZpT6FqNoZPyFzujeCyu8BPXfkvInJs+X+qGLEgp9zOm+ E5dxw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddtgedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttden ucfhrhhomheptfihrghnucghrghlkhhlihhnuceorhihrghnsehtvghsthhtohgrshhtrd gtohhmqeenucggtffrrghtthgvrhhnpeffheeiffegtdfgffejteevgeefkeelieelkeev ueetffetteduffevgeeiieehteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehrhigrnhesthgvshhtthhorghsthdrtghomhdpnhgspghrtghp thhtohepuddvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehlghhirhgufihooh gusehgmhgrihhlrdgtohhmpdhrtghpthhtohepsghrohhonhhivgeskhgvrhhnvghlrdho rhhgpdhrtghpthhtohepphgvrhgvgiesphgvrhgvgidrtgiipdhrtghpthhtohepthhifi grihesshhushgvrdgtohhmpdhrtghpthhtohepfigvnhhssegtshhivgdrohhrghdprhgt phhtthhopehjvghrnhgvjhdrshhkrhgrsggvtgesghhmrghilhdrtghomhdprhgtphhtth hopehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgpdhrtghpthhtoheplhhinhhugidq shhouhhnugesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqd grrhhmqdhkvghrnhgvlheslhhishhtshdrihhnfhhrrgguvggrugdrohhrgh X-ME-Proxy: Feedback-ID: idc0145fc:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 21 Dec 2024 04:41:47 -0500 (EST) From: Ryan Walklin To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, devicetree@vger.kernel.org, Chris Morgan Subject: [PATCH 3/3] arm64: dts: allwinner: h700: Add hp-det-gpios for Anbernic RG35XX Date: Sat, 21 Dec 2024 22:26:34 +1300 Message-ID: <20241221094122.27325-4-ryan@testtoast.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241221094122.27325-1-ryan@testtoast.com> References: <20241221094122.27325-1-ryan@testtoast.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chris Morgan Add support for headphone insertion detection via GPIO for the RG35XX series. Signed-off-by: Chris Morgan Signed-off-by: Ryan Walklin --- .../boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-2024.dts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-2024.dts b/arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-2024.dts index 89de86b442155..cbab10de760c9 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-2024.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-2024.dts @@ -238,8 +238,11 @@ panel_in_rgb: endpoint { }; &codec { - allwinner,audio-routing = "Line Out", "LINEOUT"; + /* Both speakers and headphone jack connected to 74HC4052D analog mux*/ + allwinner,audio-routing = "Speaker", "LINEOUT", + "Headphone", "LINEOUT"; allwinner,pa-gpios = <&pio 8 5 GPIO_ACTIVE_HIGH>; // PI5 + allwinner,hp-det-gpios = <&pio 8 3 GPIO_ACTIVE_HIGH>; // PI3 status = "okay"; };