Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp571683rdb; Thu, 22 Feb 2024 12:18:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVN8bEdEyPEfiIERUNEMhudZ5jbwSLO9RQA4pTJupOBEf/qf/92d7Ts219jgnYcSRgs82Dn+GsafQQ1wzn9bYHO5u9CHoU/JvYfJRzfew== X-Google-Smtp-Source: AGHT+IEAzfpLY2lHtZIWeLpwWN2Yj5kd4c6XtE9BuDwE7Cbh04rIIFPp7R8rcgiqic1l/IXs6iV0 X-Received: by 2002:ae9:e015:0:b0:787:3786:a01f with SMTP id m21-20020ae9e015000000b007873786a01fmr127780qkk.1.1708633108544; Thu, 22 Feb 2024 12:18:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708633108; cv=pass; d=google.com; s=arc-20160816; b=h9uqzgPnDuX8szDi++LwArsQsq4p59WYzSuxCzZ5swoB7j/jMLe9ntwpHpY7m0oS5b GK/+uEeIhJBljHSYC2FdzbqutqTMlP0/TDMbS36ypdLmkF6YKJUIdcuHe1LU1l5zBeWo Ii8rpptvsGIHiykdb+xyY4gA5lg6i+s4LluYqe8KNk7UmmeDvL9TxyZXRBo2B9Ik6ogs LvPycAugunKt/zE5kBCe34IO1RFxdyHJ6Jr4u7wJCzYqERrjImoPmS7UpYZVYwel3aMR 5sooCrNmic1IedA+oU5jIfFCOnHR2q68JyYMwyvtmrrP/6CnUJKXZoEQMs3WQEYakxYm iLIw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=kAWts4K9UoL7OyK0SPo5rMrJ74dFn+xUwl8Bwsa58H0=; fh=M3+Fc1/dBaTJB2BAKivwIuL9328+R2LFTRubNmcXoaE=; b=LXZWY8waqEHaS9stQ0Suq9Qu8tTps6QnRtwZRB2f4Vc3IzMLDuB6yI3YqbLAtwlkOW 7IpO+siA3uUwoHIa6Ow3Lfa6xR+GCvgWOu1Y1ddhbWqurPFkXTxddDDDNKyneiz2WVrK e1V4cIyyhynG0pMFqWIDzEPXi+4yOvdzcVB353Xxn44hXMLgg4bdCD9EmMlyjHxzcT4s uJ0sS9zoimjDW5YYpSubW6NhG0lRqrDM6F4z/OxvVioFOhrcTDJtH4Z5sUF3ATnF3m5L Dt0O8WXqeEGNGXjCUYXp83inxJh4zQtl5JkzjarsnIzLlYzV+Kbx+MGemPhxVaq25VGO G5SQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b=i1dtVq+j; 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-77306-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77306-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ou40-20020a05620a622800b0078724ca7e88si13888442qkn.125.2024.02.22.12.18.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 12:18:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77306-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b=i1dtVq+j; 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-77306-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77306-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4F2F51C2288C for ; Thu, 22 Feb 2024 20:18:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 572BA71732; Thu, 22 Feb 2024 20:18:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xff.cz header.i=@xff.cz header.b="i1dtVq+j" 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 60A6A6E60E; Thu, 22 Feb 2024 20:18:03 +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=1708633091; cv=none; b=cnOIit0d+Sy28/7Jm0HzpMoBi6LVSaipuv5CSkDolXgNcmjpSGUnmm4f91NXonUcVhxGtrDbLCcChJFngAhS/bqAl4qrAPf2Ako22682yu8AF3t2L7x/GOvQ1+jx9kDyM+eI+z/+DjabVSkZLt7vJHXB7qJNZs/5haF8NvLyp18= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708633091; c=relaxed/simple; bh=EiUKoJgFF8oMypTNd3c6JPLCRhgmvWHjSm7jz6q9M+s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=n+KLQBFXomyExzbyZa8IjsuLbMQqdiCJUVzpOmTPldUkF+bKo6+a/sXH+LU5chY2qmtQ0saYVEoLXAlYNU23VCVdTeRU3m16CPco7VqJPqeASHTsoZwoVKeSnrmRkEfonzI3EHG9F6PUESsIWv6q1zcNohuoWTVTsvdyx4De4vI= 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=i1dtVq+j; 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=1708633080; bh=EiUKoJgFF8oMypTNd3c6JPLCRhgmvWHjSm7jz6q9M+s=; h=Date:From:To:Cc:Subject:X-My-GPG-KeyId:References:From; b=i1dtVq+jo6ykSMcJvbLZEq52v7fc+zMoNxFGgWEUcNmnMtOh9qZj6CG30t3bojQ+Q vi0DRONkalTi7/8SPOBqJMed+f8XTY9mJMSTXvfoOmpUvIdIRcVq1WvicVNvobfdNv yMm3SW4kiWVCUVCOgdnYl+yphmyUU5wyokGm/grw= Date: Thu, 22 Feb 2024 21:18:00 +0100 From: =?utf-8?Q?Ond=C5=99ej?= Jirman To: Mark Brown Cc: linux-kernel@vger.kernel.org, Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Arnaud Ferraris , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: Re: [PATCH 4/4] ASoC: sun8i-codec: Implement jack and accessory detection Message-ID: Mail-Followup-To: =?utf-8?Q?Ond=C5=99ej?= Jirman , Mark Brown , linux-kernel@vger.kernel.org, Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Arnaud Ferraris , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev X-My-GPG-KeyId: EBFBDDE11FB918D44D1F56C1F9F0A873BE9777ED References: <20240222181851.3398254-1-megi@xff.cz> <20240222181851.3398254-5-megi@xff.cz> <0c351386-f1df-443f-a997-261f5c60c852@sirena.org.uk> 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0c351386-f1df-443f-a997-261f5c60c852@sirena.org.uk> Hello Mark, On Thu, Feb 22, 2024 at 06:41:13PM +0000, Mark Brown wrote: > On Thu, Feb 22, 2024 at 07:18:47PM +0100, Ondřej Jirman wrote: > > > +static struct snd_soc_jack_pin sun8i_codec_jack_pins[] = { > > + { > > + .pin = "Headphone Jack", > > + .mask = SND_JACK_HEADPHONE, > > + }, > > + { > > + .pin = "Headset Microphone", > > + .mask = SND_JACK_MICROPHONE, > > + }, > > +}; > > + > > The jack being a headset jack is going to be system specific isn't it? > Some systems might have separate headphone and microphone jacks. I'd > not expect to see any pin handling code at all in a CODEC driver, that > belongs in the machine driver. Yeah, the only reason this and the card reference seems to be here is to check whether jack detection should be enabled and in what capacity. Looks like there's some set_jack component callback for that. :) I'll look into that. kind regards, o. > > static int sun8i_codec_component_probe(struct snd_soc_component *component) > > { > > struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); > > struct sun8i_codec *scodec = snd_soc_component_get_drvdata(component); > > int ret; > > > > + scodec->card = component->card; > > + > > The fact that you're needing to look at the card here should be a bit of > a warning sign there.