From patchwork Thu Jun 9 03:21:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9166179 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 8FA6F604DB for ; Thu, 9 Jun 2016 03:21:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84BAB28047 for ; Thu, 9 Jun 2016 03:21:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 78AEC2824F; Thu, 9 Jun 2016 03:21:46 +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 05F2B28047 for ; Thu, 9 Jun 2016 03:21:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422906AbcFIDVo (ORCPT ); Wed, 8 Jun 2016 23:21:44 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:55913 "EHLO relmlie4.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1422759AbcFIDVm (ORCPT ); Wed, 8 Jun 2016 23:21:42 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie4.idc.renesas.com with ESMTP; 09 Jun 2016 12:21:40 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id D431349ED6; Thu, 9 Jun 2016 12:21:40 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id CDBDB2806E; Thu, 9 Jun 2016 12:21:40 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id C681F2806D; Thu, 9 Jun 2016 12:21:40 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id NAP09047; Thu, 9 Jun 2016 12:21:40 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="213076004" Received: from mail-pu1apc01lp0015.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.15]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 09 Jun 2016 12:21:39 +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=lLQ8jLyn3f6iZsqO2eC7hyESMCTeobfYiP1eXd5TW4M=; b=SdJ9IFHaa/3oE28rWCOsj/l9m2Ni9hsFaawCto8SeXz9O1nfNJ6iZIZgHtCoo0AgVpzXwZ3T5uIszds2MW6SXUKlkCDPFlltJe0GtDuP0lMIZn12E7Qt8fTSD5rejUp7br7vlKxegLJ/xsY2Ol+PPnbtzpHsSc8SFCa/2pOo2aE= 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 SG2PR06MB1712.apcprd06.prod.outlook.com (10.167.82.142) with Microsoft SMTP Server (TLS) id 15.1.517.8; Thu, 9 Jun 2016 03:21:37 +0000 Message-ID: <87mvmvkq8b.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2] ASoC: rsnd: adg :: AUDIO-CLKOUTn asynchronizes support User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown CC: Linux-ALSA , Liam Girdwood , Simon , MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Thu, 9 Jun 2016 03:21:37 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0047.jpnprd01.prod.outlook.com (10.164.162.29) To SG2PR06MB1712.apcprd06.prod.outlook.com (10.167.82.142) X-MS-Office365-Filtering-Correlation-Id: a078a39c-738c-477b-fde0-08d390152b48 X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1712; 2:0HrVXFAb8dq47W55znGkEVbfdDecuXQuInIQriFdcnIPjar8T4dYkqt2w13B/di05klXj0iRmRw+YgF49KPKmstRn2NlpHxiOiQu9dK+G5WVPT29BfuXA8wc9kmguOnAgPXpqUjUNolOU8AxtJ9rT9sJvngpnJdixBtPvPAlWvF5tJLqpcZUMSt75LW1Iqpz; 3:gJeEfuMkQFKfTn6xixsU/Z1w0h/jyV04O4BYy/E9Z2qRkMBZtVhudX+qWuZBwC9ZSRHSuQywAnHb0dQ8dQqyxH72xx2ag7Q9obcuAQhyyaDFhZCr20/dAkYSxQhp0z5X X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB1712; X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1712; 25:yE3LvApG3QdMIobMF6cgr+3uOVyxf4jFwIlH1ZLpg1D4gMqDJzo01yY0l49aAtyGV2eC4crxRdWSlmCN3TkV8QpxU0+objet2Qh70zPy96MsiNtUl8+m1YGFa4xHsLgZ+d/1HlX138FxmpHKSYrArnJUUiQ+EDNBpwwGIKvfZHerCJUsLPbQ4pOPU9Rc/+xt/I+SpM7WjgWYoZzudX1Ru/Qdm5v52hS8Q+YgP1VY3X5xGZxwKGIe7TJzOpqDEbgymcV7wNn4NYUdE8Kn7iw89+SWTX0eV+YbbFTrJd7Ij7ONx0MBk8guR6k706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Jn+U/zwt8u84JaUs2T4Nnv5sF4n7XC1k7rKQ1Vs2thzxtX42+7RrwrasCQQE9brZmEp+PycBpHf1j5mrNofJpcAGuK3iaOMgoFJ1Ny4Lgz8ggP8fjnaifLabxyjh1Fj8DDXEL8qyKvRX2f1p/0sxzs+Yk2p+GyVInVOt+9fi/F5LlWrPu/AslzsaMb4if9mewqMSwgaI08THanwkTl/LMYZwbJvbEE4UJkPRUMv9cWMDdklPwxt1s5UxUoLA8rVEQ1A1BApwL1ENqeyuZIAi8jDwC+lOJysYlg== 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)(3002001)(10201501046)(6055026); SRVR:SG2PR06MB1712; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB1712; X-Forefront-PRVS: 0968D37274 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(189002)(199003)(46406003)(189998001)(36756003)(101416001)(69596002)(105586002)(229853001)(83506001)(50466002)(54356999)(50986999)(92566002)(19580395003)(586003)(19580405001)(106356001)(77096005)(47776003)(33646002)(5008740100001)(6116002)(3846002)(81156014)(81166006)(8676002)(23726003)(66066001)(5004730100002)(68736007)(86362001)(575784001)(2906002)(4326007)(97736004)(4001350100001)(110136002)(42186005)(53416004)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB1712; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; CAT:NONE; LANG:en; CAT:NONE; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SG2PR06MB1712; 23:wCiCQ0ngw/c5bmpG6QzsVv+Q31JhlWUpn+5lJfK0h?= =?us-ascii?Q?m9Sxu7PxvTFuC/N522myrWDrbNjNUVVp0z0I/P03eRxW5xQTeiNUitwuwv99?= =?us-ascii?Q?ezrii/i833PnCN8PiidFhJ8VXpZ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 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1712; 20:yPlI7aVls5xfvwNJBpYUfl7opaVM85s2GRJmEDLFcfEwrZJXNhcrtE+LJZDI/GxfxdBF5ckMKvWJAApIXOSRJGCN/S6a/S9GlBSoxTh13o0Jwv4r7myp0eWJoKe/imrcZKt41N+cuVT37kK+mlQKtbXw2qcqsThFdYpJie/7bwY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2016 03:21:37.7726 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB1712 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 AUDIO-CLKOUTn can asynchronizes with L/R clock. AUDIO-CLKOUTn synchronizes with L/R clock is now default behavior. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - default is synchronizes, asynchronizes is option .../devicetree/bindings/sound/renesas,rsnd.txt | 2 ++ sound/soc/sh/rcar/adg.c | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt index c7b29df..15a7316 100644 --- a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt @@ -373,6 +373,8 @@ Optional properties: - #clock-cells : it must be 0 if your system has audio_clkout it must be 1 if your system has audio_clkout0/1/2/3 - clock-frequency : for all audio_clkout0/1/2/3 +- clkout-lr-asynchronous : boolean property. it indicates that audio_clkoutn + is asynchronizes with lr-clock. SSI subnode properties: - interrupts : Should contain SSI interrupt for PIO transfer diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c index 49354d1..7d3e0e4 100644 --- a/sound/soc/sh/rcar/adg.c +++ b/sound/soc/sh/rcar/adg.c @@ -33,11 +33,15 @@ struct rsnd_adg { struct clk *clkout[CLKOUTMAX]; struct clk_onecell_data onecell; struct rsnd_mod mod; + u32 flags; int rbga_rate_for_441khz; /* RBGA */ int rbgb_rate_for_48khz; /* RBGB */ }; +#define LRCLK_ASYNC (1 << 0) +#define adg_mode_flags(adg) (adg->flags) + #define for_each_rsnd_clk(pos, adg, i) \ for (i = 0; \ (i < CLKMAX) && \ @@ -355,6 +359,16 @@ found_clock: rsnd_adg_set_ssi_clk(ssi_mod, data); + if (!(adg_mode_flags(adg) & LRCLK_ASYNC)) { + struct rsnd_mod *adg_mod = rsnd_mod_get(adg); + u32 ckr = 0; + + if (0 == (rate % 8000)) + ckr = 0x80000000; + + rsnd_mod_bset(adg_mod, SSICKR, 0x80000000, ckr); + } + dev_dbg(dev, "ADG: %s[%d] selects 0x%x for %d\n", rsnd_mod_name(ssi_mod), rsnd_mod_id(ssi_mod), data, rate); @@ -532,6 +546,7 @@ int rsnd_adg_probe(struct rsnd_priv *priv) { struct rsnd_adg *adg; struct device *dev = rsnd_priv_to_dev(priv); + struct device_node *np = dev->of_node; adg = devm_kzalloc(dev, sizeof(*adg), GFP_KERNEL); if (!adg) { @@ -545,6 +560,9 @@ int rsnd_adg_probe(struct rsnd_priv *priv) rsnd_adg_get_clkin(priv, adg); rsnd_adg_get_clkout(priv, adg); + if (of_get_property(np, "clkout-lr-asynchronous", NULL)) + adg->flags = LRCLK_ASYNC; + priv->adg = adg; return 0;