From patchwork Tue May 31 09:05:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9143885 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 06A5D60757 for ; Tue, 31 May 2016 09:05:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEB1F25D97 for ; Tue, 31 May 2016 09:05:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E38C127D17; Tue, 31 May 2016 09:05:37 +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 6D45025D97 for ; Tue, 31 May 2016 09:05:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756118AbcEaJFg (ORCPT ); Tue, 31 May 2016 05:05:36 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:42852 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755920AbcEaJFf (ORCPT ); Tue, 31 May 2016 05:05:35 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 31 May 2016 18:05:33 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id C56B8610CB; Tue, 31 May 2016 18:05:33 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 63ACB480A6; Tue, 31 May 2016 18:05:32 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id C0129480A5; Tue, 31 May 2016 18:05:32 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id UAG07255; Tue, 31 May 2016 18:05:32 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211980691" 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-SHA; 31 May 2016 18:05:31 +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=kqSqlNUs/sXyyI+5IGTl1kjpuH0djrw1ofDZkSh3pp4=; b=fa6VX5bK+xmKAHCsm0MgXtppl0WABJww4OoIr2uvn3lnVV4oGnC5CHN9kSAP1HqOoZ1e3LJMGiwRY/2MwOyhrI5JUJsRuYiSS0Hz18sQjrHpHStKysQB8CD6GjHwwQ9qvG2p/aAYEpdazcfASkRNgJZ6SLVNDV/fZRPZljM/g3I= 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:28 +0000 Message-ID: <87shwyr4bq.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 16/39 v2] ASoC: simple-card: use asoc_simple_card_parse_clk() 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:28 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: KAWPR01CA0036.jpnprd01.prod.outlook.com (10.165.48.146) To KL1PR06MB1703.apcprd06.prod.outlook.com (10.167.63.17) X-MS-Office365-Filtering-Correlation-Id: f511a33e-ee9c-43b6-0cb2-08d38932b66c X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1703; 2:O15iEDn77+jQF+iu+lzqdRySgc74cq5wUv7/RScU0Xj37J88aMAc/lk5jjV4zwTaPO2rfjK88daDetp3JUDnKaOwneGks7k29lNANjXKxY4W1Bqr/uj5i9cj3z9pdtHe6eDuUer6aUN2/+SgMjsClHgaN4cXgE49e2N/39+GGuDwPFokbl/My93SoBQXW8q7; 3:KWbpZUf1shkhE8d7JFmt/TzFJHVbGuMWE1AtpJsgrVC2LuAtQtrTOZStjfzOku9d6mJGbxUR5/z54GbCw1SbPrhlgf17edyW7w63cWatLsxvexv3y3jOSe7pyJoHkAJr X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:KL1PR06MB1703; X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1703; 25:PAyv573zYNYLiveufaIVwSaXfS7U5QCnFIC2SIByda8RrD/h7152Rd7N8YUhlVRkb2sY+B9CpdsExxWNNkADw/FYdlv55yjYvKSwzP53Hns5twS1q/p9iNOqpghZhBKtigT9aFmpxxrqrJECSOPwRRhY9SZc+EcXfUY+z03DtOxMUKzAOfMs17VcFjIx3Nl3UMzP4jN9kK3CB6A4EMq9Z8aNWKeLDMR6Z44mO74otPhgPJprIIEUV8Mg8RAfdHs+hxxumrctZnC6P8/BUD/7e/tJrWllUeU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hcIZFBWlshW8ZZ9iuTFr6w+sE1mAELa+1sYg/y3SjaL0dXZ27lkCHVcv1slXIOhYlbtlRolz0iqTp8LK211Ocln+IxIo4MMbvI7t5z5pQ/fro5zLkKyZP0g3Ear82vmLykiATOzCPtcWVUkpMbTSjef/3Xlz5J4JMd4gi3TUfPU+Y1IhHJg7PkjZ9x0aPsQSsgxRcQdsjyuQ57/SGw/08hpJ3uGdZ/b9SKHQsi2e+1gtbURIvn5gohE0U844BqKeBN/0+njuIknX4p+GAqC4rT82ZQFbVbh2dLzFRDBt7K8FDeldFG9hC8ANanFpQeoCKUdoMDsIWg== 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)(21314002)(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:dNE3BDkLvdxqJ6L23Fy9GPIGAgCnCaCjRlDBj15Sm?= =?us-ascii?Q?TI405IzzN5R0cHTcRBsLIuoeF5jnwMVOTZOhaPkx4r2Gl6TMa0yfecehufMU?= =?us-ascii?Q?pqE7WIgQaOD0g0TUz5992lhC2zR8Q1qFezwgGXiXUuEhCcGPL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Exchange-Diagnostics: 1; KL1PR06MB1703; 5:1XjWFuQ1x8iQ7YhUuBkyMEoAsccP5cbrL47axBLLKHDlxI54DAsDctJwIV21dWUDuABNT9FevioBbLvdYp69CaaKYtgHpBbRHrDLvbVa8syLRDEvbnSOaTj1zggh8ruGbv8Raunbsr8E4bI4y9zkqA==; 24:sQQHTwSDieFtH7mwZxqtAweC0W0LvOXw8zGb09P9JP9eRqreLqQ2+TQ6j4rRKtaVjViCAlYrMvUaZ9uE7u4UsLN7nPYBVMLi6viYWNNRboY=; 7:tK+y4KJ55o4xAHBl+rv635eGuTZlrWHocJhOx2+/3bubvBHbxGoNn6fBDNSfftHsUs5M8y6iqVSz3i6G24k7yw22t7MTCo5i6GYDGPHW1T1rph7tnVQW6D8VYPpiRQBqNM60mxWXFsp5uMRcb+Qj/k3rk/8r1/iKnxvh6v0xuGmGlhTKdx+8fp2AlDUgMC7R; 20:A4pCngpiO8VvcSyn0Dk7yg6u0cpeWSjWzXkbjES9QJHN7s+oXKfQ+/ujHP7KzUFthfTapkxFL2rHwmqMsH9y0qt9PV0eB6xCh2+YBk137HuSIGKvHIqsG6OA0rtHmSORbokaunw+IKmRdp6GAryBvEgg1bUSbohgNAb4tmxA0As= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2016 09:05:28.5026 (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 --- sound/soc/generic/simple-card.c | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index e3a32d3..6a4d1d4 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -244,8 +244,6 @@ asoc_simple_card_sub_parse_of(struct device_node *np, int *args_count) { struct of_phandle_args args; - struct clk *clk; - u32 val; int ret; if (!np) @@ -282,29 +280,6 @@ asoc_simple_card_sub_parse_of(struct device_node *np, if (ret) return ret; - /* - * Parse dai->sysclk come from "clocks = <&xxx>" - * (if system has common clock) - * or "system-clock-frequency = " - * or device's module clock. - */ - if (of_property_read_bool(np, "clocks")) { - clk = of_clk_get(np, 0); - if (IS_ERR(clk)) { - ret = PTR_ERR(clk); - return ret; - } - - dai->sysclk = clk_get_rate(clk); - dai->clk = clk; - } else if (!of_property_read_u32(np, "system-clock-frequency", &val)) { - dai->sysclk = val; - } else { - clk = of_clk_get(args.np, 0); - if (!IS_ERR(clk)) - dai->sysclk = clk_get_rate(clk); - } - return 0; } @@ -316,6 +291,8 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, struct device *dev = simple_priv_to_dev(priv); struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, idx); struct simple_dai_props *dai_props = simple_priv_to_props(priv, idx); + struct asoc_simple_dai *cpu_dai = &dai_props->cpu_dai; + struct asoc_simple_dai *codec_dai = &dai_props->codec_dai; struct device_node *cpu = NULL; struct device_node *plat = NULL; struct device_node *codec = NULL; @@ -371,6 +348,14 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, if (ret < 0) goto dai_link_of_err; + ret = asoc_simple_card_parse_clk_cpu(cpu, dai_link, cpu_dai); + if (ret < 0) + goto dai_link_of_err; + + ret = asoc_simple_card_parse_clk_codec(codec, dai_link, codec_dai); + if (ret < 0) + goto dai_link_of_err; + if (!dai_link->cpu_dai_name || !dai_link->codec_dai_name) { ret = -EINVAL; goto dai_link_of_err;