From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FEB533554F for ; Tue, 9 Jun 2026 01:31:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780968719; cv=none; b=R/vtc+Rm9zcVW6d/JBZytVNragpbc6/R2ylCR04t3n2UKcJLSJpkVuVCftx76j1+6hxZ/oSIPGC1mfaEdomBPGC5SYyJyHSwblb/SlJJxLZ7AYUt5B6ey9BaA4XdvVAvR3zOWTY6Y8wI6qGG4c3TTd/+92hXj/bAe2e1i4EdW4U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780968719; c=relaxed/simple; bh=MuXPX50lKPAzNlwpboundlyXapF7ai/VmXPDdxRmtqs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hwh02onxEgjn8ijz3QUYS4QcezfGnNbJvAi7BFwwjofoGODhua24hmUuNf74c7CJNM7PAECTi7HlMkLPAS8cn4aMYNuRkrRcq3r/V/GYHWsulljUZAifWT1oTq55m/aeJjHB1Q1N7aVD/s/V8HdIPPmKMnFq/JF3o57zUpy4dHI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eWhCArQX; arc=none smtp.client-ip=209.85.216.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eWhCArQX" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-36baeec21dcso3090507a91.3 for ; Mon, 08 Jun 2026 18:31:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780968715; x=1781573515; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cTbxMBmmKBq0qJ9h4eige5HKc/AYPyWT46wIah6eu3I=; b=eWhCArQXp0QuRtxyFCX4CW8s/0DUWrpla07mPa3mvpDa+oVpNjh6XWsHPEKdhz5t5V B6pk+HB8cFTquj1SSYJ17l6DX+sT4pwJTboGz5XSxVTiLoFuESe44veVB8zqwGQeBTZ5 dJuqTEM9zVwGkrLdxvc6XvInkEEGu0FKy6vXl/uE1yJP0NsNEYRDdtdZ9mez+WJLD6nD 6+IDnVgMn4H8ez3Y9C4Hinjyl6SiWwfaNbB5ZGKK+RnajH8GLj0MoakTUSGnzJFmc3u2 0H9m1fZ4WkAecym63WMJziGChPQILrE6InoyhBPDKCFz7VTtEl8wjJdmfjuo4+2WG8G5 mPrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780968715; x=1781573515; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=cTbxMBmmKBq0qJ9h4eige5HKc/AYPyWT46wIah6eu3I=; b=UIIcmb6BHMyvtvccm/kMH5N6FZhADGQbVLo8sGw2DPIaztVtHNKWQsC9gX+wU5HGh2 eVaza9vHpwfzc40QDXkLi0huFeXL6R15vwag7E5F863YsR6PeOhAXVMqrB7Sq47U3P/w aYKF5qhPzLIObeTsu8pCOigWIGnqaPoVRap834dg+OfEgGpEPbRlbhLhlG8VEJl4ahsj Gf0LCZhEEyPx27VPZrNYqG0EzAEW9Gn9LciJvpdlBJ+5bqbpkrQEB9baS8UY8oosBE/i h3QbmL2nG7OSEl9NNTgeKik+X8bsIdd3ppzjFnjkyLXv8//fNEbJN0yM8n5r1UAx1k9d 35Ng== X-Forwarded-Encrypted: i=1; AFNElJ8rIDz/b1mmjkEwhXvxWnOi97PHQzyez4bqITVTiE28QRsgjeI81FVzP2dpbGc0zy+J/Q58AKIYrLWhVb4=@vger.kernel.org X-Gm-Message-State: AOJu0YwGyLMyxurC8P/Kohl3Yvd5BoPHVc45vkAp9pWd9y61haKrBrym CqHu8z352aoKLGp3PbsJ5F5snTJXlfAFJL9DA6fSBpypqkL1/aNSMwbV X-Gm-Gg: Acq92OFGAEKxRrejMbZXL694/1DnLyUxlT6Vn5xwLJFGynCwKw4hIaayHuJnsaQnsuE WCZAUkz+on4fa/Uu1bEyRFsLl+1/sSOVr3OMXjpmxYLorGfK05bYHNk651yq/VVRqa0WAeo2TGK 6atpz/IiG+G7oQ1lc8u+Q7Bzd/l8bNbi4LSgBFSKq1X1SpBQWGkJUvAH1AUWQgmLLHt/dvg4EZT FR43IO7ugCNZSsNXI8OXuEfxE11w4MK8rVsvBG5rVJAMuFWdSrIK/lYUsdVDxHo6gGWIJGiCSJ6 zs2g94vzQr1jENLIu1i/l2u3U/Ritj/9eMhSzbWBWYqU29KSgZPHvggsRVd2N8mS3iTvuRFxcz3 HJmyh6230F/h9uW87wHkBrR0sNRdeAFIsrmmiHi3c/Fp1rAdlkNfiqlAHEBtP/wIIWlx/0Fmy2k MVRZx5hy2JXZs5fKTLxsTUyJMakb0MRUqlrDZyqzRV6PD7T/wMlmVEA6672CEmm+NY9u54 X-Received: by 2002:a17:90b:5583:b0:36d:9e0b:3801 with SMTP id 98e67ed59e1d1-370ef0eae62mr20642239a91.8.1780968714539; Mon, 08 Jun 2026 18:31:54 -0700 (PDT) Received: from phuc-desktop.. ([183.91.15.56]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c16609e627sm198765335ad.52.2026.06.08.18.31.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2026 18:31:54 -0700 (PDT) From: phucduc.bui@gmail.com To: Kuninori Morimoto , Mark Brown , Geert Uytterhoeven Cc: Liam Girdwood , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Magnus Damm , Jaroslav Kysela , Takashi Iwai , linux-sound@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, bui duc phuc Subject: [PATCH v5 06/11] ASoC: renesas: fsi: Move fsi_clk_init() Date: Tue, 9 Jun 2026 08:31:02 +0700 Message-ID: <20260609013107.5995-7-phucduc.bui@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260609013107.5995-1-phucduc.bui@gmail.com> References: <20260609013107.5995-1-phucduc.bui@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: bui duc phuc Move fsi_clk_init() after set_rate() functions to prepare for subsequent refactoring. Suggested-by: Kuninori Morimoto Signed-off-by: bui duc phuc --- sound/soc/renesas/fsi.c | 128 ++++++++++++++++++++-------------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/sound/soc/renesas/fsi.c b/sound/soc/renesas/fsi.c index 3e3c6fd7c56b..1df7dc014363 100644 --- a/sound/soc/renesas/fsi.c +++ b/sound/soc/renesas/fsi.c @@ -717,70 +717,6 @@ static void fsi_spdif_clk_ctrl(struct fsi_priv *fsi, int enable) /* * clock function */ -static int fsi_clk_init(struct device *dev, - struct fsi_priv *fsi, - int xck, - int ick, - int div, - int (*set_rate)(struct device *dev, - struct fsi_priv *fsi)) -{ - struct fsi_clk *clock = &fsi->clock; - int is_porta = fsi_is_port_a(fsi); - - clock->xck = NULL; - clock->ick = NULL; - clock->div = NULL; - clock->rate = 0; - clock->count = 0; - clock->set_rate = set_rate; - - clock->own = devm_clk_get(dev, NULL); - if (IS_ERR(clock->own)) - return -EINVAL; - - /* external clock */ - if (xck) { - clock->xck = devm_clk_get(dev, is_porta ? "xcka" : "xckb"); - if (IS_ERR(clock->xck)) { - dev_err(dev, "can't get xck clock\n"); - return -EINVAL; - } - if (clock->xck == clock->own) { - dev_err(dev, "cpu doesn't support xck clock\n"); - return -EINVAL; - } - } - - /* FSIACLK/FSIBCLK */ - if (ick) { - clock->ick = devm_clk_get(dev, is_porta ? "icka" : "ickb"); - if (IS_ERR(clock->ick)) { - dev_err(dev, "can't get ick clock\n"); - return -EINVAL; - } - if (clock->ick == clock->own) { - dev_err(dev, "cpu doesn't support ick clock\n"); - return -EINVAL; - } - } - - /* FSI-DIV */ - if (div) { - clock->div = devm_clk_get(dev, is_porta ? "diva" : "divb"); - if (IS_ERR(clock->div)) { - dev_err(dev, "can't get div clock\n"); - return -EINVAL; - } - if (clock->div == clock->own) { - dev_err(dev, "cpu doesn't support div clock\n"); - return -EINVAL; - } - } - - return 0; -} - #define fsi_clk_invalid(fsi) fsi_clk_valid(fsi, 0) static void fsi_clk_valid(struct fsi_priv *fsi, unsigned long rate) { @@ -1034,6 +970,70 @@ static int fsi_clk_set_rate_cpg(struct device *dev, return ret; } +static int fsi_clk_init(struct device *dev, + struct fsi_priv *fsi, + int xck, + int ick, + int div, + int (*set_rate)(struct device *dev, + struct fsi_priv *fsi)) +{ + struct fsi_clk *clock = &fsi->clock; + int is_porta = fsi_is_port_a(fsi); + + clock->xck = NULL; + clock->ick = NULL; + clock->div = NULL; + clock->rate = 0; + clock->count = 0; + clock->set_rate = set_rate; + + clock->own = devm_clk_get(dev, NULL); + if (IS_ERR(clock->own)) + return -EINVAL; + + /* external clock */ + if (xck) { + clock->xck = devm_clk_get(dev, is_porta ? "xcka" : "xckb"); + if (IS_ERR(clock->xck)) { + dev_err(dev, "can't get xck clock\n"); + return -EINVAL; + } + if (clock->xck == clock->own) { + dev_err(dev, "cpu doesn't support xck clock\n"); + return -EINVAL; + } + } + + /* FSIACLK/FSIBCLK */ + if (ick) { + clock->ick = devm_clk_get(dev, is_porta ? "icka" : "ickb"); + if (IS_ERR(clock->ick)) { + dev_err(dev, "can't get ick clock\n"); + return -EINVAL; + } + if (clock->ick == clock->own) { + dev_err(dev, "cpu doesn't support ick clock\n"); + return -EINVAL; + } + } + + /* FSI-DIV */ + if (div) { + clock->div = devm_clk_get(dev, is_porta ? "diva" : "divb"); + if (IS_ERR(clock->div)) { + dev_err(dev, "can't get div clock\n"); + return -EINVAL; + } + if (clock->div == clock->own) { + dev_err(dev, "cpu doesn't support div clock\n"); + return -EINVAL; + } + } + + return 0; +} + static void fsi_pointer_update(struct fsi_stream *io, int size) { io->buff_sample_pos += size; -- 2.43.0