From: Chaoyi Chen <chaoyi.chen@rock-chips.com>
To: Michal Wilczynski <m.wilczynski@samsung.com>
Cc: Vinod Koul <vkoul@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Andrzej Hajda <andrzej.hajda@intel.com>,
Robert Foss <rfoss@kernel.org>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Luca Ceresoli <luca.ceresoli@bootlin.com>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
Lee Jones <lee@kernel.org>, Andy Yan <andy.yan@rock-chips.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Emil Renner Berthing <kernel@esmil.dk>,
Hal Feng <hal.feng@starfivetech.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Brian Masney <bmasney@redhat.com>,
Heiko Stuebner <heiko@sntech.de>, Conor Dooley <conor@kernel.org>,
Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
Dominique Belhachemi <db@domibel.de>,
Brian Masney <bmasney+clk@redhat.com>,
Jerome Brunet <jbrunet+clk@baylibre.com>,
linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
mfd@lists.linux.dev, linux-clk@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org,
linux-riscv@lists.infradead.org, Andy Yan <andyshrk@163.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Maud Spierings <maud_spierings@murena.io>,
Graham Markall <hello@big-grey.co.uk>,
Icenowy Zheng <zhengxingda@iscas.ac.cn>
Subject: Re: [PATCH v3 16/19] phy: rockchip: inno-hdmi: Use the common Innosilicon PHY helpers
Date: Mon, 7 Sep 2026 11:20:51 +0800 [thread overview]
Message-ID: <6e96691c-5d52-4e00-a15b-2a2b21f65fe3@rock-chips.com> (raw)
In-Reply-To: <20260904-jh7110-clean-send-v3-16-484f9ae72715@samsung.com>
Hello Michal,
On 9/4/2026 9:27 PM, Michal Wilczynski wrote:
> The RK3328 pre-PLL programming, its table lookup and its recalc_rate and
> determine_rate implementations are the generic Innosilicon ones, so drop
> the local copies and use the shared helpers instead.
>
> The RK3228 pre-PLL sits at different register addresses, so it keeps its
> own register level code and only shares the table lookup.
>
> The now unused RK3328 pre-PLL register macros go with it, as does the
> local pre-PLL config lookup wrapper; both call sites already have the
> TMDS clock to hand and call inno_hdmi_phy_pre_pll_lookup() directly.
>
> The RK3328 recalc_rate used to log the pre-PLL output as "vco". The
> shared helper logs it too, and reports the actual VCO frequency
> alongside the rate, which is the value with the 1.4-3.2 GHz constraint.
>
> The register writes, their order and the values written are unchanged.
> No functional change intended.
>
> Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
> ---
> drivers/phy/rockchip/Kconfig | 1 +
> drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 165 ++++----------------------
> 2 files changed, 26 insertions(+), 140 deletions(-)
>
[...]
>
> @@ -915,39 +858,11 @@ unsigned long inno_hdmi_phy_rk3328_clk_recalc_rate(struct clk_hw *hw,
> unsigned long parent_rate)
> {
> struct inno_hdmi_phy *inno = to_inno_hdmi_phy(hw);
> - unsigned long frac;
> - u8 nd, no_a, no_b, no_d;
> - u64 vco;
> - u16 nf;
> -
> - nd = inno_read(inno, 0xa1) & RK3328_PRE_PLL_PRE_DIV_MASK;
> - nf = ((inno_read(inno, 0xa2) & RK3328_PRE_PLL_FB_DIV_11_8_MASK) << 8);
> - nf |= inno_read(inno, 0xa3);
> - vco = parent_rate * nf;
> -
> - if (!(inno_read(inno, 0xa2) & RK3328_PRE_PLL_FRAC_DIV_DISABLE)) {
> - frac = inno_read(inno, 0xd3) |
> - (inno_read(inno, 0xd2) << 8) |
> - (inno_read(inno, 0xd1) << 16);
> - vco += DIV_ROUND_CLOSEST(parent_rate * frac, (1 << 24));
> - }
> -
> - if (inno_read(inno, 0xa0) & RK3328_PCLK_VCO_DIV_5_MASK) {
> - do_div(vco, nd * 5);
> - } else {
> - no_a = inno_read(inno, 0xa5) & RK3328_PRE_PLL_PCLK_DIV_A_MASK;
> - no_b = inno_read(inno, 0xa5) & RK3328_PRE_PLL_PCLK_DIV_B_MASK;
> - no_b >>= RK3328_PRE_PLL_PCLK_DIV_B_SHIFT;
> - no_b += 2;
> - no_d = inno_read(inno, 0xa6) & RK3328_PRE_PLL_PCLK_DIV_D_MASK;
> -
> - do_div(vco, (nd * (no_a == 1 ? no_b : no_a) * no_d * 2));
> - }
>
> - inno->pixclock = DIV_ROUND_CLOSEST((unsigned long)vco, 1000) * 1000;
> + inno->pixclock = inno_hdmi_phy_pre_pll_recalc_rate(&inno->pre_pll,
> + parent_rate);
>
> - dev_dbg(inno->dev, "%s rate %lu vco %llu\n",
> - __func__, inno->pixclock, vco);
> + dev_dbg(inno->dev, "%s rate %lu\n", __func__, inno->pixclock);
>
The printing here is redundant, because it has already been handled in
inno_hdmi_phy_pre_pll_recalc_rate().
Reviewed-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
> return inno->pixclock;
> }
--
Best,
Chaoyi
next prev parent reply other threads:[~2026-09-07 3:26 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20260904132708eucas1p1adfa26ef0fe5109eca63a3aeadf74915@eucas1p1.samsung.com>
2026-09-04 13:27 ` [PATCH v3 00/19] drm: starfive: jh7110: Enable display subsystem Michal Wilczynski
2026-09-04 13:27 ` [PATCH v3 01/19] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy Michal Wilczynski
2026-09-04 13:30 ` sashiko-bot
2026-09-04 13:27 ` [PATCH v3 02/19] dt-bindings: display: bridge: Add starfive,jh7110-inno-hdmi-controller Michal Wilczynski
2026-09-04 13:35 ` sashiko-bot
2026-09-04 13:27 ` [PATCH v3 03/19] dt-bindings: mfd: Add starfive,jh7110-hdmi-subsystem Michal Wilczynski
2026-09-04 13:37 ` sashiko-bot
2026-09-04 13:27 ` [PATCH v3 04/19] dt-bindings: soc: starfive: Add starfive,jh7110-vout-syscon Michal Wilczynski
2026-09-04 13:30 ` sashiko-bot
2026-09-10 8:18 ` Krzysztof Kozlowski
2026-09-04 13:27 ` [PATCH v3 05/19] dt-bindings: soc: starfive: Add starfive,jh7110-vout-subsystem Michal Wilczynski
2026-09-04 13:36 ` sashiko-bot
2026-09-10 8:21 ` Krzysztof Kozlowski
2026-09-04 13:27 ` [PATCH v3 06/19] dt-bindings: display: verisilicon: Add starfive,jh7110-dc8200 Michal Wilczynski
2026-09-04 13:31 ` sashiko-bot
2026-09-10 8:34 ` Krzysztof Kozlowski
2026-09-04 13:27 ` [PATCH v3 07/19] drm/bridge: inno-hdmi: Split probe out of bind Michal Wilczynski
2026-09-04 13:42 ` sashiko-bot
2026-09-04 13:27 ` [PATCH v3 08/19] drm/bridge: inno-hdmi: Allow the register map to come from a parent Michal Wilczynski
2026-09-04 13:43 ` sashiko-bot
2026-09-04 13:27 ` [PATCH v3 09/19] drm/bridge: inno-hdmi: Add .disable platform operation Michal Wilczynski
2026-09-04 13:49 ` sashiko-bot
2026-09-04 13:27 ` [PATCH v3 10/19] drm/bridge: inno-hdmi: Add .mode_valid " Michal Wilczynski
2026-09-04 13:40 ` sashiko-bot
2026-09-04 13:27 ` [PATCH v3 11/19] soc: starfive: Add jh7110-hdmi-subsystem driver Michal Wilczynski
2026-09-04 13:52 ` sashiko-bot
2026-09-07 8:23 ` Uwe Kleine-König
2026-09-04 13:27 ` [PATCH v3 12/19] soc: starfive: Add jh7110-vout-subsystem driver Michal Wilczynski
2026-09-04 13:47 ` sashiko-bot
2026-09-04 13:27 ` [PATCH v3 13/19] clk: starfive: jh7110-vout: Allow pixel clock rate propagation Michal Wilczynski
2026-09-04 13:44 ` sashiko-bot
2026-09-04 13:27 ` [PATCH v3 14/19] drm/bridge: starfive: Add JH7110 HDMI controller driver Michal Wilczynski
2026-09-04 13:39 ` Icenowy Zheng
2026-09-04 13:57 ` sashiko-bot
2026-09-07 3:51 ` Chaoyi Chen
2026-09-04 13:27 ` [PATCH v3 15/19] phy: Add common Innosilicon HDMI PHY helpers Michal Wilczynski
2026-09-04 13:55 ` sashiko-bot
2026-09-07 3:16 ` Chaoyi Chen
2026-09-04 13:27 ` [PATCH v3 16/19] phy: rockchip: inno-hdmi: Use the common Innosilicon " Michal Wilczynski
2026-09-04 13:59 ` sashiko-bot
2026-09-07 3:20 ` Chaoyi Chen [this message]
2026-09-04 13:27 ` [PATCH v3 17/19] phy: starfive: Add jh7110-inno-hdmi-phy driver Michal Wilczynski
2026-09-04 13:57 ` sashiko-bot
2026-09-04 13:27 ` [PATCH v3 18/19] riscv: dts: starfive: jh7110: Update DT for display subsystem Michal Wilczynski
2026-09-04 14:03 ` sashiko-bot
2026-09-10 8:37 ` Krzysztof Kozlowski
2026-09-04 13:27 ` [PATCH v3 19/19] MAINTAINERS: Add StarFive JH7110 display subsystem entry Michal Wilczynski
2026-09-04 15:13 ` [PATCH v3 00/19] drm: starfive: jh7110: Enable display subsystem Joshua Peisach
2026-09-05 5:21 ` Maud Spierings
2026-09-06 3:55 ` Dominique Belhachemi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6e96691c-5d52-4e00-a15b-2a2b21f65fe3@rock-chips.com \
--to=chaoyi.chen@rock-chips.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=alex@ghiti.fr \
--cc=andrzej.hajda@intel.com \
--cc=andy.yan@rock-chips.com \
--cc=andyshrk@163.com \
--cc=aou@eecs.berkeley.edu \
--cc=bmasney+clk@redhat.com \
--cc=bmasney@redhat.com \
--cc=conor+dt@kernel.org \
--cc=conor@kernel.org \
--cc=db@domibel.de \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hal.feng@starfivetech.com \
--cc=heiko@sntech.de \
--cc=hello@big-grey.co.uk \
--cc=jbrunet+clk@baylibre.com \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=kernel@esmil.dk \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=luca.ceresoli@bootlin.com \
--cc=m.szyprowski@samsung.com \
--cc=m.wilczynski@samsung.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=maud_spierings@murena.io \
--cc=mfd@lists.linux.dev \
--cc=mripard@kernel.org \
--cc=mturquette@baylibre.com \
--cc=neil.armstrong@linaro.org \
--cc=p.zabel@pengutronix.de \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=rfoss@kernel.org \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=vkoul@kernel.org \
--cc=zhengxingda@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox