.. | .. |
---|
9 | 9 | #include <drm/bridge/dw_hdmi.h> |
---|
10 | 10 | #include <drm/drm_encoder.h> |
---|
11 | 11 | #include <linux/clk.h> |
---|
| 12 | +#include <linux/gpio/consumer.h> |
---|
12 | 13 | #include <linux/regmap.h> |
---|
| 14 | +#include <linux/regulator/consumer.h> |
---|
13 | 15 | #include <linux/reset.h> |
---|
14 | 16 | |
---|
15 | 17 | #define SUN8I_HDMI_PHY_DBG_CTRL_REG 0x0000 |
---|
.. | .. |
---|
149 | 151 | struct sun8i_hdmi_phy_variant { |
---|
150 | 152 | bool has_phy_clk; |
---|
151 | 153 | bool has_second_pll; |
---|
| 154 | + unsigned int is_custom_phy : 1; |
---|
| 155 | + const struct dw_hdmi_curr_ctrl *cur_ctr; |
---|
| 156 | + const struct dw_hdmi_mpll_config *mpll_cfg; |
---|
| 157 | + const struct dw_hdmi_phy_config *phy_cfg; |
---|
152 | 158 | void (*phy_init)(struct sun8i_hdmi_phy *phy); |
---|
153 | 159 | void (*phy_disable)(struct dw_hdmi *hdmi, |
---|
154 | 160 | struct sun8i_hdmi_phy *phy); |
---|
.. | .. |
---|
163 | 169 | struct clk *clk_phy; |
---|
164 | 170 | struct clk *clk_pll0; |
---|
165 | 171 | struct clk *clk_pll1; |
---|
| 172 | + struct device *dev; |
---|
166 | 173 | unsigned int rcal; |
---|
167 | 174 | struct regmap *regs; |
---|
168 | 175 | struct reset_control *rst_phy; |
---|
169 | 176 | struct sun8i_hdmi_phy_variant *variant; |
---|
| 177 | +}; |
---|
| 178 | + |
---|
| 179 | +struct sun8i_dw_hdmi_quirks { |
---|
| 180 | + enum drm_mode_status (*mode_valid)(struct dw_hdmi *hdmi, void *data, |
---|
| 181 | + const struct drm_display_info *info, |
---|
| 182 | + const struct drm_display_mode *mode); |
---|
| 183 | + unsigned int use_drm_infoframe : 1; |
---|
170 | 184 | }; |
---|
171 | 185 | |
---|
172 | 186 | struct sun8i_dw_hdmi { |
---|
.. | .. |
---|
176 | 190 | struct drm_encoder encoder; |
---|
177 | 191 | struct sun8i_hdmi_phy *phy; |
---|
178 | 192 | struct dw_hdmi_plat_data plat_data; |
---|
| 193 | + struct regulator *regulator; |
---|
| 194 | + const struct sun8i_dw_hdmi_quirks *quirks; |
---|
179 | 195 | struct reset_control *rst_ctrl; |
---|
| 196 | + struct gpio_desc *ddc_en; |
---|
180 | 197 | }; |
---|
| 198 | + |
---|
| 199 | +extern struct platform_driver sun8i_hdmi_phy_driver; |
---|
181 | 200 | |
---|
182 | 201 | static inline struct sun8i_dw_hdmi * |
---|
183 | 202 | encoder_to_sun8i_dw_hdmi(struct drm_encoder *encoder) |
---|
.. | .. |
---|
185 | 204 | return container_of(encoder, struct sun8i_dw_hdmi, encoder); |
---|
186 | 205 | } |
---|
187 | 206 | |
---|
188 | | -int sun8i_hdmi_phy_probe(struct sun8i_dw_hdmi *hdmi, struct device_node *node); |
---|
189 | | -void sun8i_hdmi_phy_remove(struct sun8i_dw_hdmi *hdmi); |
---|
| 207 | +int sun8i_hdmi_phy_get(struct sun8i_dw_hdmi *hdmi, struct device_node *node); |
---|
190 | 208 | |
---|
191 | | -void sun8i_hdmi_phy_init(struct sun8i_hdmi_phy *phy); |
---|
192 | | -const struct dw_hdmi_phy_ops *sun8i_hdmi_phy_get_ops(void); |
---|
| 209 | +int sun8i_hdmi_phy_init(struct sun8i_hdmi_phy *phy); |
---|
| 210 | +void sun8i_hdmi_phy_deinit(struct sun8i_hdmi_phy *phy); |
---|
| 211 | +void sun8i_hdmi_phy_set_ops(struct sun8i_hdmi_phy *phy, |
---|
| 212 | + struct dw_hdmi_plat_data *plat_data); |
---|
193 | 213 | |
---|
194 | 214 | int sun8i_phy_clk_create(struct sun8i_hdmi_phy *phy, struct device *dev, |
---|
195 | 215 | bool second_parent); |
---|