From patchwork Tue Jul 19 02:53:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9235835 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 48E04600CB for ; Tue, 19 Jul 2016 02:53:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E69126490 for ; Tue, 19 Jul 2016 02:53:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32DDD26B41; Tue, 19 Jul 2016 02:53: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=-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 042DD265F9 for ; Tue, 19 Jul 2016 02:53:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752309AbcGSCxT (ORCPT ); Mon, 18 Jul 2016 22:53:19 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:47407 "EHLO relmlie4.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752351AbcGSCxS (ORCPT ); Mon, 18 Jul 2016 22:53:18 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie4.idc.renesas.com with ESMTP; 19 Jul 2016 11:53:16 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 9D2F04B15F; Tue, 19 Jul 2016 11:53:16 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id 7617D1806F; Tue, 19 Jul 2016 11:53:16 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id 7070F18071; Tue, 19 Jul 2016 11:53:16 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac3.idc.renesas.com with ESMTP id MAA28413; Tue, 19 Jul 2016 11:53:16 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="215372655" Received: from mail-sg2apc01lp0247.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.247]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 19 Jul 2016 11:53:15 +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=KQEmsVw/mkMecA/UoXjoET4GckwJrWiv1PGtN8nA40o=; b=G8zQ8+PFxOa38BCRjbW7Bf+UkgIEucKTqfj63lKa4YAWjWGkSJ7MMi1QBGT3pEuTGfMOGXwMR2ugfj22HuQMUMAd0GsAuuYhYNwfnArp3C/EOGmACTG/VBQ6/RUlovtoZDXSvbsvPcMZ0ae5vZgRgqk9crbKCfUlM9NI6tENxLQ= 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 PS1PR0601MB1451.apcprd06.prod.outlook.com (10.165.210.155) with Microsoft SMTP Server (TLS) id 15.1.539.14; Tue, 19 Jul 2016 02:53:13 +0000 Message-ID: <87lh0ymjl2.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/7] 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: <87oa5umjoe.wl%kuninori.morimoto.gx@renesas.com> References: <87oa5umjoe.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Tue, 19 Jul 2016 02:53:13 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: KAWPR01CA0031.jpnprd01.prod.outlook.com (10.165.48.141) To PS1PR0601MB1451.apcprd06.prod.outlook.com (10.165.210.155) X-MS-Office365-Filtering-Correlation-Id: 75e5a8a8-3f0e-489d-17b5-08d3af7fd3c3 X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1451; 2:Hwwucw8CwvUZYKXy18r3Op8Z2XWQNcOtXx4674XXnuXmx/zvJkDXBegSm6HEXgm4t3RwwDbMIhvOk5RhQ5QxJyoJWlqrsWDHEq0HNLZtEKxfm43ZauZy0CqOueQAj8B1w3uevDUBHy9cYp4Dj92b9lJoQKlhIqQpLW/+n9GxLbHNjwyxiQN8477KX1OZczZE; 3:WbFbIUCG4e4Ep7nRldHLm80QUG1KOVtbwJqqruWreuDokl/SFe6T8XV07gnOApErSigF5b1vY+UeoMZoC7MNODnlKo68r6ArHlZAxALaHO8uFo4wAnVIV9vsIb/bbTsw X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:PS1PR0601MB1451; X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1451; 25:8S8Q+pBM0m9MTeoE/WycVDcCBv0UeAcNZ105fVZfsgY9FAWQRRQ5xOmry2LPOrb72AfYxJNNvDGKFF/F9q/QYd3VEYieKKQaLpaw6skMB+LH9kDsvOs2vzgfSbMVjzkTSaCq4HFvBgFs+U172BtS9mSA2KdYhFaaFzdBuLRBhWp+sV+qBHOkRs2AkQMe7h75a7NjxRK47WeBJI/Ou6yApig7Rp+iLGitUIoiD808Le4ki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OXv7li+Dy1WH6xKEuOen3C1SL3edgsst4ER/ULuIoS7YANZXqgpZysJ3sV6t3DicZ0ingaUWy8RVGb8dHGkUQsseT19+/UMTyK3WXI2FZzcbCESxvuRk2htRVujEx+OZbM2aqEAy/U2jjaYi/M6u/0L9ycP7tFJsITwhfqYSSf/Hot3QnsXFb+RR8yq3enbzJ1iQM/3hZf3+i4pCqfK; 4:lve56t3aBemXbCfgbDejOdC3XucOlP4a18hJhB6EpfhjbLrRGADjEEwPSEDJixEQ/Lvs48jdSLVJKVvrXl3eG6S+CdpLG93YE1QoWo3HKCj+YEvsedOtXymYpPPLpH+dbG2AxVN2kQNs6ZjAyNB73IaZzf+9KB2cdTqSB+rUdwmlZUkVN3dwXQggB917OovUgdLyWPJ/2zVTnJk7+bNiOOKuTl6v91jK5ext6654xdkaTJCJbGRoGnWHyO3gM9AC3aWY8NcUxx2BePz2f3YS1BbVEOApJpBpQUvyzh0e2hlmAyBlujzY8DwFvOjeYPxJA00EiYlCnzVtfdrCRlVOqgWmcx3bkuyg4UmnTihcvyzEwyKQl4Key0TA29xS2mXRZyOdadZxA++n73qXAVV6Jg== 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)(10201501046)(3002001)(6055026); SRVR:PS1PR0601MB1451; BCL:0; PCL:0; RULEID:; SRVR:PS1PR0601MB1451; X-Forefront-PRVS: 000800954F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(101416001)(53416004)(6116002)(3846002)(586003)(23726003)(229853001)(77096005)(2906002)(33646002)(4326007)(50986999)(76176999)(106356001)(97736004)(47776003)(4001350100001)(69596002)(42186005)(7736002)(7846002)(189998001)(54356999)(105586002)(81166006)(81156014)(8676002)(46406003)(305945005)(83506001)(50466002)(86362001)(110136002)(19580395003)(92566002)(66066001)(2950100001)(68736007)(36756003)(19580405001)(21314002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR0601MB1451; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; PS1PR0601MB1451; 23:CfJY7Ls/PQfiRbEOovQfICwDQuClSnwRoziMInH?= =?us-ascii?Q?xQZ/ArExpZxxKdKN4EW7oQ8Nrgk58Kmibp6Nzap0SJ921k2guUFUvDYXa5+A?= =?us-ascii?Q?XfzlDhzHuIT5PwmYCMJs9pfmoVU0tniJ/XSxxwU5/YXKY5VKFrrgnGGdgE7i?= =?us-ascii?Q?+b/a/2L8ArxOFxOnkulqNgGVREuXiv6VomAnGgfPheQbiCq7xHJ068Hz8TbW?= =?us-ascii?Q?UvAk+FtkcP9VxcXw3twCqYZQ7ILj+rkOmm5iCpjZDAXwFedwGLNdT9KerAW8?= =?us-ascii?Q?+mqPSwRMw+MOdDEhxt/JUkzS/5ObUQTX+fqVCWI9Z+3kdNMai4/tAq7EftLc?= =?us-ascii?Q?OpxlNNML4UWYywSaD+PoH9mOip5qjvN+6onaxT0zKXfI2CwX/ck7XzBzL4Qk?= =?us-ascii?Q?CpK+TyokMPDgmqyrzwLWzCU3a2XfyLKLVyzYN/wvq98H1iFc18qPRwGeRMAN?= =?us-ascii?Q?DDsQce7OfyjX3PUbiLDR079xfW9a9QRoeBoMgUjIX3hRZCBWc6mcnFE7F1iY?= =?us-ascii?Q?DGtbrukVA9+k79cVCl599KfLfJHVJ6G9pOHU7G+QXaguYOmsNch+xKGXPIti?= =?us-ascii?Q?q+dNfquWtUykV33skhlQEHVUk+18hcFHoV19uZ5C4kBJZETCLnXMJALX6IKB?= =?us-ascii?Q?0yphzlz3I2/DH/Uxg9RPhyFiwPYQXxpSOczcgHUeX+Jy2H1VjjjaWnfnFlKq?= =?us-ascii?Q?GA6qJx+6OCjxV+fTng2sI06O55WE+PTa2iCVinEBMh/m8vhe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+KyGiFmQQ1qZbiXXFInGeGLbvQ==; 24:zPLFh6dUz72k2qUq3re6JD/0RyWOBwwDMCuONSkZVCiSvHvyrAxusb5T1Q9gxqz0I6bn6KMNxKL4aPPNGn7uNaZD5thjT2NograPkpW1GA0=; 7:MyAUnm0NyXmdDd4E15HSQDpExg0+/QuzLL11BHgjCQgz65Df45X5fTz/a+eyRXVoBtM9Zu8zLd6L8Ly/tpBxW12NWCboVJdlaj7Y9Pts4az+d6iSJhx5PL1qM5Sy8dxYfsgpCQSfLGPLok/x62lIFyTVAV0Ilx+77mUsCHnkn+mpW+px0M9DH7nEHFRCcUDZcQbyNdiLuezrZ0+WC28l9fPmTUcKfeQdveX0pie3zhuyBa91RtXWvjhzfLU/D+k8 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1451; 20:taJxeIbtToMq6XQSCBS2p7Yh8O5tv1FUYAWSMMBkPJJ/00HQBgADaYuNeDVqYo9PolJ99ptyKqZPQHpjKmEaW6TwD0gAQzNwBiUgn2gDNSvHh5EOs6ToeFT5tx+FFvEq3Gsiq+AY0fW0798zLMfa81/jQrHLN1qDlc6w2vUJI+k= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2016 02:53:13.3893 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR0601MB1451 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 43295f0..b37c81b 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; @@ -370,6 +347,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;