From patchwork Tue Aug 22 23:51:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 715789 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2C875EE49B1 for ; Tue, 22 Aug 2023 23:53:17 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E79FF852; Wed, 23 Aug 2023 01:52:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E79FF852 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1692748395; bh=ktKDgJrmb3vdkyIschEDKS4OKv0w102ZSExjB9pbuwo=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=HYbDGqKcAOfXsfahvoEsi1NWm0LOfh+VtiTOevWur6AUsxUFViXKmPVXGL618u5eW hGjJ5Nxak3RAdmPufQqQeiL6MPdfM/7BPSmrUBagIZlfUuecXwVHViyDKD2PfXcpcb j0rMAVnXvOyzDUzxOMYKZR3k3CYZIkWJLtIYJ5fI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id ACA8AF805B5; Wed, 23 Aug 2023 01:51:15 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id ED956F80022; Wed, 23 Aug 2023 01:51:14 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D97A8F805AE; Wed, 23 Aug 2023 01:51:11 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20715.outbound.protection.outlook.com [IPv6:2a01:111:f403:700c::715]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8C7D4F80022 for ; Wed, 23 Aug 2023 01:51:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8C7D4F80022 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=XbKGEKge ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=esw/UrAKpAhjQXHD6utA3aqA3583rewbcZd7CKPkQOrytB6LV1qaNTUHV03s1GJjWeEj9f8GGhJnWBxaBmgPPpqi672P0Hn/HfwtR/v3zEWjZPd0Kromi93ZFw95jJQEIK6750z5EkmLqXdZodFENvL/nJSA8cu4/00QUGcldcehA7tdwtX9QHMw8Eu3xfPjHe6XsZtdhL48sCifT9O6YHIvhWQpZ/BNbSZi/SynZhtPB+NlrmLtQnQejtQJBW1/p19WcZ69Jw6UrepGQHv1yawi0yI7z4YEjno4yKorZnO9ibRk6OJlt1T9LCsDlheuWFBGGyrTRSW6k8+aSujfrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1j8KguPYQvHgZKDiVW0d86MHnDNteytQeu7qIxhsuNY=; b=XW63VG3Qf23uEEiPF6Yf6U83ErMIEH2cnRD58rsOqz54ZyLGNYkizDpdONhm1pDCz6nneZgPdgn8bnpvjyFXdM+e0K3sTJFj2pV+ZcVxcxFVv9YH1eEdQnWyzz5xKcTdRy4c3DxfEPdoENIb0C/mHNHczUIkFsRn/ipU/o/ki1weNHac+9gNmGuAIbeCDgePGJZRZISYEV9DkIOeUjy2jVQRcU8jirD/dGXxfK/pJnJlTuzDf9CmE1XIzYaInVIlXayFJFZGOMCb1QH3J5tBu2KK/v7q7Di55daWP3YbQpje135GMIqNASjJFQ2wPJupWYMZ2YFohZUfZmIVtYqxcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1j8KguPYQvHgZKDiVW0d86MHnDNteytQeu7qIxhsuNY=; b=XbKGEKgeSe/Iw22vdfivaDv6BLxadphLl4TqCpayEbruwlWFtdxi9OQkD3F6w6yhanyPlofX4gk4sGGKOrckkTybPPFAkKAjJm/mhMnuIh7NdCa75ZiWPCs+zQQBLR3+aSZ6UUS8b7xpKAByG2Pp3BCI1oEMtObnp7/8Bqj1Vuw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB8440.jpnprd01.prod.outlook.com (2603:1096:400:15d::5) by TY3PR01MB11948.jpnprd01.prod.outlook.com (2603:1096:400:405::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 23:51:02 +0000 Received: from TYCPR01MB8440.jpnprd01.prod.outlook.com ([fe80::7b2c:6f3a:1aa:79d3]) by TYCPR01MB8440.jpnprd01.prod.outlook.com ([fe80::7b2c:6f3a:1aa:79d3%4]) with mapi id 15.20.6699.025; Tue, 22 Aug 2023 23:51:02 +0000 Message-ID: <87h6oqzlei.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 5/5] ASoC: rsnd: setup BRGCKR/BRRA/BRRB on rsnd_adg_clk_control() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA , Adnan Ali , Vincenzo De Michele , Patrick Keil In-Reply-To: <87o7iyzlfy.wl-kuninori.morimoto.gx@renesas.com> References: <87o7iyzlfy.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 22 Aug 2023 23:51:02 +0000 X-ClientProxiedBy: TY2PR0101CA0006.apcprd01.prod.exchangelabs.com (2603:1096:404:92::18) To TYCPR01MB8440.jpnprd01.prod.outlook.com (2603:1096:400:15d::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB8440:EE_|TY3PR01MB11948:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d408917-1a03-4f1a-6bbc-08dba36aa44b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ms/2+1jgBK9/+SSdSvPIHJL+pGLagBh3rfV4NnolQuqqdIl6JduRzmUatOCGIZmQebXzfnnvvvDSsN78kGsUy1UQW5eIXZLW8aVUhw9691i03F4EYUZaBOsN+qrI4KwxfRyECpg2Hk3Xq2cq+rQqEGK23RE5R62uW2IYx5yl/FqSKFzeFDmCwKoqS2OvqncdGzhsRf0BlDwcxsyLtvoHpJ66nI9YbB1KnQMMk6MTYpD7Fi2vmQ6hmI11dmmSY8v4vrclJiyj8ihosnKOZIYp9JMVKlZyw1eZCls+q8BNzPOSjtsxpoBDzo2Z2g2/CvXykklBCfPVkF18/SxHCeTeFEnVhKYSNOr2Mth/oZvKo81IuLPbvJquBIWz/rNWpRb3UVauMzjGqu/IWeMwbZMrRYrohkxlOZdNUpZY26Jv+fXWon+hod9U5EGZYiLWP7nOO4H/+WSa/UyuChadnPuaSzuaaa8hhYS4/xqepF1mgKC04IjGaN30KFdEmUCGDyji2nWOh0jnR2TkXfbF49QYeeHe2GHLDgc+LR/sq/0p5IS6xDULbwN3PchtW1PO2V6wrhmY5W6YFYhVTC3QI5KWmfN6j+YtAm2305UFOWtyeuvvwug9xMUzms8P9QytHak/ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB8440.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(136003)(346002)(366004)(396003)(376002)(1800799009)(451199024)(186009)(41300700001)(66946007)(52116002)(54906003)(6506007)(66476007)(6916009)(316002)(66556008)(6486002)(4326008)(38350700002)(38100700002)(2906002)(26005)(8936002)(8676002)(2616005)(6512007)(5660300002)(83380400001)(86362001)(36756003)(478600001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LG7+L31iqKm9+z1LdFnINuYi2FmwvThM++lJvCQguHTxZaiu2M8vRUsJVrlY7tHWgMYEXgBulicCkw+TkUoIhbZmCVktQL1/NJpTdbAHmRdHBogIqH+lhgRA9hwgm8TPwml+WBqtpIwCbj7cM6H7Bu6t4tn5FIf2zZEqyE5dVUQA5TywoC+9oru+2LqKOehqwnqIKECro5Xj78gvtlNMw0fYNTO9X6FaIuDcqw4SY4auCQMPApYroTbJ69Jb6ZvW+NidK/yEDZnNQA2VXu2T3p3cCMG1xL2wmACK+3RDhAgQbrNpYaonh3IK7Zu82aJI1Ys1hVpvYi0w5HOmCo5rEknO4AKwHgM682TuBUBDzqL2ci/C7PJjSqOklshUyncdSljekM7Qgs6lZxIoPPy2kLirj6rw3AmmbjRlCz8dKiXwsXxVuMxgSCWUolzqZ6Ytnsbm3Qzksy7iuBrccDQyasZih84Z3uiEHAjt9zZi3FWOekObv6LVFX8fe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5Pf1SvTQakk2sfQ/S53y1tc/8XITRlSIFLoj1rC7bAd4aiI= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d408917-1a03-4f1a-6bbc-08dba36aa44b X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB8440.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 23:51:02.2343 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /0libedTd377di8GwMDBXIj56whLPhc71W3huyGoPDpgt23sBg069vzO5gvZOjiRj1GTmd4D29lLSWfl1ZHVEScMYaHSnokCDbn3pWOxu+dGHrh/Q1LfcnQYkiADhSIZ X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3PR01MB11948 Message-ID-Hash: FK4GMNWFBU5XSK63IHTRNBLM3JH4ZKCY X-Message-ID-Hash: FK4GMNWFBU5XSK63IHTRNBLM3JH4ZKCY X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Current adg.c will configure BRGCKR/BRRA/BRRB to output clock when it start sound. OTAH, rsnd_adg_clk_enable() will enables clk_a/b/c when driver was probed. But it is strange, these should be set in the same time. This patch fixup it. Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/adg.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c index 94e048614c81..f0888cf31208 100644 --- a/sound/soc/sh/rcar/adg.c +++ b/sound/soc/sh/rcar/adg.c @@ -359,8 +359,6 @@ int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *ssi_mod, unsigned int rate) ckr = 0x80000000; /* BRGB output = 48kHz */ rsnd_mod_bset(adg_mod, BRGCKR, 0x80770000, adg->ckr | ckr); - rsnd_mod_write(adg_mod, BRRA, adg->brga); - rsnd_mod_write(adg_mod, BRRB, adg->brgb); dev_dbg(dev, "CLKOUT is based on BRG%c (= %dHz)\n", (ckr) ? 'B' : 'A', @@ -373,9 +371,16 @@ int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *ssi_mod, unsigned int rate) void rsnd_adg_clk_control(struct rsnd_priv *priv, int enable) { struct rsnd_adg *adg = rsnd_priv_to_adg(priv); + struct rsnd_mod *adg_mod = rsnd_mod_get(adg); struct clk *clk; int i; + if (enable) { + rsnd_mod_bset(adg_mod, BRGCKR, 0x80770000, adg->ckr); + rsnd_mod_write(adg_mod, BRRA, adg->brga); + rsnd_mod_write(adg_mod, BRRB, adg->brgb); + } + for_each_rsnd_clkin(clk, adg, i) { if (enable) { clk_prepare_enable(clk);