From patchwork Tue Jul 16 19:36:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13734864 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 20059C3DA59 for ; Tue, 16 Jul 2024 19:37:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5mogjG3EDlIBNEcm/9zv9N0YSBYqFWdSHi6LjzhdXzg=; b=j1HR5UvYqN9UVprtvqsVaL0Gcy lLxowW94XBIuB4oJO6XIG+9MCEd+9vESyLki6Hxr/EnmiSRReMtpa5YaGdjCw15T5pfb+blqpKOfQ NGLLWPMsJ8WtxWU7MfAGd1hXiDn61w/MpjwdmVc+ecPcwm2PQv0yO++isiuElRGveKYeDbV62bucp KL8cnn8QyEIKTOt8/Uiq7AHI7dvyg0NsuGNP8LaoCXDajO+uw5FtCFxBeB0QFjS3otmpsWujrXR/t nAVe4Yk49qUdbK0vOEYRdWbJ7NwCqZ5j2bzakjXytFC5XnoEsNOEZfhYY659LlRDz+MzwcY53a9rv 6Tc5Krxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTnzK-0000000BY8f-3BvA; Tue, 16 Jul 2024 19:37:26 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTnyD-0000000BXlO-3P6u for linux-arm-kernel@lists.infradead.org; Tue, 16 Jul 2024 19:36:19 +0000 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-52ea7bdde68so6535478e87.0 for ; Tue, 16 Jul 2024 12:36:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721158575; x=1721763375; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=5mogjG3EDlIBNEcm/9zv9N0YSBYqFWdSHi6LjzhdXzg=; b=BIS7rNj3/Bld+7KfMQNc5mgp2BLOs2scFgEp2TRZM2OicVI/28Qu3D/jgCgYe495gd 1chzr0WRCeisouWgtg+1wHRgP7C9vh05E1K6hXWmoNG5L1mQFpoHEETrg/32z3hqVULx mAyvaha/AY2vJVQ8724eTMu8Do0KVbIEy2KIGsy4hLMf3AY2y1/xW6XfrDvIf/FDPay6 1VjRAOJErIibGAMCh1rVgdq9lFOLV6EaWRgqbaznUKz5Le10uj5R7PoYZ5pPdx5lgBnX n73hVbMEJzhj5KnEMx2uBVlZ6pBLnPkhSVuVQNRlckQaDGvrITlmuAUeUY0UKE8PWeJT eJ4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721158576; x=1721763376; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5mogjG3EDlIBNEcm/9zv9N0YSBYqFWdSHi6LjzhdXzg=; b=RBGmXMmiZKsCgYJCzbrRuKIc0rxPiO2FPqrbZbEQLrP3xyZ+K9qe7rsXGgu9e+gX9w CI5KAmHYF26ns0Ib0SQKkARxixbCZlcNgDNm96Gj/St/03sIQZ3F2XwwAA33KsMXa/Y9 V8JlZ5K45zumdH11eaLnJFEOnD4PGh9WLlxhdsI0v3+0WHkaCAZApX41RfbkLO54TPri FlGMQ3pgqu1qRtjQmgLVYglpSm0gZq5tu4JwMWgsiPejKzucmMfqpii+hvYG56g0FB6C DYZSt6z8tlD3WGtOu1ZiVa5KbpY2gAsGtQCvGi4r7JgCLtoXMegDCUDGSpsWW7szp8zk LUHw== X-Forwarded-Encrypted: i=1; AJvYcCX+zEQrwN2zBIZQP88sr03oxzGvXJRb9S5u81vefPaT9l35UcSuWwFbtJDr3mT9gy1ouefZKznBFL/bVaa0caMnVn6EkfMexth5eXydC7X7XU8sjZ8= X-Gm-Message-State: AOJu0YzOW8TgVqlnHccQ+u7r+u/sHOHfd/k8xlr7+dFJE4pKK5vM61s/ 3LqxqPK1ym0fK0D/oG6SOvvVWsWCcjbqGt7xwqzL+5r5b7gaaIZg X-Google-Smtp-Source: AGHT+IE8xCW2u8yY29+39YQ/+7HEcMfohUoAmAIdXLjpSez37FgmkSxJIomGZotSCDC/mJtUQBdcTg== X-Received: by 2002:a05:6512:1087:b0:52c:de3a:839f with SMTP id 2adb3069b0e04-52edef1ea83mr2326681e87.20.1721158575394; Tue, 16 Jul 2024 12:36:15 -0700 (PDT) Received: from tablet.my.domain (ip-37-248-155-75.multi.internet.cyfrowypolsat.pl. [37.248.155.75]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a79bc7ff888sm351179866b.159.2024.07.16.12.36.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 12:36:15 -0700 (PDT) From: Artur Weber Date: Tue, 16 Jul 2024 21:36:07 +0200 Subject: [PATCH 3/6] ARM: dts: samsung: exynos4212-tab3: Fix headset mic, add jack detection MIME-Version: 1.0 Message-Id: <20240716-midas-audio-tab3-v1-3-a53ea075af5a@gmail.com> References: <20240716-midas-audio-tab3-v1-0-a53ea075af5a@gmail.com> In-Reply-To: <20240716-midas-audio-tab3-v1-0-a53ea075af5a@gmail.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Artur Weber X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1796; i=aweber.kernel@gmail.com; h=from:subject:message-id; bh=N2DvZ5I45eO8ikO9Ku1+P7EbOTZjolEg9CSVgTKrfaI=; b=owEBbQKS/ZANAwAKAbO7+KEToFFoAcsmYgBmlsumFhqU/Rad67zcuS2/E4tySG9Nc6jH1HZho TiaX3UhT2iJAjMEAAEKAB0WIQTmYwAOrB3szWrSiQ2zu/ihE6BRaAUCZpbLpgAKCRCzu/ihE6BR aAiwD/9NxMwgwl7QhfwCEwL3RxHqE/Ql9zh0qfbGxDYHk4VQ0mqVZlcDRp76PD1jg8aQddn05v+ IPaAA5yushqeYMFhU0EboOG9u4ghKL5s+5THNgeJ6UhtRtaY7dMgKGjisB18yHsDtjhxAkfMN0A jIMfkU7QobtEtXM95QN1GUuqNa3Ix4bA+AJXoG2vpvAyN0X+vvryw7+QaZGBrkwpgBN5GIV6IhA B174/I3ygSWIVurBXtiSJZzgx+yXtalFVR2/yBuTJQGZVoQ4QYsFY1VRb2V3ZClqU+wZMuBq+dX bmRiZDoyYZMqQxyThLKy9KU8/mcodItJV1H0j6sywyhTmrwz3jHUFpD08sgJloLQnGK9XhkaCT1 zjQjM623D+0UAEQLUGbRRQ8kq9+uq/XMrjlIrFObS1VmTc5KSsc420Yty1LpiyY0H6Je7bLOWo5 9In6LU+ggp6Qdfy53CCyiUwRQT6y/blS64wis3pZEMii0Q0VI8+An5PVxQtoizqeFLHGpJq/gK3 W2SLuxVxqUp1l4bttgLRFydQ0iPUw+Ip1FGNjPIXYnUo9/A+CZflVbzHHtCP4bh8//MiQfC2C5w 4tVwckl2ejNz7Spd94Mowlj6TAe0T4tT5WABlhxP4lZUtxwDk3Baw5mNZfeTNArO8d1hH+prrh3 FRovuEDYHuQXmuQ== X-Developer-Key: i=aweber.kernel@gmail.com; a=openpgp; fpr=E663000EAC1DECCD6AD2890DB3BBF8A113A05168 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240716_123617_887433_E7ABB657 X-CRM114-Status: GOOD ( 10.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Set up headset mic bias regulator and add the necessary properties to the samsung,midas-audio node to allow for headset jack detection. Signed-off-by: Artur Weber --- arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi index 9bc05961577d..45003967406a 100644 --- a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi +++ b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi @@ -300,11 +300,30 @@ submic_bias_reg: voltage-regulator-5 { regulator-max-microvolt = <2800000>; }; + earmic_bias_reg: voltage-regulator-6 { + compatible = "regulator-fixed"; + regulator-name = "EAR_MICBIAS_LDO_2.8V"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + gpio = <&gpm0 0 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + sound: sound { compatible = "samsung,midas-audio"; model = "TAB3"; mic-bias-supply = <&mic_bias_reg>; submic-bias-supply = <&submic_bias_reg>; + headset-mic-bias-supply = <&earmic_bias_reg>; + + lineout-sel-gpios = <&gpj1 2 GPIO_ACTIVE_HIGH>; + + headset-detect-gpios = <&gpx0 4 GPIO_ACTIVE_LOW>; + headset-key-gpios = <&gpx3 6 GPIO_ACTIVE_LOW>; + samsung,headset-4pole-threshold-microvolt = <710 2000>; + samsung,headset-button-threshold-microvolt = <0 130 260>; + io-channel-names = "headset-detect"; + io-channels = <&adc 0>; audio-routing = "HP", "HPOUT1L", "HP", "HPOUT1R", @@ -351,6 +370,11 @@ wlan_pwrseq: sdhci3-pwrseq { }; }; +&adc { + vdd-supply = <&ldo3_reg>; + status = "okay"; +}; + &bus_acp { devfreq = <&bus_dmc>; status = "okay";