From patchwork Thu May 18 01:40:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9734859 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 9DEC1601BC for ; Thu, 18 May 2017 17:00:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BD1628898 for ; Thu, 18 May 2017 17:00:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80B57288B9; Thu, 18 May 2017 17:00:21 +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 1AA7C28898 for ; Thu, 18 May 2017 17:00:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E91C66E5B3; Thu, 18 May 2017 16:59:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from relmlie3.idc.renesas.com (relmlor4.renesas.com [210.160.252.174]) by gabe.freedesktop.org (Postfix) with ESMTP id 72D056E104 for ; Thu, 18 May 2017 01:45:31 +0000 (UTC) Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 18 May 2017 10:40:28 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 4F6FC47A08; Thu, 18 May 2017 10:40:28 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.38,356,1491231600"; d="scan'208";a="243297223" Received: from mail-pu1apc01lp0016.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.16]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 18 May 2017 10:40:22 +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=vebJMMjxjt6p3PUqI1Xs4/V8AfsvWZO9uqe+QexKeyU=; b=nvzvRgJHqp0JIYYTogwQqz1cNzTuGNKXNCIEDDjWoBZI7jNpZ5++j7P0Y9fluWp/qObrBoTtML0dhwdAev/KfCTdDmyHieKD+rPYArtYStMXpbeZVe5yihcCkR1VS8ca+Q7yK0qybBZaIDxoa22zHKZB05WDrxA/Gia34ljfLlc= 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 HK2PR0601MB1875.apcprd06.prod.outlook.com (10.170.149.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16; Thu, 18 May 2017 01:40:20 +0000 Message-ID: <878tlvosk9.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 4/5] ASoC: hdmi-codec: add .get_dai_id support 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:20 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: HK2PR04CA0050.apcprd04.prod.outlook.com (10.170.154.18) To HK2PR0601MB1875.apcprd06.prod.outlook.com (10.170.149.19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 366b0b60-50bd-4f6b-e420-08d49d8ed8be X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:HK2PR0601MB1875; X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1875; 3:hs0KUDxJx1WKvCgBWOCa5HhRD2KEsU+AvJRqXhpgsbBGJzGqwQGsdWWmBbGq7WSvykXwvJ10SVkb4wIQ41fxagGngB03Kzt8G2ZJy92JBYIQF46mKJbC3sx+btObfLSrwu4TaMpdvs2K40qDYLjoVCrA6O2tV2/+EXNS2BguLDtw7jSg0pdpmJnh4O2GrlzRwIzNCvMefz45ZPa0l+lm7kZ/3Q5pjQcL/5psCqTDP56ynsWUwBaVjjFyxcLeI1Sm7s/DcsXVCXj0SulVPDm05JeYJ2107dgGyhTfjFZ0vDVXHDRHyF/bOBcIrO9QYHkn7ldy77ZogTlcoQmQR/3JZmo/emDlhwMOn0M96TRoS14=; 25:KUzs1f3lGNQZpjU7YDUOff02u41HZUJ1o9uyOzdfpOwSfmD/ertXiYfKuaQv/6XdUJnlSftxDgNugV6Xz8QnL5SrT0ExyWG2prmu1im2YuVaqKbkzjroFP/lt8ul3TMKxzZjZOv4SnMPowVoNzLQGGpILqCnUsVdObdVzgM3YnjZZNHMg4jEMfS4b5axyFHMAy24AP3PW3BPko6Qxs0KGXbaj+hBUOwDtoKEDr8J+7ur4MchvGPr9+yxCx1DOus2R3qZLoXuNrSOXFazk3hRDjc84YfThVCiXeW5xLN5gtI2n2+QNWjE0ECLhVq8/tRRRBNIoxJpXbZ0NVNV4J7ksKRW6fppwIHEZcQc9eQRBEl8CV/+oQAU3pbBtv5ZSN40Dm+TlGIHxLVDbr/aHEBU5DbuCqTRm4fkHZNFG+I6jU02Wzd8/BSQEy2Rr30A6hD47yD3OeFC9tEfldd/C/FJlAdDAg5ocWjHrwJsZwrWaqk= X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1875; 31:IxUDSxfGXF3ibC9lVlIhGI2cLPUeLXY6vZuPXLlN6LGqzuAzOhWuKHsEbXL1D9ZNGmG/99OzCKKBA6iXqpJk5Z1sEKLbqf+PbSdjO4g1CnlTSVlUly643ST2DkeFnt+lpkUFRvMYF4ym3Su/rI3/mOWv7MbRte5FDls47GkkxDv+vj8cRhCj6xfFNX25vjQlgGbPGrJT4qROCPi7F0gWH07su2kqMjPbPe1gZjYxoRWrRSSteNRzQtNtsTLmNwa5c62Z/dH0rAjA0UIkTBSb0g==; 20:HJaOoES6YES6giYARylWTFmfHUDjafGdMUC+7um9N/fblBMgwpSnlPl1uqjHxesDGOj7gbBpMuLy18xtoWsgYdlN/E4hvrWkfTwB1MmEGjrBMOTPYi49D5AKKLssISJHSi7zZI6m0A0FkFcuntIfBFtPq4KHlw04TlY+9KHVt5VVTg+SbrJGUCjBZ1BvsocssbgiIj3F9picPCoYFBRXI4km+2+602ba0ay+ONuT1IjnQk/evo2nTUDsmGtONG8tYDSgXIQAm8Y20kifXVTY0fp3hGE5akfoFm3s5P0Q8uUkH8UB/uIghG1Hgzj5M1q5Lb58FK7t5lRhADcH65u2jTrGZXOXKxW4KaHydEMmWUTr1cH54qtsZkiwKLnsLy7gITbpYJ/FH0uvZUINt4osC3LyRKXtH0Q9WkgDJQPcR7dLgYlUJ03EL4CbOtPBc9wXkt3aA9BXE9M60Ng8zXnIN7mnxp9wEJVF6VXt2/lelnhZIn8BCDpb5PenB8DJ/sNT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(20161123558100)(20161123555025)(6072148); SRVR:HK2PR0601MB1875; BCL:0; PCL:0; RULEID:; SRVR:HK2PR0601MB1875; X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1875; 4:O0SL1U330TpC094Vm9yTmlvdWZIkB1A4IjpcXQZxpFDlZUrxRGBoBMl1BI3hHy7LLsv1hK+/eL9bqsdWb/i+taDL06JoKxirUi2pp2GSLYNcXucIvKM8stBjZHXnVlp0EjWbsII6RGUNLOpMr8ngUuFtNiYsbu3jpueo8i2qEbRkRmdghNbG791akz//ssRh9O0pjYoNKDCMFkeUdc74SCWqF8GdDyL65TROgVQyahY3BssC8mV6M1mp9CnZIw/VCwWohWhAsy799pOJYJIYO351y4+XU7WWjBN94rEV2H/dlpg6B4iFAhh35bt3ZYxwwgv7cOyIRrOVw7UMWKbLViTC/BBUQalfnryyDIDs+33lJ0oCqTLOtSBZynuN9VGwByifovKQXBS9ujtUeyaxtDzuxXu6hbuiSPhv5IHGOc+joQhvdXoLgdSWIE1J/v06FB7ypxYDtWqFbmakWdzCCxIwxlG9Lp5F5cBtaMMmsiEW4jwsglck+p+r0FdeY8iaBHYt/s94l2XMsn5oEBRsKeVjuYHGapl2lJByMAhU1reEkzYLhen3hMGG4W1KuJ1ZNLszH/f2PLQG5Wzzy7StuXi9NjIHHdjplWG9XvCcXX0llGZCBeJvvDuZ3Ug9lEGOPhvy4gwHBNZajPY68j6VJlZs5qJoe4C/Nk6VYkkw8eGPjRH3OYGU4S7kaBU6XuGdZaOltmhUZp2YsbsYZTCbDJomTlR/HbRDOPmzf1us2V3qHKO9eqUtztKiXdqSSFOVhbfwEiQn+009Fj0l3WQUt/w5OtURqPEAkK9fqGF39eRNNgmGMzIWvWBbdzkMvROF X-Forefront-PRVS: 0311124FA9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39850400002)(39450400003)(39840400002)(39860400002)(39400400002)(39410400002)(305945005)(7736002)(53936002)(83506001)(4326008)(25786009)(54906002)(6116002)(6486002)(3846002)(23726003)(2950100002)(81166006)(47776003)(8676002)(7416002)(66066001)(86362001)(50466002)(42186005)(33646002)(53416004)(5660300001)(478600001)(4001350100001)(38730400002)(189998001)(36756003)(76176999)(50986999)(54356999)(142923001)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR0601MB1875; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2PR0601MB1875; 23:kGjROIYFIHkaVyRW2OVASUYvJFJW40xdQQFFqXZ?= =?us-ascii?Q?Xi6LeNtUhsCIF/vwwULaevz4qquh0wRmgnoSBj9f1RoizmEyWCJzSxtD0jWD?= =?us-ascii?Q?hIGhID2pbZswjbBUDlbFgr9xMz93D2vRnl1jwItgewhC+QQyc5ucwEXVZnim?= =?us-ascii?Q?o/KcQbv5iUzOXIBuYcJ79jX57+VJpy4G3w+HYtRJk3qt4amONzzq4aV/O65p?= =?us-ascii?Q?ZQ7r1orj7O7YlDyApCwN16lt8HKpXPf9K/Lj6ExnVJZmpsBKOs0mIWHZ6l80?= =?us-ascii?Q?Bo5E1asj7eVzp9rQ5UGzHJRdUdO5bRkYZX5A0r6ZD2sgqg22xOkmwVx1BhZe?= =?us-ascii?Q?EZkHcD7JTpTmSbeZtQz+dS0rljiEcrkrN1mzYXoIS6PnxnVmpJPx4KUKCXtw?= =?us-ascii?Q?BmusppbRIO5w+7fUJX0b11H9USLKZoLvul1i0kHjKxABtc+cLUDGFJk5B0l3?= =?us-ascii?Q?Cy64Iz7BSFhHY4EQZ4wsL1D+KIldmp4WXkZwrc4dlSqCDd1ZCVtsqWhxLL1p?= =?us-ascii?Q?zZxFPfcC8jgmypiTLxZSqplZ70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zOfFTxiRD/ILLvRizcrD0eEHifEVYVTrnDVewifu3LjIxb5E37KvVfmdZ8/1g8UmBTkb9p3ESYni2mfyOGGdI536WkoGJ5MORgG8zjoY6IZJTziBOUC1ownyVTenk8WUIKdwSV1uQOPl9ur9olGGR1/ZVYzilKUFkzFerwufsuzvZeCSH0kBzOqsvhgK3c=; 5:H5pk4HKNdQ218gA8OBd1eV/nAGVZV74rgE4+B7chM9oGjjMtFO0M+zX4iuehai1o1tPIMnNfWpwRr9sSt9v7WvjILZ+RhB/GJGZhebGpuSTCxsx1cSShFjOOCpNAHijHzWedh7EqHX/MIughyjbVAA==; 24:/mE8Khw7L9DOmcOx+uomKXHJ6Mtef+C7hxihVCxBhZrKPxtxlSvmfhcK7NyGJHt2vwsFsPCT73ye8EBwKmLKNqMcggWMXnc9M+5JZAbtXAU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1875; 7:/OK924Rsz+aRtgCLhQLIdZf3cCeJF98rEo/1xgyLumihsmC5rskJYNDIv0+Ymc9riH0r8l4nFI5BFcPxxTeBad41iaGh/LTYlRKtYb5/QrKOdYrZlbu4AuH3T+Y2U5KblojVniVRRCocq/qhJ5a/NfaRJkdEnt5t1SB+wsoZYyuyd0nd1MFk/pZCYimuBxNVXr8i2dqui3mP2MiqQw/yTLAFmqfXFGI11iTH/owa2i8hmm8dqYYPQveQtJuw/QUCU+kjoJVfxsVRt2HeofgK7NKATEWJpQjpB53M1SqQw5ZGYHdKXJLt3Kj+L1zMKuQuvaT4sv2K+/HbP95AvrxFcQ==; 20:iLkyoVH7zQv6jq2tiQLIKbWEBHa+z5RD7BI0l3oFMKbFXr8z85n8Jlh90F/h0dcgJJf8PzrfBzbfcTYY2+jSSAST9qFic9kp42K7FwKTbBUO2Md42/OhaRnbTX0rpp7aD9pdioPanImASqYbXe0cb37ip+zdpMVkiri8O0ipsx8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2017 01:40:20.4510 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR0601MB1875 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 Signed-off-by: Kuninori Morimoto --- include/sound/hdmi-codec.h | 9 +++++++++ sound/soc/codecs/hdmi-codec.c | 13 +++++++++++++ 2 files changed, 22 insertions(+) diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h index 915c435..9483c55 100644 --- a/include/sound/hdmi-codec.h +++ b/include/sound/hdmi-codec.h @@ -18,9 +18,11 @@ #ifndef __HDMI_CODEC_H__ #define __HDMI_CODEC_H__ +#include #include #include #include +#include #include /* @@ -87,6 +89,13 @@ struct hdmi_codec_ops { */ int (*get_eld)(struct device *dev, void *data, uint8_t *buf, size_t len); + + /* + * Getting DAI ID + * Optional + */ + int (*get_dai_id)(struct snd_soc_component *comment, + struct device_node *endpoint); }; /* HDMI codec initalization data */ diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index 8659b76..6d05161 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -719,6 +719,18 @@ static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd, .pcm_new = hdmi_codec_pcm_new, }; +static int hdmi_of_xlate_dai_id(struct snd_soc_component *component, + struct device_node *endpoint) +{ + struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); + int ret = -ENOTSUPP; /* see snd_soc_get_dai_id() */ + + if (hcp->hcd.ops->get_dai_id) + ret = hcp->hcd.ops->get_dai_id(component, endpoint); + + return ret; +} + static struct snd_soc_codec_driver hdmi_codec = { .component_driver = { .controls = hdmi_controls, @@ -727,6 +739,7 @@ static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd, .num_dapm_widgets = ARRAY_SIZE(hdmi_widgets), .dapm_routes = hdmi_routes, .num_dapm_routes = ARRAY_SIZE(hdmi_routes), + .of_xlate_dai_id = hdmi_of_xlate_dai_id, }, };