From patchwork Sat Mar 2 14:00:34 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: 13579534 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 B814DC5478C for ; Sat, 2 Mar 2024 14:01:14 +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=M0EqFrS6z56qRqh10/5tgO4+iiGjuK84SIiX6JsQL5g=; b=GGTiE1wosHmm6Z K8kICpBIheHFcR1sL3x1kNJwi9p8nm5W/Cd/tSkZdLJ1oxwOdmrGumrjKO/3rg+c4L4nOYdxe0KwT W1SBeqwLzVcpzdEqS/UhqCKdkFPGOSrA+EDcf0f9Oyp1zefEBxUPC/v71F/PVnpLo6mf7Mz4P703j 5PF6WT3Yrii6wiHxXj96jJ1ojtuhbp6/RA86F4wXxsLljgXu1s5//6UZt6ccxkGTC6fnnga+o1aaU EVTyUteFdmP+A4jpuKkbjj0F8Gq/mblsQzuxhvdchQ1xEVYdr4vk2DDwqWUGqfC7dyGc2RuQG4ChC BeMHZtGIIVSt8WO1Klew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rgPv9-00000003gJV-1qCO; Sat, 02 Mar 2024 14:00:59 +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 1rgPv2-00000003gGT-3iSP for linux-arm-kernel@lists.infradead.org; Sat, 02 Mar 2024 14:00:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xff.cz; s=mail; t=1709388045; bh=uiQdKioW5Q8/qfRyAEscHhnKqRIHa/efSN+ljmC4lok=; h=From:To:Cc:Subject:Date:From; b=XcOmshdWXvExDVy4K+zxIZF+CaaHhfMsi5Ewmy+e3mozM0igrri0ZlA0bSxdUbRga kjqGrvQnU6QfAwjWqHMtsW4HfwsWF1PRAi/Ao03SEhUo7JdrGlJsUBwtY4iIeE2FCs wv8bpWOwevP5sOG9hxs0c+3O4yvxbjl2a53t7/F8= 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 v3 0/4] Add support for jack detection to codec present in A64 SoC Date: Sat, 2 Mar 2024 15:00:34 +0100 Message-ID: <20240302140042.1990256-1-megi@xff.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240302_060053_346931_B5BE93EB X-CRM114-Status: GOOD ( 11.84 ) 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 a rewritten and debugged version of the original ones from Arnaud Ferraris and Samuel Holland, improved to better handle headset button presses and with more robust plug-in/out event debouncing, and to use set_jack API instead of sniffing the sound card widget names, to detect the type of jack connector. Please take a look. :) v3: - removed all device-tree related code (it's not necessary for core functionality, it only helps make the jack detect functionality of the codec be usable from simple-sound-card driver, and I'll send it spearately, because it will apparently need several more rounds of review) 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 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/soc/sunxi/sun50i-codec-analog.c | 73 +++++- sound/soc/sunxi/sun8i-codec.c | 346 +++++++++++++++++++++++++- 2 files changed, 399 insertions(+), 20 deletions(-)