hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/phy/rockchip/phy-rockchip-inno-video-phy.c
....@@ -29,7 +29,6 @@
2929 struct clk *pclk;
3030 struct regmap *regmap;
3131 struct reset_control *rst;
32
- enum phy_mode mode;
3332 };
3433
3534 static const struct reg_sequence ttl_mode[] = {
....@@ -83,6 +82,7 @@
8382 static int inno_video_phy_power_on(struct phy *phy)
8483 {
8584 struct inno_video_phy *inno = phy_get_drvdata(phy);
85
+ enum phy_mode mode = phy_get_mode(phy);
8686 const struct reg_sequence *wseq;
8787 bool dual_channel = phy_get_bus_width(phy) == 2 ? true : false;
8888 int nregs;
....@@ -92,8 +92,8 @@
9292 clk_prepare_enable(inno->pclk);
9393 pm_runtime_get_sync(inno->dev);
9494
95
- switch (inno->mode) {
96
- case PHY_MODE_VIDEO_LVDS:
95
+ switch (mode) {
96
+ case PHY_MODE_LVDS:
9797 if (dual_channel) {
9898 wseq = lvds_mode_dual_channel;
9999 nregs = ARRAY_SIZE(lvds_mode_dual_channel);
....@@ -102,12 +102,10 @@
102102 nregs = ARRAY_SIZE(lvds_mode_single_channel);
103103 }
104104 break;
105
- case PHY_MODE_VIDEO_TTL:
105
+ default:
106106 wseq = ttl_mode;
107107 nregs = ARRAY_SIZE(ttl_mode);
108108 break;
109
- default:
110
- return -EINVAL;
111109 }
112110
113111 regmap_multi_reg_write(inno->regmap, wseq, nregs);
....@@ -140,17 +138,6 @@
140138
141139 static int inno_video_phy_set_mode(struct phy *phy, enum phy_mode mode)
142140 {
143
- struct inno_video_phy *inno = phy_get_drvdata(phy);
144
-
145
- switch (mode) {
146
- case PHY_MODE_VIDEO_LVDS:
147
- case PHY_MODE_VIDEO_TTL:
148
- inno->mode = mode;
149
- break;
150
- default:
151
- return -EINVAL;
152
- }
153
-
154141 return 0;
155142 }
156143