| .. | .. |
|---|
| 7 | 7 | #include <dm.h> |
|---|
| 8 | 8 | #include <errno.h> |
|---|
| 9 | 9 | #include <i2c.h> |
|---|
| 10 | +#include <drm/drm_mipi_dsi.h> |
|---|
| 10 | 11 | #include <video_bridge.h> |
|---|
| 11 | 12 | #include <asm/unaligned.h> |
|---|
| 12 | 13 | #include <linux/media-bus-format.h> |
|---|
| .. | .. |
|---|
| 31 | 32 | struct udevice *power_supply; |
|---|
| 32 | 33 | struct gpio_desc enable_gpio; |
|---|
| 33 | 34 | struct serdes_init_seq *serdes_init_seq; |
|---|
| 35 | + bool sel_mipi; |
|---|
| 34 | 36 | }; |
|---|
| 35 | 37 | |
|---|
| 36 | 38 | static void bu18tl82_bridge_reset(struct rockchip_bridge *bridge) |
|---|
| .. | .. |
|---|
| 216 | 218 | return ret; |
|---|
| 217 | 219 | } |
|---|
| 218 | 220 | |
|---|
| 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 | + |
|---|
| 219 | 235 | bridge = calloc(1, sizeof(*bridge)); |
|---|
| 220 | 236 | if (!bridge) |
|---|
| 221 | 237 | return -ENOMEM; |
|---|
| .. | .. |
|---|
| 250 | 266 | .of_match = bu18tl82_of_match, |
|---|
| 251 | 267 | .probe = bu18tl82_probe, |
|---|
| 252 | 268 | .priv_auto_alloc_size = sizeof(struct bu18tl82_priv), |
|---|
| 269 | + .platdata_auto_alloc_size = sizeof(struct mipi_dsi_device), |
|---|
| 253 | 270 | }; |
|---|