From patchwork Wed Jul 15 07:13:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6793771 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E5EEFC05AC for ; Wed, 15 Jul 2015 07:22:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 19B5120592 for ; Wed, 15 Jul 2015 07:22:44 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id EDD7C20585 for ; Wed, 15 Jul 2015 07:22:42 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D9CB4265D9B; Wed, 15 Jul 2015 09:22:41 +0200 (CEST) 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 59E042658DB; Wed, 15 Jul 2015 09:17:03 +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 D8A6D2658FA; Wed, 15 Jul 2015 09:17:00 +0200 (CEST) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id C9E6B2658A3 for ; Wed, 15 Jul 2015 09:13:51 +0200 (CEST) Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie2.idc.renesas.com with ESMTP; 15 Jul 2015 16:13:50 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 5B39B50CE8; Wed, 15 Jul 2015 16:13:50 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 46E248002E; Wed, 15 Jul 2015 16:13:50 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 4255B8002D; Wed, 15 Jul 2015 16:13:50 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id SAC18476; Wed, 15 Jul 2015 16:13:50 +0900 X-IronPort-AV: E=Sophos;i="5.15,477,1432566000"; d="scan'";a="190394904" Received: from mail-hk2apc01lp0213.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.213]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 15 Jul 2015 16:13:49 +0900 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; Received: from morimoto-PC.renesas.com (211.11.155.144) by SG2PR06MB0604.apcprd06.prod.outlook.com (10.161.10.154) with Microsoft SMTP Server (TLS) id 15.1.213.14; Wed, 15 Jul 2015 07:13:47 +0000 Message-ID: <87lhehvqtf.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:13:47 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR01CA0059.jpnprd01.prod.outlook.com (25.164.162.169) To SG2PR06MB0604.apcprd06.prod.outlook.com (25.161.10.154) X-Microsoft-Exchange-Diagnostics: 1; SG2PR06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xgj4lzG8JKsHQIKP5DB7lDwzR; 4:onhqi6AESsRBMrUOY8RF1ZEgqcaJ8+LBuR2YCNWOp4RNU0h4mJ8u9FSvkH5A7XQiXZkbyMq5qZSFFXALZuVAbAy1Z4mAennI9G/YOsX5oNzbCxQ+HOCw0rxgEpr+aTAeCGXguoxh52MsdWGHHqRaFninn1654rTEFNoZYbfV9AcoYl73r0SojB7Lt23osFaI5v3tToa5joMpTSgLB8OOMvddc535bUE9qzzParfCzPhM4IlKIt0A1lIeBR3e+rEe+AdAKmxen9gbL8Wed7LD52sWdycLQil7ZEV52CyierE= SG2PR06MB0604: 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:SG2PR06MB0604; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB0604; X-Forefront-PRVS: 0638FD5066 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(19580405001)(77156002)(50986999)(62966003)(54356999)(76176999)(46102003)(86362001)(66066001)(36756003)(46406003)(40100003)(83506001)(122386002)(229853001)(33646002)(87976001)(23726002)(19580395003)(189998001)(4001350100001)(92566002)(77096005)(50466002)(110136002)(47776003)(107886002)(5001960100002)(2950100001)(42186005)(53416004)(5001920100001)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB0604; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0604; 23:TTeWDlC8Cxiudf7uie2oahTrSbbSRAXAu0W/5x6PQlUXzE7swZrSVbXMpzYh4tvwQZlkJY7YDVPpkj7nNXEziUr0XbVB3c9G/dhvLqo1P3Yv0CeGpIaiCsfi1TxJtzbj7sEhFsBuHdvBVyHlgpVqiZZpw7Or9Njt6rZTh/QCbFsoTU2HoD/ULjjt2DTb51k5/4n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6UJMXPxnqw4X4Ukh9/KGDg4rqIYijX/2HOpy9hAb+mA/XArlz/73NfTnYqWY7Vt+thqrhrpIv/8LIzCtkXBqDZxov9V1kuU9mcilfkvEHSm588TEbFvkMnczwcSon72hJlgFFYZlyTk3//BW7vrM1Y= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2015 07:13:47.6856 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB0604 Cc: Linux-ALSA , shiiba , Liam Girdwood , komatsu , kobayashi , Simon Subject: [alsa-devel] [PATCH 19/35] ASoC: rsnd: add rsnd_src_initialize_lock/unlock() 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 Renesas SCU (Sampling Rate Convert Unit) includes SRC/CTU/MIX/DVC, and these have similar register. xxxIR (Initialization Register) is one of them. These xxxIR need be set to 1 during initialization. Current rsnd driver has src.c / dvc.c, and we will have mix.c. It is readable if these have same named function. This patch adds rsnd_src_initialize_lock/unlock() and make sure it Signed-off-by: Kuninori Morimoto Tested-by: Keita Kobayashi --- sound/soc/sh/rcar/src.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 74ab644..b3d965e 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -124,6 +124,14 @@ static void rsnd_src_soft_reset(struct rsnd_mod *mod) rsnd_mod_write(mod, SRC_SWRSR, 1); } + +#define rsnd_src_initialize_lock(mod) __rsnd_src_initialize_lock(mod, 1) +#define rsnd_src_initialize_unlock(mod) __rsnd_src_initialize_lock(mod, 0) +static void __rsnd_src_initialize_lock(struct rsnd_mod *mod, u32 enable) +{ + rsnd_mod_write(mod, SRC_SRCIR, enable); +} + static struct dma_chan *rsnd_src_dma_req(struct rsnd_dai_stream *io, struct rsnd_mod *mod) { @@ -362,17 +370,13 @@ static int rsnd_src_init(struct rsnd_mod *mod, rsnd_src_soft_reset(mod); + rsnd_src_initialize_lock(mod); + src->err = 0; /* reset sync convert_rate */ src->sync.val = 0; - /* - * Initialize the operation of the SRC internal circuits - * see rsnd_src_start() - */ - rsnd_mod_write(mod, SRC_SRCIR, 1); - return 0; } @@ -399,11 +403,7 @@ static int rsnd_src_quit(struct rsnd_mod *mod, static int rsnd_src_start(struct rsnd_mod *mod) { - /* - * Cancel the initialization and operate the SRC function - * see rsnd_src_init() - */ - rsnd_mod_write(mod, SRC_SRCIR, 0); + rsnd_src_initialize_unlock(mod); return 0; }