From patchwork Tue May 31 09:05:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9143881 X-Patchwork-Delegate: geert@linux-m68k.org 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 9E13B60757 for ; Tue, 31 May 2016 09:05:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 922A325D97 for ; Tue, 31 May 2016 09:05:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84AA627D17; Tue, 31 May 2016 09:05:14 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBBA725D97 for ; Tue, 31 May 2016 09:05:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756702AbcEaJFN (ORCPT ); Tue, 31 May 2016 05:05:13 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:39734 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755920AbcEaJFL (ORCPT ); Tue, 31 May 2016 05:05:11 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie2.idc.renesas.com with ESMTP; 31 May 2016 18:05:10 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 2E19550342; Tue, 31 May 2016 18:05:10 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 30D228002E; Tue, 31 May 2016 18:05:10 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 2BBA48002D; Tue, 31 May 2016 18:05:10 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id UAC02701; Tue, 31 May 2016 18:05:10 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="212431953" Received: from mail-sg2apc01lp0242.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.242]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 31 May 2016 18:05:08 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GIR4EcK/48Rc6dNjecij7ivykUZ/HT+19yelwS/lyxE=; b=Lrc3DQB/v+xnbM1vRtT/64bjfxP0EfYLUzXWOQp0szGrWNlRjbyriZnK8OymLxwiXJ0532su8KpN2v0A+INNu22oK4y2Lf3G+xAB1vjpPV/R+F6KKYB9v3O+qiD/m7Euf0YJ8zrBYdZlc+hot43deh6T6E5d3zLo5wqt5RpM6RU= 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 KL1PR06MB1703.apcprd06.prod.outlook.com (10.167.63.17) with Microsoft SMTP Server (TLS) id 15.1.506.9; Tue, 31 May 2016 09:05:06 +0000 Message-ID: <87twher4ce.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 15/39 v2] ASoC: simple-card: use asoc_simple_card_parse_daifmt() User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown CC: Linux-ALSA , Liam Girdwood , Simon , In-Reply-To: <87fusysjam.wl%kuninori.morimoto.gx@renesas.com> References: <87fusysjam.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Tue, 31 May 2016 09:05:06 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TYXPR01CA0001.jpnprd01.prod.outlook.com (10.168.40.11) To KL1PR06MB1703.apcprd06.prod.outlook.com (10.167.63.17) X-MS-Office365-Filtering-Correlation-Id: be0a665c-6772-452a-d835-08d38932a966 X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1703; 2:9aZbq8sgpOpYsSiaVm3JF0j0ATQtvKLi9jkhe19KyL/qqObMIsjHKyjimLKyrGcsNRSUYA3Y3MoC0PMkTrGUXBHtXHk0onC+H6np7OgK49KG+vyMN8/2ot5WlAeA5YG5sqKVyysHwABwZSzijdCMk5L66aebUjLYUKh0jiX/YNGKRSkiWRX64DKQIAc4dCCJ; 3:+T1CU1cdV/GD6IJroG0JNPQIRvxAwiyFYDCVxv4N4YcNotmWbPNqX0IBAVyVbu8GdIpa5lUKvki9mKmHVusi8kwtNU+wJnsnsBfamZYXji9tNtOixwjqd9jds55vZf1L; 25:F6YYmm399g13LOuPo+T5YczY+hlHhZypJCV9f8mp73c7h2u8fsspB5pqTyQPFh2McOcUhLysa7PnHB5W2VK1NDcknWL58s0TmBzNj1BxHIidINyX0YortzJ3DihQfuWZpY3LUDVxIrFzajCttVX6JUCpBk0Dnr6POQF3K3FM4IOVUZcceXcIPiTwm7ecFgAVCiaKDGBiQ2hCAu62LuryuF89gIfs1oedpBudFcElpjwCwts8P520R7xTnv5BfOSWjOR325oMVDkIDYTmscUZ3+8RQh0IP0i+1Apg/WxvTgHdZReFSFnoOkgJ51trnoPH8iylWtaspLjKpMDTmO4UNyQUMnyxscckofAhl2NYiRiNaWDUSiRerO/kQvpirqPQGvO65czOruO+qKm/WDX7JpChDYXGqToo2iCdGsjxOgk= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:KL1PR06MB1703; X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1703; 20:ZkvOayAcr55MglfVC1GcoXehdyUohTnDgEwtrJkxRru86YV0sgQxmWwVZmSAs5mWEL/AKKTjeHxK7h88oSv7e+7QVS+xpReEWb+ivF+eqxscozoQwaSiLfRNhfgiFFeQ66AUchjVk/ZIQNYWQ9DLVuDDs6eBl/IKl2FXDhL8x8k8iFxp3QHWf7jwDVtLlQDbnX3X0LbqcJXB9r5BRZrPWH8TLTW/+TVQ6t1wDtPxbPEHolfkbfz5gteuxNg2FIkke4lr9z3zQN26YKIKHE2vXp3u2K2H/dPoqrE/PZ7gj02o4PAipQbDcaxyo2QBiAUgcERrAjrNyGouWRNT7MJRnalOoSQeypz/xZr9M+lHGxdnhvGV2AjjAxZbllhM0W0tByP3s8JasIYG6Sil+DfitCbaC3kOTqtuKjiAu8GJcnZoE1KZhugEEzc9l/WGEkrgu2DZwp6Gi7+Irno4o4WMZQQ98JlohxCna4R+yiENUIYAnqonk8sWGJWIuXSVepPr; 4:+dCq3FIrSmy0Fu7SleRAzPZiSvE3pco7gm7e9dSAYYkp1qNduMCV6OWOLDkQWETP5KFHT8WwurZxHQ1zizmhX69Wd67du9po2sLX6cgw6JWKh9gdLWC9aPyk6PQYQoLib9SJZW9CUQg20XWS6b16bDBuVuBEyRDTgtBe12qOAUVeT7SQ6peUdtFQjyWd634u00Bae0POF17mWnLtaWMU6dguGhZIkRMGNC0yYfhdPvLjBzc16mL87dQfqQrNfi2XSovMgGN/xzPdW8cyN/UDeZmAfLmiJD+MXWzBtQR39IotQ341gItdvQ5u3dt/Eg6P8hQD7cgqflZ5wCwyY6A6P7AQWaFArqIZM5ICtfyB+wZ/aB/tjTQ9O5A7LjG8vPkK3B7/7psN+9fDbnt7G80QYA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:KL1PR06MB1703; BCL:0; PCL:0; RULEID:; SRVR:KL1PR06MB1703; X-Forefront-PRVS: 095972DF2F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(42186005)(47776003)(4326007)(66066001)(2906002)(54356999)(76176999)(23726003)(50986999)(6116002)(19580395003)(19580405001)(229853001)(86362001)(92566002)(33646002)(5004730100002)(2950100001)(46406003)(4001350100001)(110136002)(189998001)(77096005)(8676002)(81166006)(36756003)(586003)(50466002)(53416004)(83506001)(5008740100001)(3846002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1PR06MB1703; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; KL1PR06MB1703; 23:4wKyU8rsa6fuzzjfN1TOIeg1RUwgVQH73qvQ8hyhB?= =?us-ascii?Q?mCnM25ok08xSvSon8JOVQTnTGweGUI0bh0zfJHXfjajO7FKm0R8gFExvi9y2?= =?us-ascii?Q?cUmSXTAGWe0/j8/gbn68n6dyt8v58FWOER+H0K2/4NYcP4CiyA3dCSzQXBYu?= =?us-ascii?Q?j5Omw7z1+IspRAHDpBeNl9MXmvbFitkl7RuJpohVfPC6DHURzvCOxafwzjbb?= =?us-ascii?Q?hEsHTsLX2cv/d6aply0wCEWAcbyuDZ52qngVtnnFqblN9Xvh3Fe6jpV6dHKg?= =?us-ascii?Q?z3Zp03PYdueqhI2NWPeN97SNG71ZNK0w8372iZQX9lkGYLb82yjtNFBX9ERr?= =?us-ascii?Q?s8OE4QWPyCNDXV9mpkbHLqe6nBk1VE8x6mNqlXeIe8S1ixDcVnP+eo9SacMv?= =?us-ascii?Q?Fravp4WOQ2kFzNhsxu55yWbw7tN8z4Cf0N0for77cZjpE+M89ZMPDF1n4NYB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Os3JUy94DCvz5niyKocoWl7xscxBN6GxobGgPnM4SWmZ0ZgqFsKpyOggRZnumM6Kn6PVri78rMu2coc+8qKgPW; 20:Wy10BC4WhTdI0bk4M1Z37kLjm/N/4fOe3BfjaGj8GtLbCOcW5ApsPiRYuc2C2MlSFmGV3QmAJwC8ZnwSkytsUth4M0LUtuAG/+k+BNmBidz6bQPglW1iOQTikUQRxSQsJDTlNjhOd816D6BrjVzXl/LesWZPKYZKtJPjtbKChEo= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2016 09:05:06.6581 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB1703 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Signed-off-by: Kuninori Morimoto --- include/sound/simple_card.h | 11 +--------- sound/soc/generic/Kconfig | 1 + sound/soc/generic/simple-card.c | 46 ++--------------------------------------- 3 files changed, 4 insertions(+), 54 deletions(-) diff --git a/include/sound/simple_card.h b/include/sound/simple_card.h index 0399352..a6a2e15 100644 --- a/include/sound/simple_card.h +++ b/include/sound/simple_card.h @@ -13,16 +13,7 @@ #define __SIMPLE_CARD_H #include - -struct asoc_simple_dai { - const char *name; - unsigned int sysclk; - int slots; - int slot_width; - unsigned int tx_slot_mask; - unsigned int rx_slot_mask; - struct clk *clk; -}; +#include struct asoc_simple_card_info { const char *name; diff --git a/sound/soc/generic/Kconfig b/sound/soc/generic/Kconfig index 26c2fe6..c01c5dd 100644 --- a/sound/soc/generic/Kconfig +++ b/sound/soc/generic/Kconfig @@ -3,5 +3,6 @@ config SND_SIMPLE_CARD_UTILS config SND_SIMPLE_CARD tristate "ASoC Simple sound card support" + select SND_SIMPLE_CARD_UTILS help This option enables generic simple sound card support diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 8d0311c..e3a32d3 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -308,48 +308,6 @@ asoc_simple_card_sub_parse_of(struct device_node *np, return 0; } -static int asoc_simple_card_parse_daifmt(struct device_node *node, - struct simple_card_data *priv, - struct device_node *codec, - char *prefix, int idx) -{ - struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, idx); - struct device *dev = simple_priv_to_dev(priv); - struct device_node *bitclkmaster = NULL; - struct device_node *framemaster = NULL; - unsigned int daifmt; - - daifmt = snd_soc_of_parse_daifmt(node, prefix, - &bitclkmaster, &framemaster); - daifmt &= ~SND_SOC_DAIFMT_MASTER_MASK; - - if (strlen(prefix) && !bitclkmaster && !framemaster) { - /* - * No dai-link level and master setting was not found from - * sound node level, revert back to legacy DT parsing and - * take the settings from codec node. - */ - dev_dbg(dev, "Revert to legacy daifmt parsing\n"); - - daifmt = snd_soc_of_parse_daifmt(codec, NULL, NULL, NULL) | - (daifmt & ~SND_SOC_DAIFMT_CLOCK_MASK); - } else { - if (codec == bitclkmaster) - daifmt |= (codec == framemaster) ? - SND_SOC_DAIFMT_CBM_CFM : SND_SOC_DAIFMT_CBM_CFS; - else - daifmt |= (codec == framemaster) ? - SND_SOC_DAIFMT_CBS_CFM : SND_SOC_DAIFMT_CBS_CFS; - } - - dai_link->dai_fmt = daifmt; - - of_node_put(bitclkmaster); - of_node_put(framemaster); - - return 0; -} - static int asoc_simple_card_dai_link_of(struct device_node *node, struct simple_card_data *priv, int idx, @@ -386,8 +344,8 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, goto dai_link_of_err; } - ret = asoc_simple_card_parse_daifmt(node, priv, - codec, prefix, idx); + ret = asoc_simple_card_parse_daifmt(dev, node, codec, + prefix, &dai_link->dai_fmt); if (ret < 0) goto dai_link_of_err;