hc
2023-11-06 9df731a176aab8e03b984b681b1bea01ccff6644
u-boot/drivers/video/drm/rohm-bu18tl82.c
....@@ -7,6 +7,7 @@
77 #include <dm.h>
88 #include <errno.h>
99 #include <i2c.h>
10
+#include <drm/drm_mipi_dsi.h>
1011 #include <video_bridge.h>
1112 #include <asm/unaligned.h>
1213 #include <linux/media-bus-format.h>
....@@ -31,6 +32,7 @@
3132 struct udevice *power_supply;
3233 struct gpio_desc enable_gpio;
3334 struct serdes_init_seq *serdes_init_seq;
35
+ bool sel_mipi;
3436 };
3537
3638 static void bu18tl82_bridge_reset(struct rockchip_bridge *bridge)
....@@ -216,6 +218,20 @@
216218 return ret;
217219 }
218220
221
+ priv->sel_mipi = dev_read_bool(dev, "sel-mipi");
222
+ if (priv->sel_mipi) {
223
+ struct mipi_dsi_device *device = dev_get_platdata(dev);
224
+
225
+ device->dev = dev;
226
+ device->lanes = dev_read_u32_default(dev, "dsi,lanes", 4);
227
+ device->format = dev_read_u32_default(dev, "dsi,format",
228
+ MIPI_DSI_FMT_RGB888);
229
+ device->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
230
+ MIPI_DSI_MODE_VIDEO_HBP | MIPI_DSI_MODE_LPM |
231
+ MIPI_DSI_MODE_EOT_PACKET;
232
+ device->channel = dev_read_u32_default(dev, "reg", 0);
233
+ }
234
+
219235 bridge = calloc(1, sizeof(*bridge));
220236 if (!bridge)
221237 return -ENOMEM;
....@@ -250,4 +266,5 @@
250266 .of_match = bu18tl82_of_match,
251267 .probe = bu18tl82_probe,
252268 .priv_auto_alloc_size = sizeof(struct bu18tl82_priv),
269
+ .platdata_auto_alloc_size = sizeof(struct mipi_dsi_device),
253270 };