| .. | .. |
|---|
| 29 | 29 | struct clk *pclk; |
|---|
| 30 | 30 | struct regmap *regmap; |
|---|
| 31 | 31 | struct reset_control *rst; |
|---|
| 32 | | - enum phy_mode mode; |
|---|
| 33 | 32 | }; |
|---|
| 34 | 33 | |
|---|
| 35 | 34 | static const struct reg_sequence ttl_mode[] = { |
|---|
| .. | .. |
|---|
| 83 | 82 | static int inno_video_phy_power_on(struct phy *phy) |
|---|
| 84 | 83 | { |
|---|
| 85 | 84 | struct inno_video_phy *inno = phy_get_drvdata(phy); |
|---|
| 85 | + enum phy_mode mode = phy_get_mode(phy); |
|---|
| 86 | 86 | const struct reg_sequence *wseq; |
|---|
| 87 | 87 | bool dual_channel = phy_get_bus_width(phy) == 2 ? true : false; |
|---|
| 88 | 88 | int nregs; |
|---|
| .. | .. |
|---|
| 92 | 92 | clk_prepare_enable(inno->pclk); |
|---|
| 93 | 93 | pm_runtime_get_sync(inno->dev); |
|---|
| 94 | 94 | |
|---|
| 95 | | - switch (inno->mode) { |
|---|
| 96 | | - case PHY_MODE_VIDEO_LVDS: |
|---|
| 95 | + switch (mode) { |
|---|
| 96 | + case PHY_MODE_LVDS: |
|---|
| 97 | 97 | if (dual_channel) { |
|---|
| 98 | 98 | wseq = lvds_mode_dual_channel; |
|---|
| 99 | 99 | nregs = ARRAY_SIZE(lvds_mode_dual_channel); |
|---|
| .. | .. |
|---|
| 102 | 102 | nregs = ARRAY_SIZE(lvds_mode_single_channel); |
|---|
| 103 | 103 | } |
|---|
| 104 | 104 | break; |
|---|
| 105 | | - case PHY_MODE_VIDEO_TTL: |
|---|
| 105 | + default: |
|---|
| 106 | 106 | wseq = ttl_mode; |
|---|
| 107 | 107 | nregs = ARRAY_SIZE(ttl_mode); |
|---|
| 108 | 108 | break; |
|---|
| 109 | | - default: |
|---|
| 110 | | - return -EINVAL; |
|---|
| 111 | 109 | } |
|---|
| 112 | 110 | |
|---|
| 113 | 111 | regmap_multi_reg_write(inno->regmap, wseq, nregs); |
|---|
| .. | .. |
|---|
| 140 | 138 | |
|---|
| 141 | 139 | static int inno_video_phy_set_mode(struct phy *phy, enum phy_mode mode) |
|---|
| 142 | 140 | { |
|---|
| 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 | | - |
|---|
| 154 | 141 | return 0; |
|---|
| 155 | 142 | } |
|---|
| 156 | 143 | |
|---|