From patchwork Fri May 20 09:59:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9129099 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 C0DE16048B for ; Fri, 20 May 2016 09:59:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B33932793B for ; Fri, 20 May 2016 09:59:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A809027A84; Fri, 20 May 2016 09:59:20 +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 0ADF02793B for ; Fri, 20 May 2016 09:59:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753562AbcETJ7T (ORCPT ); Fri, 20 May 2016 05:59:19 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:57417 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752668AbcETJ7S (ORCPT ); Fri, 20 May 2016 05:59:18 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 20 May 2016 18:59:17 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 1E87050D32; Fri, 20 May 2016 18:59:17 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id EFB6A2806E; Fri, 20 May 2016 18:59:16 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id A8C702806D; Fri, 20 May 2016 18:59:16 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac2.idc.renesas.com with ESMTP id UBM21728; Fri, 20 May 2016 18:59:16 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211273449" Received: from mail-hk2apc01lp0211.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.211]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 20 May 2016 18:59:16 +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=8TTdGdKKkoE1uG4XaHnAqgT/LqmmxoTacJu/uWmB4UI=; b=O4NAVb5NDugWyKNjWuK41XTQg+H/Dq43296XfWdCtYkBvWhtTMApjMJ5baAt+/y+OpHIBqdlwg0ZBLPDOupGFkTeSmgyk5lFn7egHzTQQYqJ4AMs+OYnQpPHw/EvrOIVKc+bnLwy3amqILQH84qa8XrHyMYwP8wha6yX9Xih4+c= 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 HK2PR06MB1699.apcprd06.prod.outlook.com (10.167.73.13) with Microsoft SMTP Server (TLS) id 15.1.497.12; Fri, 20 May 2016 09:59:14 +0000 Message-ID: <878tz5qcnb.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 33/49] ASoC: rsrc-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: <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:59:14 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OSXPR01CA0049.jpnprd01.prod.outlook.com (10.167.144.29) To HK2PR06MB1699.apcprd06.prod.outlook.com (10.167.73.13) X-MS-Office365-Filtering-Correlation-Id: 6f061c92-a487-4606-cec3-08d380956692 X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1699; 2:o/j60cFNCF/Mw/NnaN/bKBk18LmfOu69/GmcCIWemP12LvnL61tawvKuiXdbgyswfEiLFkJMJ5/qoFRgM8qzchti7ESEpWtjKm/CuIMczTdG1ouru8DP9OGybDudV421mHGaHEtLYunrr+PtFow8biifFRKQSuFeHSo3likHIW3GkO81bRk8ow7nYMjyuLiu; 3:3Yc9LpUn2vl1Lqj/MtDSIf+nIEvFzX4+onbF3xQ1kpsGZf8+UUEWx9rDyXyva0BhwE44tKSfT3sJSti8O5lxmHQ3DtzxItYrRLCBOT+BU7MjSK4fnozdWhGIGTsawu8g X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB1699; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1699; 25:ERVsixF12KOPekb5qkfhST6Vl4kd3AriUSH5+iGoWuoD+u7DYZXIYsCw2kwgPsoqjEUuu8GRuY8W2/Gu7u1uXDnj8ijxSpLWty234KxX3EAkOtElFnM/KtIIlFirER+/71pa6Y9t3UrmxjHk3ZSTjkTuKsW2uUguEv7WSP7dw3nO8ST7w4d9Ud7y7bJ64pJVPJ0pY9TNsLDoXNXAko9aVcM4ElEJh8DQjXwOkmQJMTMaPIqGa4O47GWjigSnb1ppoAhBBljP7wD6pd3PvNe8X3/pvefA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DwgdTa3UbbFqc2DLA6Tpv6iOlL1Rk2agz43wqP4haUlQP0zTQn9bk2Kjpkn+GCs3awZNcUMdWvPEEC0P9OvIy8maq3jPZYzaXEdeu6AmmWxIOjH4ZXWsMV4G0nkhXLzPphWLQ8RiajmT7C8sTDmF4vB26PRPcLXphXUNZhBOzP+zvvfU9H/q2dXOvR/OrkCAxo1agz9pQ7wZwS1nU6gfjLwbhL1vOi0mYpkcdTwdYsU5qP/CmGkI24emjcY8d2o1AFwLorAlaZ9BWw8bZt+w6wcvKaNGRCp7emBDPS3h0jIjTT3UM9z6ekL6xAAk/wqYpX7qKw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:HK2PR06MB1699; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB1699; X-Forefront-PRVS: 09480768F8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(86362001)(19580405001)(92566002)(8676002)(19580395003)(83506001)(46406003)(66066001)(47776003)(53416004)(4326007)(2906002)(81166006)(42186005)(36756003)(189998001)(50466002)(2950100001)(586003)(33646002)(77096005)(50986999)(3846002)(54356999)(76176999)(23726003)(229853001)(5004730100002)(5008740100001)(110136002)(6116002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB1699; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1699; 23:14hAPIlozpDdM4nv2eH1O+BHGbumjIrKWFIx5BpfnuQ3nrS7RinFyTveo1BDQTNiXaLJqYJ01oeAgLJ3yPwRpE/+hegayCFhPWuClPMhgs2yck1XyTE2e6WPk2vGJ8NFmUM3LrW38ChTpa3wRUfZ/0rKMDSIRnfmEqtJuZG07BxMvnb8pzCXDtGcq2dx9r4KKi6IxC6JN8e0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V/3bY/pqcfYEJI7pr0XZx7W4IWqnz0YlMTdDJ0cEr8tsq7wD47Gikvhur0fy5Zi0TBkX5CZl0y2GQa3d8miQJc/Yf8wOly0K1LNN2CYfaYDx82deQHKrPocjlzocAnRIM4X5gCCDhFyaBNZ; 20:N3m0Vgps413Xe0gazZOUnCOBqRTTDl3KdCP9nUPlg0vlKNiupe8/Cv14sXX8eJUQrHPEa1vP+Nu6rNQeyKJO5GcZFlg7xF1xI9cTqpf+lFalBFSkR0KNmnLONF7UTG6Y73PKl4M9JPcdTb4wgpufLW2B+CyfSGAeNduZPKk9RUA= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2016 09:59:14.3438 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB1699 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/sh/Kconfig | 1 + sound/soc/sh/rcar/rsrc-card.c | 39 ++++----------------------------------- 2 files changed, 5 insertions(+), 35 deletions(-) diff --git a/sound/soc/sh/Kconfig b/sound/soc/sh/Kconfig index c9902a6..d34d5ed 100644 --- a/sound/soc/sh/Kconfig +++ b/sound/soc/sh/Kconfig @@ -44,6 +44,7 @@ config SND_SOC_RCAR config SND_SOC_RSRC_CARD tristate "Renesas Sampling Rate Convert Sound Card" + select SND_SIMPLE_CARD_CORE help This option enables simple sound if you need sampling rate convert diff --git a/sound/soc/sh/rcar/rsrc-card.c b/sound/soc/sh/rcar/rsrc-card.c index e17bc2e..0533518 100644 --- a/sound/soc/sh/rcar/rsrc-card.c +++ b/sound/soc/sh/rcar/rsrc-card.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include struct rsrc_card_of_data { const char *prefix; @@ -156,38 +156,6 @@ 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 device_node *codec, - struct rsrc_card_priv *priv, - struct snd_soc_dai_link *dai_link, - unsigned int *retfmt) -{ - struct device_node *bitclkmaster = NULL; - struct device_node *framemaster = NULL; - 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; - - of_node_put(bitclkmaster); - of_node_put(framemaster); - - *retfmt = daifmt; - - return 0; -} - static int rsrc_card_parse_links(struct device_node *np, struct rsrc_card_priv *priv, int idx, bool is_fe) @@ -355,6 +323,7 @@ static int rsrc_card_dai_sub_link_of(struct device_node *node, static int rsrc_card_dai_link_of(struct device_node *node, struct rsrc_card_priv *priv) { + struct device *dev = rsrc_priv_to_dev(priv); struct snd_soc_dai_link *dai_link; struct device_node *np; unsigned int daifmt = 0; @@ -367,8 +336,8 @@ static int rsrc_card_dai_link_of(struct device_node *node, dai_link = rsrc_priv_to_link(priv, i); if (strcmp(np->name, "codec") == 0) { - ret = rsrc_card_parse_daifmt(node, np, priv, - dai_link, &daifmt); + ret = asoc_simple_card_parse_daifmt(dev, node, np, + NULL, &daifmt); if (ret < 0) return ret; break;