From patchwork Thu Jun 30 06:03: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: 9206653 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 B3C4E607D6 for ; Thu, 30 Jun 2016 06:03:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A59A7285B7 for ; Thu, 30 Jun 2016 06:03:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9924C285C3; Thu, 30 Jun 2016 06:03:44 +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 66AF02865A for ; Thu, 30 Jun 2016 06:03:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751034AbcF3GDn (ORCPT ); Thu, 30 Jun 2016 02:03:43 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:11355 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751203AbcF3GDl (ORCPT ); Thu, 30 Jun 2016 02:03:41 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 30 Jun 2016 15:03:17 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 8A9E049A5C; Thu, 30 Jun 2016 15:03:17 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 82AF048014; Thu, 30 Jun 2016 15:03:17 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 6DF8E480A4; Thu, 30 Jun 2016 15:03:17 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id RAL05412; Thu, 30 Jun 2016 15:03:17 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="214096178" Received: from mail-sg2apc01lp0243.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.243]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 30 Jun 2016 15:03:16 +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=HARy5Z/U5zWa2017uGqmBWiEJmG2vKFyLzjL1+flqbE=; b=gO7iH/2GcMA9srr34KM/94TkrEd1xF8YzxYgjasrMvBYm/xAn3wWaPachMEuDkSYnt2j1HyoLW7L7koPt5FfW/Dmf97k8vzyra2hQ/UDaIximfYLrvSTNafqMyrUonkh5B7wkZW5h3LveTt8U0M3NXEqDnhMTlbVr8z3z5uwNpI= 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 PS1PR06MB1706.apcprd06.prod.outlook.com (10.167.53.16) with Microsoft SMTP Server (TLS) id 15.1.528.16; Thu, 30 Jun 2016 06:03:13 +0000 Message-ID: <87twgb9q4j.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/6] 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: <87wpl79q79.wl%kuninori.morimoto.gx@renesas.com> References: <87wpl79q79.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Thu, 30 Jun 2016 06:03:13 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR01CA0034.jpnprd01.prod.outlook.com (10.164.162.144) To PS1PR06MB1706.apcprd06.prod.outlook.com (10.167.53.16) X-MS-Office365-Filtering-Correlation-Id: cc8b0ac6-13f8-4733-589e-08d3a0ac38c1 X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1706; 2:0Ve+Rqpm41NTg1uLa3zXDiOZVLACOeORjTB8CWxYzM4rPIUlo2DPx6MNfyia2VZM+ZLav4dDJTJbwcJ4y8GmO85s/FogyHlXJUXpxHXMq/MBPC8nQWKvmEkjDD1UACBufc7r3Itvi3AMS8koeDWpu7UmoHG6GZuQXfSgA+WqBtCjkA4Y5LIRY5aZ6l9IAx4i; 3:skAVtIBMCFWfwc4s4iFsrlTMI1MOPaOOiyRBfeJJiiSjIwEfJ0H0NTlin4VLJkPF/M5UCf232OdydnmwFVMIwe52sRJbgb5CBJo3bmDBZ3E5SXsY/XFxmdyvxWzscqAa X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:PS1PR06MB1706; X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1706; 25:xzBdnxXrlWiM+O1/xdgUFAm7uip5pCVBB9qoBpiDbqyQIXg83KdG1AfYGYexwzr21taed9qTD/BPlV1GbbStv9g2tWLG1YDxim5gbPjy4ax9y0zbXRmqoEsgSJDmXpep+m3pej8GAwhDutUlLPeIbdxs3LxdILICOrWbqDK57QrPtlHEO4hIDjr+dfW/9Xn2MjW5WGtuvUDM5JuToUZckf7R3seO2V7EkKzcHSuwJqHRUsMuOcH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+jDOpnzzwMYMqqg8RriQ9z6/gSBAbAgSCOHdKdxUv3ui7BiE9k2e1xtEhDqlikhW02sVQKGSRGRq/jmtlm5DFbtTM87ZiUYmxG/f3YXIl0fcN6uPrnfD1QM81MjZEnDP7vM3faQmD60GDe9k0S660PTAPteJRrcKsawWgYernkS7R; 4:9fLwebTSQwTVksrBYRlcU4Vb+TDKmcyn1iAC2XxFt852JA5D1HsrKG3Limd7mVetqLqBUZQ1jq8SiT99sAfLuBxYa0Tli0Zb6cifdmtRg5aNRgJoK32yQERc3qtphdbyDuQFlIHw/NOgXikLSdImxApeLWDzVKRXviGahsobjar/qDwffztfi6YeS9fP+Yma1CgF2/Uj4NyQuXoe8NCHKrkOUG6MJ/5fFZPAU7SoslGcca6Jg+pJqsA1AyP8s0KrFpShjwo1J0jKXBWEjZcUEIYDuDYHfZgDf2GHSY2q9xARyekwmjiL52j5qAZLNhzEdmGZmvhed6qUhItgO/GR8lzWGMG+PlCVa5Q1L06KDOHh4avtGOoKTz/yD1HJcFOaInLzuctc2+c/syr2PqWtgQ== 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:PS1PR06MB1706; BCL:0; PCL:0; RULEID:; SRVR:PS1PR06MB1706; X-Forefront-PRVS: 0989A7979C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(229853001)(110136002)(189998001)(106356001)(305945005)(81166006)(81156014)(92566002)(33646002)(7846002)(36756003)(4001350100001)(97736004)(86362001)(7736002)(586003)(8676002)(77096005)(23726003)(46406003)(50466002)(83506001)(2950100001)(4326007)(66066001)(3846002)(53416004)(42186005)(6116002)(50986999)(2906002)(76176999)(54356999)(47776003)(105586002)(19580395003)(19580405001)(69596002)(68736007)(101416001)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR06MB1706; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; PS1PR06MB1706; 23:sPJ+CP2jv0itL2m69NgBURp1Gn0RHTQDyEi7foeBE?= =?us-ascii?Q?R07n0l+k7scMFy2jWcBJfSQ/Lb42/+uYzjNSniV6wIwfPnTnjFxLyzljqm2/?= =?us-ascii?Q?fT+C5cL2lPlA62Y5AUDLoPLmMa1Fgqu7vy6WMpX2+5gn9AvgAeOFMMngMwYU?= =?us-ascii?Q?YWlRY6MRhlXJC60zKgtK4kC2bJ0dBUJwXduR6mQf5VvLmKICE94tjO5+j2cl?= =?us-ascii?Q?Pwex3LVsLqpFrVjwGoO9zzb/3q6tSO8oNfQYi8cal4OWzr7cto+znMZm1x+T?= =?us-ascii?Q?Jucr+/kypsvCObukx5UlsmCpgALePvJprSybnVoNbxjHc1w311k9XOVp9d+Q?= =?us-ascii?Q?mXRTeRIUaj5jSRZsdTS2jVhoJmhizc4ZARQyJf/jhDScmhJi5TnPS/mJi5+p?= =?us-ascii?Q?JtYNTQQv0ygKqdQ39MyRF21sxhJGA+oEL7IRXDZRIVefoY6s/0nY0PSux1wO?= =?us-ascii?Q?hlL+tx2Wejf8YhQWR4CrWta3pjzGrQWJKyY+77iJ9HuTKryCjmEwIxC+ClpJ?= =?us-ascii?Q?gd5vsjE4WGeK8TwfJ5nvhHxiegEW1dkUZ96k4tsXsu1Id/osokrG3a18c8/i?= =?us-ascii?Q?1rlcFlNbU3M7ZilIfTa/h7rf730J6iwjQQSiO9QKdGlXgit5GQec9/CIMRv6?= =?us-ascii?Q?Cbw1sdTFaOx3eLZ9WZCJEXksW94avEI3sLFdjBedJk01log0dAsy91hZVgCe?= =?us-ascii?Q?VVdX9ejBVq4KBCbcksr+WkxHbU3yE4FJ8gig5ZG0uftKEEoBPozGV9//XDIE?= =?us-ascii?Q?P1K2u8YBfC2A5SeaCIJ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IA4U7tN3imZTWYxloik+aRGg+btu77S1gLGFKqihU7L4fIF2BtmQFetw=; 7:6k+ngMWxlQImj/bcJq+WP7IoUaOKraxUUqCfk+3epiMzfRUXBHnhfQMAqevFrWTOTrRSRQ0Ebpqh66HfTAkBi3p76blaHJSfQTihqL826UXbkivI2BW88VBHHX885ey6VMaQB8+Vc3fyKM8wrf0zVebeErvWIDExbB8JnoGY8i0FfzAENbBZ0jai10XxLiSvGwUKk3Lph9M6VKFcJuZlHUaWYAgoUWrBSFo4gwg1Us3wbNu5J6LJuHwTEEUiuFtS SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1706; 20:PCxgUDgd81Ri+2/b6lJAvwURqvs1AxCkHnyIh37GB/db8cPCvYHyXjpJTJlCQ3g8fzGik0AlIjnz/Bps3ksPRo/OdkXGb08InNZZwxKBi45jb9Uj5QlqkC4R86CAZgFsKtS1oxOTmUij3hvJ6/PEhxnuLKutln+kEoIAVUfNfoA= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2016 06:03:13.2623 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR06MB1706 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 | 38 ++++---------------------------------- 2 files changed, 5 insertions(+), 34 deletions(-) diff --git a/sound/soc/sh/Kconfig b/sound/soc/sh/Kconfig index c9902a6..9311f11 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_UTILS 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 b85b5ee..c065a6d 100644 --- a/sound/soc/sh/rcar/rsrc-card.c +++ b/sound/soc/sh/rcar/rsrc-card.c @@ -20,6 +20,7 @@ #include #include #include +#include struct rsrc_card_of_data { const char *prefix; @@ -158,38 +159,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) @@ -357,6 +326,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; @@ -369,8 +339,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;