From patchwork Fri May 20 09:57:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9129091 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 4AE966048B for ; Fri, 20 May 2016 09:57:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DFE12793B for ; Fri, 20 May 2016 09:57:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32E9D27A84; Fri, 20 May 2016 09:57:41 +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 BDE472793B for ; Fri, 20 May 2016 09:57:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933426AbcETJ5h (ORCPT ); Fri, 20 May 2016 05:57:37 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:64479 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933323AbcETJ5f (ORCPT ); Fri, 20 May 2016 05:57:35 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 20 May 2016 18:57:29 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 245A652F6F; Fri, 20 May 2016 18:57:29 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 072652806E; Fri, 20 May 2016 18:57:29 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 013502806D; Fri, 20 May 2016 18:57:29 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac2.idc.renesas.com with ESMTP id UAJ21206; Fri, 20 May 2016 18:57:28 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211273345" 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; 20 May 2016 18:57:27 +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=0uvoCAw/GG7DfogPGpGv7kLZgDMALHNqtMLhIQXIncI=; b=FxUJhoyHOeJfxyF/1qZb2lP7qy4snoizAeYpSwFRxQWWY2scAWOe5x/n9qUJOjfVhSaVmbGNufDbVQFR56jSSqbEXcsmUdOIcatIurYwWJVCcSjAFhdPe/iUxsav2ZDd4IFxAgMHcDpgDhLiWw4aqPB8Jrpps/tZ8s50ou5MFBQ= 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 KL1PR06MB1704.apcprd06.prod.outlook.com (10.167.63.18) with Microsoft SMTP Server (TLS) id 15.1.497.12; Fri, 20 May 2016 09:57:25 +0000 Message-ID: <87eg8xqcq9.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 29/49] ASoC: simple-card: use asoc_simple_card_init_dai() User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown CC: Linux-ALSA , Liam Girdwood , Simon , In-Reply-To: <87lh35rs8w.wl%kuninori.morimoto.gx@renesas.com> References: <87lh35rs8w.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 20 May 2016 09:57:25 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0080.jpnprd01.prod.outlook.com (10.165.51.168) To KL1PR06MB1704.apcprd06.prod.outlook.com (10.167.63.18) X-MS-Office365-Filtering-Correlation-Id: 2dfa6159-529e-440c-0d8b-08d3809525ab X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1704; 2:+9Zsj10DgO8xTMhSFqAsn8OyBgrFW72fScCoQ2Hj7C4EjKfGATROWHyIMofMbttv30ppn4JJUI16kqjwZFpeCsIJpF0InlGAX03GsMy4d6eqOXSwM9oiGLgKC8aO+k5Q5Z9Ze1rIdnuz26vgvAsfUUiwi3t20GDxkC6erl5jDMPB+EEfF6wnklgx119I6otO; 3:XB38NQRLm5QXdhPq6I6MMDy/acYCYGlm0Jll2mOuotVCvmcF2Dvk7mU4b4iynB0fJPy4bucP92WQ56YpRUnLXiBjaW0eHHqUxAcNnbDeDaaMXw+LCW9VzRJy5NtabHPu; 25:2xs6EpQaCkXjDbvMRMC0zWuP+GMWVvN73qOWT7qdD63hsGQUopq1dxl0EAVkYWjQ+8yHajHroGDkiwAfI968okPXtyZaHPFv6hlrJkkkNeRRnDQR6JRWv+738Tz91DGriaFHpVjVz1HKTWoeu5BQx61X+11Ory8vCAV6ZdlP5HavZTEzUiQ40kWRTyF5vV0VCzEePFfo2/Xj4A+Tl1EdGpnNmJH7GnfFBZo4Ndf7FFsrz10k9DTToi9Y/UK0ojs+eWxNWt1cY/ysRAuyv4LpcVM+caSsetaTupJw+MCe2jWB3D3qmooZRq9bsuvh7X9LyYYwkE2uR73QAqqf+jNJsa9yaBHUNXceGPqD+iMk2sOGQYHIcq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+azoYlaA== 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:KL1PR06MB1704; BCL:0; PCL:0; RULEID:; SRVR:KL1PR06MB1704; X-Forefront-PRVS: 09480768F8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(2906002)(42186005)(33646002)(50466002)(4326007)(189998001)(46406003)(3846002)(83506001)(19580395003)(53416004)(19580405001)(81166006)(92566002)(54356999)(76176999)(586003)(6116002)(110136002)(50986999)(23726003)(229853001)(5008740100001)(8676002)(36756003)(66066001)(2950100001)(47776003)(86362001)(77096005)(5004730100002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1PR06MB1704; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1704; 23:xsWndZieMul20R4a3X3gff7IQR/OFRO2Z/1a58rEMrvz2iUpgue0/llQ5Myt7Rm2wKnaAsox4y4yX7U27FxcXRpt3aQuv/CyNemgZymlGO3+auCMVOcHbSA5Tpg7PtLWLDEXH4LQ0NHsYNvrxxwIEpBhgfXIlmXBQ5a/rOBXtMhHFmAnAFmYA/ebOXrLufr+fFIzq5XcKQo54btD1GJOLipkFz77jz187RN2VveYOw5NgyXV9pa4JfaXHPcVg6rNNAxKFcU3ixI6NYSZt2liqMfam9TdXmVSKgCHxxjlJKCzpKx5XySMWtuB7+WO5Z0lGAiFtQ1HyIj/IxPqKEmiufUUWpyI7qHEgJ70wWe2DAdghrcCf+2ecZWiDVnWhw/zXa5yeDdOK0ZRHxeI90l3YK/fv7/mG51tGxINcSqez6XqkZGH61g6PRxMkoE8VmTB2b1+owhi9/689nKoR+sm1AFNmt09PFeAhVszIGamfEMjKoecnke42M/U2OBuiEhm2U3SyUTJoWQhpXTvqi1lFsK2/xq51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agnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2016 09:57:25.0289 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB1704 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 | 38 +++----------------------------------- 1 file changed, 3 insertions(+), 35 deletions(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 2aacff7..cde5d50 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -110,51 +110,19 @@ static struct snd_soc_ops asoc_simple_card_ops = { .hw_params = asoc_simple_card_hw_params, }; -static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai, - struct asoc_simple_dai *set) -{ - int ret; - - if (set->sysclk) { - ret = snd_soc_dai_set_sysclk(dai, 0, set->sysclk, 0); - if (ret && ret != -ENOTSUPP) { - dev_err(dai->dev, "simple-card: set_sysclk error\n"); - goto err; - } - } - - if (set->slots) { - ret = snd_soc_dai_set_tdm_slot(dai, - set->tx_slot_mask, - set->rx_slot_mask, - set->slots, - set->slot_width); - if (ret && ret != -ENOTSUPP) { - dev_err(dai->dev, "simple-card: set_tdm_slot error\n"); - goto err; - } - } - - ret = 0; - -err: - return ret; -} - static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd) { struct simple_card_data *priv = snd_soc_card_get_drvdata(rtd->card); struct snd_soc_dai *codec = rtd->codec_dai; struct snd_soc_dai *cpu = rtd->cpu_dai; - struct simple_dai_props *dai_props; + struct simple_dai_props *dai_props = &priv->dai_props[rtd->num]; int ret; - dai_props = &priv->dai_props[rtd->num]; - ret = __asoc_simple_card_dai_init(codec, &dai_props->codec_dai); + ret = asoc_simple_card_init_dai(codec, &dai_props->codec_dai); if (ret < 0) return ret; - ret = __asoc_simple_card_dai_init(cpu, &dai_props->cpu_dai); + ret = asoc_simple_card_init_dai(cpu, &dai_props->cpu_dai); if (ret < 0) return ret;