From patchwork Mon Jun 15 06:23:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6606321 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7EDFBC0020 for ; Mon, 15 Jun 2015 06:27:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 954182056C for ; Mon, 15 Jun 2015 06:27:37 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 5756D20483 for ; Mon, 15 Jun 2015 06:27:36 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 618ED2610A6; Mon, 15 Jun 2015 08:27:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 4D0A92612D0; Mon, 15 Jun 2015 08:25:08 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 07B362612D0; Mon, 15 Jun 2015 08:25:07 +0200 (CEST) Received: from relmlie3.idc.renesas.com (relmlor4.renesas.com [210.160.252.174]) by alsa0.perex.cz (Postfix) with ESMTP id A184A261489 for ; Mon, 15 Jun 2015 08:23:33 +0200 (CEST) Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie3.idc.renesas.com with ESMTP; 15 Jun 2015 15:23:32 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id BE3704A5B0; Mon, 15 Jun 2015 15:23:32 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id B41041806F; Mon, 15 Jun 2015 15:23:32 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id A114B18071; Mon, 15 Jun 2015 15:23:32 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac3.idc.renesas.com with ESMTP id RBF17783; Mon, 15 Jun 2015 15:23:32 +0900 X-IronPort-AV: E=Sophos;i="5.13,616,1427727600"; d="scan'";a="189472444" Received: from mail-sg1lp0086.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.86]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 15 Jun 2015 15:23:31 +0900 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; Received: from morimoto-PC.renesas.com (211.11.155.132) by HKNPR06MB308.apcprd06.prod.outlook.com (10.141.37.28) with Microsoft SMTP Server (TLS) id 15.1.190.14; Mon, 15 Jun 2015 06:23:30 +0000 Message-ID: <87ioapv6eh.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown In-Reply-To: <87twu9v6kn.wl%kuninori.morimoto.gx@renesas.com> References: <87twu9v6kn.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Mon, 15 Jun 2015 06:23:30 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: TY1PR01CA0002.jpnprd01.prod.outlook.com (25.161.131.140) To HKNPR06MB308.apcprd06.prod.outlook.com (10.141.37.28) X-Microsoft-Exchange-Diagnostics: 1; HKNPR06MB308; 2:0i8vJhytVDgwkabU7a6XgZ1D4t/i5ZN/kDrhvQZ/WIU34/pta4jdtepexOrpTyBh; 2:EB8tv4qyHC9A8RpMSlvQQuVLlRMIRQ5VGPAuTXaigb9TKqFCbnTdbvbY+CZ9n+hnQYeO3gHUuf7RQTQbFVzdOTLB9V4Sn4wRYJOZl3x24uS8Mulja1+McoiOu2KJu1F8RodFkdCU1XXQqbJXNMFF6w==; 6:qCqowTaUMYAWqXZQUMZJw5V55AnnzpgfH9bmDBK3PbkIHN1ODv/JmoHa5ZgZS5zk+Vst+4gkKoXpJ/JSA0rlgvC56rwV0KyxHDhDnO8LeLwSGMbdY6GvjbJpdJO/5KgitLNrRLzuVxuhX43J4FqQZCb6tL03u1ZT1W6r0p/pHlpAh1vWTtIDANI7lH7WUYEkFGqOYYKJO1hJTcW57FNyIBxOFO3rwk3x6xbjTA9hUlFaj3nE30e2z76u8GFNNaWQ7VPpnZ3Yife4QCSH51KwrpS/t7x36i4c/YwwttxO2J/QIhZBglwMJ1GUMTYX/2haNV50/O6CDk9O9Fu35hZ2Y/ibSUu2ZSQbcj2+pMMcwo22gS5yi6COCBEPHrkI/B6OE3Y7GmcCLJXDqXc+KjNuxPPWD471SMuYqOiOb1X3zPfC8c6lWVG1R+vLtVUh9RHVsORfODHwLBvQLJt0pCMM27XcqmVLYei62jNbsAA0sZ8g5v2EK/a346r3i5WbGlPJ X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HKNPR06MB308; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(520003)(5005006)(3002001); SRVR:HKNPR06MB308; BCL:0; PCL:0; RULEID:; SRVR:HKNPR06MB308; X-Microsoft-Exchange-Diagnostics: 1; HKNPR06MB308; 3:3qmhynFPO36HtQEBGfS6vOrCq51KmmxbXYlp23iKDHT9Oey8+y+REjT5IJ+xqB10ab5QDbD72xS/YUZUqWXotMKZdJgAKxcjDND84yTjBqj0/7pId19KRG3XES0zAcFlVR8h5vyghdwIMWkkenIww4ODXfgJLJKY3gCwnWR7LeI6E0X3dY9VTJMWwdlsTHwXVvEkA1ULyjvBzbPcWxsXhwqII0NIev4V67hFGw3MQGtXTFOwBshujzhO76tUD0k+p72XX9PCFrPZfudKnoo62VI0WJiEkE6xYjFnT8VVs+A5U/Eoy5XCzdrQW1BC8zTk X-Forefront-PRVS: 0608DEDB67 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(46102003)(92566002)(33646002)(229853001)(47776003)(50986999)(76176999)(66066001)(50466002)(87976001)(23726002)(19580405001)(19580395003)(83506001)(54356999)(4001350100001)(62966003)(77156002)(122386002)(40100003)(77096005)(2950100001)(189998001)(36756003)(110136002)(5001960100002)(86362001)(5001920100001)(53416004)(42186005)(575784001); DIR:OUT; SFP:1102; SCL:1; SRVR:HKNPR06MB308; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:; X-Microsoft-Exchange-Diagnostics: 1; HKNPR06MB308; 9:sX8IwJvNI72lctTxJ0El3JibOwv+3OrjgMFv789otCugUgUzJ6mKksHhEeQlYBHXgfF5QUhZ4jyxIZ31hYzArVtLv9p9vLFtalMSyWuUEFIhL10qUYncx/9PbdcT5s64ZO0WSD5+IxlV2zXFi2LMvCS8lfIGIwuLsKTQyuFxud5U4EZk/SbD66kDh7YiXfE45F0NX0HDFTp9CU9W7oMt+ymmcER9nGLnAKsFY23fUTs2qwDqGqvkr372JkMtfsCJXszA1uSh7dfsrCyuRjBzUpGDUYTr/IeTJ/2u+ujn241bSYbZEF4a2P+M/sS/RpY+6sa7iTMTVO6sQIcOk3onFGobU/Uw/xxbIncaHtfp3HbtLSpa5RFxnmcSQEOqn3+8AKlr0GIBJdLh1bscY0lVSQ6uwLktOz1xJ4zQAw215/YGZJCoZyMs+cOO5o+1ieg7SetjTiT+eROZheRHiS9Cu2YTTf2WFibX3uXFHJdkCyytZB+HSvnXlXaFwB4mQFGQVsxtFdgs9MYTPT1Z44rp/D5VR027QHKaqLZJou5Z53NGurccCc3ZJndy3HGHgLY1lNGI2qVqBT5JX4/BAwIPgcSdPMhgesc9g97Kkob+FCbBja//Nh0azqzMnIFke1jjJh7uMclKbfOpGzWBZuwV0+6/8A+/FcGNbWRqxX1VLou2ynvbmvjO2yTjBvE9D/MfRC6NHS00VljlVd/UGWYdr0IAdivBY8r5X6HNhGnymcGjkQW0ZvHUla+pcu82tNlT6hBOH6ZL3+m5bDJRBws0hQpzLfLrsZo6+/cuFfHahUjbxhmSpaJ9uBuCL9uA9PI/hHrDl96VSaGIBa21librwlVxE7TfR578K1J2954e2/u2KPlopxzdpgHfWkCsBmJk X-Microsoft-Exchange-Diagnostics: 1; HKNPR06MB308; 3:Ei+YqNGWhMEzarCeUUYDWIxcpSMHGPaM0srDEGgKjziP2mJkgkx37nC3kAHPfP4HNDGeZ4bns7LxP6Fl8oeIQfCCh0oXI1RzTHqiQv3wx33ENCsAlK5238udxH4XWlcP2wFxzFHffwwfqP/ssT/RVg==; 10:TqkBFRW6Fw0k73pXOiijPv7Xs6PPkYBDDtsIbZ76BEhv5b4rywOKEfLIrIqfLM+JjLXp9MOeGLTx7R5Z1x7PCiNMipZYsxXQnGw7xLuhVy8=; 6:m1Cy/tcIU6B5wYZ3vgVrjGmiaQgBKgVAuMngTlHAN+/7TNzsC8louGToykDV8Z9bvn5oMoicPa/evkfCbEL/5XHy8I8bdFQlJDk6VdGvLo0yOGkXyMDm6Klx/Vv3bcZITIZecUT59/Hf8Bqe87KiJg== X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2015 06:23:30.6471 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKNPR06MB308 Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 08/21] ASoC: rsrc-card: move rsrc_card_parse_daifmt() to upper side X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto This is prepare for DPCM cleanup Signed-off-by: Kuninori Morimoto Tested-by: Keita Kobayashi --- sound/soc/sh/rcar/rsrc-card.c | 70 +++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/sound/soc/sh/rcar/rsrc-card.c b/sound/soc/sh/rcar/rsrc-card.c index 8162b7d..d0d74b5 100644 --- a/sound/soc/sh/rcar/rsrc-card.c +++ b/sound/soc/sh/rcar/rsrc-card.c @@ -171,6 +171,41 @@ static int rsrc_card_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, return 0; } +static int rsrc_card_parse_daifmt(struct device_node *node, + struct rsrc_card_priv *priv, + struct device_node *codec, + int idx) +{ + struct device_node *bitclkmaster = NULL; + struct device_node *framemaster = NULL; + struct rsrc_card_dai_props *dai_props = rsrc_priv_to_props(priv, idx); + struct rsrc_card_dai *cpu_dai = &dai_props->cpu_dai; + struct rsrc_card_dai *codec_dai = &dai_props->codec_dai; + unsigned int daifmt; + + daifmt = snd_soc_of_parse_daifmt(node, NULL, + &bitclkmaster, &framemaster); + daifmt &= ~SND_SOC_DAIFMT_MASTER_MASK; + + if (!bitclkmaster && !framemaster) + return -EINVAL; + + 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; + + cpu_dai->fmt = daifmt; + codec_dai->fmt = daifmt; + + of_node_put(bitclkmaster); + of_node_put(framemaster); + + return 0; +} + static int rsrc_card_sub_parse_of(struct rsrc_card_priv *priv, struct device_node *np, @@ -266,41 +301,6 @@ rsrc_card_sub_parse_of(struct rsrc_card_priv *priv, return 0; } -static int rsrc_card_parse_daifmt(struct device_node *node, - struct rsrc_card_priv *priv, - struct device_node *codec, - int idx) -{ - struct device_node *bitclkmaster = NULL; - struct device_node *framemaster = NULL; - struct rsrc_card_dai_props *dai_props = rsrc_priv_to_props(priv, idx); - struct rsrc_card_dai *cpu_dai = &dai_props->cpu_dai; - struct rsrc_card_dai *codec_dai = &dai_props->codec_dai; - unsigned int daifmt; - - daifmt = snd_soc_of_parse_daifmt(node, NULL, - &bitclkmaster, &framemaster); - daifmt &= ~SND_SOC_DAIFMT_MASTER_MASK; - - if (!bitclkmaster && !framemaster) - return -EINVAL; - - 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; - - cpu_dai->fmt = daifmt; - codec_dai->fmt = daifmt; - - of_node_put(bitclkmaster); - of_node_put(framemaster); - - return 0; -} - static int rsrc_card_dai_link_of(struct device_node *node, struct rsrc_card_priv *priv, int idx)