From patchwork Tue May 31 09:09:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9144021 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 7F63360761 for ; Tue, 31 May 2016 09:24:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F0422793B for ; Tue, 31 May 2016 09:24:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6201528188; Tue, 31 May 2016 09:24:32 +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=-1.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD0072793B for ; Tue, 31 May 2016 09:24:30 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 08257266B24; Tue, 31 May 2016 11:24:25 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id D8B25266668; Tue, 31 May 2016 11:14:58 +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 3094D2667FC; Tue, 31 May 2016 11:14:57 +0200 (CEST) Received: from relmlie3.idc.renesas.com (relmlor4.renesas.com [210.160.252.174]) by alsa0.perex.cz (Postfix) with ESMTP id 38900266668 for ; Tue, 31 May 2016 11:09:11 +0200 (CEST) Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 31 May 2016 18:09:10 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id EA77649742; Tue, 31 May 2016 18:09:10 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id CCC42480A4; Tue, 31 May 2016 18:09:10 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id C7E5A480A3; Tue, 31 May 2016 18:09:10 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id UAC08250; Tue, 31 May 2016 18:09:10 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="212432323" Received: from mail-pu1apc01lp0024.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.24]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 31 May 2016 18:09:10 +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=HARy5Z/U5zWa2017uGqmBWiEJmG2vKFyLzjL1+flqbE=; b=Q0pO5EaTgYrsgfGtXUqaj3mZnwjgyJli5RuYYRqWTPA6fwpPD32XZtkqa+1Uzl/pY/2g/q9HCVvbmNjoARC0KccVLUsGMtLh/E9awHlRZCviQGZWh4MpS8gQ8fRYE1qzi34FMb5XWVsdWbKxGNj9F+habkOu0MYkiEzk+ActH4g= 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 PS1PR06MB1705.apcprd06.prod.outlook.com (10.167.53.15) with Microsoft SMTP Server (TLS) id 15.1.506.9; Tue, 31 May 2016 09:09:08 +0000 Message-ID: <87fusyr45m.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: <87fusysjam.wl%kuninori.morimoto.gx@renesas.com> References: <87fusysjam.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Tue, 31 May 2016 09:09:08 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR01CA0087.jpnprd01.prod.outlook.com (10.167.153.175) To PS1PR06MB1705.apcprd06.prod.outlook.com (10.167.53.15) X-MS-Office365-Filtering-Correlation-Id: 77f74c9a-f3b7-4829-11ae-08d389333972 X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1705; 2:o96lhXCGacEW77gFwBfMQD7XIxyjqtvdHeR7NUNTlZTGNHT+qnDvA4AYG/ViiruSOCRNj57yByEXwEsrXY1j5mz7W2fEsoz++lpcClldwiE/D83vUMSzksxOXcDaodgUwBetSijeC8efdWntnIpx9kFKB8Frh9YBxt4XhyBdnG6jNHgMegTApObaKkmSh+cZ; 3:Orno0Sp/GyrhteZeDA1gbVI6qT5C8zsTfOy1tUGl3p3p3FO7vOZBopTktkqTjIF/8vYc1m6cOfhBWe4Nof0oGhF2FS27RRb7RprhadPBCYyC7EcXjXLhdSaKkgoE6S53 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:PS1PR06MB1705; X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1705; 25:OusJ7EmKRCg0XAHUGODnR0jZsEVCUd6lBr5EsfmCNIMy3qx8PzBAvniwHIx2ZV5xEaZf6/gcowE5fYrU93CILy42zRj76fyV4Hwl4mcQkPmSjk4NDvYz40YV1e0v3ad6YbZrQIhb9mE8MulCIXtRzH0R+ELj8HrWUap8N3O/XFV81O3We23U4J91NSoyvz0ZRk4G4eMng0h0D6Tn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halFocUwKcldUSr1WEf5Hla8TtkBIttNuo3vOb6SWo7bfKIficKKb925jWlc9Z6PiN6eHZh7XHhUlaCZRu9KCs+qGaaOaD3f9gqEo93hnngvkwXx55Up8AGX+oBp1JxKcUdeWNI52kU5aPEnWpP6kN8AoklgoSEx109I8lFOMwn+znfBq+/dT0qI5zfqnuEUYb0A7dtiuWhc7lJjUWgw0Q3wyQN43ePCzuZLJWx+o3R3jEnjTYkYwI+Lj8V8eyDGzC3+9mH2eSuXbADXOZPBZgmDNqGXAc61pzJRDvw3CGGp2j8b4c97rl5RDfsKAo8xVFFr5FNz61mmw0iU2DTK6+AnNRZfDKu3SOoyMXuY389/C1EqHMPZwm5Hz/qrQ== 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:PS1PR06MB1705; BCL:0; PCL:0; RULEID:; SRVR:PS1PR06MB1705; X-Forefront-PRVS: 095972DF2F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(81166006)(46406003)(5008740100001)(19580395003)(4326007)(19580405001)(50466002)(36756003)(586003)(5004730100002)(6116002)(23726003)(50986999)(54356999)(76176999)(3846002)(77096005)(83506001)(110136002)(4001350100001)(2950100001)(189998001)(33646002)(86362001)(53416004)(2906002)(8676002)(42186005)(47776003)(66066001)(229853001)(92566002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR06MB1705; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; PS1PR06MB1705; 23:syxtJ/W1vr2F4iEs6XP+CSrJdyfUqNfh5r7D/P5XK?= =?us-ascii?Q?nH9OmZnEWb9COKD35Atr1BqWJ2q54lkE9L7952SjIXQFGiLfVYAXLe11dcG1?= =?us-ascii?Q?tPPvSgeG9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oft-Exchange-Diagnostics: 1; PS1PR06MB1705; 5:bPFsureRM5W+Knc2Di3FRgRz7LmHELx9NZrj0nsmYc4HbKUKmtyxW2DghKrh+lub8DV5R4gDatIG6gYlI0+ZJ7Z8IhjrUO/KbKuIauqPKjanfW+wPm7d5C97CSIqhxTxxBr6mi5M3cCmTSlGlMejsQ==; 24:MpEYynhYhPz9ZIY/R9M6nlchblKy36XNnefbJHOHIMXuGjx0xO6Jr47oC3ZsKFu+Q18msH6lXraCUDPab3cqKDUi3rKwrG5+RgfR3vaTttg=; 7:YislA718wisDbuDAsr69NTvTQP4SAw/rOOHk8RmM3YSrAUikmtnSRkX63XezDE2IIyLEDlbjnJqj8ddak1bop1LmhlN2cJ5FK+iAATm8Ff/Du8rU4KpST0kSk6Iyy9Ds1cY+Z/8lIbTs6bo10udlwzInCn4YE4fs/Il2cKVMg1iKsqXuoApL8TDVE4P/1hDf; 20:82RBSi5RmauJY69l/TJtCD07DU2IUvVtbzpXmJgW0munk3VxpfTWEMAK4ETR+dHjZE+g6tNfR8yMYkE08QVgb+HQrahtCUVb5pA/l6HQkHyZkHXV4OjpCl+7chPMJql9EMzb9xL/p6TcaJwcwklM+V3tdS66bzqWKlJ4OPhUk68= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2016 09:09:08.5736 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR06MB1705 Cc: linux-renesas-soc@vger.kernel.org, Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 25/39 v2] ASoC: rsrc-card: use asoc_simple_card_parse_daifmt() 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 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;