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 X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88B9AC4CEC9 for ; Wed, 18 Sep 2019 11:53:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C2A721907 for ; Wed, 18 Sep 2019 11:53:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="fego5LxI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728423AbfIRLxI (ORCPT ); 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-Google-Smtp-Source: APXvYqyhL40Vy4UIINlY/uIQouC/knlNQeJfWaG2W2HqYygbGI5RQ+ggz1DPkhARkI89YhNy/gvof3y7jgV5PmDT70U= 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 = { > 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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B25ECC4CEC4 for ; Wed, 18 Sep 2019 11:54:06 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3C77721897 for ; Wed, 18 Sep 2019 11:54:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="EhGaMNdY"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="fego5LxI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C77721897 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org 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 8B280166C; Wed, 18 Sep 2019 13:53:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8B280166C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1568807644; bh=DPTyM7bw1cN7rhKHpzOsi8xgW0QgaMfyT+eiYqNonkw=; h=References:In-Reply-To:From:Date:To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=EhGaMNdYi6DoAhsjw9gS3ZpFwgrPtgsGU33Sni0J5archsKgFY06RZTlwDahQLbHa O/xKUWE66SnADmfer7EnZLIlPcL6zZWoyEBKmnl7DVlmfHPhtLxEvhoPW+EDburbaX C0IyVG57Ehr+4mFZ0Y32rjyywuzAdYxxDPb/TizE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0A88FF80146; Wed, 18 Sep 2019 13:53:14 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 63EDDF80506; Wed, 18 Sep 2019 13:53:12 +0200 (CEST) Received: from mail-vs1-xe43.google.com (mail-vs1-xe43.google.com [IPv6:2607:f8b0:4864:20::e43]) (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 9F310F800C1 for ; Wed, 18 Sep 2019 13:53:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9F310F800C1 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="fego5LxI" Received: by mail-vs1-xe43.google.com with SMTP id b123so4254198vsb.5 for ; Wed, 18 Sep 2019 04:53:09 -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=fzLFc+BOms0XwvNVFkIZCMz3HVinaX1dYVR+P0v/y+sZTYevt/54QeZgo9YtWTl4X6 LGFgrmxrqWgZFQwOkRepPhBYMmHauJsUwpB+5Zd3WH7zFod47XfQuEyXocvbepTiItk9 FcyKLQjfFvi3uT9GNgDlM/bNOlGbGBSAR8CCGOiK65nlOSy7peNb+lW/eydHvGv/Wum1 YUDhpX1KtJNuFcVpToIANc0rrCID0U85cfsFiv8j6xRtPoGWfrbVUV/Cd/Vuj5X2zgx0 E+IP92N6/w3sNmO+7Sjsp5G3Hv9DMwmmmKTvW/PAZMFbIsoaFOP0ih4HCq2s4CIUfJnT tRfA== X-Gm-Message-State: APjAAAXrGuf12We0UQmOLqeUO4WE+XGR06Qj7Jbrl6Vwzs6wBkduvYYu pEKRQCeDeARtvMA1lsdmqwLxsAuRBWdM9gqga+lEfg== X-Google-Smtp-Source: APXvYqyhL40Vy4UIINlY/uIQouC/knlNQeJfWaG2W2HqYygbGI5RQ+ggz1DPkhARkI89YhNy/gvof3y7jgV5PmDT70U= 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: To: Jerome Brunet Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Heiko Stuebner , Neil Armstrong , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel , Hans Verkuil , Andrzej Hajda , Laurent Pinchart , Takashi Iwai , linux-rockchip@lists.infradead.org, Dylan Reid , tzungbi@chromium.org, Jonas Karlman , Liam Girdwood , Russell King , Mark Brown , linux-arm-kernel@lists.infradead.org, Jernej Skrabec , Doug Anderson , Daniel Vetter Subject: Re: [alsa-devel] [PATCH v6 2/4] drm: dw-hdmi-i2s: Use fixed id for codec device 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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 = { > _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cheng-yi Chiang Subject: Re: [PATCH v6 2/4] drm: dw-hdmi-i2s: Use fixed id for codec device Date: Wed, 18 Sep 2019 19:52:39 +0800 Message-ID: References: <20190918082500.209281-1-cychiang@chromium.org> <20190918082500.209281-3-cychiang@chromium.org> <1j7e663sfu.fsf@starbuckisacylon.baylibre.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <1j7e663sfu.fsf@starbuckisacylon.baylibre.com> Sender: linux-kernel-owner@vger.kernel.org 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..." List-Id: linux-rockchip.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 = { > 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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 297B0C4CEC4 for ; Wed, 18 Sep 2019 11:53:20 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id F10CB21907 for ; Wed, 18 Sep 2019 11:53:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AsQRWtem"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="fego5LxI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F10CB21907 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id: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=39X0AsJZdAsWo1kTSCposDdRDBBB/Xs3DtJE4MKYr4w=; b=AsQRWtemfM3yqw iatvwE5SxktW0nub+bFBwcwoB4GDAOM9jJJ2d+yVyLyVpGBm2DjIO83FivKgw2IngiSnGzQF2duWW pxfOSXgVKzCZL3oZvJKNdGqX99eOhTVoIefToYa7GyZMcvNNyJkiBo7QAzfusVMcjc/Tvf4Ap32k1 z1xRWMI2A4E9WSCaRKv7etOnMD8oyC3HM3HWniLeXNokaHJexHbgOkRbZG1d2cdYdr4fa6U0QT7H1 nc2U8jneEkjdSeWzZQYSjZDxPBQF5paayqX1kZygI18oTzDRkBzaWzHAgU2v4BSaCbhYOflJsjyDF T+oVrrnhCuJrdsOTPUKA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iAYWN-00018b-41; Wed, 18 Sep 2019 11:53:19 +0000 Received: from mail-vs1-xe43.google.com ([2607:f8b0:4864:20::e43]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iAYWG-00015u-Et for linux-arm-kernel@lists.infradead.org; Wed, 18 Sep 2019 11:53:14 +0000 Received: by mail-vs1-xe43.google.com with SMTP id w195so4226349vsw.11 for ; Wed, 18 Sep 2019 04:53:12 -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=GEcN43vI4pUffvx654jfeL/Ukcxqc6I8MViAqM0/2UTXFzknSlK3VFt7f98YcNGOH7 kuuHD9YHKzexAvcVlM21kQsdAGVX3oxkcw9iHNuFVdofVVDxuxxLYyOdDkVsp5SrYCgu ODBdC2j9GI4O6YXNN8iTgXoFLi9RUFIT6Wnywp430IETv7kkWMjkkK7czzu5Q4ydnoHb efX5LLkrOd8bVwhmRBnhgv1JZ5it1ekbBLdk6Z6YGe7FZYMgBuP0IE1sHHPsMex9MfRi CKHiwttDg/Wi76zv5djhKBONdlD6IvoLsf1jDu1+3f+rhDMRGUvUb3F6Kkto5DNjjsGC 4+tw== X-Gm-Message-State: APjAAAXZRCZJBcvL9i8XSN5dSSDCM/TEo7rqoLfaUXXN2AA3u0AOw4bk SiefKQilBb/YThohm4TESea9pHFVezqbUm8yuAbH1w== X-Google-Smtp-Source: APXvYqyhL40Vy4UIINlY/uIQouC/knlNQeJfWaG2W2HqYygbGI5RQ+ggz1DPkhARkI89YhNy/gvof3y7jgV5PmDT70U= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190918_045312_615201_7907F8F2 X-CRM114-Status: GOOD ( 23.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Heiko Stuebner , Neil Armstrong , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel , Hans Verkuil , Andrzej Hajda , Laurent Pinchart , Takashi Iwai , linux-rockchip@lists.infradead.org, Dylan Reid , tzungbi@chromium.org, Jonas Karlman , Liam Girdwood , Russell King , Mark Brown , Jaroslav Kysela , linux-arm-kernel@lists.infradead.org, Jernej Skrabec , Doug Anderson , Daniel Vetter Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 = { > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel