From 8fa4e4f849ff1df22a56939d0d856eeeeb461133 Mon Sep 17 00:00:00 2001 From: Andy Yan Date: Mon, 28 Jun 2021 17:32:16 +0800 Subject: [PATCH] phy: rockchip-inno-video: use stand phy_mode definition Switch from rockchip defined PHY_MODE_VIDEO_xx to stand PHY_MODE_xx There is no PHY_MODE_TTL/RGB definition in stand phy_mode, so use RGB as the default mode. Signed-off-by: Andy Yan Change-Id: Ie96c673c902881e651949cf63dce98c1005eb34c --- .../rockchip/phy-rockchip-inno-video-phy.c | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-video-phy.c b/drivers/phy/rockchip/phy-rockchip-inno-video-phy.c index 65b152535870..22d26f1413d9 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-video-phy.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-video-phy.c @@ -29,7 +29,6 @@ struct inno_video_phy { struct clk *pclk; struct regmap *regmap; struct reset_control *rst; - enum phy_mode mode; }; static const struct reg_sequence ttl_mode[] = { @@ -83,6 +82,7 @@ static const struct reg_sequence lvds_mode_dual_channel[] = { static int inno_video_phy_power_on(struct phy *phy) { struct inno_video_phy *inno = phy_get_drvdata(phy); + enum phy_mode mode = phy_get_mode(phy); const struct reg_sequence *wseq; bool dual_channel = phy_get_bus_width(phy) == 2 ? true : false; int nregs; @@ -92,8 +92,8 @@ static int inno_video_phy_power_on(struct phy *phy) clk_prepare_enable(inno->pclk); pm_runtime_get_sync(inno->dev); - switch (inno->mode) { - case PHY_MODE_VIDEO_LVDS: + switch (mode) { + case PHY_MODE_LVDS: if (dual_channel) { wseq = lvds_mode_dual_channel; nregs = ARRAY_SIZE(lvds_mode_dual_channel); @@ -102,12 +102,10 @@ static int inno_video_phy_power_on(struct phy *phy) nregs = ARRAY_SIZE(lvds_mode_single_channel); } break; - case PHY_MODE_VIDEO_TTL: + default: wseq = ttl_mode; nregs = ARRAY_SIZE(ttl_mode); break; - default: - return -EINVAL; } regmap_multi_reg_write(inno->regmap, wseq, nregs); @@ -140,17 +138,6 @@ static int inno_video_phy_power_off(struct phy *phy) static int inno_video_phy_set_mode(struct phy *phy, enum phy_mode mode) { - struct inno_video_phy *inno = phy_get_drvdata(phy); - - switch (mode) { - case PHY_MODE_VIDEO_LVDS: - case PHY_MODE_VIDEO_TTL: - inno->mode = mode; - break; - default: - return -EINVAL; - } - return 0; }