| .. | .. |
|---|
| 25 | 25 | * Epson QCIF display. |
|---|
| 26 | 26 | * |
|---|
| 27 | 27 | */ |
|---|
| 28 | | -#include <drm/drmP.h> |
|---|
| 29 | | -#include <drm/drm_panel.h> |
|---|
| 30 | 28 | |
|---|
| 31 | 29 | #include <linux/bitops.h> |
|---|
| 32 | 30 | #include <linux/init.h> |
|---|
| 33 | 31 | #include <linux/kernel.h> |
|---|
| 34 | 32 | #include <linux/mfd/syscon.h> |
|---|
| 33 | +#include <linux/mod_devicetable.h> |
|---|
| 35 | 34 | #include <linux/module.h> |
|---|
| 36 | 35 | #include <linux/platform_device.h> |
|---|
| 37 | 36 | #include <linux/regmap.h> |
|---|
| 38 | 37 | |
|---|
| 39 | 38 | #include <video/of_videomode.h> |
|---|
| 40 | 39 | #include <video/videomode.h> |
|---|
| 40 | + |
|---|
| 41 | +#include <drm/drm_modes.h> |
|---|
| 42 | +#include <drm/drm_panel.h> |
|---|
| 41 | 43 | |
|---|
| 42 | 44 | /* |
|---|
| 43 | 45 | * This configuration register in the Versatile and RealView |
|---|
| .. | .. |
|---|
| 141 | 143 | .vsync_start = 240 + 5, |
|---|
| 142 | 144 | .vsync_end = 240 + 5 + 6, |
|---|
| 143 | 145 | .vtotal = 240 + 5 + 6 + 5, |
|---|
| 144 | | - .vrefresh = 116, |
|---|
| 145 | 146 | .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC, |
|---|
| 146 | 147 | }, |
|---|
| 147 | 148 | }, |
|---|
| .. | .. |
|---|
| 165 | 166 | .vsync_start = 480 + 11, |
|---|
| 166 | 167 | .vsync_end = 480 + 11 + 2, |
|---|
| 167 | 168 | .vtotal = 480 + 11 + 2 + 32, |
|---|
| 168 | | - .vrefresh = 60, |
|---|
| 169 | 169 | .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC, |
|---|
| 170 | 170 | }, |
|---|
| 171 | 171 | }, |
|---|
| .. | .. |
|---|
| 188 | 188 | .vsync_start = 220 + 0, |
|---|
| 189 | 189 | .vsync_end = 220 + 0 + 2, |
|---|
| 190 | 190 | .vtotal = 220 + 0 + 2 + 1, |
|---|
| 191 | | - .vrefresh = 390, |
|---|
| 192 | 191 | .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC, |
|---|
| 193 | 192 | }, |
|---|
| 194 | | - .bus_flags = DRM_BUS_FLAG_PIXDATA_NEGEDGE, |
|---|
| 193 | + .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE, |
|---|
| 195 | 194 | }, |
|---|
| 196 | 195 | /* |
|---|
| 197 | 196 | * Sanyo ALR252RGT 240x320 portrait display found on the |
|---|
| .. | .. |
|---|
| 212 | 211 | .vsync_start = 320 + 2, |
|---|
| 213 | 212 | .vsync_end = 320 + 2 + 2, |
|---|
| 214 | 213 | .vtotal = 320 + 2 + 2 + 2, |
|---|
| 215 | | - .vrefresh = 116, |
|---|
| 216 | 214 | .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC, |
|---|
| 217 | 215 | }, |
|---|
| 218 | | - .bus_flags = DRM_BUS_FLAG_PIXDATA_NEGEDGE, |
|---|
| 216 | + .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE, |
|---|
| 219 | 217 | .ib2 = true, |
|---|
| 220 | 218 | }, |
|---|
| 221 | 219 | }; |
|---|
| .. | .. |
|---|
| 258 | 256 | return 0; |
|---|
| 259 | 257 | } |
|---|
| 260 | 258 | |
|---|
| 261 | | -static int versatile_panel_get_modes(struct drm_panel *panel) |
|---|
| 259 | +static int versatile_panel_get_modes(struct drm_panel *panel, |
|---|
| 260 | + struct drm_connector *connector) |
|---|
| 262 | 261 | { |
|---|
| 263 | | - struct drm_connector *connector = panel->connector; |
|---|
| 264 | 262 | struct versatile_panel *vpanel = to_versatile_panel(panel); |
|---|
| 265 | 263 | struct drm_display_mode *mode; |
|---|
| 266 | 264 | |
|---|
| 267 | | - strncpy(connector->display_info.name, vpanel->panel_type->name, |
|---|
| 268 | | - DRM_DISPLAY_INFO_LEN); |
|---|
| 269 | 265 | connector->display_info.width_mm = vpanel->panel_type->width_mm; |
|---|
| 270 | 266 | connector->display_info.height_mm = vpanel->panel_type->height_mm; |
|---|
| 271 | 267 | connector->display_info.bus_flags = vpanel->panel_type->bus_flags; |
|---|
| 272 | 268 | |
|---|
| 273 | | - mode = drm_mode_duplicate(panel->drm, &vpanel->panel_type->mode); |
|---|
| 269 | + mode = drm_mode_duplicate(connector->dev, &vpanel->panel_type->mode); |
|---|
| 274 | 270 | drm_mode_set_name(mode); |
|---|
| 275 | 271 | mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; |
|---|
| 276 | 272 | |
|---|
| .. | .. |
|---|
| 350 | 346 | dev_info(dev, "panel mounted on IB2 daughterboard\n"); |
|---|
| 351 | 347 | } |
|---|
| 352 | 348 | |
|---|
| 353 | | - drm_panel_init(&vpanel->panel); |
|---|
| 354 | | - vpanel->panel.dev = dev; |
|---|
| 355 | | - vpanel->panel.funcs = &versatile_panel_drm_funcs; |
|---|
| 349 | + drm_panel_init(&vpanel->panel, dev, &versatile_panel_drm_funcs, |
|---|
| 350 | + DRM_MODE_CONNECTOR_DPI); |
|---|
| 356 | 351 | |
|---|
| 357 | | - return drm_panel_add(&vpanel->panel); |
|---|
| 352 | + drm_panel_add(&vpanel->panel); |
|---|
| 353 | + |
|---|
| 354 | + return 0; |
|---|
| 358 | 355 | } |
|---|
| 359 | 356 | |
|---|
| 360 | 357 | static const struct of_device_id versatile_panel_match[] = { |
|---|