From patchwork Thu May 18 01:40:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9734839 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 266F3601A1 for ; Thu, 18 May 2017 16:58:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 156C528898 for ; Thu, 18 May 2017 16:58:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A0AF288B9; Thu, 18 May 2017 16:58:57 +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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F24D128898 for ; Thu, 18 May 2017 16:58:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EDA736E5A7; Thu, 18 May 2017 16:58:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by gabe.freedesktop.org (Postfix) with ESMTP id 531D46E105 for ; Thu, 18 May 2017 01:45:56 +0000 (UTC) Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie2.idc.renesas.com with ESMTP; 18 May 2017 10:40:53 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id EC25A47A6B; Thu, 18 May 2017 10:40:52 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.38,356,1491231600"; d="scan'208";a="244224618" Received: from mail-hk2apc01lp0210.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.210]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 18 May 2017 10:40:51 +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=9C+krEj8Mxf+gv/1vXKpvHM3rymFf1c2DVKFblpS1EQ=; b=SCKMh0DYFUd2QO7FLW/aC1rAQ+nRfUuo1d5FhlBDoKMTtcbH+A0eKPGd8CEKsNlEbG2Ff3ealitbPvdScWv/wQGHTJSLfCu3im2uZRaPEbaZ3e0zr6UOpmnExh5Iyb5k1z/Wgj1nlJKsdNpmE4ri1IQCaqI6UjBwEkXLvka0KkU= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by PS1PR0601MB1882.apcprd06.prod.outlook.com (2603:1096:803:8::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Thu, 18 May 2017 01:40:47 +0000 Message-ID: <877f1fosji.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 5/5] drm: dw-hdmi-i2s: add .get_dai_id callback for ALSA SoC User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown , Archit Taneja In-Reply-To: <87efvnosnb.wl%kuninori.morimoto.gx@renesas.com> References: <87efvnosnb.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Thu, 18 May 2017 01:40:47 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: HK2PR02CA0020.apcprd02.prod.outlook.com (2a01:111:e400:a429::30) To PS1PR0601MB1882.apcprd06.prod.outlook.com (2603:1096:803:8::20) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PS1PR0601MB1882: X-MS-Office365-Filtering-Correlation-Id: 012ac6fc-f7a1-472b-06b4-08d49d8ee95c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:PS1PR0601MB1882; X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1882; 3:XWaYL29vNwG1aJ4GxJ43a0VnjeE85PzHqMd6QzhNQAdKR4BqaLlhKzsRPD/XDEIv7mBCvRRGWq6yITtBjEKuQs8u5n7OS2/6ZjoPpMvtywVtu+QbBsMNdESKTDUoz/P/0VS1Jag+m7yBjHOounuUHy2uDKrFKs9tJoH216CI95AE2hrJ/yoLk/yK+9rMLDO3k7wCLDs4gUlb89abXCfxX6Se0rfUC+DkQ8sHJQg01aIg/dUqLtJ7CFNyxV610CO/WcBUsi7V2t1ZLfeBLoFTquf543NC/tkeZ9xSzFz97HpvxNu8Gsdo23Ry/1R+nGDSETTRBp9G2VLlWwhtfQC3NYM9Z+a8aI6pS+juG5aVEI0=; 25:KKcbfw+OQ1nvQukZkXG+iBSy/gbD3U4/UFU6kQ5JvW7AaJAY9d6Bs//l6Oqd94oWaHbL0L9/ROeKlfZFm8TX0lwKnu7EnKaz7YnGQufC2R0dDm27FSwO65gta2Gj9fW8vWs8uQuOyk6Jki+VL8sx4qsb5qyTPQpbv07gygSkyTjhc+lSgcjOuphiA1bNuGqNNHnNdtBf56XAmApxXsnIvjxVoQcc8bZih3jQ8TnhwXmJGSWAt22eFtXz1VBOXVHt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++F5t X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123564025)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148); SRVR:PS1PR0601MB1882; BCL:0; PCL:0; RULEID:; SRVR:PS1PR0601MB1882; X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1882; 4:uakYYMDUQMu2XRVJL5mCMXygmyEgofHFXnS6oDxA/br5KfuC+GhQv7lb5/09+vqHx8jZmGKJNStQlWtrl5Cts2IYbZkf4L1oFZyyBOSyJzvhq0I3VITy9xleX36KovPbh30TVORTN+3Z/wVUGJvk2oQdFNy8fazmvFjehNMA0Xa14gzTHbz4qpNwA/Yv/22jiagyQJWfYkWzpUH3zB6/FDcR9t1JIQ9dZ4v+M4PHVsAaYR7PZiV8EamsuudAED3iF3DPJcG5a5FN7NwzLd2azorr2luxvsJeqnMTs391HoCrGUETu1cmz+KUa8SCz0SYbPP0xlDSMscvBIV50KK1179OeGWFqjj9QEi4k/QlNf9WuX8v+XQqPeNBttkipGE4Ty8L/5xYjYbYTU3dIHLtey/iZHvWzV2DMXf15jW9pl2kIbgYA0ccJNZM25hL+uSQ32bdzFLJJHQLj0iqfg7ypzyAwi5sUNPkZgL+74OZBGm7t5WBoutcp6AmMbLNBMFdBw7SxnXkcRm86RBEsr3HdFytsGbxgCVgcfnbnVw5s3HVY4JAzMqfQSVxV9w/lZ5ZYC+04ooQ/9cBTQTSqihl/I6U5QNqoonhXoxEnrnDXU7ebHW9+2YJhBgd/P6+/ENKOhX1MoNJPqGZBs+8hlRBcH/OhMXOnYihmfouU1u5wAWEZFSc/6n+v0mNCes8h9UDRqmZ4sUTl8ls1LlaSaHmHxWWGXMeP57Ih2tUh92aWQAtTTLxOSXA0osVz2HSUF6PYkq+Irswti1V4S5T5m0tMsCEaa9/fCOJmSW+SgBYGtppRs04F5mOcN7G0M+aEYDm X-Forefront-PRVS: 0311124FA9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39400400002)(39410400002)(39450400003)(39860400002)(39840400002)(39850400002)(189998001)(83506001)(478600001)(50986999)(76176999)(54356999)(47776003)(38730400002)(7416002)(7736002)(3846002)(305945005)(23726003)(54906002)(6116002)(25786009)(5660300001)(36756003)(86362001)(6486002)(8676002)(53936002)(230783001)(4001350100001)(50466002)(4326008)(42186005)(53416004)(33646002)(66066001)(2950100002)(81166006)(142923001)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR0601MB1882; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; PS1PR0601MB1882; 23:DotmsjB/q5QetGdpmC9skp9JlTAAHDOJ8E6AeM8?= =?us-ascii?Q?8x9xmqLPb6gGLKnThcbMeQCJ283Y+v5NjIM0nyfef8qIgvma/fHS9FdliPVH?= =?us-ascii?Q?oI68b9otFXlbWGOczCVWa3ugFgHfry0BiyFOxWZyzHN6xRmBSk78KQN/YMz9?= =?us-ascii?Q?6S0VNhcyLbG5ZoOMNf+RoGc2ji9+/Kg4xEOrT1r5XLvmF3swc9puRscsbKm9?= =?us-ascii?Q?KQKI0mdhmpIbWTmoIvcH3SSl+roJioGI1KoTIby6Ej9LF8MCTUVmbCl02YCM?= =?us-ascii?Q?Tr26KyrCgiBmV/xPGbQ/l8wKnxQD166+4UMKOemeIVK8CZrLGo1+u6EKaqmB?= =?us-ascii?Q?/LzK0MX/1wRudprd72gMKz609LiQwApbtbdu/M0lo0Ji0C5+OglqnVcd60MF?= =?us-ascii?Q?5BskieH7X+FILm1/85q6s42bN9iTM2d4SDUpFbUOPT5VgNuI+yl0Nu/lQMEn?= =?us-ascii?Q?Rgn0bfm7pA3qYF+rdmS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A59tqRYW0lXnJM76lstR3SlDz9roRP32kWMeQh7khwTj7rG9h0T4ZOwBfMSLJ8WJjrJyXqpJPbno= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2017 01:40:47.7519 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR0601MB1882 X-Mailman-Approved-At: Thu, 18 May 2017 16:58:16 +0000 Cc: Jose Abreu , Linux-ALSA , Laurent Pinchart , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, Russell King , Simon 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 ALSA SoC needs to know connected DAI ID for probing. It is not a big problem if device/driver was only for sound, but getting DAI ID will be difficult if device includes both Video/Sound, like HDMI. To solve this issue, this patch adds new .get_dai_id callback on hdmi_codec_ops. dw-hdmi-i2s will assume that HDMI sound will be connected to reg = <2>. Then, ALSA SoC side will recognized it as DAI 0 ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; /* HDMI Video IN */ }; port@1 { reg = <1>; /* HDMI OUT */ }; port@2 { reg = <2>; /* HDMI Sound IN */ }; }; Signed-off-by: Kuninori Morimoto Acked-by: Archit Taneja --- .../bindings/display/bridge/renesas,dw-hdmi.txt | 9 ++++++++- drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/display/bridge/renesas,dw-hdmi.txt b/Documentation/devicetree/bindings/display/bridge/renesas,dw-hdmi.txt index f6b3f36..81b6858 100644 --- a/Documentation/devicetree/bindings/display/bridge/renesas,dw-hdmi.txt +++ b/Documentation/devicetree/bindings/display/bridge/renesas,dw-hdmi.txt @@ -25,7 +25,8 @@ Required properties: - clock-names: Shall contain "iahb" and "isfr" as defined in dw_hdmi.txt. - ports: See dw_hdmi.txt. The DWC HDMI shall have one port numbered 0 corresponding to the video input of the controller and one port numbered 1 - corresponding to its HDMI output. Each port shall have a single endpoint. + corresponding to its HDMI output, and one port numbered 2 corresponding to + sound input of the controller. Each port shall have a single endpoint. Optional properties: @@ -59,6 +60,12 @@ Example: remote-endpoint = <&hdmi0_con>; }; }; + port@2 { + reg = <2>; + rcar_dw_hdmi0_sound_in: endpoint { + remote-endpoint = <&hdmi_sound_out>; + }; + }; }; }; 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 aaf287d..b2cf59f 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c @@ -82,9 +82,30 @@ static void dw_hdmi_i2s_audio_shutdown(struct device *dev, void *data) hdmi_write(audio, HDMI_AUD_CONF0_SW_RESET, HDMI_AUD_CONF0); } +static int dw_hdmi_i2s_get_dai_id(struct snd_soc_component *component, + struct device_node *endpoint) +{ + struct of_endpoint of_ep; + int ret; + + ret = of_graph_parse_endpoint(endpoint, &of_ep); + if (ret < 0) + return ret; + + /* + * HDMI sound should be located as reg = <2> + * Then, it is sound port 0 + */ + if (of_ep.port == 2) + return 0; + + return -EINVAL; +} + static struct hdmi_codec_ops dw_hdmi_i2s_ops = { .hw_params = dw_hdmi_i2s_hw_params, .audio_shutdown = dw_hdmi_i2s_audio_shutdown, + .get_dai_id = dw_hdmi_i2s_get_dai_id, }; static int snd_dw_hdmi_probe(struct platform_device *pdev)