From patchwork Wed Jul 15 07:10:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6793641 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D72489F2E8 for ; Wed, 15 Jul 2015 07:14:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E93BA205D8 for ; Wed, 15 Jul 2015 07:14:46 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id B0092204E0 for ; Wed, 15 Jul 2015 07:14:45 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id BB24D265849; Wed, 15 Jul 2015 09:14:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAD_ENC_HEADER,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 B518A265993; Wed, 15 Jul 2015 09:12:22 +0200 (CEST) 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 DEB25265998; Wed, 15 Jul 2015 09:12:20 +0200 (CEST) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id 124BC265846 for ; Wed, 15 Jul 2015 09:10:26 +0200 (CEST) Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie2.idc.renesas.com with ESMTP; 15 Jul 2015 16:10:25 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id AABF244B17; Wed, 15 Jul 2015 16:10:25 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id AA7478002E; Wed, 15 Jul 2015 16:10:25 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id A416B8002D; Wed, 15 Jul 2015 16:10:25 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id SAD16758; Wed, 15 Jul 2015 16:10:25 +0900 X-IronPort-AV: E=Sophos;i="5.15,477,1432566000"; d="scan'";a="191575602" Received: from mail-hk2apc01lp0207.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.207]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 15 Jul 2015 16:10:24 +0900 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; Received: from morimoto-PC.renesas.com (211.11.155.144) by SIXPR06MB0606.apcprd06.prod.outlook.com (10.160.237.148) with Microsoft SMTP Server (TLS) id 15.1.213.14; Wed, 15 Jul 2015 07:10:22 +0000 Message-ID: <87zj2xvqz4.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown In-Reply-To: <87d1ztx5pb.wl%kuninori.morimoto.gx@renesas.com> References: <87d1ztx5pb.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Wed, 15 Jul 2015 07:10:22 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR06CA0023.apcprd06.prod.outlook.com (25.164.91.33) To SIXPR06MB0606.apcprd06.prod.outlook.com (25.160.237.148) X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB0606; 2:Crb0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iV5tJG0vwIx2xIseZMyDnWa; 4:8VJc6PtenESVsE8E70A32OGX+hRxlbIxuxyJNKHTZTLbAgQyHbLptMOTCk22+TE7IDRocz0ZOcCu/4jQY8pajO01rhWYs5MuzhooSEeUtCjvFo0gXyog9iE2f/mnG0mLTE8+EkX0hI2+wcp5yhroonKl1Rorsszr2Jqe0YYfFzlbMZ32ypk+h70f59wF606+OzSMN06kduf3Dq/GfL4TiCKVCTvR4CyKWHNqstniiCmrf7LKfBQxLNJjMUEBf2lu0/AVKQx9m3JLdKVv9eXdTr/2V9UQv+ptrE6q9/4Vdk0= SIXPR06MB0606: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:SIXPR06MB0606; BCL:0; PCL:0; RULEID:; SRVR:SIXPR06MB0606; X-Forefront-PRVS: 0638FD5066 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(50466002)(189998001)(50986999)(2950100001)(77096005)(53416004)(92566002)(54356999)(5001960100002)(575784001)(86362001)(46102003)(42186005)(36756003)(23726002)(107886002)(229853001)(66066001)(19580395003)(77156002)(122386002)(62966003)(40100003)(33646002)(5001920100001)(87976001)(19580405001)(76176999)(110136002)(46406003)(47776003)(4001350100001)(83506001)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:SIXPR06MB0606; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SIXPR06MB0606; 23:ObinmOzegYP7DCQN1aS5Zm2XIh9lSdIVmzcTWCinE?= =?us-ascii?Q?C1VGhF4ji/I0p4cqRDa+NreyFsjrVwRq37DVI+tDUJLFkXYc4U0gr/svBuoo?= =?us-ascii?Q?fStVW2sP6fnOM4gapA6/GsCHPpU9CqSMTiUrvalMc2flMJVJ6DrEoEy4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+tnSFhpD9HxLCuLm5Z10vqH9TkoKwbZXpvIv25kW9a7DSoGOw7NKDFP6lcd4lRUmOw/UiJDzQnQXmdls8XEuVJjDRSTyj1OA/vtUCeJndX8FJ1ePyqK1n6I9rUpxxkHqsmWD5eeQUbnXA==; 24:Fe/yzeWGdXJ/DQa2RXLrzQcY40zWRlyckUaYSD1uIlVwjnd6mFLVE6SX36uW7g6qGPLvdo8W9r5hIS4AV9SeKqdH800XW4TNj94ymAlKMt8=; 20:et1lJ/xKnwglwInrXa7yVktH692T6G4QnpR78g40wHnVYVHVJ1dXXGeIjdd9RxMC7TuTC+67pAzN6mKieNgMFxY/85i+l7ci6BZh12lduui7ATMVP1jNHrqYVu7uQ/9o8Z6UNl8+CyikITeZ/OyxPs2U41JDallMKv7tWjkJS+M= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2015 07:10:22.9706 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SIXPR06MB0606 Cc: Linux-ALSA , shiiba , Liam Girdwood , komatsu , kobayashi , Simon Subject: [alsa-devel] [PATCH 09/35] ASoC: rsnd: add workaround for SRC sync convert + DVC 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 We couldn't use SRC sync convert mode together with DVC, but we can use workaround for it. This patch adds workaround and can use SRC sync convert + DVC Signed-off-by: Kuninori Morimoto Tested-by: Keita Kobayashi --- sound/soc/sh/rcar/src.c | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 9e11f73..38d0aba 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -616,6 +616,14 @@ static void rsnd_src_irq_ctrol_gen2(struct rsnd_mod *mod, int enable) int_val = 0; } + /* + * WORKAROUND + * + * ignore over flow error when rsnd_enable_sync_convert() + */ + if (rsnd_enable_sync_convert(src)) + sys_int_val = sys_int_val & 0xffff; + rsnd_mod_write(mod, SRC_INT_ENABLE0, int_val); rsnd_mod_bset(mod, SCU_SYS_INT_EN0, sys_int_mask, sys_int_val); rsnd_mod_bset(mod, SCU_SYS_INT_EN1, sys_int_mask, sys_int_val); @@ -631,11 +639,22 @@ static void rsnd_src_error_clear_gen2(struct rsnd_mod *mod) static bool rsnd_src_error_record_gen2(struct rsnd_mod *mod) { - u32 val = OUF_SRC(rsnd_mod_id(mod)); + struct rsnd_src *src = rsnd_mod_to_src(mod); + u32 val0, val1; bool ret = false; - if ((rsnd_mod_read(mod, SCU_SYS_STATUS0) & val) || - (rsnd_mod_read(mod, SCU_SYS_STATUS1) & val)) { + val0 = val1 = OUF_SRC(rsnd_mod_id(mod)); + + /* + * WORKAROUND + * + * ignore over flow error when rsnd_enable_sync_convert() + */ + if (rsnd_enable_sync_convert(src)) + val0 = val0 & 0xffff; + + if ((rsnd_mod_read(mod, SCU_SYS_STATUS0) & val0) || + (rsnd_mod_read(mod, SCU_SYS_STATUS1) & val1)) { struct rsnd_src *src = rsnd_mod_to_src(mod); src->err++; @@ -651,7 +670,16 @@ static bool rsnd_src_error_record_gen2(struct rsnd_mod *mod) static int _rsnd_src_start_gen2(struct rsnd_mod *mod, struct rsnd_dai_stream *io) { - u32 val = rsnd_io_to_mod_dvc(io) ? 0x01 : 0x11; + struct rsnd_src *src = rsnd_mod_to_src(mod); + u32 val; + + /* + * WORKAROUND + * + * Enable SRC output if you want to use sync convert together with DVC + */ + val = (rsnd_io_to_mod_dvc(io) && !rsnd_enable_sync_convert(src)) ? + 0x01 : 0x11; rsnd_mod_write(mod, SRC_CTRL, val); @@ -921,13 +949,6 @@ static int rsnd_src_pcm_new(struct rsnd_mod *mod, return 0; /* - * We can't use SRC sync convert - * if it has DVC - */ - if (rsnd_io_to_mod_dvc(io)) - return 0; - - /* * enable sync convert */ ret = rsnd_kctrl_new_s(mod, io, rtd,