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 56D73C433FE for ; Wed, 19 Jan 2022 05:59:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351637AbiASF7o (ORCPT ); Wed, 19 Jan 2022 00:59:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239210AbiASF7m (ORCPT ); Wed, 19 Jan 2022 00:59:42 -0500 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C897C06161C for ; Tue, 18 Jan 2022 21:59:42 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id p27so4995523lfa.1 for ; Tue, 18 Jan 2022 21:59:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1tKYVg7wJMJMNFKIyw+d3Kv62PM5IDYj6Uiog3M1guQ=; b=O3rjR1xwJ5RJa/8Pr4j+o/xz2ODymM24FgRvDAyyXVz801NpNIj40tnMPXagEzzIdN YgApJ9Se2RtCuzQIBr9UoxOYieOUmAITh7Ff2mH+sSXNnt/MyPTQm0hxbsds1OhLg9Lx iGrVXc3V0OyRFdbBmsPvPpedratR1otyTGqBk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1tKYVg7wJMJMNFKIyw+d3Kv62PM5IDYj6Uiog3M1guQ=; b=unRdqjrvLgH1YeFCW+bkNRqGTO3KUqQMU1J2E5bHteaa9RxETRwOUihjaOLVhOTfor ol/utYV0utbRRBHi2j+Y3DJWH7+DY7x9BHsG+ikQUaO2viYxqBnRinVI2AufqhWf9epB l/HlLREplMAxVdZobaui7T7jbzHJKlWQ9Uv7dWDqVo8PMiO2rCXnUG7N9iq8R73QkI1y 0oH8kqrFpOORU/1OivcgpJ4maN20hcFBFgds0KyMIZtFoYwvARCScR6QFr06l5uX8SfZ OTeahhzvYdZC+GPqFH6+PvAxnWpXzmSzTzmuEEfcqV2/u10tgiIY8AWKHlp19Vnj1Hpj 2OSg== X-Gm-Message-State: AOAM533j0bcPgm+YcELV2K6WtTQupeiIrjpjqQE/rA/q7vlTliPRSZOt DIRIgoi+IK0mTyNN+TEFCFly7a39jv/f/jWISdPbBQ== X-Google-Smtp-Source: ABdhPJxmDuwkFJziW4xvLsZmdp9HyrtsLl84OWqtBxpyS7OeNwc36CaaRT+rymCOgrfcQNTO0R57Np83PfJ/v382SjQ= X-Received: by 2002:a05:6512:1320:: with SMTP id x32mr25449431lfu.597.1642571980606; Tue, 18 Jan 2022 21:59:40 -0800 (PST) MIME-Version: 1.0 References: <20220114230209.4091727-1-briannorris@chromium.org> <20220114150129.v2.3.I3c79b1466c14b02980071221e5b99283cd26ec77@changeid> In-Reply-To: From: Chen-Yu Tsai Date: Wed, 19 Jan 2022 13:59:29 +0800 Message-ID: Subject: Re: [PATCH v2 3/3] ASoC: rk3399_gru_sound: Wire up DP jack detection To: Brian Norris 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 19, 2022 at 4:18 AM Brian Norris wrote: > > 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). Neither am I, so ... > 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. I missed this bit. As you say, things are good. > > For this particular patch it works either way, so > > > > Reviewed-by: Chen-Yu Tsai > > Thanks for looking! And thanks for double checking! 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 948E2C433F5 for ; Wed, 19 Jan 2022 05:59:50 +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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9kK0qjWrPFpAq+x56uk6nckJdCvQNWIx2op/sdJL5ZI=; b=0v1rhag2LLgQoK cM3HxLsYa64clqKyOozSOJcGgl5eunBGozSMvi83K/+QUuKzCo5wiGZ3dMWZguo9is/L2cmkHKS+a rBiZ6jATbbAlvcialDHZomuwf9TgZPVhz8i+YFYWhhynbJKWBONhWsVnd7MiY+Kke6OLnKngyw2Cr PqpyWmfnrFakiE6Ha7tXk9fwm3RFSt4sDXjDlsZoJlvc8TlDe8lwpMezHGrzeaTSciw5qnFKX7TF6 aDKvF3jO8pLktc2ac+8PVUVLbFIHF3E+1IQ7Wv4aBFOjwV63BvO1C1XlQ02wiTgsyokzcjhvSGtL3 6yfBcdLLN6urwF/y+IFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nA40X-003tk6-62; Wed, 19 Jan 2022 05:59:45 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nA40U-003tiN-GV for linux-rockchip@lists.infradead.org; Wed, 19 Jan 2022 05:59:43 +0000 Received: by mail-lf1-x129.google.com with SMTP id o12so4798563lfu.12 for ; Tue, 18 Jan 2022 21:59:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1tKYVg7wJMJMNFKIyw+d3Kv62PM5IDYj6Uiog3M1guQ=; b=O3rjR1xwJ5RJa/8Pr4j+o/xz2ODymM24FgRvDAyyXVz801NpNIj40tnMPXagEzzIdN YgApJ9Se2RtCuzQIBr9UoxOYieOUmAITh7Ff2mH+sSXNnt/MyPTQm0hxbsds1OhLg9Lx iGrVXc3V0OyRFdbBmsPvPpedratR1otyTGqBk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1tKYVg7wJMJMNFKIyw+d3Kv62PM5IDYj6Uiog3M1guQ=; b=7hvuZJTwyqoG2nquaUcSBcVnnQfi+meEPvQYXxVGS+2hNnFJe8pZl43RBsuJqTMNLS lmNh6dxElI6wpTy8HBsVLXPdwqBfQ7v96X2V8371wSua++uhPAK4QgoyF0hfJqMegkT+ 6uElS05Mk+9HR9iCV6A/8WckVkX9F2rXvUpl9ueSQYDL+jJYzFbDjkGbmC6YN04Tnors 19f4gok21uTFrqEmGjgjdXLobI6/xj6xsOd7aOko6/ue//qT/Lmp5IqKsn95PVFJWFNU OZaG4m8XquOyQxZGFHK/cXCMDGxReIE0ZbkMm+f71pkqSOj1fOOiQ4LWtHHAbBL/347q gPBQ== X-Gm-Message-State: AOAM531AiE13dAqYvfh96w8+WZM6YirEtwcluyMndRp91iwkIR/Wt+sX swycABYKR7vj2Y+SSpFviiPHyIgb6d6ZdHDVayj9Nw== X-Google-Smtp-Source: ABdhPJxmDuwkFJziW4xvLsZmdp9HyrtsLl84OWqtBxpyS7OeNwc36CaaRT+rymCOgrfcQNTO0R57Np83PfJ/v382SjQ= X-Received: by 2002:a05:6512:1320:: with SMTP id x32mr25449431lfu.597.1642571980606; Tue, 18 Jan 2022 21:59:40 -0800 (PST) MIME-Version: 1.0 References: <20220114230209.4091727-1-briannorris@chromium.org> <20220114150129.v2.3.I3c79b1466c14b02980071221e5b99283cd26ec77@changeid> In-Reply-To: From: Chen-Yu Tsai Date: Wed, 19 Jan 2022 13:59:29 +0800 Message-ID: Subject: Re: [PATCH v2 3/3] ASoC: rk3399_gru_sound: Wire up DP jack detection To: Brian Norris 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220118_215942_579465_B922DC76 X-CRM114-Status: GOOD ( 27.11 ) 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 On Wed, Jan 19, 2022 at 4:18 AM Brian Norris wrote: > > 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). Neither am I, so ... > 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. I missed this bit. As you say, things are good. > > For this particular patch it works either way, so > > > > Reviewed-by: Chen-Yu Tsai > > Thanks for looking! And thanks for double checking! _______________________________________________ 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 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 2036CC433EF for ; Wed, 19 Jan 2022 05:59:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 10DEE10EE5E; Wed, 19 Jan 2022 05:59:43 +0000 (UTC) Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6361610EE82 for ; Wed, 19 Jan 2022 05:59:42 +0000 (UTC) Received: by mail-lf1-x129.google.com with SMTP id x11so4981351lfa.2 for ; Tue, 18 Jan 2022 21:59:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1tKYVg7wJMJMNFKIyw+d3Kv62PM5IDYj6Uiog3M1guQ=; b=O3rjR1xwJ5RJa/8Pr4j+o/xz2ODymM24FgRvDAyyXVz801NpNIj40tnMPXagEzzIdN YgApJ9Se2RtCuzQIBr9UoxOYieOUmAITh7Ff2mH+sSXNnt/MyPTQm0hxbsds1OhLg9Lx iGrVXc3V0OyRFdbBmsPvPpedratR1otyTGqBk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1tKYVg7wJMJMNFKIyw+d3Kv62PM5IDYj6Uiog3M1guQ=; b=f6pUdHWSiWqamPW+SguV9YgO+CZ46DP74Z4vKiOcFKt2dIMTSGart/zyRNl3zmPDgS S+mqMeUTL2KzEZM9badsQQJG7kXIg8TlO/GEuILncm+T3mk+jnsp29+dy/aCgh7nxCkL M7xBEHRafzgNWQsWiVOFveSWk82SVKrBPaFzG8NIEjkyQ21fEhODghfMoq1w2PGHZo4b AsPhfeTqpQtYaR12xD3lIWiF4OQxVM8/uz5AFlNBQgIj4yMUPHn3JSNx1IBZ6H1Mwn2V VfwKnL5VTdLclH/qh94ct+xCjbKv2bydiyXr/cpYd58nxcvidFI5pEcUAwdC69Z0x0pr sdJg== X-Gm-Message-State: AOAM533KSpiS86FcgVeFK1iM0vM9yLlv/4DjU/eSptgeHjdw+OdJe5t5 vrR9uB6s9yQkWGkH627rMxsHe24goWKhug/p2V9aFA== X-Google-Smtp-Source: ABdhPJxmDuwkFJziW4xvLsZmdp9HyrtsLl84OWqtBxpyS7OeNwc36CaaRT+rymCOgrfcQNTO0R57Np83PfJ/v382SjQ= X-Received: by 2002:a05:6512:1320:: with SMTP id x32mr25449431lfu.597.1642571980606; Tue, 18 Jan 2022 21:59:40 -0800 (PST) MIME-Version: 1.0 References: <20220114230209.4091727-1-briannorris@chromium.org> <20220114150129.v2.3.I3c79b1466c14b02980071221e5b99283cd26ec77@changeid> In-Reply-To: From: Chen-Yu Tsai Date: Wed, 19 Jan 2022 13:59:29 +0800 Message-ID: Subject: Re: [PATCH v2 3/3] ASoC: rk3399_gru_sound: Wire up DP jack detection To: Brian Norris Content-Type: text/plain; charset="UTF-8" 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" On Wed, Jan 19, 2022 at 4:18 AM Brian Norris wrote: > > 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). Neither am I, so ... > 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. I missed this bit. As you say, things are good. > > For this particular patch it works either way, so > > > > Reviewed-by: Chen-Yu Tsai > > Thanks for looking! And thanks for double checking! 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 9502AC433F5 for ; Wed, 19 Jan 2022 06:00:44 +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 141113338; Wed, 19 Jan 2022 06:59:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 141113338 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1642572042; bh=nQAmdo16Vq58Zy7cZD8RCems/wC3KORTogxczHUYSQw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lO/MyxMSThi4Nj/t0FOlNrrIhak8ylmWi7ivDUw8mqaoLsIpiL6I+SHfDn3+zcVlA usAfuxpQjBUqFXzVogzcZToCl9XEKRMGPNLK/LxrmQynPKvU5padrQdxjAuK6JZVVt WCzDWVog05C0y4CepiH9o+hylePwVlWOUeW6rH5I= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 92B5EF801F7; Wed, 19 Jan 2022 06:59:51 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2B5C2F801F7; Wed, 19 Jan 2022 06:59:49 +0100 (CET) Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) (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 9CCF8F80128 for ; Wed, 19 Jan 2022 06:59:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9CCF8F80128 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="O3rjR1xw" Received: by mail-lf1-x130.google.com with SMTP id x22so4818057lfd.10 for ; Tue, 18 Jan 2022 21:59:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1tKYVg7wJMJMNFKIyw+d3Kv62PM5IDYj6Uiog3M1guQ=; b=O3rjR1xwJ5RJa/8Pr4j+o/xz2ODymM24FgRvDAyyXVz801NpNIj40tnMPXagEzzIdN YgApJ9Se2RtCuzQIBr9UoxOYieOUmAITh7Ff2mH+sSXNnt/MyPTQm0hxbsds1OhLg9Lx iGrVXc3V0OyRFdbBmsPvPpedratR1otyTGqBk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1tKYVg7wJMJMNFKIyw+d3Kv62PM5IDYj6Uiog3M1guQ=; b=WCuBRUvn8j8MTRtcR3glb2GneIV+dDCHv0gdACr0BaXK2R3e+oKn4XWo3mVniB2fTA gBQ7o5jyJHoOpHwO/doadT9Gdy3iTBc1mpK4AXVBgHSiIKEXKBeZSSXytQjhLH4mGpJB hRmjmxIs/xAxbulMOqQAUkzH8UqOPN/hcWUSa6Y4g7skHfPUxeDqkbbR0Xc1tQvGe4yI 9GfribRTksim8XenM1CVmXabHGwhwxV7JOmaSMCw2CfdCxRly8UsNxa8d3+Nk6SGWdP7 AewNGE8DUEkUt0hXZ/pjYim8ZH4YWzr2CGnv7OqNcWhr+rWUG7Yq94KhESGKG3JcPGle op/Q== X-Gm-Message-State: AOAM530dJMF9NFlKZ/Ds3tQwhePWjgwszreCvBqM3506ZvQBD65wuAs7 r96iwPvekWN1gHua4SWEJj9Da7Z14FvsXKbXd9LLLA== X-Google-Smtp-Source: ABdhPJxmDuwkFJziW4xvLsZmdp9HyrtsLl84OWqtBxpyS7OeNwc36CaaRT+rymCOgrfcQNTO0R57Np83PfJ/v382SjQ= X-Received: by 2002:a05:6512:1320:: with SMTP id x32mr25449431lfu.597.1642571980606; Tue, 18 Jan 2022 21:59:40 -0800 (PST) MIME-Version: 1.0 References: <20220114230209.4091727-1-briannorris@chromium.org> <20220114150129.v2.3.I3c79b1466c14b02980071221e5b99283cd26ec77@changeid> In-Reply-To: From: Chen-Yu Tsai Date: Wed, 19 Jan 2022 13:59:29 +0800 Message-ID: Subject: Re: [PATCH v2 3/3] ASoC: rk3399_gru_sound: Wire up DP jack detection To: Brian Norris Content-Type: text/plain; charset="UTF-8" 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" On Wed, Jan 19, 2022 at 4:18 AM Brian Norris wrote: > > 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). Neither am I, so ... > 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. I missed this bit. As you say, things are good. > > For this particular patch it works either way, so > > > > Reviewed-by: Chen-Yu Tsai > > Thanks for looking! And thanks for double checking! 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 75123C433F5 for ; Wed, 19 Jan 2022 06:00:57 +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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=42XQc8kaY0CdD2FDIim54TCNX8ZkfRjUwleYdX63jUY=; b=U+foGtYCfowLBC A3zfjf3jYcIWIoa6wAkgPBV5iFTHcT+a9brfYGF6TpzEn1dpaLgwsgwmg6X8l+/bcU8sEFkE5Mfzo ixKkhvyTu97HfA0YMfesja7pRLqm5mdO6UETjybpMDUT1IkBjgISdR03TAkJqJQnMOAnVz0tqvk34 NRTFYtt5MEBFQURzPlv//xPOu7ytTK42XXaHAXACZpBLQOc2m0jUDyf37GS6oRM5A34mlF3ktRf21 HzrOGHoJ0Kul3ljEoMiQ1AB0c2u1nut0isM/mgSuLy5XzfciGoUapoEZ5RvxVxQ8pHYZp78udRbkl Ui23Bw7Wb3rZnFSerdVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nA40Y-003tkX-LW; Wed, 19 Jan 2022 05:59:46 +0000 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nA40U-003tiM-Gs for linux-arm-kernel@lists.infradead.org; Wed, 19 Jan 2022 05:59:43 +0000 Received: by mail-lf1-x130.google.com with SMTP id m1so4937449lfq.4 for ; Tue, 18 Jan 2022 21:59:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1tKYVg7wJMJMNFKIyw+d3Kv62PM5IDYj6Uiog3M1guQ=; b=O3rjR1xwJ5RJa/8Pr4j+o/xz2ODymM24FgRvDAyyXVz801NpNIj40tnMPXagEzzIdN YgApJ9Se2RtCuzQIBr9UoxOYieOUmAITh7Ff2mH+sSXNnt/MyPTQm0hxbsds1OhLg9Lx iGrVXc3V0OyRFdbBmsPvPpedratR1otyTGqBk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1tKYVg7wJMJMNFKIyw+d3Kv62PM5IDYj6Uiog3M1guQ=; b=RZaKxGkwyXv3vkprTLywjXkH44Avd370RzDMQVHFohEwSREZk8HgD5ftghGegBAbWF +mBnwOztDELmn/q360YH7MCGXtLdPAJXlhsqEM9hIYfWyuzmzXB2oGghFtSMIMkWQg5k Ph7RjoqETuX5Q4A4NUpzcFmhrVtwVErcUSl+aXMP8d8INXl7Pr6Ucgc5/zqoq4OCd9uw Ls5nxAPHf2Aj+tDUnFlKpx1FPEsPw+hTIxSyO7UiKxuWg+IQ2O78zY8ghgFOaLoOYL5T gB14zfR67HRgTkOLg+oZzSlW0OQMTSSzrGtHgvNFRwER8HORSUFPkvDtjmqb6dRDUZv8 It+A== X-Gm-Message-State: AOAM530dMnNQjqcWS/7EuWhZLup/ER9CHKuL3D1tQnwXsfysBwcws5Si gyLiBniZBuKiE2yYSR0GqOc7hMZpCV6Zfhx4OZqxiA== X-Google-Smtp-Source: ABdhPJxmDuwkFJziW4xvLsZmdp9HyrtsLl84OWqtBxpyS7OeNwc36CaaRT+rymCOgrfcQNTO0R57Np83PfJ/v382SjQ= X-Received: by 2002:a05:6512:1320:: with SMTP id x32mr25449431lfu.597.1642571980606; Tue, 18 Jan 2022 21:59:40 -0800 (PST) MIME-Version: 1.0 References: <20220114230209.4091727-1-briannorris@chromium.org> <20220114150129.v2.3.I3c79b1466c14b02980071221e5b99283cd26ec77@changeid> In-Reply-To: From: Chen-Yu Tsai Date: Wed, 19 Jan 2022 13:59:29 +0800 Message-ID: Subject: Re: [PATCH v2 3/3] ASoC: rk3399_gru_sound: Wire up DP jack detection To: Brian Norris 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220118_215942_582291_C7684920 X-CRM114-Status: GOOD ( 28.61 ) 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 On Wed, Jan 19, 2022 at 4:18 AM Brian Norris wrote: > > 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). Neither am I, so ... > 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. I missed this bit. As you say, things are good. > > For this particular patch it works either way, so > > > > Reviewed-by: Chen-Yu Tsai > > Thanks for looking! And thanks for double checking! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel