From nobody Sat Jun 13 04:50:03 2026 Received: from smtp.forwardemail.net (smtp.forwardemail.net [121.127.44.66]) (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 B356E270575 for ; Sun, 10 May 2026 09:58:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=121.127.44.66 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778407085; cv=none; b=jxhsVrheTWgMeBrd9pccAtFuYGCIRcHIV3+66n9jeul5EAw7ZmpTRIPrs5KFJU30qE1zD0Z5X3FVvc3zyW7dFsh7z2f5hAjCsVyR6Ih9y0smsTX5ztWMJRG2V3S2imMl9A17GNQ2EI4IS85M6LCf6NPQ1Ji9tTUT4krm6IG2CLU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778407085; c=relaxed/simple; bh=dWixOeK5k5HvmhdB5e5rHTBTW/FQKD+eK/B/hwcJ2pY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GnQUb6fj/osXAcGlCMClKkHjoQ08Yf7aLEczKZL1jfk93K3xDKCulYtk44l5pf8tjCNPPqjX7Rn16Vju6xyX2uGchqwLfZuu+imLx45wvI3fB5NGms4l4Qgwmgwoo2yq3oSA86w6anIlr32tRkFdKr9CDiIZ8rmYOAgX/3dKJ3g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=kwiboo.se; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b=e90Y/pVa; arc=none smtp.client-ip=121.127.44.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=kwiboo.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="e90Y/pVa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1778407069; bh=DWZ4GiBEFujDrd/076IUmJSFK/5E0kNgV5LKOYyEubk=; b=e90Y/pVao2vvY+WuLwm7FHyikeREQvJLwtAjwmQkCDocx/9wYW8fcQiUOBRIzG1uvd90NNyq1 SUxLYR1rUGP4wrc/nwj+AW/sI5SXSxiO/BHSnx9Cw7iQ1GiaomRnNwoWNkHUu1c4qTw1pyNLzpO ip+CTomwKDStTMyVsh601bX+IPmqa+DDP71tU6GGXMOF0bLgeIHxrcrKxzLLZ2oflk9mLTai7Dt OgaNW9BtjCoT02t6rxUcgAnHpVe/+5RIW/I3OiRo2dOPxyPXdcAjL37rckAwD2ll8FCwhzitHkM WOehdpcnOZHk06qZG0F4zrsAzov0TJDPKsZ47RAHlEgQ== X-Forward-Email-ID: 6a00569249521910acdb9441 X-Forward-Email-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 121.127.44.66 X-Forward-Email-Version: 2.8.0 X-Forward-Email-Website: https://forwardemail.net X-Complaints-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Report-Abuse-To: abuse@forwardemail.net From: Jonas Karlman To: Vinod Koul , Neil Armstrong , Heiko Stuebner Cc: linux-phy@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman Subject: [PATCH v2 1/2] phy: rockchip: inno-hdmi: Add configure() and validate() ops Date: Sun, 10 May 2026 09:57:29 +0000 Message-ID: <20260510095731.1222705-2-jonas@kwiboo.se> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260510095731.1222705-1-jonas@kwiboo.se> References: <20260510095731.1222705-1-jonas@kwiboo.se> 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 commit 10ed34d6eaaf ("phy: Add HDMI configuration options") introduced a way for HDMI PHYs to be configured through the generic phy_configure() function. This driver derives the TMDS character rate from the pixel clock and the PHY bus width setting. However, no in-tree consumer of this PHY has ever called phy_set_bus_width() to change the TMDS character rate as only 8-bit RGB output is supported by the HDMI display driver. Add configure() and validate() ops to allow consumers to configure the TMDS character rate using phy_configure(). Fallback to the deprecated way of using the PHY bus width to configure the TMDS character rate. Signed-off-by: Jonas Karlman --- Changes in v2: - Add validate() ops to validate that the TMDS rate is supported - Split out parts that remove the old workaround into a separate patch --- drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/ro= ckchip/phy-rockchip-inno-hdmi.c index 1483907413fa..9cfe956fefe7 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c @@ -245,6 +245,7 @@ struct inno_hdmi_phy { struct clk *phyclk; unsigned long pixclock; unsigned long tmdsclock; + struct phy_configure_opts_hdmi hdmi_cfg; }; =20 struct pre_pll_config { @@ -554,7 +555,12 @@ static inline void inno_update_bits(struct inno_hdmi_p= hy *inno, u8 reg, static unsigned long inno_hdmi_phy_get_tmdsclk(struct inno_hdmi_phy *inno, unsigned long rate) { - int bus_width =3D phy_get_bus_width(inno->phy); + int bus_width; + + if (inno->hdmi_cfg.tmds_char_rate) + return inno->hdmi_cfg.tmds_char_rate; + + bus_width =3D phy_get_bus_width(inno->phy); =20 switch (bus_width) { case 4: @@ -602,6 +608,42 @@ static irqreturn_t inno_hdmi_phy_rk3328_irq(int irq, v= oid *dev_id) return IRQ_HANDLED; } =20 +static int inno_hdmi_phy_validate(struct phy *phy, enum phy_mode mode, + int submode, union phy_configure_opts *opts) +{ + const struct pre_pll_config *cfg =3D pre_pll_cfg_table; + unsigned long tmdsclock; + + if (!(mode =3D=3D PHY_MODE_HDMI && submode =3D=3D PHY_HDMI_MODE_TMDS)) + return -EINVAL; + + if (!opts->hdmi.tmds_char_rate || opts->hdmi.tmds_char_rate > 594000000) + return -EINVAL; + + tmdsclock =3D opts->hdmi.tmds_char_rate; + for (; cfg->pixclock !=3D 0; cfg++) + if (cfg->pixclock =3D=3D tmdsclock && cfg->tmdsclock =3D=3D tmdsclock) + return 0; + + return -EINVAL; +} + +static int inno_hdmi_phy_configure(struct phy *phy, + union phy_configure_opts *opts) +{ + struct inno_hdmi_phy *inno =3D phy_get_drvdata(phy); + int ret; + + ret =3D inno_hdmi_phy_validate(phy, phy_get_mode(phy), + PHY_HDMI_MODE_TMDS, opts); + if (ret) + return ret; + + inno->hdmi_cfg =3D opts->hdmi; + + return 0; +} + static int inno_hdmi_phy_power_on(struct phy *phy) { struct inno_hdmi_phy *inno =3D phy_get_drvdata(phy); @@ -670,6 +712,8 @@ static const struct phy_ops inno_hdmi_phy_ops =3D { .owner =3D THIS_MODULE, .power_on =3D inno_hdmi_phy_power_on, .power_off =3D inno_hdmi_phy_power_off, + .configure =3D inno_hdmi_phy_configure, + .validate =3D inno_hdmi_phy_validate, }; =20 static const @@ -1392,6 +1436,7 @@ static int inno_hdmi_phy_probe(struct platform_device= *pdev) } =20 phy_set_drvdata(inno->phy, inno); + phy_set_mode_ext(inno->phy, PHY_MODE_HDMI, PHY_HDMI_MODE_TMDS); phy_set_bus_width(inno->phy, 8); =20 if (inno->plat_data->ops->init) { --=20 2.54.0 From nobody Sat Jun 13 04:50:03 2026 Received: from smtp.forwardemail.net (smtp.forwardemail.net [121.127.44.73]) (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 0E866194C96 for ; Sun, 10 May 2026 09:58:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=121.127.44.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778407090; cv=none; b=BWWYelILXS+T3poeciV063XCnL8ROLyCskZiZC92SD/b2at1awRk1ZdAL8xSq3jbPKK2Ug0L7bnblvmuR03Mbb34IuaqkDHVw0AsUlBMFY3Ix2JjVI//MV7nYY5EZA83thQfSV0taaNiH+CLqoTqASYQWc7veaXyj/zZ9LgVEXw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778407090; c=relaxed/simple; bh=OQnHQeJRgGDIKwEn8AWG2FkQL5mcQLfPbr5Bg8DAiOE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UqfQZ+R0tVApJez3IwmetLxwYRkua9qvth0c3L/ggQU5BthJLnQVugdMHIn1OIRCXxclhuZdqpeTaNZ/YQ0kZRTJW6ajRFiSRTarg+VRkGJxciJ4LUdugLJf9mF1OQEnkvAr6YDpIcwkRX9DVJTlutFXC0zuoO47/WvUTEjHjug= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=kwiboo.se; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b=ob79e6XK; arc=none smtp.client-ip=121.127.44.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=kwiboo.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="ob79e6XK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1778407078; bh=a3O2JsdROe8x096gOuuqqbxiw2qYFkgKuoR23qAEBRA=; b=ob79e6XKI9ST0fJCsOyas1Pks/HGg6GvCiD7SUNp+ChGoUBxc+jNyJChMfuuVCvokl7ISsP30 /01FiJp/g8cHL7qi3tDZ2cf2re28FxdHw87k6Q97FfmsLVApFOhljJOJikUZb8btx7RYFblH7ZS pbnRGWb7tKi5IMC6PCOd1SQu9iWYeCj3tsmP3Mqgm3J0X9vcodDcQttD6Dg5gui1KzACfDXC0cr LybyuO65lW9yn4OgmDNE6S7ZFl2m6nPjoUMn3JraTodAQObWSP1x8gB+cS4LdDWBfZXdK+1Y208 HGgQmuqxE6VRecn78wyUDWXUfN+lreXxaNtwWADE43zA== X-Forward-Email-ID: 6a00569449521910acdb9460 X-Forward-Email-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 121.127.44.73 X-Forward-Email-Version: 2.8.0 X-Forward-Email-Website: https://forwardemail.net X-Complaints-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Report-Abuse-To: abuse@forwardemail.net From: Jonas Karlman To: Vinod Koul , Neil Armstrong , Heiko Stuebner Cc: linux-phy@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman Subject: [PATCH v2 2/2] phy: rockchip: inno-hdmi: Remove deprecated way to configure TMDS rate Date: Sun, 10 May 2026 09:57:30 +0000 Message-ID: <20260510095731.1222705-3-jonas@kwiboo.se> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260510095731.1222705-1-jonas@kwiboo.se> References: <20260510095731.1222705-1-jonas@kwiboo.se> 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 TMDS character rate of this PHY is configured using PHY bus width in downstream vendor kernel and out-of-tree patches, however no in-tree consumer of this PHY has ever called phy_set_bus_width() to change the TMDS character rate as currently only 8-bit RGB output is supported by the HDMI display driver. The series "Split Generic PHY consumer and provider" clarifies that phy_set_bus_width() is intended as a provider-only function. Remove the deprecated unused fallback way to configure TMDS character rate now that this HDMI PHY support using phy_configure() to configure the TMDS character rate. Signed-off-by: Jonas Karlman --- v2: New patch, split from original patch --- drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/ro= ckchip/phy-rockchip-inno-hdmi.c index 9cfe956fefe7..5e76a1ea9d9f 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c @@ -555,24 +555,10 @@ static inline void inno_update_bits(struct inno_hdmi_= phy *inno, u8 reg, static unsigned long inno_hdmi_phy_get_tmdsclk(struct inno_hdmi_phy *inno, unsigned long rate) { - int bus_width; - if (inno->hdmi_cfg.tmds_char_rate) return inno->hdmi_cfg.tmds_char_rate; =20 - bus_width =3D phy_get_bus_width(inno->phy); - - switch (bus_width) { - case 4: - case 5: - case 6: - case 10: - case 12: - case 16: - return (u64)rate * bus_width / 8; - default: - return rate; - } + return rate; } =20 static irqreturn_t inno_hdmi_phy_rk3328_hardirq(int irq, void *dev_id) @@ -1437,7 +1423,6 @@ static int inno_hdmi_phy_probe(struct platform_device= *pdev) =20 phy_set_drvdata(inno->phy, inno); phy_set_mode_ext(inno->phy, PHY_MODE_HDMI, PHY_HDMI_MODE_TMDS); - phy_set_bus_width(inno->phy, 8); =20 if (inno->plat_data->ops->init) { ret =3D inno->plat_data->ops->init(inno); --=20 2.54.0