forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h
....@@ -9,7 +9,9 @@
99 #include <drm/bridge/dw_hdmi.h>
1010 #include <drm/drm_encoder.h>
1111 #include <linux/clk.h>
12
+#include <linux/gpio/consumer.h>
1213 #include <linux/regmap.h>
14
+#include <linux/regulator/consumer.h>
1315 #include <linux/reset.h>
1416
1517 #define SUN8I_HDMI_PHY_DBG_CTRL_REG 0x0000
....@@ -149,6 +151,10 @@
149151 struct sun8i_hdmi_phy_variant {
150152 bool has_phy_clk;
151153 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;
152158 void (*phy_init)(struct sun8i_hdmi_phy *phy);
153159 void (*phy_disable)(struct dw_hdmi *hdmi,
154160 struct sun8i_hdmi_phy *phy);
....@@ -163,10 +169,18 @@
163169 struct clk *clk_phy;
164170 struct clk *clk_pll0;
165171 struct clk *clk_pll1;
172
+ struct device *dev;
166173 unsigned int rcal;
167174 struct regmap *regs;
168175 struct reset_control *rst_phy;
169176 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;
170184 };
171185
172186 struct sun8i_dw_hdmi {
....@@ -176,8 +190,13 @@
176190 struct drm_encoder encoder;
177191 struct sun8i_hdmi_phy *phy;
178192 struct dw_hdmi_plat_data plat_data;
193
+ struct regulator *regulator;
194
+ const struct sun8i_dw_hdmi_quirks *quirks;
179195 struct reset_control *rst_ctrl;
196
+ struct gpio_desc *ddc_en;
180197 };
198
+
199
+extern struct platform_driver sun8i_hdmi_phy_driver;
181200
182201 static inline struct sun8i_dw_hdmi *
183202 encoder_to_sun8i_dw_hdmi(struct drm_encoder *encoder)
....@@ -185,11 +204,12 @@
185204 return container_of(encoder, struct sun8i_dw_hdmi, encoder);
186205 }
187206
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);
190208
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);
193213
194214 int sun8i_phy_clk_create(struct sun8i_hdmi_phy *phy, struct device *dev,
195215 bool second_parent);