From patchwork Thu Nov 27 08:07:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 5393081 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9F2B49F319 for ; Thu, 27 Nov 2014 08:14:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D89E4201B9 for ; Thu, 27 Nov 2014 08:14:09 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id B54092010B for ; Thu, 27 Nov 2014 08:14:08 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D6314265DB5; Thu, 27 Nov 2014 09:14:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 3E810265DB1; Thu, 27 Nov 2014 09:09:16 +0100 (CET) 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 D747E265DB1; Thu, 27 Nov 2014 09:09:14 +0100 (CET) Received: from relmlie1.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa0.perex.cz (Postfix) with ESMTP id E2A5F265DC3 for ; Thu, 27 Nov 2014 09:07:10 +0100 (CET) Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 27 Nov 2014 17:07:09 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 67B294A2BC; Thu, 27 Nov 2014 17:07:09 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 6867D8002D; Thu, 27 Nov 2014 17:07:09 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 4DDFD8002F; Thu, 27 Nov 2014 17:07:09 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id TAS31541; Thu, 27 Nov 2014 17:07:09 +0900 X-IronPort-AV: E=Sophos;i="5.07,467,1413212400"; d="scan'208";a="174554493" Received: from mail-sg1lp0087.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.87]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 27 Nov 2014 17:07:08 +0900 Received: from remon.renesas.com (211.11.155.132) by HKXPR06MB168.apcprd06.prod.outlook.com (10.242.124.21) with Microsoft SMTP Server (TLS) id 15.1.26.15; Thu, 27 Nov 2014 08:07:07 +0000 Message-ID: <87mw7d83t6.wl%kuninori.morimoto.gx@renesas.com> To: Mark Brown In-Reply-To: <877fyh9ilx.wl%kuninori.morimoto.gx@renesas.com> References: <877fyh9ilx.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Date: Thu, 27 Nov 2014 08:07:07 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: HKXPR02CA0065.apcprd02.prod.outlook.com (25.161.48.50) To HKXPR06MB168.apcprd06.prod.outlook.com (10.242.124.21) X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB168; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB168; X-Forefront-PRVS: 040866B734 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(21056001)(36756003)(110136001)(33646002)(66066001)(31966008)(105586002)(95666004)(50466002)(62966003)(77096003)(46102003)(77156002)(86362001)(92566001)(69596002)(92726001)(4396001)(19580405001)(101416001)(19580395003)(46406003)(107046002)(229853001)(120916001)(102836001)(97736003)(99396003)(20776003)(54356999)(76176999)(81156004)(83506001)(106356001)(23726002)(42186005)(122386002)(40100003)(47776003)(50986999)(53416004)(64706001); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB168; H:remon.renesas.com; FPR:; SPF:None; MLV:sfv; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB168; X-OriginatorOrg: renesas.com Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 14/20] ASoC: rsnd: set SRC_ROUTE_MODE0 on each rsnd_src_set_convert_rate() 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 Current src.c sets SRC_ROUTE_MODE0 on rsnd_src_start(), but, set it in rsnd_src_set_convert_rate() is natural. Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/src.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 6a63f8f..0b6b230 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -302,17 +302,12 @@ static int rsnd_src_quit(struct rsnd_mod *mod, static int rsnd_src_start(struct rsnd_mod *mod, struct rsnd_dai *rdai) { - struct rsnd_src *src = rsnd_mod_to_src(mod); - /* * Cancel the initialization and operate the SRC function * see rsnd_src_init() */ rsnd_mod_write(mod, SRC_SRCIR, 0); - if (rsnd_src_convert_rate(src)) - rsnd_mod_write(mod, SRC_ROUTE_MODE0, 1); - return 0; } @@ -320,11 +315,7 @@ static int rsnd_src_start(struct rsnd_mod *mod, static int rsnd_src_stop(struct rsnd_mod *mod, struct rsnd_dai *rdai) { - struct rsnd_src *src = rsnd_mod_to_src(mod); - - if (rsnd_src_convert_rate(src)) - rsnd_mod_write(mod, SRC_ROUTE_MODE0, 0); - + /* nothing to do */ return 0; } @@ -431,6 +422,7 @@ static int rsnd_src_set_convert_timing_gen1(struct rsnd_mod *mod, static int rsnd_src_set_convert_rate_gen1(struct rsnd_mod *mod, struct rsnd_dai *rdai) { + struct rsnd_src *src = rsnd_mod_to_src(mod); int ret; ret = rsnd_src_set_convert_rate(mod, rdai); @@ -444,6 +436,10 @@ static int rsnd_src_set_convert_rate_gen1(struct rsnd_mod *mod, rsnd_mod_write(mod, SRC_MNFSR, rsnd_mod_read(mod, SRC_IFSVR) / 100 * 98); + /* Gen1/Gen2 are not compatible */ + if (rsnd_src_convert_rate(src)) + rsnd_mod_write(mod, SRC_ROUTE_MODE0, 1); + /* no SRC_BFSSR settings, since SRC_SRCCR::BUFMD is 0 */ return 0; @@ -548,6 +544,11 @@ static int rsnd_src_set_convert_rate_gen2(struct rsnd_mod *mod, rsnd_mod_write(mod, SRC_SRCCR, 0x00011110); + if (convert_rate) { + /* Gen1/Gen2 are not compatible */ + rsnd_mod_write(mod, SRC_ROUTE_MODE0, 1); + } + switch (rsnd_mod_id(mod)) { case 5: case 6: