From patchwork Fri May 20 09:42:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9129035 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 1341B60762 for ; Fri, 20 May 2016 09:43:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 062141FF6C for ; Fri, 20 May 2016 09:43:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEE4325D91; Fri, 20 May 2016 09:42:59 +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 679191FF6C for ; Fri, 20 May 2016 09:42:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753772AbcETJm7 (ORCPT ); Fri, 20 May 2016 05:42:59 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:42211 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753257AbcETJm6 (ORCPT ); Fri, 20 May 2016 05:42:58 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 20 May 2016 18:42:56 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 9D6C95049D; Fri, 20 May 2016 18:42:55 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 847ED480A3; Fri, 20 May 2016 18:42:55 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 83983480A5; Fri, 20 May 2016 18:42:55 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id UAB02219; Fri, 20 May 2016 18:42:55 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211713457" Received: from mail-sg2apc01lp0239.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.239]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 20 May 2016 18:42:54 +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=ZfUemjnTb+gBA6yf4iRHzYetbnoMsBLDyMI9pkQaXLk=; b=VJTC49SzMmO/Fl/x44+NRJoz0b3nu7F2MqIAy5bV/oOYOi51yNYvEdmL8CG0eQJ7dKOukcS1uO1UyXzGZ3E6kSbXp7lsC9JWqn1V5aC15uBu0oVSMXq/TwX4HsUJt0BXGtEfPbwc1AInV5Vg78reuW/KJO0LOOtxgErB3aDF9Jo= 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 KL1PR06MB1703.apcprd06.prod.outlook.com (10.167.63.17) with Microsoft SMTP Server (TLS) id 15.1.497.12; Fri, 20 May 2016 09:42:51 +0000 Message-ID: <87d1ohrryw.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 06/49] ASoC: simple-card-core: add asoc_simple_card_parse_tdm() 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:42:51 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR06CA0041.apcprd06.prod.outlook.com (10.164.91.51) To KL1PR06MB1703.apcprd06.prod.outlook.com (10.167.63.17) X-MS-Office365-Filtering-Correlation-Id: 1c401ee0-9e45-4624-09c0-08d380931c99 X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1703; 2:X2n2T5m6nPTnpKPT/diYltdX6wAElNxJpYyLjb8nZoJddOJuJyJnf191U9uygd7t0DMsWyLjBkkHcci2qByAAxeYaBtcRjRX65YcqenqjDu5l1oJbdff/KeT13EdKd3/+CxHBMTdkOeRfV3wkVGkhDgiOxRPjBpGPPGhS1lwp3vV3aN6jcGFIAzcoOJfnxWC; 3:qODaGpSocGm0Y0NVC80movJviOTZwJeRwE/rT+WEItLgbcUPFmItU9URuDQRNEFVM7ioyxZ9C73A8/J0bOaNOMysc5aRTuNZ7aRKqBWGkgHd/Ud6VDJtEgz1MzcEE00r; 25:E/OhhhudipbFLVLDf6GngGS1A85BRRNq2f/cVtCtinC/vSPS+rvV56fLJ2CcYDXg0rwvvkQPZZj3eB3i9S1ppniwdXSRTj7LLLb8rGVmPwz602okW2MEk1P1drgT0TYEmwkjUIDqKflrwAIRHMFdpH8TMSNVBXkJmQd0CiJi6VZ9eox/yDtyAynr1Hfr0AtcTuErsMEwIp65wzav129eIWTAKj06LorC2of3sqjNhtWW87smC1OO6qKUvCosLaBbC0zYq6/bRSAckVYbk3XoUPRRUNPNxEneIFs+AdVjvckEQrxwTlccdqy2NX7TiOxlkmbZIT1qynY1x9tEOissRFf/qtKGetaEG/EQhNdjITGM5HXcwrCAsNj6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-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:KL1PR06MB1703; BCL:0; PCL:0; RULEID:; SRVR:KL1PR06MB1703; X-Forefront-PRVS: 09480768F8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(4326007)(2906002)(46406003)(5004730100002)(23726003)(3846002)(2950100001)(33646002)(229853001)(110136002)(36756003)(53416004)(42186005)(86362001)(19580405001)(19580395003)(47776003)(83506001)(189998001)(66066001)(76176999)(54356999)(230783001)(50986999)(8676002)(81166006)(77096005)(5008740100001)(92566002)(586003)(50466002)(6116002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1PR06MB1703; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1703; 23:Wy9ujMbsj/cS4J7/a4h+R5Zr2r6j8BEvWL6lNqnf5KRGcopr7HF09+1+LK15411drKLcKzsdFQIHDBYCHEDTy7EM+ohwLkx/jCR2vFe9ftk4I/zHEvTdqWSqukz2/3udZGdRI1Nr9l+27FczEdPLuohcDSCjkKyXYtehtq5AEHqQ1lpyaHZxk/3i/Ecy036FNg3YxPozR6rZbKurF5G5LI4FGNaDHPoBP53zg+evb4UvKOBTpm71YKmI/JXq0BYKEfkXeAPGL2ipne2Sy8cUbaak2BimloZ6V5ObFa7LnCepy0cDxo2r848P9takU24wseSTRBZ9KJVzGghAZbPh9A+lWXei8ROGy0c4+x9rjVR7slyr0bLvG+ADuCOoXicFcV/BWPR9quJ6N3Xu2MnACVnZrNkvb/97ATc9ApFT+apNP4vWOA8NCsqOGNl0MFKOhngMtQCQmxN9zmTuizG7lFMG7DjaFDkoYzYszIukil9dcMjycj3GSEfDo5DMOJtWG6H9QtxzS/WYJHmxVvtq/wAQJbbHYgfPU4z2mh/rGUPc2NB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Metadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2016 09:42:51.1617 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB1703 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 simple-card is supporting TDM. This patch makes this method simple style standard. Signed-off-by: Kuninori Morimoto --- include/sound/simple_card_core.h | 12 ++++++++++++ sound/soc/generic/simple-card-core.c | 11 +++++++++++ 2 files changed, 23 insertions(+) diff --git a/include/sound/simple_card_core.h b/include/sound/simple_card_core.h index 7acc798..6bb2c5f 100644 --- a/include/sound/simple_card_core.h +++ b/include/sound/simple_card_core.h @@ -12,10 +12,22 @@ #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; +}; + int asoc_simple_card_parse_daifmt(struct device *dev, struct device_node *node, struct device_node *codec, char *prefix, unsigned int *retfmt); +int asoc_simple_card_parse_tdm(struct device_node *port_np, + struct asoc_simple_dai *simple_dai); #endif /* __SIMPLE_CARD_CORE_H */ diff --git a/sound/soc/generic/simple-card-core.c b/sound/soc/generic/simple-card-core.c index ddef5d1..e3536f4 100644 --- a/sound/soc/generic/simple-card-core.c +++ b/sound/soc/generic/simple-card-core.c @@ -52,3 +52,14 @@ int asoc_simple_card_parse_daifmt(struct device *dev, return 0; } EXPORT_SYMBOL_GPL(asoc_simple_card_parse_daifmt); + +int asoc_simple_card_parse_tdm(struct device_node *port_np, + struct asoc_simple_dai *simple_dai) +{ + return snd_soc_of_parse_tdm_slot(port_np, + &simple_dai->tx_slot_mask, + &simple_dai->rx_slot_mask, + &simple_dai->slots, + &simple_dai->slot_width); +} +EXPORT_SYMBOL_GPL(asoc_simple_card_parse_tdm);