From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF539C433FE for ; Tue, 18 Jan 2022 20:18:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349130AbiARUSC (ORCPT ); Tue, 18 Jan 2022 15:18:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349112AbiARUSA (ORCPT ); Tue, 18 Jan 2022 15:18:00 -0500 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9899C061574 for ; Tue, 18 Jan 2022 12:18:00 -0800 (PST) Received: by mail-pj1-x102b.google.com with SMTP id g9-20020a17090a67c900b001b4f1d71e4fso377715pjm.4 for ; Tue, 18 Jan 2022 12:18:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=fTJy6r2petxIyCqlCeqcI3j0J1mr0+L2iTxm9kuz7Xs=; b=inhbbrVy+Fl/lXwKK3g5gU174TWO3UbXPm6+kPhfHgNNQVApLzBtbDcGk4Xgom17AB i3YZWJdLTgR31k1+RKgfidYdZUqNPiFDDZAGoFHkdyc4Ob67KE7sURHRukbTSubzASSf maDQWVxRz4iuaY3PO0xLJR+1EQcEZT+I8Q6AQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=fTJy6r2petxIyCqlCeqcI3j0J1mr0+L2iTxm9kuz7Xs=; b=C405xfIacK2Fesp1/SE4deeKRuMFHpPcpPekzAtduOKoPtyR1CylyB8DYoTKTVIX6e QY7X6n7X3EYwC3058dA3iZ8LrxQFwyX6p9ySOIrKm2XpJFKhZS0koof6zIahllQ9B1uT ytqP2djFXv44GiLXO2Kbx//A15RpA0at0T6fveTitM+2RIl5I5OoUsSd6lhZg+hqC+Te z4TZsSJrOVwMqtQ1g5q6qnfJt1cMqEUAft0u8yxSrvaBfdZ2rDDjdCMz0KK8hgEvuCWr Z4A9CIfqFarh1Ae4f8zz4CSE+2JZFVhJIooLtONS/9Y54XDOFechYiWRqT6t9WIFROtf Mfig== X-Gm-Message-State: AOAM532/jQY/subbsZWqfJH81zERFcak/E//AN+M8wNkzuPjQ0EdMl3F x5SXv+dECLh1g0LxZ5cKPrLu1w== X-Google-Smtp-Source: ABdhPJxiIurI5FHOTYvsCLYSQboCxGuQP/VrNeICLl1afrsd2ymXtXw5svEXZBZPdy/+GQJ6NoXhPA== X-Received: by 2002:a17:90b:4b8a:: with SMTP id lr10mr278353pjb.58.1642537079558; Tue, 18 Jan 2022 12:17:59 -0800 (PST) Received: from google.com ([2620:15c:202:201:e4bb:67e6:f0b5:1b92]) by smtp.gmail.com with ESMTPSA id ha11sm1170099pjb.3.2022.01.18.12.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jan 2022 12:17:58 -0800 (PST) Date: Tue, 18 Jan 2022 12:17:55 -0800 From: Brian Norris To: Chen-Yu Tsai Cc: Heiko Stuebner , Liam Girdwood , Mark Brown , David Airlie , Daniel Vetter , linux-rockchip@lists.infradead.org, Lin Huang , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Rob Herring , Sandy Huang , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org Subject: Re: [PATCH v2 3/3] ASoC: rk3399_gru_sound: Wire up DP jack detection Message-ID: References: <20220114230209.4091727-1-briannorris@chromium.org> <20220114150129.v2.3.I3c79b1466c14b02980071221e5b99283cd26ec77@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Chen-Yu, On Mon, Jan 17, 2022 at 05:01:52PM +0800, Chen-Yu Tsai wrote: > On Sat, Jan 15, 2022 at 7:03 AM Brian Norris wrote: > > > > Now that the cdn-dp driver supports plug-change callbacks, let's wire it > > up. > > > > Signed-off-by: Brian Norris > > --- > > > > (no changes since v1) > > > > sound/soc/rockchip/rk3399_gru_sound.c | 20 ++++++++++++++++++++ > > 1 file changed, 20 insertions(+) > > > > diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c > > index e2d52d8d0ff9..eeef3ed70037 100644 > > --- a/sound/soc/rockchip/rk3399_gru_sound.c > > +++ b/sound/soc/rockchip/rk3399_gru_sound.c > > @@ -164,6 +164,25 @@ static int rockchip_sound_da7219_hw_params(struct snd_pcm_substream *substream, > > return 0; > > } > > > > +static struct snd_soc_jack cdn_dp_card_jack; > > + > > +static int rockchip_sound_cdndp_init(struct snd_soc_pcm_runtime *rtd) > > +{ > > + struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; > > Using snd_soc_card_get_codec_dai() might be a better choice throughout this > driver. While it will work for the cdn_dp case, because it is the first DAI > in |rockchip_dais[]|, all the invocations for the other codecs are likely > returning the wrong DAI. I'll admit, I'm not very familiar with the ASoC object model, so you may well be correct that there's something fishy in here. But I did trace through the objects involved here, and we *are* getting the correct DAI for both this case and the DA7219 case (preexisting code). It looks like we actually have a new runtime for each of our static dai_links: devm_snd_soc_register_card() ... for_each_card_prelinks() snd_soc_add_pcm_runtime() So I think this is valid to keep as-is. > For this particular patch it works either way, so > > Reviewed-by: Chen-Yu Tsai Thanks for looking! Brian From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 11F3FC433EF for ; Tue, 18 Jan 2022 20:18:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 30EC310E556; Tue, 18 Jan 2022 20:18:01 +0000 (UTC) Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by gabe.freedesktop.org (Postfix) with ESMTPS id E366210E556 for ; Tue, 18 Jan 2022 20:17:59 +0000 (UTC) Received: by mail-pl1-x636.google.com with SMTP id u11so20295355plh.13 for ; Tue, 18 Jan 2022 12:17:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=fTJy6r2petxIyCqlCeqcI3j0J1mr0+L2iTxm9kuz7Xs=; b=inhbbrVy+Fl/lXwKK3g5gU174TWO3UbXPm6+kPhfHgNNQVApLzBtbDcGk4Xgom17AB i3YZWJdLTgR31k1+RKgfidYdZUqNPiFDDZAGoFHkdyc4Ob67KE7sURHRukbTSubzASSf maDQWVxRz4iuaY3PO0xLJR+1EQcEZT+I8Q6AQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=fTJy6r2petxIyCqlCeqcI3j0J1mr0+L2iTxm9kuz7Xs=; b=bMOzdTLFKZMxX12LtTow3k0V+SLC0RTteNYdR7Y77pPCeCHXNHbKQq3FYXRQVR73iY fIwOHhnha1MzyT9GEN36V12B3KfHQQ1HN3vl1VcCaoTwE9Z9FZ1LhyKRh8NVmFy3i0Uh DtMVqqnsS+Zo1Btqwtc51aJeDuS/WqOnQDNGK+DOzI69cWl/zzjkDBekOI4kyH63A5zA zzywF/VaumTpph700pHgJfhPBxkAdA0unACeN2bGsLMryr6KvK3UVDmhHFWeD30rzlus eLb2XBgwrPlX4gl/+DtmgBiZdB8h4p8NGMbrYHeEtb41Hg8iyfw8jGCQrlTrBE6YV8ic vDZA== X-Gm-Message-State: AOAM533J+9zIRueU6K32RfleXWULEm/6n3G2djR1YLzncssKdCpJW2f0 iV16ihOGuL8fnKnzQpdj/lLD8g== X-Google-Smtp-Source: ABdhPJxiIurI5FHOTYvsCLYSQboCxGuQP/VrNeICLl1afrsd2ymXtXw5svEXZBZPdy/+GQJ6NoXhPA== X-Received: by 2002:a17:90b:4b8a:: with SMTP id lr10mr278353pjb.58.1642537079558; Tue, 18 Jan 2022 12:17:59 -0800 (PST) Received: from google.com ([2620:15c:202:201:e4bb:67e6:f0b5:1b92]) by smtp.gmail.com with ESMTPSA id ha11sm1170099pjb.3.2022.01.18.12.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jan 2022 12:17:58 -0800 (PST) Date: Tue, 18 Jan 2022 12:17:55 -0800 From: Brian Norris To: Chen-Yu Tsai Subject: Re: [PATCH v2 3/3] ASoC: rk3399_gru_sound: Wire up DP jack detection Message-ID: References: <20220114230209.4091727-1-briannorris@chromium.org> <20220114150129.v2.3.I3c79b1466c14b02980071221e5b99283cd26ec77@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, David Airlie , linux-kernel@vger.kernel.org, Liam Girdwood , dri-devel@lists.freedesktop.org, Sandy Huang , linux-rockchip@lists.infradead.org, Mark Brown , Rob Herring , linux-arm-kernel@lists.infradead.org, Lin Huang Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Chen-Yu, On Mon, Jan 17, 2022 at 05:01:52PM +0800, Chen-Yu Tsai wrote: > On Sat, Jan 15, 2022 at 7:03 AM Brian Norris wrote: > > > > Now that the cdn-dp driver supports plug-change callbacks, let's wire it > > up. > > > > Signed-off-by: Brian Norris > > --- > > > > (no changes since v1) > > > > sound/soc/rockchip/rk3399_gru_sound.c | 20 ++++++++++++++++++++ > > 1 file changed, 20 insertions(+) > > > > diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c > > index e2d52d8d0ff9..eeef3ed70037 100644 > > --- a/sound/soc/rockchip/rk3399_gru_sound.c > > +++ b/sound/soc/rockchip/rk3399_gru_sound.c > > @@ -164,6 +164,25 @@ static int rockchip_sound_da7219_hw_params(struct snd_pcm_substream *substream, > > return 0; > > } > > > > +static struct snd_soc_jack cdn_dp_card_jack; > > + > > +static int rockchip_sound_cdndp_init(struct snd_soc_pcm_runtime *rtd) > > +{ > > + struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; > > Using snd_soc_card_get_codec_dai() might be a better choice throughout this > driver. While it will work for the cdn_dp case, because it is the first DAI > in |rockchip_dais[]|, all the invocations for the other codecs are likely > returning the wrong DAI. I'll admit, I'm not very familiar with the ASoC object model, so you may well be correct that there's something fishy in here. But I did trace through the objects involved here, and we *are* getting the correct DAI for both this case and the DA7219 case (preexisting code). It looks like we actually have a new runtime for each of our static dai_links: devm_snd_soc_register_card() ... for_each_card_prelinks() snd_soc_add_pcm_runtime() So I think this is valid to keep as-is. > For this particular patch it works either way, so > > Reviewed-by: Chen-Yu Tsai Thanks for looking! Brian From mboxrd@z Thu Jan 1 00:00:00 1970 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 C0813C433F5 for ; Tue, 18 Jan 2022 20:18:13 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=L/QrK2E1o8RjTN8/1SRXE9PYktnxiq5DcCgWAX9vV7s=; b=Qq/5o/2Gitw1ik fLsSrWWa4hnuy/+vpx+02M7H0wnkvbV9bQooReNCWQdxDZORct2vFHKKyBdtNLjzwoG3/MyEkO5Vc zwf5DJJszmmdD6cvfotBYQnJI/0MPWKRd35c2BEhyutSuyOwCRFn5YlOFiAzihGkZWqWgW17Ot2xA h3smlqIjqkBTpcy1cTInWGkaFKOBuLsie9GM8DALkHFKVtN7/OuGsAZElWIQkke0c+GI+5hnVePap C80DmiEos6QkMtX+zXbHpw3GvniANxNEEyFku6JJA33pmMPqpXak4ArqVEtA59TV/xlplO1oRm7X5 O+CoInKnHfl+ZXb2VIiQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n9uve-002rh4-It; Tue, 18 Jan 2022 20:18:06 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n9uvZ-002ret-BP for linux-rockchip@lists.infradead.org; Tue, 18 Jan 2022 20:18:04 +0000 Received: by mail-pj1-x102e.google.com with SMTP id d15-20020a17090a110f00b001b4e7d27474so402102pja.2 for ; Tue, 18 Jan 2022 12:17:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=fTJy6r2petxIyCqlCeqcI3j0J1mr0+L2iTxm9kuz7Xs=; b=inhbbrVy+Fl/lXwKK3g5gU174TWO3UbXPm6+kPhfHgNNQVApLzBtbDcGk4Xgom17AB i3YZWJdLTgR31k1+RKgfidYdZUqNPiFDDZAGoFHkdyc4Ob67KE7sURHRukbTSubzASSf maDQWVxRz4iuaY3PO0xLJR+1EQcEZT+I8Q6AQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=fTJy6r2petxIyCqlCeqcI3j0J1mr0+L2iTxm9kuz7Xs=; b=55IatECAYUbG2c15a/Fn4POKoRMRFaOhRr1u2NNKAR/nRgnHczfFu+Xl7q6c5T2yM2 AlmYTxL1NNHpuNPRK2/v+tvhU94RLITpkFoxJl76CHfntTO3jmkX3V/Y3YBm6wVRY7bE nHZWalKbdKgxue6bWeqNE2d8OY3pOQDs8yM4aL9iyTsV9DsTA+pNU9UJMJ5rgM/NKx82 3tgrOOA4nVr+LAqVxUnYnYJ1ib3LXaTTeh2AO2/zY1QA07DQAdTExIEKiWS4xbuxZyO2 nbOI47yL3WdJ7M+biW19g4Wk0+SE+uX/2FVQLGTKjWD+WPEF9if6bYlK+YRsDZHik5Lt nGzA== X-Gm-Message-State: AOAM530nJdUXb3qOaq98Jgtz1yiDiejnIoh53HcyXeIgoFnV6xNwkBAq pD/C6gbBdkrnJKL6ao4EHyZZ+w== X-Google-Smtp-Source: ABdhPJxiIurI5FHOTYvsCLYSQboCxGuQP/VrNeICLl1afrsd2ymXtXw5svEXZBZPdy/+GQJ6NoXhPA== X-Received: by 2002:a17:90b:4b8a:: with SMTP id lr10mr278353pjb.58.1642537079558; Tue, 18 Jan 2022 12:17:59 -0800 (PST) Received: from google.com ([2620:15c:202:201:e4bb:67e6:f0b5:1b92]) by smtp.gmail.com with ESMTPSA id ha11sm1170099pjb.3.2022.01.18.12.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jan 2022 12:17:58 -0800 (PST) Date: Tue, 18 Jan 2022 12:17:55 -0800 From: Brian Norris To: Chen-Yu Tsai Cc: Heiko Stuebner , Liam Girdwood , Mark Brown , David Airlie , Daniel Vetter , linux-rockchip@lists.infradead.org, Lin Huang , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Rob Herring , Sandy Huang , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org Subject: Re: [PATCH v2 3/3] ASoC: rk3399_gru_sound: Wire up DP jack detection Message-ID: References: <20220114230209.4091727-1-briannorris@chromium.org> <20220114150129.v2.3.I3c79b1466c14b02980071221e5b99283cd26ec77@changeid> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220118_121801_420822_F24E6D56 X-CRM114-Status: GOOD ( 22.79 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Hi Chen-Yu, On Mon, Jan 17, 2022 at 05:01:52PM +0800, Chen-Yu Tsai wrote: > On Sat, Jan 15, 2022 at 7:03 AM Brian Norris wrote: > > > > Now that the cdn-dp driver supports plug-change callbacks, let's wire it > > up. > > > > Signed-off-by: Brian Norris > > --- > > > > (no changes since v1) > > > > sound/soc/rockchip/rk3399_gru_sound.c | 20 ++++++++++++++++++++ > > 1 file changed, 20 insertions(+) > > > > diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c > > index e2d52d8d0ff9..eeef3ed70037 100644 > > --- a/sound/soc/rockchip/rk3399_gru_sound.c > > +++ b/sound/soc/rockchip/rk3399_gru_sound.c > > @@ -164,6 +164,25 @@ static int rockchip_sound_da7219_hw_params(struct snd_pcm_substream *substream, > > return 0; > > } > > > > +static struct snd_soc_jack cdn_dp_card_jack; > > + > > +static int rockchip_sound_cdndp_init(struct snd_soc_pcm_runtime *rtd) > > +{ > > + struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; > > Using snd_soc_card_get_codec_dai() might be a better choice throughout this > driver. While it will work for the cdn_dp case, because it is the first DAI > in |rockchip_dais[]|, all the invocations for the other codecs are likely > returning the wrong DAI. I'll admit, I'm not very familiar with the ASoC object model, so you may well be correct that there's something fishy in here. But I did trace through the objects involved here, and we *are* getting the correct DAI for both this case and the DA7219 case (preexisting code). It looks like we actually have a new runtime for each of our static dai_links: devm_snd_soc_register_card() ... for_each_card_prelinks() snd_soc_add_pcm_runtime() So I think this is valid to keep as-is. > For this particular patch it works either way, so > > Reviewed-by: Chen-Yu Tsai Thanks for looking! Brian _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip From mboxrd@z Thu Jan 1 00:00:00 1970 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 4E36AC433F5 for ; Tue, 18 Jan 2022 20:19:05 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 861E32D53; Tue, 18 Jan 2022 21:18:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 861E32D53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1642537143; bh=s3ka3H0uD+7oVkDF6I9N02EzkbrxVdN44ln2B48OtEE=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=tuj63KZ9R+X1DEkzAU7qXtI22lC/i1bu8Jf+ajE35bNQaSYkQmQ4DuB6y/ruNM8V5 wSTFlFqm/zjnJbfDgxym4Nr1LEEchfAGNWz7WJMaZZyBnu9H/k1Yno5ZikOIvQVcsa KrLn4LlH/AZQmMEpVfsyTImE20jqaD+6m0Ri++nc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1F2B8F80100; Tue, 18 Jan 2022 21:18:13 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5B6E4F800CE; Tue, 18 Jan 2022 21:18:09 +0100 (CET) Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7E067F800CE for ; Tue, 18 Jan 2022 21:18:02 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7E067F800CE Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="inhbbrVy" Received: by mail-pj1-x102c.google.com with SMTP id d12-20020a17090a628c00b001b4f47e2f51so687617pjj.3 for ; Tue, 18 Jan 2022 12:18:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=fTJy6r2petxIyCqlCeqcI3j0J1mr0+L2iTxm9kuz7Xs=; b=inhbbrVy+Fl/lXwKK3g5gU174TWO3UbXPm6+kPhfHgNNQVApLzBtbDcGk4Xgom17AB i3YZWJdLTgR31k1+RKgfidYdZUqNPiFDDZAGoFHkdyc4Ob67KE7sURHRukbTSubzASSf maDQWVxRz4iuaY3PO0xLJR+1EQcEZT+I8Q6AQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=fTJy6r2petxIyCqlCeqcI3j0J1mr0+L2iTxm9kuz7Xs=; b=bQ9nQPP++9zHM9ivQxQUggRp95Edb4hFT7A2C5CTCgZhvvUlWF4f0zVmPycgwPJQlB jCnfLy4RfeDId1M/GiFJxTV2EcHwIoUk+xrg1VLrwH3NKZ5GeNflKwsIplMVDpmjhBGm 77XTJOp+MVuMtxvm/KlEAcBM5ej0IHRKKoHNaUsXHrv1FHcMyUa2QJuLgKOehCd6wlgW 83UBndj1yMHCI17P2Hy5bZJzq/Q+rlWPwDX02YDsoeAQNakR7a81OEOl/pruR2KXNXYW IWeaqGW2Ku7NDRBuLiMTscF7usUgjdT/LFCDWT0RvBFMlbQ5RnyuVxnWm51KqjE+E1Yj OUpA== X-Gm-Message-State: AOAM531t98ktt5/aot5pR//Qst2Snr9W5TEZ5u+ecbhQAZ0bibOkbaep ZxIQu2+zCw5ohiMgHugM4WnCRw== X-Google-Smtp-Source: ABdhPJxiIurI5FHOTYvsCLYSQboCxGuQP/VrNeICLl1afrsd2ymXtXw5svEXZBZPdy/+GQJ6NoXhPA== X-Received: by 2002:a17:90b:4b8a:: with SMTP id lr10mr278353pjb.58.1642537079558; Tue, 18 Jan 2022 12:17:59 -0800 (PST) Received: from google.com ([2620:15c:202:201:e4bb:67e6:f0b5:1b92]) by smtp.gmail.com with ESMTPSA id ha11sm1170099pjb.3.2022.01.18.12.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jan 2022 12:17:58 -0800 (PST) Date: Tue, 18 Jan 2022 12:17:55 -0800 From: Brian Norris To: Chen-Yu Tsai Subject: Re: [PATCH v2 3/3] ASoC: rk3399_gru_sound: Wire up DP jack detection Message-ID: References: <20220114230209.4091727-1-briannorris@chromium.org> <20220114150129.v2.3.I3c79b1466c14b02980071221e5b99283cd26ec77@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Heiko Stuebner , David Airlie , linux-kernel@vger.kernel.org, Liam Girdwood , dri-devel@lists.freedesktop.org, Sandy Huang , linux-rockchip@lists.infradead.org, Mark Brown , Daniel Vetter , Rob Herring , linux-arm-kernel@lists.infradead.org, Lin Huang X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Hi Chen-Yu, On Mon, Jan 17, 2022 at 05:01:52PM +0800, Chen-Yu Tsai wrote: > On Sat, Jan 15, 2022 at 7:03 AM Brian Norris wrote: > > > > Now that the cdn-dp driver supports plug-change callbacks, let's wire it > > up. > > > > Signed-off-by: Brian Norris > > --- > > > > (no changes since v1) > > > > sound/soc/rockchip/rk3399_gru_sound.c | 20 ++++++++++++++++++++ > > 1 file changed, 20 insertions(+) > > > > diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c > > index e2d52d8d0ff9..eeef3ed70037 100644 > > --- a/sound/soc/rockchip/rk3399_gru_sound.c > > +++ b/sound/soc/rockchip/rk3399_gru_sound.c > > @@ -164,6 +164,25 @@ static int rockchip_sound_da7219_hw_params(struct snd_pcm_substream *substream, > > return 0; > > } > > > > +static struct snd_soc_jack cdn_dp_card_jack; > > + > > +static int rockchip_sound_cdndp_init(struct snd_soc_pcm_runtime *rtd) > > +{ > > + struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; > > Using snd_soc_card_get_codec_dai() might be a better choice throughout this > driver. While it will work for the cdn_dp case, because it is the first DAI > in |rockchip_dais[]|, all the invocations for the other codecs are likely > returning the wrong DAI. I'll admit, I'm not very familiar with the ASoC object model, so you may well be correct that there's something fishy in here. But I did trace through the objects involved here, and we *are* getting the correct DAI for both this case and the DA7219 case (preexisting code). It looks like we actually have a new runtime for each of our static dai_links: devm_snd_soc_register_card() ... for_each_card_prelinks() snd_soc_add_pcm_runtime() So I think this is valid to keep as-is. > For this particular patch it works either way, so > > Reviewed-by: Chen-Yu Tsai Thanks for looking! Brian From mboxrd@z Thu Jan 1 00:00:00 1970 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 AD0D3C433EF for ; Tue, 18 Jan 2022 20:19:28 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5gkVZPeSjLd2Es6Xhia5gzCK55a9GtECPdBv0W5SQow=; b=oi+xsxbE98/nNN EdGzMazpFfgMMxq6mNEX9DhFCPBaxvAUQFhJeDtqPjCs1w6a6klu7fk6NLg424lUFr1amEXSz+kDZ +ml1mZ3Kx8jNjiUqyEpEVktsJzNV1FX8CyGGC2y13aErPUSNmn7R5A6H0LowTYXa3bVQ0+4Xb7HaT y9ExTLnOIK/4aILJhkpIOZfah4pr/WjO2tsz0pGiVStD/6L+opVCEFe1HANW9za2y2yIJdyys4Wso ZBpsBNfVu1FW221aFXKtE+FpqlP1By5tO81akJRvKCBrrtpkxHS5qbjQL3KRNKCmtiCSfRoLg2pmw vF2VR0jYytsmgM63olLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n9uvg-002rh8-0C; Tue, 18 Jan 2022 20:18:08 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n9uvZ-002res-BB for linux-arm-kernel@lists.infradead.org; Tue, 18 Jan 2022 20:18:04 +0000 Received: by mail-pj1-x102e.google.com with SMTP id n16-20020a17090a091000b001b46196d572so373646pjn.5 for ; Tue, 18 Jan 2022 12:17:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=fTJy6r2petxIyCqlCeqcI3j0J1mr0+L2iTxm9kuz7Xs=; b=inhbbrVy+Fl/lXwKK3g5gU174TWO3UbXPm6+kPhfHgNNQVApLzBtbDcGk4Xgom17AB i3YZWJdLTgR31k1+RKgfidYdZUqNPiFDDZAGoFHkdyc4Ob67KE7sURHRukbTSubzASSf maDQWVxRz4iuaY3PO0xLJR+1EQcEZT+I8Q6AQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=fTJy6r2petxIyCqlCeqcI3j0J1mr0+L2iTxm9kuz7Xs=; b=3fAJbOPkGeo9Dp+CaJhmgZbu5pJKM7ZiWRXQTVhWKpMC4PLPMsRON54/41WmkUku8e GtxAkW40yeQo+noqLfn8xgM3NedpIr3sn/WwqC4PozI3a20XqCxJdGhgg2/HLSNR895b SlDkF+e+ExoJ2vvzcyTW44bTmo5zG59kERstsxO+3JToY3Q5tXc4qXL/3Bf78WzrJxg1 h6pbVUgMmS2K1MJtdMeRl8YNglBlCQCT5vC3eQngkaVjG5O0Dg/ItKlr78ZMG9bRf83g 2tSvTQ+Mxmg9u14RNNs+DIbVimMgIE4olCqtU1fimuUC0K7W+iQNDiKSBW+XSsnx5fqW jckA== X-Gm-Message-State: AOAM530t9rHxmE0+dbeWLRek6wpDwdMYLpqfzkIXnmtnAQHdPWhXgikH Wq5KdshnDMWwHwwDj54TK23hAUK+o9TltQ== X-Google-Smtp-Source: ABdhPJxiIurI5FHOTYvsCLYSQboCxGuQP/VrNeICLl1afrsd2ymXtXw5svEXZBZPdy/+GQJ6NoXhPA== X-Received: by 2002:a17:90b:4b8a:: with SMTP id lr10mr278353pjb.58.1642537079558; Tue, 18 Jan 2022 12:17:59 -0800 (PST) Received: from google.com ([2620:15c:202:201:e4bb:67e6:f0b5:1b92]) by smtp.gmail.com with ESMTPSA id ha11sm1170099pjb.3.2022.01.18.12.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jan 2022 12:17:58 -0800 (PST) Date: Tue, 18 Jan 2022 12:17:55 -0800 From: Brian Norris To: Chen-Yu Tsai Cc: Heiko Stuebner , Liam Girdwood , Mark Brown , David Airlie , Daniel Vetter , linux-rockchip@lists.infradead.org, Lin Huang , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Rob Herring , Sandy Huang , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org Subject: Re: [PATCH v2 3/3] ASoC: rk3399_gru_sound: Wire up DP jack detection Message-ID: References: <20220114230209.4091727-1-briannorris@chromium.org> <20220114150129.v2.3.I3c79b1466c14b02980071221e5b99283cd26ec77@changeid> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220118_121801_425853_2B003EF8 X-CRM114-Status: GOOD ( 24.20 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Chen-Yu, On Mon, Jan 17, 2022 at 05:01:52PM +0800, Chen-Yu Tsai wrote: > On Sat, Jan 15, 2022 at 7:03 AM Brian Norris wrote: > > > > Now that the cdn-dp driver supports plug-change callbacks, let's wire it > > up. > > > > Signed-off-by: Brian Norris > > --- > > > > (no changes since v1) > > > > sound/soc/rockchip/rk3399_gru_sound.c | 20 ++++++++++++++++++++ > > 1 file changed, 20 insertions(+) > > > > diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c > > index e2d52d8d0ff9..eeef3ed70037 100644 > > --- a/sound/soc/rockchip/rk3399_gru_sound.c > > +++ b/sound/soc/rockchip/rk3399_gru_sound.c > > @@ -164,6 +164,25 @@ static int rockchip_sound_da7219_hw_params(struct snd_pcm_substream *substream, > > return 0; > > } > > > > +static struct snd_soc_jack cdn_dp_card_jack; > > + > > +static int rockchip_sound_cdndp_init(struct snd_soc_pcm_runtime *rtd) > > +{ > > + struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; > > Using snd_soc_card_get_codec_dai() might be a better choice throughout this > driver. While it will work for the cdn_dp case, because it is the first DAI > in |rockchip_dais[]|, all the invocations for the other codecs are likely > returning the wrong DAI. I'll admit, I'm not very familiar with the ASoC object model, so you may well be correct that there's something fishy in here. But I did trace through the objects involved here, and we *are* getting the correct DAI for both this case and the DA7219 case (preexisting code). It looks like we actually have a new runtime for each of our static dai_links: devm_snd_soc_register_card() ... for_each_card_prelinks() snd_soc_add_pcm_runtime() So I think this is valid to keep as-is. > For this particular patch it works either way, so > > Reviewed-by: Chen-Yu Tsai Thanks for looking! Brian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel