From patchwork Fri May 20 09:50:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9129065 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 44CE560762 for ; Fri, 20 May 2016 09:51:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34C0F1FF6C for ; Fri, 20 May 2016 09:51:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 26F1B2618C; Fri, 20 May 2016 09:51:04 +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 7C2531FF6C for ; Fri, 20 May 2016 09:51:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933059AbcETJvC (ORCPT ); Fri, 20 May 2016 05:51:02 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:15112 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932816AbcETJvB (ORCPT ); Fri, 20 May 2016 05:51:01 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 20 May 2016 18:50:59 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 955A450898; Fri, 20 May 2016 18:50:59 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 78ADD2806E; Fri, 20 May 2016 18:50:59 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 73A972806D; Fri, 20 May 2016 18:50:59 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id UAL18813; Fri, 20 May 2016 18:50:59 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211714015" Received: from mail-hk2apc01lp0210.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.210]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 20 May 2016 18:50:58 +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=wgdgYvC0ZFj2H1OxzRYnBaK4UrUo9SgHEPMp/C0oAfY=; b=hU4dtKqP8SIt/RR8+tMmESHxVC/Z/U4FyFZQrbEoijeWcBMbmiVXhGHHbH6eW1n3C0635YDanUwyXFv9AuQMcqEi0uH9zzqhKyFlk+WEwrT9tEm9gT5bJbrj2T4ugc8cUF5RxQZG9uGyCNxrSXYIZSLAzyMe0wX1oSvTtYlvYJo= 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.501.7; Fri, 20 May 2016 09:50:56 +0000 Message-ID: <87shxdqd0y.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 20/49] ASoC: simple-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:50:56 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TYXPR0101CA0009.jpnprd01.prod.outlook.com (10.168.40.147) To PS1PR06MB1705.apcprd06.prod.outlook.com (10.167.53.15) X-MS-Office365-Filtering-Correlation-Id: 159bb7fc-d655-402c-6009-08d380943dfd X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1705; 2:IpCRsgKI0sDtj0Ir4kTYqF8+IyEjpr/h/DHcSf/jr5aZENhHET9bIogplg4g939hrLLm9/bwoLwB4DScNZ3QPXpS1Pzm8jweWGZ9YlcxMHE/rHXfUndazWAu3Bslw3Rn5u2Ufv6YGBHpC9GxFvlwHwGdbVDIoHBfgh7lD3pKaXIgmeaD1B2KGtaig1ppi3Q6; 3:TXSt/2b9F52sVJZejiSq8Nx3qM9rgaNAX5EGB/cZQpDyAqMaHl78uMjvpWmz8ZjjZVYrDnckUA0qu7vCpLDX1PLY8/6hYvJmDZKpZ4rQME5QMPpLi1st2r9jay0fvCg1; 25:spH1CpvqeYbncgv5205OHqQrRD19B6ZxYYuXAtmo89qiSTmO6YWP5tQOTg+gWUoMXpJwvFJoMGSMTWpKRGHW8jMqoOYVBcCdrxgA4enDnZWKM/mvkic/CUbK3bJVvTYhkuFSoUSLYjYRvaW19sLeBbyVzjvS1LUorXWRMGlONT0T36/sx4ENQvKwUKqfc+Im9RE2gIy3XBlL+3XPFEehJJHe1DpryHAZLpqS418/oOXGsxkxzlSjwCnpoHioxJseP2eikmT0M0Tl2URq/HB6bgpmOUZAns25s0HADCOSGpSVxa73HRkDzEPbuQTcH37v8O2jabAd6SzTuts9PThTQCGckiXLrfVEQWSoOoj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+Mzw== 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)(10201501046)(3002001)(6055026); SRVR:PS1PR06MB1705; BCL:0; PCL:0; RULEID:; SRVR:PS1PR06MB1705; X-Forefront-PRVS: 09480768F8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(46406003)(4326007)(5004730100002)(5008740100001)(229853001)(83506001)(33646002)(23726003)(2906002)(3846002)(6116002)(50466002)(586003)(66066001)(47776003)(36756003)(2950100001)(81166006)(53416004)(8676002)(77096005)(42186005)(110136002)(189998001)(92566002)(86362001)(19580405001)(19580395003)(54356999)(76176999)(50986999)(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: 1; PS1PR06MB1705; 23:tuU4WlGAirR217MZlbZ2PfO/eU9WBGhiLLcswU5G1Ugmh7uU/qgzsRkA4inpKmDeXlun7GK3YTZm4uUq4O7NbqCDTgYVoDLx2G0KsG0noZ4BgBxoX1hVCewbd94J71EZFyoXurPXWE3n7qQNGNH9TjgWFNnP4k4+CZuWUp/w3sG4fDvATBArMDM76lvWQJXbcu525eaCisGjoj274L1trt5YiH7S3YDhpDwhxQ3fz+15GYuM/jVqb4ZNCKqB8VuaRT15yfbnr61ty2l3oNH35rhUFKEUPhwwKgzS8n/F6oCO4TB2r0Uj6sYR5sO5EKPCUwgQQlRtFGm1x/K1TLJCRsI6X3lUZitBQB5vTsWNv9ZW+PeCowUlc9mEDg89mKMmuAXPZQfRB3rKym6fo+XUDDnC/DRhZgcCUpUarKWXGpm8nG5LjUEADISFrzBzTqQkHYTCmzlukfpaFGAsvWpDMuk7AkewAjhsAmixgX9l7THAwY8EXm3T1fmveMw5C04LypQidNVTWmU+sqbouDRSYm/EqlOfVfPAg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23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2016 09:50:56.8996 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR06MB1705 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 --- include/sound/simple_card.h | 11 +--------- sound/soc/generic/Kconfig | 1 + sound/soc/generic/simple-card.c | 46 ++--------------------------------------- 3 files changed, 4 insertions(+), 54 deletions(-) diff --git a/include/sound/simple_card.h b/include/sound/simple_card.h index 0399352..27ff63a 100644 --- a/include/sound/simple_card.h +++ b/include/sound/simple_card.h @@ -13,16 +13,7 @@ #define __SIMPLE_CARD_H #include - -struct asoc_simple_dai { - const char *name; - unsigned int sysclk; - int slots; - int slot_width; - unsigned int tx_slot_mask; - unsigned int rx_slot_mask; - struct clk *clk; -}; +#include struct asoc_simple_card_info { const char *name; diff --git a/sound/soc/generic/Kconfig b/sound/soc/generic/Kconfig index 59c2e66..441fc9f 100644 --- a/sound/soc/generic/Kconfig +++ b/sound/soc/generic/Kconfig @@ -3,5 +3,6 @@ config SND_SIMPLE_CARD_CORE config SND_SIMPLE_CARD tristate "ASoC Simple sound card support" + select SND_SIMPLE_CARD_CORE help This option enables generic simple sound card support diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index f9fc686..c67d94f 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -281,48 +281,6 @@ asoc_simple_card_sub_parse_of(struct device_node *np, return 0; } -static int asoc_simple_card_parse_daifmt(struct device_node *node, - struct simple_card_data *priv, - struct device_node *codec, - char *prefix, int idx) -{ - struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, idx); - struct device *dev = simple_priv_to_dev(priv); - struct device_node *bitclkmaster = NULL; - struct device_node *framemaster = NULL; - unsigned int daifmt; - - daifmt = snd_soc_of_parse_daifmt(node, prefix, - &bitclkmaster, &framemaster); - daifmt &= ~SND_SOC_DAIFMT_MASTER_MASK; - - if (strlen(prefix) && !bitclkmaster && !framemaster) { - /* - * No dai-link level and master setting was not found from - * sound node level, revert back to legacy DT parsing and - * take the settings from codec node. - */ - dev_dbg(dev, "Revert to legacy daifmt parsing\n"); - - daifmt = snd_soc_of_parse_daifmt(codec, NULL, NULL, NULL) | - (daifmt & ~SND_SOC_DAIFMT_CLOCK_MASK); - } else { - 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; - } - - dai_link->dai_fmt = daifmt; - - of_node_put(bitclkmaster); - of_node_put(framemaster); - - return 0; -} - static int asoc_simple_card_dai_link_of(struct device_node *node, struct simple_card_data *priv, int idx, @@ -359,8 +317,8 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, goto dai_link_of_err; } - ret = asoc_simple_card_parse_daifmt(node, priv, - codec, prefix, idx); + ret = asoc_simple_card_parse_daifmt(dev, node, codec, + prefix, &dai_link->dai_fmt); if (ret < 0) goto dai_link_of_err;