Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp886495lqg; Sat, 2 Mar 2024 06:01:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX1sUnlRPcywMFqzkh4UUkXg8PHkH/KA+e+h6NT6UXGGulBAjd/36cPrS1VntVjBnl6zQ0SpOhe1FxpftB1107wjUaOjJuoBkxOAzwKkQ== X-Google-Smtp-Source: AGHT+IEn2/B7D8FsXmmvjALq0KsQrY+OmqZ0jGf6mAtISOuaxlwVn7mKR8IJFFFxjpOZxqgkcEqR X-Received: by 2002:a17:90a:b388:b0:29a:3e25:a851 with SMTP id e8-20020a17090ab38800b0029a3e25a851mr3571349pjr.28.1709388063473; Sat, 02 Mar 2024 06:01:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709388063; cv=pass; d=google.com; s=arc-20160816; b=KGDEfo3SLj/Xx/vfE0KiPBSe/AtUxuw/qPt8dJnsQMpOhJZxPTe0S9QfpFSb0InOHS tfxy+aHDXp4HIdSWTOeG9+icH0jOeg34rZ1ytJpoiC27WlqRNPpJxFFXIroU0qPO2TMV kWiRGe/Ai8D+k8rSUKrpKLkGO9akMNVCbsvyCZv0UOQPznQiYcRl5HXmXNzNzjbbkKbp 5SOB2XjtsnEVcq/6N9Sbkle2xfqqmf4vBLsK7I5av1jo/QBxtTUDNJRBHe5NtOYiDVM2 hfhiwIVPNAdGP32P0ob3KbzvWF1kMDWA47Q6f3iSQ//ua3WyP/7hK2ZQETLEOvnb4b7L qpDg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=AyD9exTQqfCEDDwgHQN4HGU1baMGTlyg80R6dAEUYOM=; fh=LyOUUyERizBut43yg2bQgiL8MyPFN7nnSRizOKM8oK8=; b=ccCU7iblO0nQe9tjfghcWMb7IxTVVvC++dcO8rvSFpBIy6kPJlTI5m5dPT3S3XlkbL ItRtGd5WQ4qTSWzhfRW8BfSe1tGNCXYfr8KO28JPduZDX0cgyyRJVdv3tvoqG3mXA8o+ 12UrmZi5bC8x2vlxseMtDUodp72vuOhh38G5NDGWtd0vyH4YA23RbpfnN1JcvUqfb+77 DG4BleQ9GWZU49CzeTm8NRfbACiCaT6AMTf4iDIfVIHoGMY9m9F5DhS/G76xdULMbfIW JmpbecF6SYGI7kdxeMIHZJYB9MKUqt86oql1IDGf5MhiieX5zCMrJLIYeRP3xgeR+GMm hUcw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b=XcOmshdW; arc=pass (i=1 spf=pass spfdomain=xff.cz dkim=pass dkdomain=xff.cz dmarc=pass fromdomain=xff.cz); spf=pass (google.com: domain of linux-kernel+bounces-89455-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id q59-20020a17090a754100b0029969ee2a08si7386037pjk.52.2024.03.02.06.01.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Mar 2024 06:01:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89455-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b=XcOmshdW; arc=pass (i=1 spf=pass spfdomain=xff.cz dkim=pass dkdomain=xff.cz dmarc=pass fromdomain=xff.cz); spf=pass (google.com: domain of linux-kernel+bounces-89455-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 17C6F283C98 for ; Sat, 2 Mar 2024 14:01:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4307C17C7C; Sat, 2 Mar 2024 14:00:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xff.cz header.i=@xff.cz header.b="XcOmshdW" Received: from vps.xff.cz (vps.xff.cz [195.181.215.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33348179B7; Sat, 2 Mar 2024 14:00:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.181.215.36 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709388051; cv=none; b=RVu98FeISx5eywYZhifWG/2gOeedBic9J2QY+IhuqEhuQ6OSPFXXmo4T8uIt7cgIdeOt3eCo5pyl1Z0/Nc+fNAB5J1XcxyUhZSeWNnoZ9TeJ0cHBrApyXqdwgDFwtCYIvtNfn8sRWCq7ylwXDunqxcR4O7xsEKxtqryRepyRIBY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709388051; c=relaxed/simple; bh=uiQdKioW5Q8/qfRyAEscHhnKqRIHa/efSN+ljmC4lok=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=G6Fe/PBY7drqVOiNO8F37wnZs/AXmgTrsB2ejxcwiGCok1VwkUpiW1/+CClCXTdp16z3UnxRAIdagiwB2sa6wIITNqBqWR93CeRfT7eO6A15hjIE1Xna8a063KBUUbrFmB9t46iuFMdeRbUOqLB4t4QIoQXucFeTOQ1bDT09SNA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=xff.cz; spf=pass smtp.mailfrom=xff.cz; dkim=pass (1024-bit key) header.d=xff.cz header.i=@xff.cz header.b=XcOmshdW; arc=none smtp.client-ip=195.181.215.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=xff.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xff.cz 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=20Jirman?= 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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(-) -- 2.44.0