From patchwork Fri Feb 23 01:52:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ond=C5=99ej_Jirman?= X-Patchwork-Id: 13568473 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 508CBC47DD9 for ; Fri, 23 Feb 2024 01:54:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=MSZWR352dWAOmAG0Hz+hskClKGuJjn6XX9gESH9dOuo=; b=Qa6x4sJtnKq25/ hThD9yVQKD8YbIc+muDup6GyZkI7UnbVP8JD1e1qEcXuOl1tvtrn2DYkFqqeZ+k5Bgt9d55I16eF/ sgP7ziS/9xHEMZBKa2vI9YUcIXZRndYFcTBnqljVxvYpBtJxzVnNbh2foITrYNWLPmaQd1jaHgaiS oQQt/q6uF7n5MsiswlY8+V/hzllSgCCls1mOfAA8sbZiLxxGosay5jQP3h5qzIbqrKJExwTrKpimZ PRFvFrvIMdHcmltq0OPSgH+x2hzT8QCtODFzavpgL/XML8f//yHV+S8RykPZOcEwqZMpdY7Hv1zU4 VYaOcR91AriZaB6tEwQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdKlU-00000007Rlh-2oHn; Fri, 23 Feb 2024 01:54:16 +0000 Received: from vps.xff.cz ([195.181.215.36]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdKjr-00000007RM8-3eb4 for linux-arm-kernel@lists.infradead.org; Fri, 23 Feb 2024 01:52:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xff.cz; s=mail; t=1708653140; bh=ZdTOrLkg/qf7wFKH1nhH7OcmYSUdowUaRsJjf+n31IQ=; h=From:To:Cc:Subject:Date:From; b=VgoLDlY9OJ/xjChBR72wKD4pPi0joITT85F6KeVVD9zA8bLrxlasSNexuZK4DXhDo sEjGAxBYEdmoG2utxMlSvZh33LJzmOu46M340lt8U/2YAP1UIlsE2nsPzau8M2Z2IH ERp3YJRXDX74C4FX0zd/PiVpwIlArSR6JyO8x5ac= From: =?utf-8?q?Ond=C5=99ej_Jirman?= To: linux-kernel@vger.kernel.org, Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: Ondrej Jirman , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Arnaud Ferraris , linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH v2 0/5] Add support for jack detection to codec present in A64 SoC Date: Fri, 23 Feb 2024 02:52:10 +0100 Message-ID: <20240223015219.3618111-1-megi@xff.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240222_175236_881831_8A117CBF X-CRM114-Status: GOOD ( 11.56 ) 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 From: Ondrej Jirman This series adds support for jack detection to this codec. I used and tested this on Pinephone. It works quite nicely. I tested it against Android headset mic button resistor specification. The patches are improved and debugged version of the original ones from Arnaud Ferraris and Samuel Holland, imrpoved to better handle headset button presses and with more robust plug-in/out event debouncing. Please take a look. :) v2: - use set_jack/get_jack_type - get rid of some custom poking inside card internals to figure out what kind of jack port we should setup the codec for - read jack-type from OF as suggested here: https://elixir.bootlin.com/linux/latest/source/sound/soc/soc-component.c#L288 - add DT bindings Thank you very much, Ondřej Jirman Arnaud Ferraris (2): ASoC: sun50i-codec-analog: Enable jack detection on startup ASoC: sun8i-codec: Implement jack and accessory detection Ondrej Jirman (1): dt-bindings: sound: Add jack-type property to sun8i-a33-codec Samuel Holland (2): ASoC: sun50i-codec-analog: Move suspend/resume to set_bias_level ASoC: sun8i-codec: Enable bus clock at STANDBY and higher bias .../sound/allwinner,sun8i-a33-codec.yaml | 9 + sound/soc/sunxi/sun50i-codec-analog.c | 73 +++- sound/soc/sunxi/sun8i-codec.c | 359 +++++++++++++++++- 3 files changed, 421 insertions(+), 20 deletions(-)