From 1543e317f1da31b75942316931e8f491a8920811 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Thu, 04 Jan 2024 10:08:02 +0000
Subject: [PATCH] disable FB
---
kernel/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/kernel/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c b/kernel/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
index 3e8e436..c844328 100644
--- a/kernel/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
+++ b/kernel/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
@@ -287,9 +287,42 @@
return 0;
}
+static const char *rockchip_combphy_mode2str(enum phy_mode mode)
+{
+ switch (mode) {
+ case PHY_TYPE_SATA:
+ return "SATA";
+ case PHY_TYPE_PCIE:
+ return "PCIe";
+ case PHY_TYPE_USB3:
+ return "USB3";
+ case PHY_TYPE_SGMII:
+ case PHY_TYPE_QSGMII:
+ return "GMII";
+ default:
+ return "Unknown";
+ }
+}
+
+static int rockchip_combphy_validate(struct phy *phy, enum phy_mode mode, int submode,
+ union phy_configure_opts *opts)
+{
+ struct rockchip_combphy_priv *priv = phy_get_drvdata(phy);
+
+ if (mode != priv->mode) {
+ dev_err(priv->dev, "expected mode is %s, but current mode is %s\n",
+ rockchip_combphy_mode2str(mode),
+ rockchip_combphy_mode2str(priv->mode));
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
static const struct phy_ops rochchip_combphy_ops = {
.init = rockchip_combphy_init,
.exit = rockchip_combphy_exit,
+ .validate = rockchip_combphy_validate,
.owner = THIS_MODULE,
};
--
Gitblit v1.6.2