From patchwork Tue May 31 09:00:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9143845 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 E22EF60757 for ; Tue, 31 May 2016 09:00:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D68CA27BF1 for ; Tue, 31 May 2016 09:00:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB3C328185; Tue, 31 May 2016 09:00:48 +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 78FC427BF1 for ; Tue, 31 May 2016 09:00:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755920AbcEaJAr (ORCPT ); Tue, 31 May 2016 05:00:47 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:41127 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756609AbcEaJAo (ORCPT ); Tue, 31 May 2016 05:00:44 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie3.idc.renesas.com with ESMTP; 31 May 2016 18:00:43 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 435BC62E47; Tue, 31 May 2016 18:00:43 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 211032806F; Tue, 31 May 2016 18:00:43 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 1931F2806D; Tue, 31 May 2016 18:00:43 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac2.idc.renesas.com with ESMTP id UAM09628; Tue, 31 May 2016 18:00:43 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211980283" Received: from mail-sg2apc01lp0242.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.242]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 31 May 2016 18:00:41 +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=BaASa5SfPkJ5lZym8jqEe66GWv+5ZTHPXj2N1waPA90=; b=mR6AQYzcb1WZ7aCXDqOsV/DUdm/JffHiWKbo//xb6/xR2nZEKuc3T/VxZ0QU4f2wD68QjHqLrsCYyQsRO5WnXGJNhtdNFwRenK1NfZrrTEeBH4eAWUUybh9ndOpot+tpsC+KjeBw0T/INjpEvmv6NUCqZ5zpWg1qBSykBNqr/VU= 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 PS1PR06MB1708.apcprd06.prod.outlook.com (10.167.53.18) with Microsoft SMTP Server (TLS) id 15.1.506.9; Tue, 31 May 2016 09:00:40 +0000 Message-ID: <878tyqsj48.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 05/39 v2] ASoC: simple-card-utils: 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: <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:00:40 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0062.jpnprd01.prod.outlook.com (10.165.51.150) To PS1PR06MB1708.apcprd06.prod.outlook.com (10.167.53.18) X-MS-Office365-Filtering-Correlation-Id: 8ac2584b-b6ff-4c5f-f08f-08d389320a62 X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1708; 2:K0cqQGc1G2aziwLydLkSQlzCYni9Mc6rYYXm8MXrOZa056760mwfgH/zp2WP/HW2Fs6gUDNEs5z843Be7A5ECfbzapx/dtYJcQe12OYLY81KrZhwyEcUPYKQ2Wjvv6KlEnUJFSuiFtIw6fv5wUe8plkcmeEfY6gOzWKFIlEyez/LPgxu5IBrfGQb1awA3ZEV; 3:6OTJKz0+hoDCQnTz+X9TE3oKWLaXTGVWSm1HaF60oMEZRQxMR1hn2yRoXHhVDpc0Kxq05vpeHLbEUTapxq9QpRo2txZh87jMcpTtYxMbiMYO3HyJgPLtAbQY/jIsIO87; 25:4Vbi6hNLU57Gt4ObGcV0wG4oQBNPkl4dqq1OZnPcRI5k+POmNh5L8vnT9/qOzKwUWaw77FcS3FAPVcpMWfmUitO4h4dEBMzOQ4kaXwZ0txAXjXUz2ZN2nWmXyaIMIbSsn7J7HP30SQj3l5fqBZy+WR90Pq7xTCl5bHFifBSqVqZtFSD7FwLQN25twIjN2p2Qh6ueasSBkC61AX210nXo0KniCsbsdmOdYU63kJUzUNiyT7DMA5sKp5Z1JRe271AHIcZqrj6lK3twZKp27ctGmrStt2fM5tqXqutB8qwbjvsNZQY/m8+4/zUB1Kxfbxznz6IwYm2cNw1qpz6rcYTovnFTzF4dRl6TUg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dGoSqMSzlxvU5Cg== 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:PS1PR06MB1708; BCL:0; PCL:0; RULEID:; SRVR:PS1PR06MB1708; X-Forefront-PRVS: 095972DF2F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(81166006)(8676002)(83506001)(4001350100001)(50466002)(2906002)(92566002)(586003)(19580395003)(3846002)(19580405001)(6116002)(46406003)(189998001)(23726003)(110136002)(50986999)(54356999)(76176999)(4326007)(42186005)(66066001)(86362001)(47776003)(229853001)(5008740100001)(2950100001)(36756003)(5004730100002)(53416004)(230783001)(33646002)(77096005)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR06MB1708; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; PS1PR06MB1708; 23:+rXqlYTiJs1dWaq8E21BgUIEZlLWUFAefgTFVTFqn?= =?us-ascii?Q?9l6d7MRI0YFweHGygYC5dSE7vA+gbLsZ8+qvbSpIyp0cIjj8SuzUcIE4M10c?= =?us-ascii?Q?S4Be8crw1anpYj08Dmo4FZK5huxf8wMK7IbGzkfbicm3PLN9gyJslq5XBVyG?= =?us-ascii?Q?g5zb4z04fIk+tY8I0+FkVnmLc6qEOJr1PV09LX6o0BM6lrQV/6ynqqR1pEzv?= =?us-ascii?Q?CHxLXbfHZ3SwtQxzuf9+dJDPjJUKZxjh+cD9B5c85CIeIp4IufYoTFTHVfGD?= =?us-ascii?Q?ktM0ZmXsyPUGRPVM8F+PXHVsV90prfORmDt95538DaxNaM6BqtNkj1lvIKW6?= =?us-ascii?Q?ibKczl1WDqiUg+GKr0ISeAUmeqWr9TPEqBQSt/8ofuycQsa+G2uuUa/nsGwA?= =?us-ascii?Q?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ihY7pvrqFwQhCtpXWl8SS7KARB4mWvuDuxXlB1EohQKqyCY0JZIqIJlLADep2+kRZlkjS9RpSOIq8PPIcLHlvD8C3+/NKHeSs4IXNBgOIGms+dLl94zdQk/wJx0w6TijdJ2UU00cveXCU5Oy609C6l9KInsrPHbR6RoOgic3; 20:Z+XKWrj5UacvRhNBZBlbkH3ueDF7f2xFObPwHCShW54uz7wINbEY5tF8n2lC+3qdBOtpzsLhXXKo59QHZvl+8XRrJN8N6im989BnzdMxTEawpbCOYCmb1hicW9cYH3WQ73LNBM967v84dLOaYteRV0nbDRtjd8HDm944BwHnwb8= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2016 09:00:40.0154 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR06MB1708 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_utils.h | 12 ++++++++++++ sound/soc/generic/simple-card-utils.c | 11 +++++++++++ 2 files changed, 23 insertions(+) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 7acc798..6bb2c5f 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.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-utils.c b/sound/soc/generic/simple-card-utils.c index 3f6b725..86fb2cf 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.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);