From nobody Sun Feb 8 23:26:22 2026 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 51A6844DB63; Tue, 20 Jan 2026 15:06:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768921584; cv=none; b=j6Fj+r3/hZgM7SraIcDG6pnHZXrZw2ABpXsoM/xtcdts2zdGFGTzIHenVYIU45FlfWsGpK+rze5Lj4MUFDudvIWLMys38DSkhSiXU8UicotXFvN2mbNqn/xNE72kvci21wCEEl43gNwmtOrH1kRcfHXmiwZcN58/HNPyd6bTC9g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768921584; c=relaxed/simple; bh=g74mkjYd/T1r49iTPjhmB5mxAtAAYnDMu7MuP8yatps=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fcFWB1THE8ckzp/7zWxMXK8UQuwzmAzDFKKxYyrbgr4A8RqkjsGTBrKiW8xXtY07rrKxb9Vigi/8wflhpkojv8ag6nkqXsgvRsYdJ8zYSovphOhbmiMql3Nradh64tOwlQeltPjnd1tmWeF68sKkrODRl4R9wkR2OJzX6ffkfFI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: NS3+FQE1SNuDrS2ILb8POQ== X-CSE-MsgGUID: LcuSTYA9R6ysKuhq9B6G5w== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 21 Jan 2026 00:06:16 +0900 Received: from vm01.adwin.renesas.com (unknown [10.226.92.24]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id C65F2402261F; Wed, 21 Jan 2026 00:06:12 +0900 (JST) From: Ovidiu Panait To: geert+renesas@glider.be, magnus.damm@gmail.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, biju.das.jz@bp.renesas.com, fabrizio.castro.jz@renesas.com Cc: linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH v2 1/5] clk: versaclock3: Remove unused SE2 clock select macro Date: Tue, 20 Jan 2026 15:06:02 +0000 Message-ID: <20260120150606.7356-2-ovidiu.panait.rb@renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120150606.7356-1-ovidiu.panait.rb@renesas.com> References: <20260120150606.7356-1-ovidiu.panait.rb@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The VC3_SE2_CTRL_REG0_SE2_CLK_SEL macro is no longer used since commit ae6040cd7c7f8 ("clk: versaclock3: Prepare for the addition of 5L35023 device"), which switched SE2 clock select handling to use variant-specific OF data (se2_clk_sel_msk). Signed-off-by: Ovidiu Panait --- v2 changes: None. drivers/clk/clk-versaclock3.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/clk/clk-versaclock3.c b/drivers/clk/clk-versaclock3.c index 1849863dbd67..f387cdb12f48 100644 --- a/drivers/clk/clk-versaclock3.c +++ b/drivers/clk/clk-versaclock3.c @@ -61,7 +61,6 @@ #define VC3_OUTPUT_CTR_DIV4_SRC_SEL BIT(3) =20 #define VC3_SE2_CTRL_REG0 0x1f -#define VC3_SE2_CTRL_REG0_SE2_CLK_SEL BIT(6) =20 #define VC3_SE3_DIFF1_CTRL_REG 0x21 #define VC3_SE3_DIFF1_CTRL_REG_SE3_CLK_SEL BIT(6) --=20 2.51.0 From nobody Sun Feb 8 23:26:22 2026 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3D0314657EA; Tue, 20 Jan 2026 15:06:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768921590; cv=none; b=jXqs63zGZR/9EfuqIMgAY61F4i04+6UE4ZCusWvKXg2f6xnVLiVVGLgHE29ATXESG22GSWUCQ2jnN6ql8cKPE5kzKMuhlrbBqxpPWAVxmd43yHFQdw4hrAxS/juD0IEvNWD9vdINEbEBZyMfdLf5N6Rk40km2BBtAwwY1OvBoRk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768921590; c=relaxed/simple; bh=X+Hf/miYtwn8mLMNSub6ZRCadjeTxEICFVNeXeYg1Uk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PUO/lfWv1upUhOzj3IlllHZ+xBlmILGC4ZEHA2b/ve2HcaoB+aZtmKmfjwqVHKGLJdVFNg76/hyVg/SBkDBz3q4vKbDA+TLtz7y5jFe9o/7ARWqDbOEQXfC9N5/eSORDkQjxXWYxHEJR2tZQa/AKBF4JFbiRFf9I4s2H8oojRrU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: 6rtea5VQRTmKzgffk2w0sA== X-CSE-MsgGUID: V8VhoD5nQja+AnoRf8zdjw== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 21 Jan 2026 00:06:21 +0900 Received: from vm01.adwin.renesas.com (unknown [10.226.92.24]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 81016402261F; Wed, 21 Jan 2026 00:06:17 +0900 (JST) From: Ovidiu Panait To: geert+renesas@glider.be, magnus.damm@gmail.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, biju.das.jz@bp.renesas.com, fabrizio.castro.jz@renesas.com Cc: linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH v2 2/5] clk: versaclock3: Use clk_parent_data arrays for clk_mux Date: Tue, 20 Jan 2026 15:06:03 +0000 Message-ID: <20260120150606.7356-3-ovidiu.panait.rb@renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120150606.7356-1-ovidiu.panait.rb@renesas.com> References: <20260120150606.7356-1-ovidiu.panait.rb@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Replace the inline parent_hws initializers with static clk_parent_data arrays for the clk muxes. This provides more flexibility in how parents are described and will simplify extending the parent lists in the next commit. Signed-off-by: Ovidiu Panait --- v2 changes: None. drivers/clk/clk-versaclock3.c | 48 ++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/drivers/clk/clk-versaclock3.c b/drivers/clk/clk-versaclock3.c index f387cdb12f48..ebd9d75d7f55 100644 --- a/drivers/clk/clk-versaclock3.c +++ b/drivers/clk/clk-versaclock3.c @@ -900,6 +900,29 @@ static struct vc3_hw_data clk_div[] =3D { } }; =20 +static const struct clk_parent_data clk_mux_parent_data[][2] =3D { + [VC3_SE1_MUX] =3D { + { .hw =3D &clk_div[VC3_DIV5].hw }, + { .hw =3D &clk_div[VC3_DIV4].hw } + }, + [VC3_SE2_MUX] =3D { + { .hw =3D &clk_div[VC3_DIV5].hw }, + { .hw =3D &clk_div[VC3_DIV4].hw } + }, + [VC3_SE3_MUX] =3D { + { .hw =3D &clk_div[VC3_DIV2].hw }, + { .hw =3D &clk_div[VC3_DIV4].hw } + }, + [VC3_DIFF1_MUX] =3D { + { .hw =3D &clk_div[VC3_DIV1].hw }, + { .hw =3D &clk_div[VC3_DIV3].hw } + }, + [VC3_DIFF2_MUX] =3D { + { .hw =3D &clk_div[VC3_DIV1].hw }, + { .hw =3D &clk_div[VC3_DIV3].hw } + }, +}; + static struct vc3_hw_data clk_mux[] =3D { [VC3_SE1_MUX] =3D { .data =3D &(struct vc3_clk_data) { @@ -909,10 +932,7 @@ static struct vc3_hw_data clk_mux[] =3D { .hw.init =3D &(struct clk_init_data) { .name =3D "se1_mux", .ops =3D &vc3_clk_mux_ops, - .parent_hws =3D (const struct clk_hw *[]) { - &clk_div[VC3_DIV5].hw, - &clk_div[VC3_DIV4].hw - }, + .parent_data =3D clk_mux_parent_data[VC3_SE1_MUX], .num_parents =3D 2, .flags =3D CLK_SET_RATE_PARENT } @@ -924,10 +944,7 @@ static struct vc3_hw_data clk_mux[] =3D { .hw.init =3D &(struct clk_init_data) { .name =3D "se2_mux", .ops =3D &vc3_clk_mux_ops, - .parent_hws =3D (const struct clk_hw *[]) { - &clk_div[VC3_DIV5].hw, - &clk_div[VC3_DIV4].hw - }, + .parent_data =3D clk_mux_parent_data[VC3_SE2_MUX], .num_parents =3D 2, .flags =3D CLK_SET_RATE_PARENT } @@ -940,10 +957,7 @@ static struct vc3_hw_data clk_mux[] =3D { .hw.init =3D &(struct clk_init_data) { .name =3D "se3_mux", .ops =3D &vc3_clk_mux_ops, - .parent_hws =3D (const struct clk_hw *[]) { - &clk_div[VC3_DIV2].hw, - &clk_div[VC3_DIV4].hw - }, + .parent_data =3D clk_mux_parent_data[VC3_SE3_MUX], .num_parents =3D 2, .flags =3D CLK_SET_RATE_PARENT } @@ -956,10 +970,7 @@ static struct vc3_hw_data clk_mux[] =3D { .hw.init =3D &(struct clk_init_data) { .name =3D "diff1_mux", .ops =3D &vc3_clk_mux_ops, - .parent_hws =3D (const struct clk_hw *[]) { - &clk_div[VC3_DIV1].hw, - &clk_div[VC3_DIV3].hw - }, + .parent_data =3D clk_mux_parent_data[VC3_DIFF1_MUX], .num_parents =3D 2, .flags =3D CLK_SET_RATE_PARENT } @@ -972,10 +983,7 @@ static struct vc3_hw_data clk_mux[] =3D { .hw.init =3D &(struct clk_init_data) { .name =3D "diff2_mux", .ops =3D &vc3_clk_mux_ops, - .parent_hws =3D (const struct clk_hw *[]) { - &clk_div[VC3_DIV1].hw, - &clk_div[VC3_DIV3].hw - }, + .parent_data =3D clk_mux_parent_data[VC3_DIFF2_MUX], .num_parents =3D 2, .flags =3D CLK_SET_RATE_PARENT } --=20 2.51.0 From nobody Sun Feb 8 23:26:22 2026 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 295DE466B44; Tue, 20 Jan 2026 15:06:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768921593; cv=none; b=tG6N4JKcx4SXIeaVzsOB/o194UlyuUCII9YD5y3GH/NWFkfeVEXHFaU8YKvLo0ZbeiVWZk/CR/wUmkRO/P86t8aELVqI/LuDwF9tDkLEE4RgfzMwNpUkXK+2UiwpYeXwm/BR57j02cooTWUkH8nyVrxn/7EqnaenxZ+TKQK9Y70= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768921593; c=relaxed/simple; bh=KZwTxLHxL1Doc3YxcrFYNw6yDZhRFqBpXb+jaGyw/bE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Aj5zsycpfrnhBLZiPgsmW5v+7v35VT/x5U0ZF3Q/l0fyPI2KgcHpr4lavW7j3NOBi4Xp0pxtb9NTHo76I4QqikCtKP36u2ngHbsSaRW931CIkfZuxmjCK1rCUBUwO6MSnlSTkI6biXMJHYSpNf7uD+vDMz0yDBnnauKOOAbRo1g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: YUnI0gulSLa/BzAAMZY4hg== X-CSE-MsgGUID: vkMZCOxXR+anPv7ZJhBuAg== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 21 Jan 2026 00:06:26 +0900 Received: from vm01.adwin.renesas.com (unknown [10.226.92.24]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 3171D4022B00; Wed, 21 Jan 2026 00:06:21 +0900 (JST) From: Ovidiu Panait To: geert+renesas@glider.be, magnus.damm@gmail.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, biju.das.jz@bp.renesas.com, fabrizio.castro.jz@renesas.com Cc: linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH v2 3/5] clk: versaclock3: Add freerunning 32.768kHz clock support Date: Tue, 20 Jan 2026 15:06:04 +0000 Message-ID: <20260120150606.7356-4-ovidiu.panait.rb@renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120150606.7356-1-ovidiu.panait.rb@renesas.com> References: <20260120150606.7356-1-ovidiu.panait.rb@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Versa 3 clock generator has an internal 32.768kHz oscillator that can be routed to the SE1, SE2 and SE3 outputs. This patch exposes it as a fixed-rate clock ("vc3-clk-32k") and makes it available as a parent for the SE1/SE2/SE3 muxes. The 32.768kHz clock is only intended to be used when explicitly requested (i.e. when a rate of exactly 32768Hz is set). Selecting it as a fallback for other rates can cause issues, for example in audio configurations. To enforce this, introduce a new helper function, _vc3_clk_mux_determine_rate() which rejects configurations where the 32.768kHz parent would otherwise be chosen implicitly. Two new fields are added to struct vc3_clk_data: - clk_32k_bitmsk: bit mask for selecting the 32.768kHz oscillator - clk_32k_index: index of the 32.768kHz clock in the mux parent list They are used by clk_mux callbacks to select the appropriate parent clock. Signed-off-by: Ovidiu Panait --- v2 changes: None. drivers/clk/clk-versaclock3.c | 85 +++++++++++++++++++++++++++++------ 1 file changed, 71 insertions(+), 14 deletions(-) diff --git a/drivers/clk/clk-versaclock3.c b/drivers/clk/clk-versaclock3.c index ebd9d75d7f55..b5df349f497d 100644 --- a/drivers/clk/clk-versaclock3.c +++ b/drivers/clk/clk-versaclock3.c @@ -61,8 +61,10 @@ #define VC3_OUTPUT_CTR_DIV4_SRC_SEL BIT(3) =20 #define VC3_SE2_CTRL_REG0 0x1f +#define VC3_SE2_CTRL_REG0_SE2_FREERUN_32K BIT(7) =20 #define VC3_SE3_DIFF1_CTRL_REG 0x21 +#define VC3_SE3_DIFF1_CTRL_REG_SE3_FREERUN_32K BIT(7) #define VC3_SE3_DIFF1_CTRL_REG_SE3_CLK_SEL BIT(6) =20 #define VC3_DIFF1_CTRL_REG 0x22 @@ -72,6 +74,7 @@ #define VC3_DIFF2_CTRL_REG_DIFF2_CLK_SEL BIT(7) =20 #define VC3_SE1_DIV4_CTRL 0x24 +#define VC3_SE1_DIV4_CTRL_SE1_FREERUN_32K BIT(4) #define VC3_SE1_DIV4_CTRL_SE1_CLK_SEL BIT(3) =20 #define VC3_PLL1_VCO_MIN 300000000UL @@ -83,6 +86,9 @@ #define VC3_2_POW_16 (U16_MAX + 1) #define VC3_DIV_MASK(width) ((1 << (width)) - 1) =20 +#define VC3_CLK_32K_NAME "vc3-clk-32k" +#define VC3_CLK_32K_FREQ 32768 + enum vc3_pfd_mux { VC3_PFD2_MUX, VC3_PFD3_MUX, @@ -134,6 +140,9 @@ enum vc3_clk_mux { struct vc3_clk_data { u8 offs; u8 bitmsk; + + u8 clk_32k_bitmsk; + u8 clk_32k_index; }; =20 struct vc3_pfd_data { @@ -213,6 +222,7 @@ static const struct clk_div_table div3_divs[] =3D { {} }; =20 +static struct clk_hw *clk_32k; static struct clk_hw *clk_out[6]; =20 static u8 vc3_pfd_mux_get_parent(struct clk_hw *hw) @@ -549,19 +559,40 @@ static const struct clk_ops vc3_div_ops =3D { .set_rate =3D vc3_div_set_rate, }; =20 +static int _vc3_clk_mux_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) +{ + bool is_32k_req =3D (req->rate =3D=3D VC3_CLK_32K_FREQ); + struct clk_rate_request tmp_req; + int ret; + + clk_hw_init_rate_request(hw, &tmp_req, req->rate); + + ret =3D clk_mux_determine_rate_flags(hw, &tmp_req, CLK_SET_RATE_PARENT); + if (ret) + return ret; + + /* Select the 32.768 kHz parent only when explicitly requested. */ + if ((tmp_req.best_parent_rate =3D=3D VC3_CLK_32K_FREQ) && !is_32k_req) + return -EINVAL; + + memcpy(req, &tmp_req, sizeof(*req)); + + return 0; +} + static int vc3_clk_mux_determine_rate(struct clk_hw *hw, struct clk_rate_request *req) { int frc; =20 - if (clk_mux_determine_rate_flags(hw, req, CLK_SET_RATE_PARENT)) { + if (_vc3_clk_mux_determine_rate(hw, req)) { /* The below check is equivalent to (best_parent_rate/rate) */ if (req->best_parent_rate >=3D req->rate) { frc =3D DIV_ROUND_CLOSEST_ULL(req->best_parent_rate, req->rate); req->rate *=3D frc; - return clk_mux_determine_rate_flags(hw, req, - CLK_SET_RATE_PARENT); + return _vc3_clk_mux_determine_rate(hw, req); } } =20 @@ -576,6 +607,9 @@ static u8 vc3_clk_mux_get_parent(struct clk_hw *hw) =20 regmap_read(vc3->regmap, clk_mux->offs, &val); =20 + if (clk_mux->clk_32k_bitmsk && !(val & clk_mux->clk_32k_bitmsk)) + return clk_mux->clk_32k_index; + return !!(val & clk_mux->bitmsk); } =20 @@ -583,9 +617,15 @@ static int vc3_clk_mux_set_parent(struct clk_hw *hw, u= 8 index) { struct vc3_hw_data *vc3 =3D container_of(hw, struct vc3_hw_data, hw); const struct vc3_clk_data *clk_mux =3D vc3->data; + unsigned int bitmsk =3D clk_mux->clk_32k_bitmsk; + unsigned int val =3D 0; + + if (index !=3D clk_mux->clk_32k_index) { + bitmsk |=3D clk_mux->bitmsk; + val =3D clk_mux->clk_32k_bitmsk | (index ? clk_mux->bitmsk : 0); + } =20 - return regmap_update_bits(vc3->regmap, clk_mux->offs, clk_mux->bitmsk, - index ? clk_mux->bitmsk : 0); + return regmap_update_bits(vc3->regmap, clk_mux->offs, bitmsk, val); } =20 static const struct clk_ops vc3_clk_mux_ops =3D { @@ -900,18 +940,21 @@ static struct vc3_hw_data clk_div[] =3D { } }; =20 -static const struct clk_parent_data clk_mux_parent_data[][2] =3D { +static const struct clk_parent_data clk_mux_parent_data[][3] =3D { [VC3_SE1_MUX] =3D { { .hw =3D &clk_div[VC3_DIV5].hw }, - { .hw =3D &clk_div[VC3_DIV4].hw } + { .hw =3D &clk_div[VC3_DIV4].hw }, + { .name =3D VC3_CLK_32K_NAME, .index =3D -1 } }, [VC3_SE2_MUX] =3D { { .hw =3D &clk_div[VC3_DIV5].hw }, - { .hw =3D &clk_div[VC3_DIV4].hw } + { .hw =3D &clk_div[VC3_DIV4].hw }, + { .name =3D VC3_CLK_32K_NAME, .index =3D -1 } }, [VC3_SE3_MUX] =3D { { .hw =3D &clk_div[VC3_DIV2].hw }, - { .hw =3D &clk_div[VC3_DIV4].hw } + { .hw =3D &clk_div[VC3_DIV4].hw }, + { .name =3D VC3_CLK_32K_NAME, .index =3D -1 } }, [VC3_DIFF1_MUX] =3D { { .hw =3D &clk_div[VC3_DIV1].hw }, @@ -927,38 +970,44 @@ static struct vc3_hw_data clk_mux[] =3D { [VC3_SE1_MUX] =3D { .data =3D &(struct vc3_clk_data) { .offs =3D VC3_SE1_DIV4_CTRL, - .bitmsk =3D VC3_SE1_DIV4_CTRL_SE1_CLK_SEL + .bitmsk =3D VC3_SE1_DIV4_CTRL_SE1_CLK_SEL, + .clk_32k_bitmsk =3D VC3_SE1_DIV4_CTRL_SE1_FREERUN_32K, + .clk_32k_index =3D 2 }, .hw.init =3D &(struct clk_init_data) { .name =3D "se1_mux", .ops =3D &vc3_clk_mux_ops, .parent_data =3D clk_mux_parent_data[VC3_SE1_MUX], - .num_parents =3D 2, + .num_parents =3D 3, .flags =3D CLK_SET_RATE_PARENT } }, [VC3_SE2_MUX] =3D { .data =3D &(struct vc3_clk_data) { .offs =3D VC3_SE2_CTRL_REG0, + .clk_32k_bitmsk =3D VC3_SE2_CTRL_REG0_SE2_FREERUN_32K, + .clk_32k_index =3D 2 }, .hw.init =3D &(struct clk_init_data) { .name =3D "se2_mux", .ops =3D &vc3_clk_mux_ops, .parent_data =3D clk_mux_parent_data[VC3_SE2_MUX], - .num_parents =3D 2, + .num_parents =3D 3, .flags =3D CLK_SET_RATE_PARENT } }, [VC3_SE3_MUX] =3D { .data =3D &(struct vc3_clk_data) { .offs =3D VC3_SE3_DIFF1_CTRL_REG, - .bitmsk =3D VC3_SE3_DIFF1_CTRL_REG_SE3_CLK_SEL + .bitmsk =3D VC3_SE3_DIFF1_CTRL_REG_SE3_CLK_SEL, + .clk_32k_bitmsk =3D VC3_SE3_DIFF1_CTRL_REG_SE3_FREERUN_32K, + .clk_32k_index =3D 2 }, .hw.init =3D &(struct clk_init_data) { .name =3D "se3_mux", .ops =3D &vc3_clk_mux_ops, .parent_data =3D clk_mux_parent_data[VC3_SE3_MUX], - .num_parents =3D 2, + .num_parents =3D 3, .flags =3D CLK_SET_RATE_PARENT } }, @@ -1038,6 +1087,14 @@ static int vc3_probe(struct i2c_client *client) return ret; } =20 + /* Register fixed 32.768kHz clock */ + clk_32k =3D devm_clk_hw_register_fixed_rate(dev, VC3_CLK_32K_NAME, NULL, + 0, VC3_CLK_32K_FREQ); + if (IS_ERR(clk_32k)) + return dev_err_probe(dev, PTR_ERR(clk_32k), + "Failed to register %dHz fixed clock\n", + VC3_CLK_32K_FREQ); + /* Register pfd muxes */ for (i =3D 0; i < ARRAY_SIZE(clk_pfd_mux); i++) { clk_pfd_mux[i].regmap =3D regmap; --=20 2.51.0 From nobody Sun Feb 8 23:26:22 2026 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01F95466B50; Tue, 20 Jan 2026 15:06:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768921594; cv=none; b=QPE5jYVGXohA5lVod4wcoyaYcMTz2mH4KLrnwcK6abD7TNp1jj6v0wDWc0JYXeRDyfjwre31OXdrujEypoBWTM3ONSrpuu/4zyqbib6dY7DAuqKvJJpZJlf/4oV1X8qyziq52mjtuiyTLNg1fKpZeUWQI0ZSmDHS3Nvt28YjAxk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768921594; c=relaxed/simple; bh=vgIXuJTGjYgFHqOU/AjAXxtKNjUamkHUF8We3gLEPZE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h/ZEYKLD9t/ZWklu3SO7+ZkTNGVKasfX9UQEUw8HvCBIg7nbvj7BbjoVNjXKHLV7ujrezSPbw8X5/TwZtYAgAfJIpIH5SnE7AuoHPDIve3bIUnmaSygcnfOr/SaAmCdwPwg+LYhAQ6DmrqotpD1UGH2YDf0RjsYnwsQpp3WQ7xc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: O3X+MApoTZKD71CsGiiHpA== X-CSE-MsgGUID: Fk0qRjr3RRe3wIeUmI+QQw== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 21 Jan 2026 00:06:30 +0900 Received: from vm01.adwin.renesas.com (unknown [10.226.92.24]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id D8173402261F; Wed, 21 Jan 2026 00:06:26 +0900 (JST) From: Ovidiu Panait To: geert+renesas@glider.be, magnus.damm@gmail.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, biju.das.jz@bp.renesas.com, fabrizio.castro.jz@renesas.com Cc: linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH v2 4/5] arm64: dts: renesas: r9a09g057h44-rzv2h-evk: Add versa3 clock generator node Date: Tue, 20 Jan 2026 15:06:05 +0000 Message-ID: <20260120150606.7356-5-ovidiu.panait.rb@renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120150606.7356-1-ovidiu.panait.rb@renesas.com> References: <20260120150606.7356-1-ovidiu.panait.rb@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add versa3 clock generator node. It provides clocks for the RTC, PCIe and audio devices. Signed-off-by: Ovidiu Panait --- v2 changes: None. .../dts/renesas/r9a09g057h44-rzv2h-evk.dts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r9a09g057h44-rzv2h-evk.dts b/arch/= arm64/boot/dts/renesas/r9a09g057h44-rzv2h-evk.dts index dc4577ebf2e9..4a70e0707b38 100644 --- a/arch/arm64/boot/dts/renesas/r9a09g057h44-rzv2h-evk.dts +++ b/arch/arm64/boot/dts/renesas/r9a09g057h44-rzv2h-evk.dts @@ -108,6 +108,12 @@ vqmmc_sdhi1: regulator-vccq-sdhi1 { states =3D <3300000 0>, <1800000 1>; }; =20 + x1: x1-clock { + compatible =3D "fixed-clock"; + #clock-cells =3D <0>; + clock-frequency =3D <24000000>; + }; + /* 32.768kHz crystal */ x6: x6-clock { compatible =3D "fixed-clock"; @@ -277,6 +283,25 @@ raa215300: pmic@12 { clocks =3D <&x6>; clock-names =3D "xin"; }; + + versa3: clock-generator@69 { + compatible =3D "renesas,5l35023"; + reg =3D <0x69>; + clocks =3D <&x1>; + #clock-cells =3D <1>; + assigned-clocks =3D <&versa3 0>, + <&versa3 1>, + <&versa3 2>, + <&versa3 3>, + <&versa3 4>, + <&versa3 5>; + assigned-clock-rates =3D <24000000>, + <24576000>, + <32768>, + <22579200>, + <100000000>, + <100000000>; + }; }; =20 &mdio0 { --=20 2.51.0 From nobody Sun Feb 8 23:26:22 2026 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D204947A0BD; Tue, 20 Jan 2026 15:06:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768921598; cv=none; b=Vf4tqF/5bzLRzCnZ+D6dQX7Iju1tw9GfyOc4X3d075Vr5c0BMma6P8Ln/a7SJrLcE6ZlX8Azpp9M8P2KaUQyCVRTjgp3HaGIlrT+msiyo2iIR/z1t3wVujMFiCGd7v5t8HxRFTLyHPkKg8Ey7Qqjgq2lIiPX/VMkcdOaKPySVR4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768921598; c=relaxed/simple; bh=HwnOiUZ/RWt0dPC99yeATkbRtqsbXpXMaimFxLxXPd4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dF9qfkbTMfr7+EdEbbdcizPYxelWS5GUFDmxKn0H4cHcfhR/loDyi36SCTnnrumLlB8pCvLnmb5u9yHMZFqKJpCmY16GqCW5lsZ+2HT+oPtJZd3LOOngA3bCWRjRKXBaZ4+5Crcf1gdb1OarLGeGzQiYxmEUwz8Z0/bCrqk0Xi4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: it7hc4pmSfCLjwohDXpBcg== X-CSE-MsgGUID: Ibvn49FOQWeHXGv3xtef7w== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 21 Jan 2026 00:06:35 +0900 Received: from vm01.adwin.renesas.com (unknown [10.226.92.24]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 887C44022B00; Wed, 21 Jan 2026 00:06:31 +0900 (JST) From: Ovidiu Panait To: geert+renesas@glider.be, magnus.damm@gmail.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, biju.das.jz@bp.renesas.com, fabrizio.castro.jz@renesas.com Cc: linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH v2 5/5] arm64: dts: renesas: r9a09g056n48-rzv2n-evk: Add versa3 clock generator node Date: Tue, 20 Jan 2026 15:06:06 +0000 Message-ID: <20260120150606.7356-6-ovidiu.panait.rb@renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120150606.7356-1-ovidiu.panait.rb@renesas.com> References: <20260120150606.7356-1-ovidiu.panait.rb@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add versa3 clock generator node. It provides clocks for the RTC, PCIe and audio devices. Signed-off-by: Ovidiu Panait --- v2 changes: New patch. .../dts/renesas/r9a09g056n48-rzv2n-evk.dts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r9a09g056n48-rzv2n-evk.dts b/arch/= arm64/boot/dts/renesas/r9a09g056n48-rzv2n-evk.dts index 9af50198d2f1..8399f4f705c4 100644 --- a/arch/arm64/boot/dts/renesas/r9a09g056n48-rzv2n-evk.dts +++ b/arch/arm64/boot/dts/renesas/r9a09g056n48-rzv2n-evk.dts @@ -100,6 +100,12 @@ vqmmc_sdhi1: regulator-vqmmc-sdhi1 { states =3D <3300000 0>, <1800000 1>; }; =20 + x1: x1-clock { + compatible =3D "fixed-clock"; + #clock-cells =3D <0>; + clock-frequency =3D <24000000>; + }; + /* 32.768kHz crystal */ x6: x6-clock { compatible =3D "fixed-clock"; @@ -256,6 +262,25 @@ raa215300: pmic@12 { clocks =3D <&x6>; clock-names =3D "xin"; }; + + versa3: clock-generator@69 { + compatible =3D "renesas,5l35023"; + reg =3D <0x69>; + clocks =3D <&x1>; + #clock-cells =3D <1>; + assigned-clocks =3D <&versa3 0>, + <&versa3 1>, + <&versa3 2>, + <&versa3 3>, + <&versa3 4>, + <&versa3 5>; + assigned-clock-rates =3D <24000000>, + <24576000>, + <32768>, + <22579200>, + <100000000>, + <100000000>; + }; }; =20 &mdio0 { --=20 2.51.0