From patchwork Wed Aug 3 02:08:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9262447 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5B6B660754 for ; Thu, 4 Aug 2016 00:36:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B9A327FA2 for ; Thu, 4 Aug 2016 00:36:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 407382807E; Thu, 4 Aug 2016 00:36:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DF7627FA2 for ; Thu, 4 Aug 2016 00:36:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 03E366E918; Thu, 4 Aug 2016 00:36:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from relmlie4.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by gabe.freedesktop.org (Postfix) with ESMTP id 1E6086E708 for ; Wed, 3 Aug 2016 02:08:46 +0000 (UTC) Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie4.idc.renesas.com with ESMTP; 03 Aug 2016 11:08:45 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 90A5A3D045; Wed, 3 Aug 2016 11:08:45 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id 8F52E1806F; Wed, 3 Aug 2016 11:08:45 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id 861C51800A; Wed, 3 Aug 2016 11:08:45 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac3.idc.renesas.com with ESMTP id MAA02291; Wed, 3 Aug 2016 11:08:45 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'208";a="217059890" Received: from mail-hk2apc01lp0212.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.212]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 03 Aug 2016 11:08:44 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=sUjV9zWeVDrhnrnp0kwMFFonthbtbn2DneyW/1QcFGI=; b=Gp/ynUDc0SfPV6dKnxYfjLF4oxT3SLfeEYxjxug1g1nXXMuDIku98deW6dxNuV2yFPMJ1njx4WPNIFH+GZBYT4hfo6jWaAxvHEptTHl6S7E0VW+p1DO2J39iNOYfuaxb+BxbM2hgA2t4j6Ed7GEP2WkNY4hmhPodcHDoP675S+k= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by HK2PR0601MB1442.apcprd06.prod.outlook.com (10.165.182.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Wed, 3 Aug 2016 02:08:41 +0000 Message-ID: <877fby8vc7.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Archit Taneja , Mark Brown In-Reply-To: <878twe8ven.wl%kuninori.morimoto.gx@renesas.com> References: <878twe8ven.wl%kuninori.morimoto.gx@renesas.com> Subject: [PATCH 1/2 v2][resend] ASoC: hdmi-codec: enable multi probe for same device User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Wed, 3 Aug 2016 02:08:41 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR01CA0033.jpnprd01.prod.outlook.com (10.164.162.143) To HK2PR0601MB1442.apcprd06.prod.outlook.com (10.165.182.148) X-MS-Office365-Filtering-Correlation-Id: acc401cc-43c5-477a-a595-08d3bb4317a5 X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1442; 2:mlZ7To7cnaMWoYBBB+m62GF0msyDzCldYGA9u9ImcRwyLDH5twuPXRKGVDAcKL0InFc6OVRQQ9x8sdgfcFgcUtALjerb+5LqlY0y+OTG5rxSmnBKzFASc8j3EXNZwhgWJVEF/I60cbptK8XOoS+MuuJU3ClmG8WCzu967NCM9Dol4EUb8liVN7S+uuAuvJrv; 3:R8XFTNzi2TYYuhwopKF3ltY7Ch+DsmTmp3SBFnOMHiUatcc+Bb5bKRuzvV/x/BEJ+GxC1Q2fkPQh1t0fnaOrF0rXJJgE92eNEr+hbUhcyCU6ge/VTUZzLkUGz+sLUek/; 25:2yTlVdDsnG1uJ/QsHdep4yvKxNq3sw0GWS8nfoVsrLt+isqNOl/EqT82b6Gs8c2xpR+so1X0PlEqO+n5twhq9th+ZRBSMie36ZruR6gJI3RDxBS6dBVr95PS/pjWFuCMcN4GovWc1C1TZ4cj6Bu50yvfBdbPnGY4TJ0b83ZM1Gy0SMaZEljA9S/xqNzoKXSSXfMuC+rQQNgnlaK6zZPRYzoCgrLZpsEqziW12NGBBQuu26K1MRzlhNgrvgcppkSHvYVRJiBbr89Y6D5mfgRbTALdgxyOcYaBwvVABynhAmBpNdzs1r3w12iG2AvwTsXtVLb7GgVhoCYLA94ofG4dP8gwvsp2CUmUtgL9jN7Ax40Cd9f2EYS8aBe/QtfgREPSB5u92+uMZacm1JsMhSZszg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR0601MB1442; X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1442; 31:4gTg6yT0fR0DHwQ8ZF0HS3hU5Jx/44nhUs7xjevVHDYqfPybhWNPOgTtiz6K8ISn3cUEiBmlN3EHmsEsRcrSkA7R9RKLyoJVrqvhaTtOWKxTDjO3OCyV1M1Gu3I+oKXXEE0VSIMI6HAnfWAb5gx40eG8RKYOEUR+3hI9AoGIKf+4O6V3lLwZwWfW12Nd97k+U11+0oPxGO5s7CnVFBbyTk4Q6tjCaGXHcyQHv9OUZGM=; 20:2thiVUuTawvPZWqtCz4MET2Y70IFJiQMzsM11v/ML8BoWquSrUf/A9yQPl+qijKZRlkHhKo+rnBvzy7XNi8a8rmI18dvX7vXH/G/95k3eKkLwBbL1C3bBJBlbNFdxlPJPN+Qys02wqyGnu+xNagl2feDpbsfO8VQhxo/uwpiT/gDgQavJIHr/NFCrImh9dSzqhV/XLPkRIR2+nbs3YhhAvtniBeqJpPEghwpyRnGZfOJZbKWqkrzAF6IsHoNspuBC4uG/hID5MfuGZO8ZA7T7r6yfHJxm40c8A3oLqUlJQgAHhEWSD/i2oI8HrpvdDRGPRIlh/lzmGQQyG4ij3K6Wxw9s50rToJEh7l/e7gLxCUA8SiiV9cqaimHfrs+NU6ba73YtlSJW4azzLzZ2K9/n/YIV0WhoKMpb5W0ACPY8tXMTCRAo6ZzxGB6Fk83hs2Ez6tImguNv8njRDcnPr+ID0W2cVkM7Enusior6/JRA2lwer13+uPbVhZNXunLbsrg X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:HK2PR0601MB1442; BCL:0; PCL:0; RULEID:; SRVR:HK2PR0601MB1442; X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1442; 4:cBTH/6EGRRzzluUceWKT3BwHuAi8l54eu3r/fUJ4M/Iyk4ZyMFablZXqfm00CZZLFMrgmmOueZI9wmwTZgNMOjxfUOuugOjTrBuIWbltyl0HUzBL5nGeI4aXd8cCJrGirf1Rid56gzfa/Lf1EinDBCLJWHJn+S6M2alHnqh4jPkCDkX+tUtsZ0WiS77A86ag/9pUmsaas73v26iCJMj/qhnbxVbvkAAd6KgKyJj7JvKhHFtkvf2Gqp0SIOFxor9DnAAX6P063MvzdUJDaomcSuHp8ixgKGDwcQ8AXxdU1myYZ8hW+rVtfi1dM+/bdnZcPb04D7JomF7SJjjZGYoPiE6QcpOWTgyePHuiKQQbIqIU0VS0aqnodf9AP49xWvZK X-Forefront-PRVS: 00235A1EEF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(189002)(199003)(189998001)(23726003)(92566002)(6116002)(86362001)(66066001)(97736004)(3846002)(586003)(68736007)(47776003)(105586002)(83506001)(69596002)(33646002)(4001350100001)(5001770100001)(19580405001)(36756003)(106356001)(76176999)(8666005)(50986999)(8676002)(53416004)(229853001)(305945005)(101416001)(7846002)(50466002)(2950100001)(77096005)(7736002)(54356999)(81156014)(42186005)(7416002)(19580395003)(4326007)(2906002)(81166006)(46406003)(7059030)(21314002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR0601MB1442; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2PR0601MB1442; 23:8DUcCwlBa8lYUm7uTL+AASg5pu+lJTDaIHoamKI?= =?us-ascii?Q?wgHGC570llP3yv11jUUlBVE0usfVvaJWs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C08+MtR1R/8YVXr5zm/4RU5HwYDqf9Qr5V9eS5nZTIobFUbC/ut9wUwjn/Dd3pwr2b4HIakJfDib63ygirA+zwX2wNEWMEDFgmp10/3/v76oA2/4xLtmiyU609zdyCoFqNt8SambORFGoth8wHAkhQ+jZFCfQY5A00oXPouQaxxzMsLh1lGo4I0diAmPcamWV/RQyPE6peUbbI3V9vAxf5Fh4pEJSWkLyUxVnomtqXYM SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1442; 20:2404+o/pQbEGvMrTj3rXGnkMPQWdzkykPN+gXI1YfuirTHab5Y2yp2MoiH8pvov71c57YMPcn8d4++KO+ybuFbRvCRdklaXQ4mS/hg6oNI0tdSUcacF5RJU7AbDhVwk+UEKdpHpX2crResH26ecWKWR54UJSSjo2JsMm4PM4K1o= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2016 02:08:41.3834 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR0601MB1442 X-Mailman-Approved-At: Thu, 04 Aug 2016 00:35:48 +0000 Cc: Fabio Estevam , Linux-ALSA , Daniel Vetter , Koji Matsuoka , dri-devel@lists.freedesktop.org, Liam Girdwood , linux-renesas-soc@vger.kernel.org, Simon , Russell King , Thierry Reding , linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto hdmi-codec driver is common HDMI sound driver, but it doesn't care about multi sound ports. For example, hdmi-codec driver is supporting 1 I2S and 1 SPDIF ports, so, we can't use this driver if HDMI has 2 or more I2S ports. And we would like to use multi detection. For example, DesignWare HDMI driver is providing dw_hdmi_bind() to DRM/KMS driver, and it will setups HDMI video/sound. Note is that it will be called under for_each loop of ports. int dw_hdmi_bind(xxx) { /* register hdmi-codec driver here */ } static int xxx_probe(struct platform_device *pdev) { for_each_xxx(xx) { ... dw_hdmi_bind(xxx); ... } } This case, dw_hdmi_bind() would like to use hdmi-codec, and it will be called multiple times for each ports. Here, ASoC's CPU/Codec/Card bind will checks each "of_node" on DT, and hdmi-codec driver is assuming its parent device for it. But it doesn't care about case. Thus, ASoC never detect correct sound card in this case. To solve this issue, this patch checks each parent device, and names "hdmi-hifi.x" in order to each ports. And uses struct snd_soc_component_driver :: of_xlate_dai_name for snd_soc_get_dai_name(). Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/hdmi-codec.c | 67 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index f27d115..f64ecaa 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -24,6 +24,15 @@ #include /* This is only to get MAX_ELD_BYTES */ +struct hdmi_device { + struct device *dev; + struct list_head list; + int cnt; +}; +#define pos_to_hdmi_device(pos) container_of((pos), struct hdmi_device, list) +LIST_HEAD(hdmi_device_list); + +#define DAI_NAME_SIZE 16 struct hdmi_codec_priv { struct hdmi_codec_pdata hcd; struct snd_soc_dai_driver *daidrv; @@ -320,7 +329,6 @@ static const struct snd_soc_dai_ops hdmi_dai_ops = { SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE) static struct snd_soc_dai_driver hdmi_i2s_dai = { - .name = "i2s-hifi", .id = DAI_ID_I2S, .playback = { .stream_name = "Playback", @@ -334,7 +342,6 @@ static struct snd_soc_dai_driver hdmi_i2s_dai = { }; static const struct snd_soc_dai_driver hdmi_spdif_dai = { - .name = "spdif-hifi", .id = DAI_ID_SPDIF, .playback = { .stream_name = "Playback", @@ -346,6 +353,27 @@ static const struct snd_soc_dai_driver hdmi_spdif_dai = { .ops = &hdmi_dai_ops, }; +static char hdmi_dai_name[][DAI_NAME_SIZE] = { + "hdmi-hifi.0", + "hdmi-hifi.1", + "hdmi-hifi.2", + "hdmi-hifi.3", +}; + +static int hdmi_of_xlate_dai_name(struct snd_soc_component *component, + struct of_phandle_args *args, + const char **dai_name) +{ + int id = args->args[0]; + + if (id < ARRAY_SIZE(hdmi_dai_name)) { + *dai_name = hdmi_dai_name[id]; + return 0; + } + + return -EAGAIN; +} + static struct snd_soc_codec_driver hdmi_codec = { .controls = hdmi_controls, .num_controls = ARRAY_SIZE(hdmi_controls), @@ -353,6 +381,9 @@ static struct snd_soc_codec_driver hdmi_codec = { .num_dapm_widgets = ARRAY_SIZE(hdmi_widgets), .dapm_routes = hdmi_routes, .num_dapm_routes = ARRAY_SIZE(hdmi_routes), + .component_driver = { + .of_xlate_dai_name = hdmi_of_xlate_dai_name, + }, }; static int hdmi_codec_probe(struct platform_device *pdev) @@ -360,6 +391,8 @@ static int hdmi_codec_probe(struct platform_device *pdev) struct hdmi_codec_pdata *hcd = pdev->dev.platform_data; struct device *dev = &pdev->dev; struct hdmi_codec_priv *hcp; + struct hdmi_device *hd; + struct list_head *pos; int dai_count, i = 0; int ret; @@ -381,6 +414,31 @@ static int hdmi_codec_probe(struct platform_device *pdev) if (!hcp) return -ENOMEM; + hd = NULL; + list_for_each(pos, &hdmi_device_list) { + struct hdmi_device *tmp = pos_to_hdmi_device(pos); + + if (tmp->dev == dev->parent) { + hd = tmp; + break; + } + } + + if (!hd) { + hd = devm_kzalloc(dev, sizeof(*hd), GFP_KERNEL); + if (!hd) + return -ENOMEM; + + hd->dev = dev->parent; + + list_add_tail(&hd->list, &hdmi_device_list); + } + + if (hd->cnt >= ARRAY_SIZE(hdmi_dai_name)) { + dev_err(dev, "too many hdmi codec are deteced\n"); + return -EINVAL; + } + hcp->hcd = *hcd; mutex_init(&hcp->current_stream_lock); @@ -393,11 +451,14 @@ static int hdmi_codec_probe(struct platform_device *pdev) hcp->daidrv[i] = hdmi_i2s_dai; hcp->daidrv[i].playback.channels_max = hcd->max_i2s_channels; + hcp->daidrv[i].name = hdmi_dai_name[hd->cnt++]; i++; } - if (hcd->spdif) + if (hcd->spdif) { hcp->daidrv[i] = hdmi_spdif_dai; + hcp->daidrv[i].name = hdmi_dai_name[hd->cnt++]; + } ret = snd_soc_register_codec(dev, &hdmi_codec, hcp->daidrv, dai_count);