Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6610053ybe; Wed, 18 Sep 2019 06:21:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxiTBI6suhTJiReY9kbJ1RjD8rMkJGDidMCFReWUw1bhXDWBIRTjGjzzEl+JevBAdvDbtox X-Received: by 2002:a17:906:d8c8:: with SMTP id re8mr9526843ejb.130.1568812905231; Wed, 18 Sep 2019 06:21:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568812905; cv=none; d=google.com; s=arc-20160816; b=yJeEUHDbvHlnJ720xSG+WoxBidmCv4qbYq3JgtgFwSFQcyPS4enTh7/LueE1tcTCe3 q5zNHZ3GtHxEHnm85sCnH3sEcz0ktF7faLrEnz2aia4gVvx7Lch/qRWcGsLISaxgVa9H m1oHfqAp/HBKD+fQRvDvV1XUvuilWr2dYQtH6y/lT+p3NyPq7jxtK3undM1tkz+mhnms 244nYn+dmEvurcsre+GdHp/434CttkwnwQ0RzLdPfOLrrErP+lD6x42c13+sZn3ccABV njmQLnFX+2YZ8+8jAwDsGIM2w1fnmfHYrisufMJ8DZxBnKvJ9V8AZtGl6RKf518+ddkF JHHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=1KlX045+but4kZYDkxl79NCCq10iOcslEdRaiYLes50=; b=QiyEXKsAP65154OUuVsPl1PlPaJm+eZ1KF0OBIkhRV7J7e6VA0wHaK80pGcstMm0qy TLZ0216Ah+tOC5LqrSYtZ8yN5fxrc3WW74YjJTUBQhmYKj8nkCpQrufCV6a0OkMSlwdX zhys0D8GnwNj8sD5w+CKM10MDvR6rlgjbYianRFq02U3wleMbf1wOTge+CTAVbM3M+j+ LiYCXayrAlpok0KM4PsoBLlrjJ+lBdBi5rj1ZTHQa5arBE/i3vZnNLcj2cnQfg5yZWb8 LhvNWoDJcamNkwnTKGxjG8OwYKdxHdfdygUyPL7LH/mLqxeG8BCIDhvLhTGUZQ0L2qv+ uGAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fego5LxI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id b30si3240739eda.200.2019.09.18.06.21.21; Wed, 18 Sep 2019 06:21:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fego5LxI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728089AbfIRLxI (ORCPT + 99 others); Wed, 18 Sep 2019 07:53:08 -0400 Received: from mail-vs1-f65.google.com ([209.85.217.65]:45949 "EHLO mail-vs1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbfIRLxI (ORCPT ); Wed, 18 Sep 2019 07:53:08 -0400 Received: by mail-vs1-f65.google.com with SMTP id d204so4219055vsc.12 for ; Wed, 18 Sep 2019 04:53:07 -0700 (PDT) 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=1KlX045+but4kZYDkxl79NCCq10iOcslEdRaiYLes50=; b=fego5LxIL6sB7nuVbbaJVJB9N7WNC8aIjmYR0y5szXrjm/cLvc2AEl4CT76peU8LyO ovgIJAkEcVdo/HQkTbgy73bCOznMQ54xCR6vuEpJF43zd/anX3d2aaBum9pZVtNEW2/S KaQ6549ctO0oKG1CzL2x+C+6Ci98YSp8YZRfo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1KlX045+but4kZYDkxl79NCCq10iOcslEdRaiYLes50=; b=mxdTigv1bxolK8yZtSXfqjRN4sdoKIzaSTlHSneaIeuYC0d6GkzfgCWgXGMiJmV99D WjE6r4kteAsQrwfEiJ4qhEY+CH5H0IKrsfPuvwN/VDGycn2mwUwE6+RrIXltmIgao4k2 NXwQWmS8ZzuUImFeEXh4L34janDZoUFBGrU1BbZZVaL1P242rfa9ZjrS1jMUvRlmZyeX AL55ksCbSC9Zfr+RJVC6ZSymml0PEw1SO8HGkBXtBileVkHcBVHiB0Guvj09IF1PnVFv 3zjGViNLa2aKO3Vg195d7jZpysdO9RbXcR20R3oAiLqobfywZaKSkGNsLNl5vwgvfBc0 OqRw== X-Gm-Message-State: APjAAAUH7zpgoh5BNCSXqcjlpM+e5JbAAxFqAv/b3vYli4qEaq9COhBK VfEr5BYonwWMaW55gXf2OixUSZ3rf1mUdi71qZCBl/ysvN6PLw== X-Received: by 2002:a67:db8d:: with SMTP id f13mr1855977vsk.163.1568807586619; Wed, 18 Sep 2019 04:53:06 -0700 (PDT) MIME-Version: 1.0 References: <20190918082500.209281-1-cychiang@chromium.org> <20190918082500.209281-3-cychiang@chromium.org> <1j7e663sfu.fsf@starbuckisacylon.baylibre.com> In-Reply-To: <1j7e663sfu.fsf@starbuckisacylon.baylibre.com> From: Cheng-yi Chiang Date: Wed, 18 Sep 2019 19:52:39 +0800 Message-ID: Subject: Re: [PATCH v6 2/4] drm: dw-hdmi-i2s: Use fixed id for codec device To: Jerome Brunet Cc: linux-kernel , Neil Armstrong , Jernej Skrabec , Jonas Karlman , Hans Verkuil , Mark Brown , Liam Girdwood , Takashi Iwai , Jaroslav Kysela , Russell King , Andrzej Hajda , Laurent Pinchart , David Airlie , Daniel Vetter , Heiko Stuebner , Doug Anderson , Dylan Reid , tzungbi@chromium.org, "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 18, 2019 at 4:43 PM Jerome Brunet wrote: > > > On Wed 18 Sep 2019 at 10:24, Cheng-Yi Chiang wrote: > > > The problem of using auto ID is that the device name will be like > > hdmi-audio-codec..auto. > > > > The number might be changed when there are other platform devices being > > created before hdmi-audio-codec device. > > Use a fixed name so machine driver can set codec name on the DAI link. > > > > Using the fixed name should be fine because there will only be one > > hdmi-audio-codec device. > > While this is true all platforms we know of (I suppose), It might not be > the case later on. I wonder if making such assumption is really > desirable in a code which is used by quite a few different platforms. > > Instead of trying to predict what the device name will be, can't you just > query it in your machine driver ? Using a device tree phandle maybe ? > > It is quite usual to set the dai links this way, "simple-card" is a good > example of this. > Hi Jerome, Thanks for the quick reply! And thanks for pointing this out. I found that soc_component_to_node searches upward for one layer so it can find the node which creates hdmi-audio-codec in runtime. This works even that hdmi-audio-codec does not have its own node in dts. I will change accordingly in v7. Thanks! > > > > Fix the codec name in rockchip rk3288_hdmi_analog machine driver. > > > > Signed-off-by: Cheng-Yi Chiang > > --- > > drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 2 +- > > sound/soc/rockchip/rk3288_hdmi_analog.c | 3 ++- > > 2 files changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c > > index d7e65c869415..86bd482b9f94 100644 > > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c > > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c > > @@ -193,7 +193,7 @@ static int snd_dw_hdmi_probe(struct platform_device *pdev) > > > > memset(&pdevinfo, 0, sizeof(pdevinfo)); > > pdevinfo.parent = pdev->dev.parent; > > - pdevinfo.id = PLATFORM_DEVID_AUTO; > > + pdevinfo.id = PLATFORM_DEVID_NONE; > > pdevinfo.name = HDMI_CODEC_DRV_NAME; > > pdevinfo.data = &pdata; > > pdevinfo.size_data = sizeof(pdata); > > diff --git a/sound/soc/rockchip/rk3288_hdmi_analog.c b/sound/soc/rockchip/rk3288_hdmi_analog.c > > index 767700c34ee2..8286025a8747 100644 > > --- a/sound/soc/rockchip/rk3288_hdmi_analog.c > > +++ b/sound/soc/rockchip/rk3288_hdmi_analog.c > > @@ -15,6 +15,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -142,7 +143,7 @@ static const struct snd_soc_ops rk_ops = { > > SND_SOC_DAILINK_DEFS(audio, > > DAILINK_COMP_ARRAY(COMP_EMPTY()), > > DAILINK_COMP_ARRAY(COMP_CODEC(NULL, NULL), > > - COMP_CODEC("hdmi-audio-codec.2.auto", "i2s-hifi")), > > + COMP_CODEC(HDMI_CODEC_DRV_NAME, "i2s-hifi")), > > DAILINK_COMP_ARRAY(COMP_EMPTY())); > > > > static struct snd_soc_dai_link rk_dailink = { >