Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1054515pxb; Fri, 21 Jan 2022 08:57:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwi6Weo6CBESMAZMyO5AHFgHESno2aHTvekSTZ/urqU+QOk0/3d5TIIaPPEloo22MABqD/v X-Received: by 2002:aa7:92c5:0:b0:4bd:9f44:9562 with SMTP id k5-20020aa792c5000000b004bd9f449562mr4659106pfa.80.1642784235755; Fri, 21 Jan 2022 08:57:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642784235; cv=none; d=google.com; s=arc-20160816; b=guJIPLc9G5WTCrbD9nySzXzGhs02HSnwZ+SYPtT8MHH6KPiqSC0+8Q+UQC5VTvORbY rW8xWEj56+pPpSTWVaxRLTrAlVDFOcXiKh2XFrn2XMF4WArnVmsiAW4PcKYa6CfkeO+N hZTzvlolxz6K4GwTt0hziGCOIMMwd18DG0xX6M8NQiVIAueV/qOR7fhpFv3K+hKaVbSZ rtwhM6atzDHSkLzC/ZY+OTTs4C4mnLG0lvjhSgtpuTb4KOHsxfl4X8Q2dFEOHUNXCuA0 BOIMaTcQIoVWa8zUlJTu8dt9xEkEEIPtYmmLLhND4otXiY6j9FeuwVptX7AVLqa7ubNT B0lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=1tKYVg7wJMJMNFKIyw+d3Kv62PM5IDYj6Uiog3M1guQ=; b=ZjoGctEH2a4h1fPguFTxMFmxFWsMheurDBLKfuIjeBQ3M9oEZTFTUdQMRB/ocSNEtU QjRLqOCCpdgVjJeaaALXP08uFz/rH/+6cb2UoyYF4NECQLWQyjIjP2Wzg07sil4fy7wk PvsCmsIS/86Kqk5uoMRw5rdKCxKPpyOBxZLhOeBPR4XFovFRBRXmzfXg9ltWDwrc/TRY cJ8FAkql1jR/20UCRN3HiXJU9M9/EC/yOYkdXReCiB1wVNDYthHJ/VUCuD/PMCtxyvTu x5xZ1o2ZbWXyueBISJ17ArXjqEVtDSbS9m2dA6SFYVCfp6KvBKZuZA2kx0l50AxLP94V 5HtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=O3rjR1xw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p5si6249301pjz.156.2022.01.21.08.57.03; Fri, 21 Jan 2022 08:57:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=O3rjR1xw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351614AbiASF7o (ORCPT + 99 others); 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-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!