Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013, NVIDIA Corporation. All rights reserved. |
| 3 | * |
| 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 5 | * copy of this software and associated documentation files (the "Software"), |
| 6 | * to deal in the Software without restriction, including without limitation |
| 7 | * the rights to use, copy, modify, merge, publish, distribute, sub license, |
| 8 | * and/or sell copies of the Software, and to permit persons to whom the |
| 9 | * Software is furnished to do so, subject to the following conditions: |
| 10 | * |
| 11 | * The above copyright notice and this permission notice (including the |
| 12 | * next paragraph) shall be included in all copies or substantial portions |
| 13 | * of the Software. |
| 14 | * |
| 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL |
| 18 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 20 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 21 | * DEALINGS IN THE SOFTWARE. |
| 22 | */ |
| 23 | |
| 24 | #include <linux/backlight.h> |
Alexandre Courbot | cfdf054 | 2014-03-01 14:00:58 +0900 | [diff] [blame] | 25 | #include <linux/gpio/consumer.h> |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 26 | #include <linux/module.h> |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 27 | #include <linux/of_platform.h> |
| 28 | #include <linux/platform_device.h> |
| 29 | #include <linux/regulator/consumer.h> |
| 30 | |
| 31 | #include <drm/drmP.h> |
| 32 | #include <drm/drm_crtc.h> |
Thierry Reding | 210fcd9 | 2013-11-22 19:27:11 +0100 | [diff] [blame] | 33 | #include <drm/drm_mipi_dsi.h> |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 34 | #include <drm/drm_panel.h> |
| 35 | |
Philipp Zabel | a5d3e62 | 2014-12-11 18:32:45 +0100 | [diff] [blame] | 36 | #include <video/display_timing.h> |
| 37 | #include <video/videomode.h> |
| 38 | |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 39 | struct panel_desc { |
| 40 | const struct drm_display_mode *modes; |
| 41 | unsigned int num_modes; |
Philipp Zabel | a5d3e62 | 2014-12-11 18:32:45 +0100 | [diff] [blame] | 42 | const struct display_timing *timings; |
| 43 | unsigned int num_timings; |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 44 | |
Stéphane Marchesin | 0208d51 | 2014-06-19 18:18:28 -0700 | [diff] [blame] | 45 | unsigned int bpc; |
| 46 | |
Ulrich Ölmann | 85533e3 | 2015-12-04 12:31:28 +0100 | [diff] [blame^] | 47 | /** |
| 48 | * @width: width (in millimeters) of the panel's active display area |
| 49 | * @height: height (in millimeters) of the panel's active display area |
| 50 | */ |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 51 | struct { |
| 52 | unsigned int width; |
| 53 | unsigned int height; |
| 54 | } size; |
Ajay Kumar | f673c37 | 2014-07-31 23:12:11 +0530 | [diff] [blame] | 55 | |
| 56 | /** |
| 57 | * @prepare: the time (in milliseconds) that it takes for the panel to |
| 58 | * become ready and start receiving video data |
| 59 | * @enable: the time (in milliseconds) that it takes for the panel to |
| 60 | * display the first valid frame after starting to receive |
| 61 | * video data |
| 62 | * @disable: the time (in milliseconds) that it takes for the panel to |
| 63 | * turn the display off (no content is visible) |
| 64 | * @unprepare: the time (in milliseconds) that it takes for the panel |
| 65 | * to power itself down completely |
| 66 | */ |
| 67 | struct { |
| 68 | unsigned int prepare; |
| 69 | unsigned int enable; |
| 70 | unsigned int disable; |
| 71 | unsigned int unprepare; |
| 72 | } delay; |
Boris Brezillon | 795f7ab | 2014-07-22 13:33:59 +0200 | [diff] [blame] | 73 | |
| 74 | u32 bus_format; |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 75 | }; |
| 76 | |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 77 | struct panel_simple { |
| 78 | struct drm_panel base; |
Ajay Kumar | 613a633 | 2014-07-31 23:12:10 +0530 | [diff] [blame] | 79 | bool prepared; |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 80 | bool enabled; |
| 81 | |
| 82 | const struct panel_desc *desc; |
| 83 | |
| 84 | struct backlight_device *backlight; |
| 85 | struct regulator *supply; |
| 86 | struct i2c_adapter *ddc; |
| 87 | |
Alexandre Courbot | cfdf054 | 2014-03-01 14:00:58 +0900 | [diff] [blame] | 88 | struct gpio_desc *enable_gpio; |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 89 | }; |
| 90 | |
| 91 | static inline struct panel_simple *to_panel_simple(struct drm_panel *panel) |
| 92 | { |
| 93 | return container_of(panel, struct panel_simple, base); |
| 94 | } |
| 95 | |
| 96 | static int panel_simple_get_fixed_modes(struct panel_simple *panel) |
| 97 | { |
| 98 | struct drm_connector *connector = panel->base.connector; |
| 99 | struct drm_device *drm = panel->base.drm; |
| 100 | struct drm_display_mode *mode; |
| 101 | unsigned int i, num = 0; |
| 102 | |
| 103 | if (!panel->desc) |
| 104 | return 0; |
| 105 | |
Philipp Zabel | a5d3e62 | 2014-12-11 18:32:45 +0100 | [diff] [blame] | 106 | for (i = 0; i < panel->desc->num_timings; i++) { |
| 107 | const struct display_timing *dt = &panel->desc->timings[i]; |
| 108 | struct videomode vm; |
| 109 | |
| 110 | videomode_from_timing(dt, &vm); |
| 111 | mode = drm_mode_create(drm); |
| 112 | if (!mode) { |
| 113 | dev_err(drm->dev, "failed to add mode %ux%u\n", |
| 114 | dt->hactive.typ, dt->vactive.typ); |
| 115 | continue; |
| 116 | } |
| 117 | |
| 118 | drm_display_mode_from_videomode(&vm, mode); |
| 119 | drm_mode_set_name(mode); |
| 120 | |
| 121 | drm_mode_probed_add(connector, mode); |
| 122 | num++; |
| 123 | } |
| 124 | |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 125 | for (i = 0; i < panel->desc->num_modes; i++) { |
| 126 | const struct drm_display_mode *m = &panel->desc->modes[i]; |
| 127 | |
| 128 | mode = drm_mode_duplicate(drm, m); |
| 129 | if (!mode) { |
| 130 | dev_err(drm->dev, "failed to add mode %ux%u@%u\n", |
| 131 | m->hdisplay, m->vdisplay, m->vrefresh); |
| 132 | continue; |
| 133 | } |
| 134 | |
| 135 | drm_mode_set_name(mode); |
| 136 | |
| 137 | drm_mode_probed_add(connector, mode); |
| 138 | num++; |
| 139 | } |
| 140 | |
Stéphane Marchesin | 0208d51 | 2014-06-19 18:18:28 -0700 | [diff] [blame] | 141 | connector->display_info.bpc = panel->desc->bpc; |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 142 | connector->display_info.width_mm = panel->desc->size.width; |
| 143 | connector->display_info.height_mm = panel->desc->size.height; |
Boris Brezillon | 795f7ab | 2014-07-22 13:33:59 +0200 | [diff] [blame] | 144 | if (panel->desc->bus_format) |
| 145 | drm_display_info_set_bus_formats(&connector->display_info, |
| 146 | &panel->desc->bus_format, 1); |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 147 | |
| 148 | return num; |
| 149 | } |
| 150 | |
| 151 | static int panel_simple_disable(struct drm_panel *panel) |
| 152 | { |
| 153 | struct panel_simple *p = to_panel_simple(panel); |
| 154 | |
| 155 | if (!p->enabled) |
| 156 | return 0; |
| 157 | |
| 158 | if (p->backlight) { |
| 159 | p->backlight->props.power = FB_BLANK_POWERDOWN; |
| 160 | backlight_update_status(p->backlight); |
| 161 | } |
| 162 | |
Ajay Kumar | f673c37 | 2014-07-31 23:12:11 +0530 | [diff] [blame] | 163 | if (p->desc->delay.disable) |
| 164 | msleep(p->desc->delay.disable); |
| 165 | |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 166 | p->enabled = false; |
| 167 | |
| 168 | return 0; |
| 169 | } |
| 170 | |
Ajay Kumar | c0e1d17 | 2014-07-31 23:12:04 +0530 | [diff] [blame] | 171 | static int panel_simple_unprepare(struct drm_panel *panel) |
| 172 | { |
Ajay Kumar | 613a633 | 2014-07-31 23:12:10 +0530 | [diff] [blame] | 173 | struct panel_simple *p = to_panel_simple(panel); |
| 174 | |
| 175 | if (!p->prepared) |
| 176 | return 0; |
| 177 | |
| 178 | if (p->enable_gpio) |
| 179 | gpiod_set_value_cansleep(p->enable_gpio, 0); |
| 180 | |
| 181 | regulator_disable(p->supply); |
| 182 | |
Ajay Kumar | f673c37 | 2014-07-31 23:12:11 +0530 | [diff] [blame] | 183 | if (p->desc->delay.unprepare) |
| 184 | msleep(p->desc->delay.unprepare); |
| 185 | |
Ajay Kumar | 613a633 | 2014-07-31 23:12:10 +0530 | [diff] [blame] | 186 | p->prepared = false; |
| 187 | |
Ajay Kumar | c0e1d17 | 2014-07-31 23:12:04 +0530 | [diff] [blame] | 188 | return 0; |
| 189 | } |
| 190 | |
| 191 | static int panel_simple_prepare(struct drm_panel *panel) |
| 192 | { |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 193 | struct panel_simple *p = to_panel_simple(panel); |
| 194 | int err; |
| 195 | |
Ajay Kumar | 613a633 | 2014-07-31 23:12:10 +0530 | [diff] [blame] | 196 | if (p->prepared) |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 197 | return 0; |
| 198 | |
| 199 | err = regulator_enable(p->supply); |
| 200 | if (err < 0) { |
| 201 | dev_err(panel->dev, "failed to enable supply: %d\n", err); |
| 202 | return err; |
| 203 | } |
| 204 | |
Alexandre Courbot | cfdf054 | 2014-03-01 14:00:58 +0900 | [diff] [blame] | 205 | if (p->enable_gpio) |
Thierry Reding | 15c1a91 | 2014-03-14 12:03:47 +0100 | [diff] [blame] | 206 | gpiod_set_value_cansleep(p->enable_gpio, 1); |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 207 | |
Ajay Kumar | f673c37 | 2014-07-31 23:12:11 +0530 | [diff] [blame] | 208 | if (p->desc->delay.prepare) |
| 209 | msleep(p->desc->delay.prepare); |
| 210 | |
Ajay Kumar | 613a633 | 2014-07-31 23:12:10 +0530 | [diff] [blame] | 211 | p->prepared = true; |
| 212 | |
| 213 | return 0; |
| 214 | } |
| 215 | |
| 216 | static int panel_simple_enable(struct drm_panel *panel) |
| 217 | { |
| 218 | struct panel_simple *p = to_panel_simple(panel); |
| 219 | |
| 220 | if (p->enabled) |
| 221 | return 0; |
| 222 | |
Ajay Kumar | f673c37 | 2014-07-31 23:12:11 +0530 | [diff] [blame] | 223 | if (p->desc->delay.enable) |
| 224 | msleep(p->desc->delay.enable); |
| 225 | |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 226 | if (p->backlight) { |
| 227 | p->backlight->props.power = FB_BLANK_UNBLANK; |
| 228 | backlight_update_status(p->backlight); |
| 229 | } |
| 230 | |
| 231 | p->enabled = true; |
| 232 | |
| 233 | return 0; |
| 234 | } |
| 235 | |
| 236 | static int panel_simple_get_modes(struct drm_panel *panel) |
| 237 | { |
| 238 | struct panel_simple *p = to_panel_simple(panel); |
| 239 | int num = 0; |
| 240 | |
| 241 | /* probe EDID if a DDC bus is available */ |
| 242 | if (p->ddc) { |
| 243 | struct edid *edid = drm_get_edid(panel->connector, p->ddc); |
Stephen Warren | 70bf687 | 2014-01-09 11:37:34 -0700 | [diff] [blame] | 244 | drm_mode_connector_update_edid_property(panel->connector, edid); |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 245 | if (edid) { |
| 246 | num += drm_add_edid_modes(panel->connector, edid); |
| 247 | kfree(edid); |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | /* add hard-coded panel modes */ |
| 252 | num += panel_simple_get_fixed_modes(p); |
| 253 | |
| 254 | return num; |
| 255 | } |
| 256 | |
Philipp Zabel | a5d3e62 | 2014-12-11 18:32:45 +0100 | [diff] [blame] | 257 | static int panel_simple_get_timings(struct drm_panel *panel, |
| 258 | unsigned int num_timings, |
| 259 | struct display_timing *timings) |
| 260 | { |
| 261 | struct panel_simple *p = to_panel_simple(panel); |
| 262 | unsigned int i; |
| 263 | |
| 264 | if (p->desc->num_timings < num_timings) |
| 265 | num_timings = p->desc->num_timings; |
| 266 | |
| 267 | if (timings) |
| 268 | for (i = 0; i < num_timings; i++) |
| 269 | timings[i] = p->desc->timings[i]; |
| 270 | |
| 271 | return p->desc->num_timings; |
| 272 | } |
| 273 | |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 274 | static const struct drm_panel_funcs panel_simple_funcs = { |
| 275 | .disable = panel_simple_disable, |
Ajay Kumar | c0e1d17 | 2014-07-31 23:12:04 +0530 | [diff] [blame] | 276 | .unprepare = panel_simple_unprepare, |
| 277 | .prepare = panel_simple_prepare, |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 278 | .enable = panel_simple_enable, |
| 279 | .get_modes = panel_simple_get_modes, |
Philipp Zabel | a5d3e62 | 2014-12-11 18:32:45 +0100 | [diff] [blame] | 280 | .get_timings = panel_simple_get_timings, |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 281 | }; |
| 282 | |
| 283 | static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) |
| 284 | { |
| 285 | struct device_node *backlight, *ddc; |
| 286 | struct panel_simple *panel; |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 287 | int err; |
| 288 | |
| 289 | panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL); |
| 290 | if (!panel) |
| 291 | return -ENOMEM; |
| 292 | |
| 293 | panel->enabled = false; |
Ajay Kumar | 613a633 | 2014-07-31 23:12:10 +0530 | [diff] [blame] | 294 | panel->prepared = false; |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 295 | panel->desc = desc; |
| 296 | |
| 297 | panel->supply = devm_regulator_get(dev, "power"); |
| 298 | if (IS_ERR(panel->supply)) |
| 299 | return PTR_ERR(panel->supply); |
| 300 | |
Alexandre Courbot | a61400d | 2014-10-23 17:16:58 +0900 | [diff] [blame] | 301 | panel->enable_gpio = devm_gpiod_get_optional(dev, "enable", |
| 302 | GPIOD_OUT_LOW); |
Alexandre Courbot | cfdf054 | 2014-03-01 14:00:58 +0900 | [diff] [blame] | 303 | if (IS_ERR(panel->enable_gpio)) { |
| 304 | err = PTR_ERR(panel->enable_gpio); |
Alexandre Courbot | 9746c61 | 2014-07-25 23:47:25 +0900 | [diff] [blame] | 305 | dev_err(dev, "failed to request GPIO: %d\n", err); |
| 306 | return err; |
| 307 | } |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 308 | |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 309 | backlight = of_parse_phandle(dev->of_node, "backlight", 0); |
| 310 | if (backlight) { |
| 311 | panel->backlight = of_find_backlight_by_node(backlight); |
| 312 | of_node_put(backlight); |
| 313 | |
Alexandre Courbot | cfdf054 | 2014-03-01 14:00:58 +0900 | [diff] [blame] | 314 | if (!panel->backlight) |
| 315 | return -EPROBE_DEFER; |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 316 | } |
| 317 | |
| 318 | ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0); |
| 319 | if (ddc) { |
| 320 | panel->ddc = of_find_i2c_adapter_by_node(ddc); |
| 321 | of_node_put(ddc); |
| 322 | |
| 323 | if (!panel->ddc) { |
| 324 | err = -EPROBE_DEFER; |
| 325 | goto free_backlight; |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | drm_panel_init(&panel->base); |
| 330 | panel->base.dev = dev; |
| 331 | panel->base.funcs = &panel_simple_funcs; |
| 332 | |
| 333 | err = drm_panel_add(&panel->base); |
| 334 | if (err < 0) |
| 335 | goto free_ddc; |
| 336 | |
| 337 | dev_set_drvdata(dev, panel); |
| 338 | |
| 339 | return 0; |
| 340 | |
| 341 | free_ddc: |
| 342 | if (panel->ddc) |
| 343 | put_device(&panel->ddc->dev); |
| 344 | free_backlight: |
| 345 | if (panel->backlight) |
| 346 | put_device(&panel->backlight->dev); |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 347 | |
| 348 | return err; |
| 349 | } |
| 350 | |
| 351 | static int panel_simple_remove(struct device *dev) |
| 352 | { |
| 353 | struct panel_simple *panel = dev_get_drvdata(dev); |
| 354 | |
| 355 | drm_panel_detach(&panel->base); |
| 356 | drm_panel_remove(&panel->base); |
| 357 | |
| 358 | panel_simple_disable(&panel->base); |
| 359 | |
| 360 | if (panel->ddc) |
| 361 | put_device(&panel->ddc->dev); |
| 362 | |
| 363 | if (panel->backlight) |
| 364 | put_device(&panel->backlight->dev); |
| 365 | |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 366 | return 0; |
| 367 | } |
| 368 | |
Thierry Reding | d02fd93 | 2014-04-29 17:21:21 +0200 | [diff] [blame] | 369 | static void panel_simple_shutdown(struct device *dev) |
| 370 | { |
| 371 | struct panel_simple *panel = dev_get_drvdata(dev); |
| 372 | |
| 373 | panel_simple_disable(&panel->base); |
| 374 | } |
| 375 | |
Philipp Zabel | 1c550fa1 | 2015-02-11 18:50:09 +0100 | [diff] [blame] | 376 | static const struct drm_display_mode ampire_am800480r3tmqwa1h_mode = { |
| 377 | .clock = 33333, |
| 378 | .hdisplay = 800, |
| 379 | .hsync_start = 800 + 0, |
| 380 | .hsync_end = 800 + 0 + 255, |
| 381 | .htotal = 800 + 0 + 255 + 0, |
| 382 | .vdisplay = 480, |
| 383 | .vsync_start = 480 + 2, |
| 384 | .vsync_end = 480 + 2 + 45, |
| 385 | .vtotal = 480 + 2 + 45 + 0, |
| 386 | .vrefresh = 60, |
| 387 | .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC, |
| 388 | }; |
| 389 | |
| 390 | static const struct panel_desc ampire_am800480r3tmqwa1h = { |
| 391 | .modes = &ire_am800480r3tmqwa1h_mode, |
| 392 | .num_modes = 1, |
| 393 | .bpc = 6, |
| 394 | .size = { |
| 395 | .width = 152, |
| 396 | .height = 91, |
| 397 | }, |
| 398 | .bus_format = MEDIA_BUS_FMT_RGB666_1X18, |
| 399 | }; |
| 400 | |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 401 | static const struct drm_display_mode auo_b101aw03_mode = { |
| 402 | .clock = 51450, |
| 403 | .hdisplay = 1024, |
| 404 | .hsync_start = 1024 + 156, |
| 405 | .hsync_end = 1024 + 156 + 8, |
| 406 | .htotal = 1024 + 156 + 8 + 156, |
| 407 | .vdisplay = 600, |
| 408 | .vsync_start = 600 + 16, |
| 409 | .vsync_end = 600 + 16 + 6, |
| 410 | .vtotal = 600 + 16 + 6 + 16, |
| 411 | .vrefresh = 60, |
| 412 | }; |
| 413 | |
| 414 | static const struct panel_desc auo_b101aw03 = { |
| 415 | .modes = &auo_b101aw03_mode, |
| 416 | .num_modes = 1, |
Stéphane Marchesin | 0208d51 | 2014-06-19 18:18:28 -0700 | [diff] [blame] | 417 | .bpc = 6, |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 418 | .size = { |
| 419 | .width = 223, |
| 420 | .height = 125, |
| 421 | }, |
| 422 | }; |
| 423 | |
Huang Lin | a531bc3 | 2015-02-28 10:18:58 +0800 | [diff] [blame] | 424 | static const struct drm_display_mode auo_b101ean01_mode = { |
| 425 | .clock = 72500, |
| 426 | .hdisplay = 1280, |
| 427 | .hsync_start = 1280 + 119, |
| 428 | .hsync_end = 1280 + 119 + 32, |
| 429 | .htotal = 1280 + 119 + 32 + 21, |
| 430 | .vdisplay = 800, |
| 431 | .vsync_start = 800 + 4, |
| 432 | .vsync_end = 800 + 4 + 20, |
| 433 | .vtotal = 800 + 4 + 20 + 8, |
| 434 | .vrefresh = 60, |
| 435 | }; |
| 436 | |
| 437 | static const struct panel_desc auo_b101ean01 = { |
| 438 | .modes = &auo_b101ean01_mode, |
| 439 | .num_modes = 1, |
| 440 | .bpc = 6, |
| 441 | .size = { |
| 442 | .width = 217, |
| 443 | .height = 136, |
| 444 | }, |
| 445 | }; |
| 446 | |
Rob Clark | dac746e | 2014-08-01 17:01:06 -0400 | [diff] [blame] | 447 | static const struct drm_display_mode auo_b101xtn01_mode = { |
| 448 | .clock = 72000, |
| 449 | .hdisplay = 1366, |
| 450 | .hsync_start = 1366 + 20, |
| 451 | .hsync_end = 1366 + 20 + 70, |
| 452 | .htotal = 1366 + 20 + 70, |
| 453 | .vdisplay = 768, |
| 454 | .vsync_start = 768 + 14, |
| 455 | .vsync_end = 768 + 14 + 42, |
| 456 | .vtotal = 768 + 14 + 42, |
| 457 | .vrefresh = 60, |
| 458 | .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC, |
| 459 | }; |
| 460 | |
| 461 | static const struct panel_desc auo_b101xtn01 = { |
| 462 | .modes = &auo_b101xtn01_mode, |
| 463 | .num_modes = 1, |
| 464 | .bpc = 6, |
| 465 | .size = { |
| 466 | .width = 223, |
| 467 | .height = 125, |
| 468 | }, |
| 469 | }; |
| 470 | |
Ajay Kumar | e35e305 | 2014-09-01 15:40:02 +0530 | [diff] [blame] | 471 | static const struct drm_display_mode auo_b116xw03_mode = { |
| 472 | .clock = 70589, |
| 473 | .hdisplay = 1366, |
| 474 | .hsync_start = 1366 + 40, |
| 475 | .hsync_end = 1366 + 40 + 40, |
| 476 | .htotal = 1366 + 40 + 40 + 32, |
| 477 | .vdisplay = 768, |
| 478 | .vsync_start = 768 + 10, |
| 479 | .vsync_end = 768 + 10 + 12, |
| 480 | .vtotal = 768 + 10 + 12 + 6, |
| 481 | .vrefresh = 60, |
| 482 | }; |
| 483 | |
| 484 | static const struct panel_desc auo_b116xw03 = { |
| 485 | .modes = &auo_b116xw03_mode, |
| 486 | .num_modes = 1, |
| 487 | .bpc = 6, |
| 488 | .size = { |
| 489 | .width = 256, |
| 490 | .height = 144, |
| 491 | }, |
| 492 | }; |
| 493 | |
Stéphane Marchesin | a333f7a | 2014-05-23 19:27:59 -0700 | [diff] [blame] | 494 | static const struct drm_display_mode auo_b133xtn01_mode = { |
| 495 | .clock = 69500, |
| 496 | .hdisplay = 1366, |
| 497 | .hsync_start = 1366 + 48, |
| 498 | .hsync_end = 1366 + 48 + 32, |
| 499 | .htotal = 1366 + 48 + 32 + 20, |
| 500 | .vdisplay = 768, |
| 501 | .vsync_start = 768 + 3, |
| 502 | .vsync_end = 768 + 3 + 6, |
| 503 | .vtotal = 768 + 3 + 6 + 13, |
| 504 | .vrefresh = 60, |
| 505 | }; |
| 506 | |
| 507 | static const struct panel_desc auo_b133xtn01 = { |
| 508 | .modes = &auo_b133xtn01_mode, |
| 509 | .num_modes = 1, |
Stéphane Marchesin | 0208d51 | 2014-06-19 18:18:28 -0700 | [diff] [blame] | 510 | .bpc = 6, |
Stéphane Marchesin | a333f7a | 2014-05-23 19:27:59 -0700 | [diff] [blame] | 511 | .size = { |
| 512 | .width = 293, |
| 513 | .height = 165, |
| 514 | }, |
| 515 | }; |
| 516 | |
Ajay Kumar | 3e51d60 | 2014-07-31 23:12:12 +0530 | [diff] [blame] | 517 | static const struct drm_display_mode auo_b133htn01_mode = { |
| 518 | .clock = 150660, |
| 519 | .hdisplay = 1920, |
| 520 | .hsync_start = 1920 + 172, |
| 521 | .hsync_end = 1920 + 172 + 80, |
| 522 | .htotal = 1920 + 172 + 80 + 60, |
| 523 | .vdisplay = 1080, |
| 524 | .vsync_start = 1080 + 25, |
| 525 | .vsync_end = 1080 + 25 + 10, |
| 526 | .vtotal = 1080 + 25 + 10 + 10, |
| 527 | .vrefresh = 60, |
| 528 | }; |
| 529 | |
| 530 | static const struct panel_desc auo_b133htn01 = { |
| 531 | .modes = &auo_b133htn01_mode, |
| 532 | .num_modes = 1, |
Thierry Reding | d7a839c | 2014-11-06 10:11:01 +0100 | [diff] [blame] | 533 | .bpc = 6, |
Ajay Kumar | 3e51d60 | 2014-07-31 23:12:12 +0530 | [diff] [blame] | 534 | .size = { |
| 535 | .width = 293, |
| 536 | .height = 165, |
| 537 | }, |
| 538 | .delay = { |
| 539 | .prepare = 105, |
| 540 | .enable = 20, |
| 541 | .unprepare = 50, |
| 542 | }, |
| 543 | }; |
| 544 | |
Philipp Zabel | d47df63 | 2014-12-18 16:43:43 +0100 | [diff] [blame] | 545 | static const struct drm_display_mode avic_tm070ddh03_mode = { |
| 546 | .clock = 51200, |
| 547 | .hdisplay = 1024, |
| 548 | .hsync_start = 1024 + 160, |
| 549 | .hsync_end = 1024 + 160 + 4, |
| 550 | .htotal = 1024 + 160 + 4 + 156, |
| 551 | .vdisplay = 600, |
| 552 | .vsync_start = 600 + 17, |
| 553 | .vsync_end = 600 + 17 + 1, |
| 554 | .vtotal = 600 + 17 + 1 + 17, |
| 555 | .vrefresh = 60, |
| 556 | }; |
| 557 | |
| 558 | static const struct panel_desc avic_tm070ddh03 = { |
| 559 | .modes = &avic_tm070ddh03_mode, |
| 560 | .num_modes = 1, |
| 561 | .bpc = 8, |
| 562 | .size = { |
| 563 | .width = 154, |
| 564 | .height = 90, |
| 565 | }, |
| 566 | .delay = { |
| 567 | .prepare = 20, |
| 568 | .enable = 200, |
| 569 | .disable = 200, |
| 570 | }, |
| 571 | }; |
| 572 | |
Stephen Warren | 4c93075 | 2014-01-07 16:46:26 -0700 | [diff] [blame] | 573 | static const struct drm_display_mode chunghwa_claa101wa01a_mode = { |
| 574 | .clock = 72070, |
| 575 | .hdisplay = 1366, |
| 576 | .hsync_start = 1366 + 58, |
| 577 | .hsync_end = 1366 + 58 + 58, |
| 578 | .htotal = 1366 + 58 + 58 + 58, |
| 579 | .vdisplay = 768, |
| 580 | .vsync_start = 768 + 4, |
| 581 | .vsync_end = 768 + 4 + 4, |
| 582 | .vtotal = 768 + 4 + 4 + 4, |
| 583 | .vrefresh = 60, |
| 584 | }; |
| 585 | |
| 586 | static const struct panel_desc chunghwa_claa101wa01a = { |
| 587 | .modes = &chunghwa_claa101wa01a_mode, |
| 588 | .num_modes = 1, |
Stéphane Marchesin | 0208d51 | 2014-06-19 18:18:28 -0700 | [diff] [blame] | 589 | .bpc = 6, |
Stephen Warren | 4c93075 | 2014-01-07 16:46:26 -0700 | [diff] [blame] | 590 | .size = { |
| 591 | .width = 220, |
| 592 | .height = 120, |
| 593 | }, |
| 594 | }; |
| 595 | |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 596 | static const struct drm_display_mode chunghwa_claa101wb01_mode = { |
| 597 | .clock = 69300, |
| 598 | .hdisplay = 1366, |
| 599 | .hsync_start = 1366 + 48, |
| 600 | .hsync_end = 1366 + 48 + 32, |
| 601 | .htotal = 1366 + 48 + 32 + 20, |
| 602 | .vdisplay = 768, |
| 603 | .vsync_start = 768 + 16, |
| 604 | .vsync_end = 768 + 16 + 8, |
| 605 | .vtotal = 768 + 16 + 8 + 16, |
| 606 | .vrefresh = 60, |
| 607 | }; |
| 608 | |
| 609 | static const struct panel_desc chunghwa_claa101wb01 = { |
| 610 | .modes = &chunghwa_claa101wb01_mode, |
| 611 | .num_modes = 1, |
Stéphane Marchesin | 0208d51 | 2014-06-19 18:18:28 -0700 | [diff] [blame] | 612 | .bpc = 6, |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 613 | .size = { |
| 614 | .width = 223, |
| 615 | .height = 125, |
| 616 | }, |
| 617 | }; |
| 618 | |
Stefan Agner | 26ab006 | 2014-05-15 11:38:45 +0200 | [diff] [blame] | 619 | static const struct drm_display_mode edt_et057090dhu_mode = { |
| 620 | .clock = 25175, |
| 621 | .hdisplay = 640, |
| 622 | .hsync_start = 640 + 16, |
| 623 | .hsync_end = 640 + 16 + 30, |
| 624 | .htotal = 640 + 16 + 30 + 114, |
| 625 | .vdisplay = 480, |
| 626 | .vsync_start = 480 + 10, |
| 627 | .vsync_end = 480 + 10 + 3, |
| 628 | .vtotal = 480 + 10 + 3 + 32, |
| 629 | .vrefresh = 60, |
| 630 | .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC, |
| 631 | }; |
| 632 | |
| 633 | static const struct panel_desc edt_et057090dhu = { |
| 634 | .modes = &edt_et057090dhu_mode, |
| 635 | .num_modes = 1, |
Stéphane Marchesin | 0208d51 | 2014-06-19 18:18:28 -0700 | [diff] [blame] | 636 | .bpc = 6, |
Stefan Agner | 26ab006 | 2014-05-15 11:38:45 +0200 | [diff] [blame] | 637 | .size = { |
| 638 | .width = 115, |
| 639 | .height = 86, |
| 640 | }, |
| 641 | }; |
| 642 | |
Philipp Zabel | fff5de4 | 2014-05-15 12:25:47 +0200 | [diff] [blame] | 643 | static const struct drm_display_mode edt_etm0700g0dh6_mode = { |
| 644 | .clock = 33260, |
| 645 | .hdisplay = 800, |
| 646 | .hsync_start = 800 + 40, |
| 647 | .hsync_end = 800 + 40 + 128, |
| 648 | .htotal = 800 + 40 + 128 + 88, |
| 649 | .vdisplay = 480, |
| 650 | .vsync_start = 480 + 10, |
| 651 | .vsync_end = 480 + 10 + 2, |
| 652 | .vtotal = 480 + 10 + 2 + 33, |
| 653 | .vrefresh = 60, |
| 654 | .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC, |
| 655 | }; |
| 656 | |
| 657 | static const struct panel_desc edt_etm0700g0dh6 = { |
| 658 | .modes = &edt_etm0700g0dh6_mode, |
| 659 | .num_modes = 1, |
Stéphane Marchesin | 0208d51 | 2014-06-19 18:18:28 -0700 | [diff] [blame] | 660 | .bpc = 6, |
Philipp Zabel | fff5de4 | 2014-05-15 12:25:47 +0200 | [diff] [blame] | 661 | .size = { |
| 662 | .width = 152, |
| 663 | .height = 91, |
| 664 | }, |
| 665 | }; |
| 666 | |
Boris BREZILLON | 102932b | 2014-06-05 15:53:32 +0200 | [diff] [blame] | 667 | static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = { |
| 668 | .clock = 32260, |
| 669 | .hdisplay = 800, |
| 670 | .hsync_start = 800 + 168, |
| 671 | .hsync_end = 800 + 168 + 64, |
| 672 | .htotal = 800 + 168 + 64 + 88, |
| 673 | .vdisplay = 480, |
| 674 | .vsync_start = 480 + 37, |
| 675 | .vsync_end = 480 + 37 + 2, |
| 676 | .vtotal = 480 + 37 + 2 + 8, |
| 677 | .vrefresh = 60, |
| 678 | }; |
| 679 | |
| 680 | static const struct panel_desc foxlink_fl500wvr00_a0t = { |
| 681 | .modes = &foxlink_fl500wvr00_a0t_mode, |
| 682 | .num_modes = 1, |
Thierry Reding | d7a839c | 2014-11-06 10:11:01 +0100 | [diff] [blame] | 683 | .bpc = 8, |
Boris BREZILLON | 102932b | 2014-06-05 15:53:32 +0200 | [diff] [blame] | 684 | .size = { |
| 685 | .width = 108, |
| 686 | .height = 65, |
| 687 | }, |
Boris Brezillon | bb276cb | 2014-07-22 13:35:47 +0200 | [diff] [blame] | 688 | .bus_format = MEDIA_BUS_FMT_RGB888_1X24, |
Boris BREZILLON | 102932b | 2014-06-05 15:53:32 +0200 | [diff] [blame] | 689 | }; |
| 690 | |
Philipp Zabel | d435a2a | 2014-11-19 10:29:55 +0100 | [diff] [blame] | 691 | static const struct drm_display_mode giantplus_gpg482739qs5_mode = { |
| 692 | .clock = 9000, |
| 693 | .hdisplay = 480, |
| 694 | .hsync_start = 480 + 5, |
| 695 | .hsync_end = 480 + 5 + 1, |
| 696 | .htotal = 480 + 5 + 1 + 40, |
| 697 | .vdisplay = 272, |
| 698 | .vsync_start = 272 + 8, |
| 699 | .vsync_end = 272 + 8 + 1, |
| 700 | .vtotal = 272 + 8 + 1 + 8, |
| 701 | .vrefresh = 60, |
| 702 | }; |
| 703 | |
| 704 | static const struct panel_desc giantplus_gpg482739qs5 = { |
| 705 | .modes = &giantplus_gpg482739qs5_mode, |
| 706 | .num_modes = 1, |
| 707 | .bpc = 8, |
| 708 | .size = { |
| 709 | .width = 95, |
| 710 | .height = 54, |
| 711 | }, |
Philipp Zabel | 33536a0 | 2015-02-11 18:50:07 +0100 | [diff] [blame] | 712 | .bus_format = MEDIA_BUS_FMT_RGB888_1X24, |
Philipp Zabel | d435a2a | 2014-11-19 10:29:55 +0100 | [diff] [blame] | 713 | }; |
| 714 | |
Philipp Zabel | ab07725 | 2014-12-11 18:32:46 +0100 | [diff] [blame] | 715 | static const struct display_timing hannstar_hsd070pww1_timing = { |
| 716 | .pixelclock = { 64300000, 71100000, 82000000 }, |
| 717 | .hactive = { 1280, 1280, 1280 }, |
| 718 | .hfront_porch = { 1, 1, 10 }, |
| 719 | .hback_porch = { 1, 1, 10 }, |
Philipp Zabel | d901d2b | 2015-08-12 12:32:13 +0200 | [diff] [blame] | 720 | /* |
| 721 | * According to the data sheet, the minimum horizontal blanking interval |
| 722 | * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the |
| 723 | * minimum working horizontal blanking interval to be 60 clocks. |
| 724 | */ |
| 725 | .hsync_len = { 58, 158, 661 }, |
Philipp Zabel | ab07725 | 2014-12-11 18:32:46 +0100 | [diff] [blame] | 726 | .vactive = { 800, 800, 800 }, |
| 727 | .vfront_porch = { 1, 1, 10 }, |
| 728 | .vback_porch = { 1, 1, 10 }, |
| 729 | .vsync_len = { 1, 21, 203 }, |
| 730 | .flags = DISPLAY_FLAGS_DE_HIGH, |
Philipp Zabel | a853205 | 2014-10-23 16:31:06 +0200 | [diff] [blame] | 731 | }; |
| 732 | |
| 733 | static const struct panel_desc hannstar_hsd070pww1 = { |
Philipp Zabel | ab07725 | 2014-12-11 18:32:46 +0100 | [diff] [blame] | 734 | .timings = &hannstar_hsd070pww1_timing, |
| 735 | .num_timings = 1, |
Philipp Zabel | a853205 | 2014-10-23 16:31:06 +0200 | [diff] [blame] | 736 | .bpc = 6, |
| 737 | .size = { |
| 738 | .width = 151, |
| 739 | .height = 94, |
| 740 | }, |
Philipp Zabel | 58d6a7b | 2015-08-12 12:32:12 +0200 | [diff] [blame] | 741 | .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, |
Philipp Zabel | a853205 | 2014-10-23 16:31:06 +0200 | [diff] [blame] | 742 | }; |
| 743 | |
Eric Nelson | c0d607e | 2015-04-13 15:09:26 -0700 | [diff] [blame] | 744 | static const struct display_timing hannstar_hsd100pxn1_timing = { |
| 745 | .pixelclock = { 55000000, 65000000, 75000000 }, |
| 746 | .hactive = { 1024, 1024, 1024 }, |
| 747 | .hfront_porch = { 40, 40, 40 }, |
| 748 | .hback_porch = { 220, 220, 220 }, |
| 749 | .hsync_len = { 20, 60, 100 }, |
| 750 | .vactive = { 768, 768, 768 }, |
| 751 | .vfront_porch = { 7, 7, 7 }, |
| 752 | .vback_porch = { 21, 21, 21 }, |
| 753 | .vsync_len = { 10, 10, 10 }, |
| 754 | .flags = DISPLAY_FLAGS_DE_HIGH, |
| 755 | }; |
| 756 | |
| 757 | static const struct panel_desc hannstar_hsd100pxn1 = { |
| 758 | .timings = &hannstar_hsd100pxn1_timing, |
| 759 | .num_timings = 1, |
| 760 | .bpc = 6, |
| 761 | .size = { |
| 762 | .width = 203, |
| 763 | .height = 152, |
| 764 | }, |
Philipp Zabel | 4946b04 | 2015-05-20 11:34:08 +0200 | [diff] [blame] | 765 | .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, |
Eric Nelson | c0d607e | 2015-04-13 15:09:26 -0700 | [diff] [blame] | 766 | }; |
| 767 | |
Lucas Stach | 61ac0bf | 2014-11-06 17:44:35 +0100 | [diff] [blame] | 768 | static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = { |
| 769 | .clock = 33333, |
| 770 | .hdisplay = 800, |
| 771 | .hsync_start = 800 + 85, |
| 772 | .hsync_end = 800 + 85 + 86, |
| 773 | .htotal = 800 + 85 + 86 + 85, |
| 774 | .vdisplay = 480, |
| 775 | .vsync_start = 480 + 16, |
| 776 | .vsync_end = 480 + 16 + 13, |
| 777 | .vtotal = 480 + 16 + 13 + 16, |
| 778 | .vrefresh = 60, |
| 779 | }; |
| 780 | |
| 781 | static const struct panel_desc hitachi_tx23d38vm0caa = { |
| 782 | .modes = &hitachi_tx23d38vm0caa_mode, |
| 783 | .num_modes = 1, |
| 784 | .bpc = 6, |
| 785 | .size = { |
| 786 | .width = 195, |
| 787 | .height = 117, |
| 788 | }, |
| 789 | }; |
| 790 | |
Nicolas Ferre | 41bcceb | 2015-03-19 14:43:01 +0100 | [diff] [blame] | 791 | static const struct drm_display_mode innolux_at043tn24_mode = { |
| 792 | .clock = 9000, |
| 793 | .hdisplay = 480, |
| 794 | .hsync_start = 480 + 2, |
| 795 | .hsync_end = 480 + 2 + 41, |
| 796 | .htotal = 480 + 2 + 41 + 2, |
| 797 | .vdisplay = 272, |
| 798 | .vsync_start = 272 + 2, |
| 799 | .vsync_end = 272 + 2 + 11, |
| 800 | .vtotal = 272 + 2 + 11 + 2, |
| 801 | .vrefresh = 60, |
| 802 | .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC, |
| 803 | }; |
| 804 | |
| 805 | static const struct panel_desc innolux_at043tn24 = { |
| 806 | .modes = &innolux_at043tn24_mode, |
| 807 | .num_modes = 1, |
| 808 | .bpc = 8, |
| 809 | .size = { |
| 810 | .width = 95, |
| 811 | .height = 54, |
| 812 | }, |
| 813 | .bus_format = MEDIA_BUS_FMT_RGB888_1X24, |
| 814 | }; |
| 815 | |
Lucas Stach | d731f66 | 2014-11-06 17:44:33 +0100 | [diff] [blame] | 816 | static const struct drm_display_mode innolux_g121i1_l01_mode = { |
Thierry Reding | 0a2288c | 2014-07-03 14:02:59 +0200 | [diff] [blame] | 817 | .clock = 71000, |
Lucas Stach | d731f66 | 2014-11-06 17:44:33 +0100 | [diff] [blame] | 818 | .hdisplay = 1280, |
| 819 | .hsync_start = 1280 + 64, |
| 820 | .hsync_end = 1280 + 64 + 32, |
| 821 | .htotal = 1280 + 64 + 32 + 64, |
| 822 | .vdisplay = 800, |
| 823 | .vsync_start = 800 + 9, |
| 824 | .vsync_end = 800 + 9 + 6, |
| 825 | .vtotal = 800 + 9 + 6 + 9, |
| 826 | .vrefresh = 60, |
| 827 | }; |
| 828 | |
| 829 | static const struct panel_desc innolux_g121i1_l01 = { |
| 830 | .modes = &innolux_g121i1_l01_mode, |
| 831 | .num_modes = 1, |
| 832 | .bpc = 6, |
| 833 | .size = { |
| 834 | .width = 261, |
| 835 | .height = 163, |
| 836 | }, |
| 837 | }; |
| 838 | |
Akshay Bhat | f8fa17b | 2015-11-18 15:57:47 -0500 | [diff] [blame] | 839 | static const struct drm_display_mode innolux_g121x1_l03_mode = { |
| 840 | .clock = 65000, |
| 841 | .hdisplay = 1024, |
| 842 | .hsync_start = 1024 + 0, |
| 843 | .hsync_end = 1024 + 1, |
| 844 | .htotal = 1024 + 0 + 1 + 320, |
| 845 | .vdisplay = 768, |
| 846 | .vsync_start = 768 + 38, |
| 847 | .vsync_end = 768 + 38 + 1, |
| 848 | .vtotal = 768 + 38 + 1 + 0, |
| 849 | .vrefresh = 60, |
| 850 | }; |
| 851 | |
| 852 | static const struct panel_desc innolux_g121x1_l03 = { |
| 853 | .modes = &innolux_g121x1_l03_mode, |
| 854 | .num_modes = 1, |
| 855 | .bpc = 6, |
| 856 | .size = { |
| 857 | .width = 246, |
| 858 | .height = 185, |
| 859 | }, |
| 860 | .delay = { |
| 861 | .enable = 200, |
| 862 | .unprepare = 200, |
| 863 | .disable = 400, |
| 864 | }, |
| 865 | }; |
| 866 | |
Thierry Reding | 0a2288c | 2014-07-03 14:02:59 +0200 | [diff] [blame] | 867 | static const struct drm_display_mode innolux_n116bge_mode = { |
Daniel Kurtz | 7fe8c77 | 2014-09-02 10:56:46 +0800 | [diff] [blame] | 868 | .clock = 76420, |
Thierry Reding | 0a2288c | 2014-07-03 14:02:59 +0200 | [diff] [blame] | 869 | .hdisplay = 1366, |
Daniel Kurtz | 7fe8c77 | 2014-09-02 10:56:46 +0800 | [diff] [blame] | 870 | .hsync_start = 1366 + 136, |
| 871 | .hsync_end = 1366 + 136 + 30, |
| 872 | .htotal = 1366 + 136 + 30 + 60, |
Thierry Reding | 0a2288c | 2014-07-03 14:02:59 +0200 | [diff] [blame] | 873 | .vdisplay = 768, |
| 874 | .vsync_start = 768 + 8, |
Daniel Kurtz | 7fe8c77 | 2014-09-02 10:56:46 +0800 | [diff] [blame] | 875 | .vsync_end = 768 + 8 + 12, |
| 876 | .vtotal = 768 + 8 + 12 + 12, |
Thierry Reding | 0a2288c | 2014-07-03 14:02:59 +0200 | [diff] [blame] | 877 | .vrefresh = 60, |
| 878 | .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC, |
| 879 | }; |
| 880 | |
| 881 | static const struct panel_desc innolux_n116bge = { |
| 882 | .modes = &innolux_n116bge_mode, |
| 883 | .num_modes = 1, |
| 884 | .bpc = 6, |
| 885 | .size = { |
| 886 | .width = 256, |
| 887 | .height = 144, |
| 888 | }, |
| 889 | }; |
| 890 | |
Alban Bedel | ea44739 | 2014-07-22 08:38:55 +0200 | [diff] [blame] | 891 | static const struct drm_display_mode innolux_n156bge_l21_mode = { |
| 892 | .clock = 69300, |
| 893 | .hdisplay = 1366, |
| 894 | .hsync_start = 1366 + 16, |
| 895 | .hsync_end = 1366 + 16 + 34, |
| 896 | .htotal = 1366 + 16 + 34 + 50, |
| 897 | .vdisplay = 768, |
| 898 | .vsync_start = 768 + 2, |
| 899 | .vsync_end = 768 + 2 + 6, |
| 900 | .vtotal = 768 + 2 + 6 + 12, |
| 901 | .vrefresh = 60, |
| 902 | }; |
| 903 | |
| 904 | static const struct panel_desc innolux_n156bge_l21 = { |
| 905 | .modes = &innolux_n156bge_l21_mode, |
| 906 | .num_modes = 1, |
Stéphane Marchesin | 0208d51 | 2014-06-19 18:18:28 -0700 | [diff] [blame] | 907 | .bpc = 6, |
Alban Bedel | ea44739 | 2014-07-22 08:38:55 +0200 | [diff] [blame] | 908 | .size = { |
| 909 | .width = 344, |
| 910 | .height = 193, |
| 911 | }, |
| 912 | }; |
| 913 | |
Michael Grzeschik | bccac3f | 2015-03-19 12:22:44 +0100 | [diff] [blame] | 914 | static const struct drm_display_mode innolux_zj070na_01p_mode = { |
| 915 | .clock = 51501, |
| 916 | .hdisplay = 1024, |
| 917 | .hsync_start = 1024 + 128, |
| 918 | .hsync_end = 1024 + 128 + 64, |
| 919 | .htotal = 1024 + 128 + 64 + 128, |
| 920 | .vdisplay = 600, |
| 921 | .vsync_start = 600 + 16, |
| 922 | .vsync_end = 600 + 16 + 4, |
| 923 | .vtotal = 600 + 16 + 4 + 16, |
| 924 | .vrefresh = 60, |
| 925 | }; |
| 926 | |
| 927 | static const struct panel_desc innolux_zj070na_01p = { |
| 928 | .modes = &innolux_zj070na_01p_mode, |
| 929 | .num_modes = 1, |
| 930 | .bpc = 6, |
| 931 | .size = { |
| 932 | .width = 1024, |
| 933 | .height = 600, |
| 934 | }, |
| 935 | }; |
| 936 | |
Lucas Stach | 8def22e | 2015-12-02 19:41:11 +0100 | [diff] [blame] | 937 | static const struct display_timing kyo_tcg121xglp_timing = { |
| 938 | .pixelclock = { 52000000, 65000000, 71000000 }, |
| 939 | .hactive = { 1024, 1024, 1024 }, |
| 940 | .hfront_porch = { 2, 2, 2 }, |
| 941 | .hback_porch = { 2, 2, 2 }, |
| 942 | .hsync_len = { 86, 124, 244 }, |
| 943 | .vactive = { 768, 768, 768 }, |
| 944 | .vfront_porch = { 2, 2, 2 }, |
| 945 | .vback_porch = { 2, 2, 2 }, |
| 946 | .vsync_len = { 6, 34, 73 }, |
| 947 | .flags = DISPLAY_FLAGS_DE_HIGH, |
| 948 | }; |
| 949 | |
| 950 | static const struct panel_desc kyo_tcg121xglp = { |
| 951 | .timings = &kyo_tcg121xglp_timing, |
| 952 | .num_timings = 1, |
| 953 | .bpc = 8, |
| 954 | .size = { |
| 955 | .width = 246, |
| 956 | .height = 184, |
| 957 | }, |
| 958 | .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, |
| 959 | }; |
| 960 | |
Heiko Schocher | dd01500 | 2015-05-22 10:25:57 +0200 | [diff] [blame] | 961 | static const struct drm_display_mode lg_lb070wv8_mode = { |
| 962 | .clock = 33246, |
| 963 | .hdisplay = 800, |
| 964 | .hsync_start = 800 + 88, |
| 965 | .hsync_end = 800 + 88 + 80, |
| 966 | .htotal = 800 + 88 + 80 + 88, |
| 967 | .vdisplay = 480, |
| 968 | .vsync_start = 480 + 10, |
| 969 | .vsync_end = 480 + 10 + 25, |
| 970 | .vtotal = 480 + 10 + 25 + 10, |
| 971 | .vrefresh = 60, |
| 972 | }; |
| 973 | |
| 974 | static const struct panel_desc lg_lb070wv8 = { |
| 975 | .modes = &lg_lb070wv8_mode, |
| 976 | .num_modes = 1, |
| 977 | .bpc = 16, |
| 978 | .size = { |
| 979 | .width = 151, |
| 980 | .height = 91, |
| 981 | }, |
| 982 | .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, |
| 983 | }; |
| 984 | |
Thierry Reding | ec7c565 | 2013-11-15 15:59:32 +0100 | [diff] [blame] | 985 | static const struct drm_display_mode lg_lp129qe_mode = { |
| 986 | .clock = 285250, |
| 987 | .hdisplay = 2560, |
| 988 | .hsync_start = 2560 + 48, |
| 989 | .hsync_end = 2560 + 48 + 32, |
| 990 | .htotal = 2560 + 48 + 32 + 80, |
| 991 | .vdisplay = 1700, |
| 992 | .vsync_start = 1700 + 3, |
| 993 | .vsync_end = 1700 + 3 + 10, |
| 994 | .vtotal = 1700 + 3 + 10 + 36, |
| 995 | .vrefresh = 60, |
| 996 | }; |
| 997 | |
| 998 | static const struct panel_desc lg_lp129qe = { |
| 999 | .modes = &lg_lp129qe_mode, |
| 1000 | .num_modes = 1, |
Stéphane Marchesin | 0208d51 | 2014-06-19 18:18:28 -0700 | [diff] [blame] | 1001 | .bpc = 8, |
Thierry Reding | ec7c565 | 2013-11-15 15:59:32 +0100 | [diff] [blame] | 1002 | .size = { |
| 1003 | .width = 272, |
| 1004 | .height = 181, |
| 1005 | }, |
| 1006 | }; |
| 1007 | |
jianwei wang | c6e87f9 | 2015-07-29 16:30:02 +0800 | [diff] [blame] | 1008 | static const struct drm_display_mode nec_nl4827hc19_05b_mode = { |
| 1009 | .clock = 10870, |
| 1010 | .hdisplay = 480, |
| 1011 | .hsync_start = 480 + 2, |
| 1012 | .hsync_end = 480 + 2 + 41, |
| 1013 | .htotal = 480 + 2 + 41 + 2, |
| 1014 | .vdisplay = 272, |
| 1015 | .vsync_start = 272 + 2, |
| 1016 | .vsync_end = 272 + 2 + 4, |
| 1017 | .vtotal = 272 + 2 + 4 + 2, |
| 1018 | .vrefresh = 74, |
| 1019 | }; |
| 1020 | |
| 1021 | static const struct panel_desc nec_nl4827hc19_05b = { |
| 1022 | .modes = &nec_nl4827hc19_05b_mode, |
| 1023 | .num_modes = 1, |
| 1024 | .bpc = 8, |
| 1025 | .size = { |
| 1026 | .width = 95, |
| 1027 | .height = 54, |
| 1028 | }, |
| 1029 | .bus_format = MEDIA_BUS_FMT_RGB888_1X24 |
| 1030 | }; |
| 1031 | |
Gary Bisson | a99fb62 | 2015-06-10 18:44:23 +0200 | [diff] [blame] | 1032 | static const struct display_timing okaya_rs800480t_7x0gp_timing = { |
| 1033 | .pixelclock = { 30000000, 30000000, 40000000 }, |
| 1034 | .hactive = { 800, 800, 800 }, |
| 1035 | .hfront_porch = { 40, 40, 40 }, |
| 1036 | .hback_porch = { 40, 40, 40 }, |
| 1037 | .hsync_len = { 1, 48, 48 }, |
| 1038 | .vactive = { 480, 480, 480 }, |
| 1039 | .vfront_porch = { 13, 13, 13 }, |
| 1040 | .vback_porch = { 29, 29, 29 }, |
| 1041 | .vsync_len = { 3, 3, 3 }, |
| 1042 | .flags = DISPLAY_FLAGS_DE_HIGH, |
| 1043 | }; |
| 1044 | |
| 1045 | static const struct panel_desc okaya_rs800480t_7x0gp = { |
| 1046 | .timings = &okaya_rs800480t_7x0gp_timing, |
| 1047 | .num_timings = 1, |
| 1048 | .bpc = 6, |
| 1049 | .size = { |
| 1050 | .width = 154, |
| 1051 | .height = 87, |
| 1052 | }, |
| 1053 | .delay = { |
| 1054 | .prepare = 41, |
| 1055 | .enable = 50, |
| 1056 | .unprepare = 41, |
| 1057 | .disable = 50, |
| 1058 | }, |
| 1059 | .bus_format = MEDIA_BUS_FMT_RGB666_1X18, |
| 1060 | }; |
| 1061 | |
Philipp Zabel | 725c9d4 | 2015-02-11 18:50:11 +0100 | [diff] [blame] | 1062 | static const struct drm_display_mode ortustech_com43h4m85ulc_mode = { |
| 1063 | .clock = 25000, |
| 1064 | .hdisplay = 480, |
| 1065 | .hsync_start = 480 + 10, |
| 1066 | .hsync_end = 480 + 10 + 10, |
| 1067 | .htotal = 480 + 10 + 10 + 15, |
| 1068 | .vdisplay = 800, |
| 1069 | .vsync_start = 800 + 3, |
| 1070 | .vsync_end = 800 + 3 + 3, |
| 1071 | .vtotal = 800 + 3 + 3 + 3, |
| 1072 | .vrefresh = 60, |
| 1073 | }; |
| 1074 | |
| 1075 | static const struct panel_desc ortustech_com43h4m85ulc = { |
| 1076 | .modes = &ortustech_com43h4m85ulc_mode, |
| 1077 | .num_modes = 1, |
| 1078 | .bpc = 8, |
| 1079 | .size = { |
| 1080 | .width = 56, |
| 1081 | .height = 93, |
| 1082 | }, |
| 1083 | .bus_format = MEDIA_BUS_FMT_RGB888_1X24, |
| 1084 | }; |
| 1085 | |
Marc Dietrich | 6d54e3d | 2013-12-21 21:38:12 +0100 | [diff] [blame] | 1086 | static const struct drm_display_mode samsung_ltn101nt05_mode = { |
| 1087 | .clock = 54030, |
| 1088 | .hdisplay = 1024, |
| 1089 | .hsync_start = 1024 + 24, |
| 1090 | .hsync_end = 1024 + 24 + 136, |
| 1091 | .htotal = 1024 + 24 + 136 + 160, |
| 1092 | .vdisplay = 600, |
| 1093 | .vsync_start = 600 + 3, |
| 1094 | .vsync_end = 600 + 3 + 6, |
| 1095 | .vtotal = 600 + 3 + 6 + 61, |
| 1096 | .vrefresh = 60, |
| 1097 | }; |
| 1098 | |
| 1099 | static const struct panel_desc samsung_ltn101nt05 = { |
| 1100 | .modes = &samsung_ltn101nt05_mode, |
| 1101 | .num_modes = 1, |
Stéphane Marchesin | 0208d51 | 2014-06-19 18:18:28 -0700 | [diff] [blame] | 1102 | .bpc = 6, |
Marc Dietrich | 6d54e3d | 2013-12-21 21:38:12 +0100 | [diff] [blame] | 1103 | .size = { |
| 1104 | .width = 1024, |
| 1105 | .height = 600, |
| 1106 | }, |
| 1107 | }; |
| 1108 | |
Stéphane Marchesin | 0c93430 | 2015-03-18 10:52:18 +0100 | [diff] [blame] | 1109 | static const struct drm_display_mode samsung_ltn140at29_301_mode = { |
| 1110 | .clock = 76300, |
| 1111 | .hdisplay = 1366, |
| 1112 | .hsync_start = 1366 + 64, |
| 1113 | .hsync_end = 1366 + 64 + 48, |
| 1114 | .htotal = 1366 + 64 + 48 + 128, |
| 1115 | .vdisplay = 768, |
| 1116 | .vsync_start = 768 + 2, |
| 1117 | .vsync_end = 768 + 2 + 5, |
| 1118 | .vtotal = 768 + 2 + 5 + 17, |
| 1119 | .vrefresh = 60, |
| 1120 | }; |
| 1121 | |
| 1122 | static const struct panel_desc samsung_ltn140at29_301 = { |
| 1123 | .modes = &samsung_ltn140at29_301_mode, |
| 1124 | .num_modes = 1, |
| 1125 | .bpc = 6, |
| 1126 | .size = { |
| 1127 | .width = 320, |
| 1128 | .height = 187, |
| 1129 | }, |
| 1130 | }; |
| 1131 | |
Boris BREZILLON | 9c6615b | 2015-03-19 14:43:00 +0100 | [diff] [blame] | 1132 | static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = { |
| 1133 | .clock = 33300, |
| 1134 | .hdisplay = 800, |
| 1135 | .hsync_start = 800 + 1, |
| 1136 | .hsync_end = 800 + 1 + 64, |
| 1137 | .htotal = 800 + 1 + 64 + 64, |
| 1138 | .vdisplay = 480, |
| 1139 | .vsync_start = 480 + 1, |
| 1140 | .vsync_end = 480 + 1 + 23, |
| 1141 | .vtotal = 480 + 1 + 23 + 22, |
| 1142 | .vrefresh = 60, |
| 1143 | }; |
| 1144 | |
| 1145 | static const struct panel_desc shelly_sca07010_bfn_lnn = { |
| 1146 | .modes = &shelly_sca07010_bfn_lnn_mode, |
| 1147 | .num_modes = 1, |
| 1148 | .size = { |
| 1149 | .width = 152, |
| 1150 | .height = 91, |
| 1151 | }, |
| 1152 | .bus_format = MEDIA_BUS_FMT_RGB666_1X18, |
| 1153 | }; |
| 1154 | |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 1155 | static const struct of_device_id platform_of_match[] = { |
| 1156 | { |
Philipp Zabel | 1c550fa1 | 2015-02-11 18:50:09 +0100 | [diff] [blame] | 1157 | .compatible = "ampire,am800480r3tmqwa1h", |
| 1158 | .data = &ire_am800480r3tmqwa1h, |
| 1159 | }, { |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 1160 | .compatible = "auo,b101aw03", |
| 1161 | .data = &auo_b101aw03, |
| 1162 | }, { |
Huang Lin | a531bc3 | 2015-02-28 10:18:58 +0800 | [diff] [blame] | 1163 | .compatible = "auo,b101ean01", |
| 1164 | .data = &auo_b101ean01, |
| 1165 | }, { |
Rob Clark | dac746e | 2014-08-01 17:01:06 -0400 | [diff] [blame] | 1166 | .compatible = "auo,b101xtn01", |
| 1167 | .data = &auo_b101xtn01, |
| 1168 | }, { |
Ajay Kumar | e35e305 | 2014-09-01 15:40:02 +0530 | [diff] [blame] | 1169 | .compatible = "auo,b116xw03", |
| 1170 | .data = &auo_b116xw03, |
| 1171 | }, { |
Ajay Kumar | 3e51d60 | 2014-07-31 23:12:12 +0530 | [diff] [blame] | 1172 | .compatible = "auo,b133htn01", |
| 1173 | .data = &auo_b133htn01, |
| 1174 | }, { |
Stéphane Marchesin | a333f7a | 2014-05-23 19:27:59 -0700 | [diff] [blame] | 1175 | .compatible = "auo,b133xtn01", |
| 1176 | .data = &auo_b133xtn01, |
| 1177 | }, { |
Philipp Zabel | d47df63 | 2014-12-18 16:43:43 +0100 | [diff] [blame] | 1178 | .compatible = "avic,tm070ddh03", |
| 1179 | .data = &avic_tm070ddh03, |
| 1180 | }, { |
Stephen Warren | 4c93075 | 2014-01-07 16:46:26 -0700 | [diff] [blame] | 1181 | .compatible = "chunghwa,claa101wa01a", |
| 1182 | .data = &chunghwa_claa101wa01a |
| 1183 | }, { |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 1184 | .compatible = "chunghwa,claa101wb01", |
| 1185 | .data = &chunghwa_claa101wb01 |
| 1186 | }, { |
Stefan Agner | 26ab006 | 2014-05-15 11:38:45 +0200 | [diff] [blame] | 1187 | .compatible = "edt,et057090dhu", |
| 1188 | .data = &edt_et057090dhu, |
| 1189 | }, { |
Philipp Zabel | fff5de4 | 2014-05-15 12:25:47 +0200 | [diff] [blame] | 1190 | .compatible = "edt,et070080dh6", |
| 1191 | .data = &edt_etm0700g0dh6, |
| 1192 | }, { |
| 1193 | .compatible = "edt,etm0700g0dh6", |
| 1194 | .data = &edt_etm0700g0dh6, |
| 1195 | }, { |
Boris BREZILLON | 102932b | 2014-06-05 15:53:32 +0200 | [diff] [blame] | 1196 | .compatible = "foxlink,fl500wvr00-a0t", |
| 1197 | .data = &foxlink_fl500wvr00_a0t, |
| 1198 | }, { |
Philipp Zabel | d435a2a | 2014-11-19 10:29:55 +0100 | [diff] [blame] | 1199 | .compatible = "giantplus,gpg482739qs5", |
| 1200 | .data = &giantplus_gpg482739qs5 |
| 1201 | }, { |
Philipp Zabel | a853205 | 2014-10-23 16:31:06 +0200 | [diff] [blame] | 1202 | .compatible = "hannstar,hsd070pww1", |
| 1203 | .data = &hannstar_hsd070pww1, |
| 1204 | }, { |
Eric Nelson | c0d607e | 2015-04-13 15:09:26 -0700 | [diff] [blame] | 1205 | .compatible = "hannstar,hsd100pxn1", |
| 1206 | .data = &hannstar_hsd100pxn1, |
| 1207 | }, { |
Lucas Stach | 61ac0bf | 2014-11-06 17:44:35 +0100 | [diff] [blame] | 1208 | .compatible = "hit,tx23d38vm0caa", |
| 1209 | .data = &hitachi_tx23d38vm0caa |
| 1210 | }, { |
Nicolas Ferre | 41bcceb | 2015-03-19 14:43:01 +0100 | [diff] [blame] | 1211 | .compatible = "innolux,at043tn24", |
| 1212 | .data = &innolux_at043tn24, |
| 1213 | }, { |
Lucas Stach | d731f66 | 2014-11-06 17:44:33 +0100 | [diff] [blame] | 1214 | .compatible ="innolux,g121i1-l01", |
| 1215 | .data = &innolux_g121i1_l01 |
| 1216 | }, { |
Akshay Bhat | f8fa17b | 2015-11-18 15:57:47 -0500 | [diff] [blame] | 1217 | .compatible = "innolux,g121x1-l03", |
| 1218 | .data = &innolux_g121x1_l03, |
| 1219 | }, { |
Thierry Reding | 0a2288c | 2014-07-03 14:02:59 +0200 | [diff] [blame] | 1220 | .compatible = "innolux,n116bge", |
| 1221 | .data = &innolux_n116bge, |
| 1222 | }, { |
Alban Bedel | ea44739 | 2014-07-22 08:38:55 +0200 | [diff] [blame] | 1223 | .compatible = "innolux,n156bge-l21", |
| 1224 | .data = &innolux_n156bge_l21, |
| 1225 | }, { |
Michael Grzeschik | bccac3f | 2015-03-19 12:22:44 +0100 | [diff] [blame] | 1226 | .compatible = "innolux,zj070na-01p", |
| 1227 | .data = &innolux_zj070na_01p, |
| 1228 | }, { |
Lucas Stach | 8def22e | 2015-12-02 19:41:11 +0100 | [diff] [blame] | 1229 | .compatible = "kyo,tcg121xglp", |
| 1230 | .data = &kyo_tcg121xglp, |
| 1231 | }, { |
Heiko Schocher | dd01500 | 2015-05-22 10:25:57 +0200 | [diff] [blame] | 1232 | .compatible = "lg,lb070wv8", |
| 1233 | .data = &lg_lb070wv8, |
| 1234 | }, { |
Thierry Reding | ec7c565 | 2013-11-15 15:59:32 +0100 | [diff] [blame] | 1235 | .compatible = "lg,lp129qe", |
| 1236 | .data = &lg_lp129qe, |
| 1237 | }, { |
jianwei wang | c6e87f9 | 2015-07-29 16:30:02 +0800 | [diff] [blame] | 1238 | .compatible = "nec,nl4827hc19-05b", |
| 1239 | .data = &nec_nl4827hc19_05b, |
| 1240 | }, { |
Gary Bisson | a99fb62 | 2015-06-10 18:44:23 +0200 | [diff] [blame] | 1241 | .compatible = "okaya,rs800480t-7x0gp", |
| 1242 | .data = &okaya_rs800480t_7x0gp, |
| 1243 | }, { |
Philipp Zabel | 725c9d4 | 2015-02-11 18:50:11 +0100 | [diff] [blame] | 1244 | .compatible = "ortustech,com43h4m85ulc", |
| 1245 | .data = &ortustech_com43h4m85ulc, |
| 1246 | }, { |
Marc Dietrich | 6d54e3d | 2013-12-21 21:38:12 +0100 | [diff] [blame] | 1247 | .compatible = "samsung,ltn101nt05", |
| 1248 | .data = &samsung_ltn101nt05, |
| 1249 | }, { |
Stéphane Marchesin | 0c93430 | 2015-03-18 10:52:18 +0100 | [diff] [blame] | 1250 | .compatible = "samsung,ltn140at29-301", |
| 1251 | .data = &samsung_ltn140at29_301, |
| 1252 | }, { |
Boris BREZILLON | 9c6615b | 2015-03-19 14:43:00 +0100 | [diff] [blame] | 1253 | .compatible = "shelly,sca07010-bfn-lnn", |
| 1254 | .data = &shelly_sca07010_bfn_lnn, |
| 1255 | }, { |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 1256 | /* sentinel */ |
| 1257 | } |
| 1258 | }; |
| 1259 | MODULE_DEVICE_TABLE(of, platform_of_match); |
| 1260 | |
| 1261 | static int panel_simple_platform_probe(struct platform_device *pdev) |
| 1262 | { |
| 1263 | const struct of_device_id *id; |
| 1264 | |
| 1265 | id = of_match_node(platform_of_match, pdev->dev.of_node); |
| 1266 | if (!id) |
| 1267 | return -ENODEV; |
| 1268 | |
| 1269 | return panel_simple_probe(&pdev->dev, id->data); |
| 1270 | } |
| 1271 | |
| 1272 | static int panel_simple_platform_remove(struct platform_device *pdev) |
| 1273 | { |
| 1274 | return panel_simple_remove(&pdev->dev); |
| 1275 | } |
| 1276 | |
Thierry Reding | d02fd93 | 2014-04-29 17:21:21 +0200 | [diff] [blame] | 1277 | static void panel_simple_platform_shutdown(struct platform_device *pdev) |
| 1278 | { |
| 1279 | panel_simple_shutdown(&pdev->dev); |
| 1280 | } |
| 1281 | |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 1282 | static struct platform_driver panel_simple_platform_driver = { |
| 1283 | .driver = { |
| 1284 | .name = "panel-simple", |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 1285 | .of_match_table = platform_of_match, |
| 1286 | }, |
| 1287 | .probe = panel_simple_platform_probe, |
| 1288 | .remove = panel_simple_platform_remove, |
Thierry Reding | d02fd93 | 2014-04-29 17:21:21 +0200 | [diff] [blame] | 1289 | .shutdown = panel_simple_platform_shutdown, |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 1290 | }; |
| 1291 | |
Thierry Reding | 210fcd9 | 2013-11-22 19:27:11 +0100 | [diff] [blame] | 1292 | struct panel_desc_dsi { |
| 1293 | struct panel_desc desc; |
| 1294 | |
Thierry Reding | 462658b | 2014-03-14 11:24:57 +0100 | [diff] [blame] | 1295 | unsigned long flags; |
Thierry Reding | 210fcd9 | 2013-11-22 19:27:11 +0100 | [diff] [blame] | 1296 | enum mipi_dsi_pixel_format format; |
| 1297 | unsigned int lanes; |
| 1298 | }; |
| 1299 | |
Thierry Reding | d718d79 | 2015-04-08 16:52:33 +0200 | [diff] [blame] | 1300 | static const struct drm_display_mode auo_b080uan01_mode = { |
| 1301 | .clock = 154500, |
| 1302 | .hdisplay = 1200, |
| 1303 | .hsync_start = 1200 + 62, |
| 1304 | .hsync_end = 1200 + 62 + 4, |
| 1305 | .htotal = 1200 + 62 + 4 + 62, |
| 1306 | .vdisplay = 1920, |
| 1307 | .vsync_start = 1920 + 9, |
| 1308 | .vsync_end = 1920 + 9 + 2, |
| 1309 | .vtotal = 1920 + 9 + 2 + 8, |
| 1310 | .vrefresh = 60, |
| 1311 | }; |
| 1312 | |
| 1313 | static const struct panel_desc_dsi auo_b080uan01 = { |
| 1314 | .desc = { |
| 1315 | .modes = &auo_b080uan01_mode, |
| 1316 | .num_modes = 1, |
| 1317 | .bpc = 8, |
| 1318 | .size = { |
| 1319 | .width = 108, |
| 1320 | .height = 272, |
| 1321 | }, |
| 1322 | }, |
| 1323 | .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS, |
| 1324 | .format = MIPI_DSI_FMT_RGB888, |
| 1325 | .lanes = 4, |
| 1326 | }; |
| 1327 | |
Chris Zhong | c852196 | 2015-11-20 16:15:37 +0800 | [diff] [blame] | 1328 | static const struct drm_display_mode boe_tv080wum_nl0_mode = { |
| 1329 | .clock = 160000, |
| 1330 | .hdisplay = 1200, |
| 1331 | .hsync_start = 1200 + 120, |
| 1332 | .hsync_end = 1200 + 120 + 20, |
| 1333 | .htotal = 1200 + 120 + 20 + 21, |
| 1334 | .vdisplay = 1920, |
| 1335 | .vsync_start = 1920 + 21, |
| 1336 | .vsync_end = 1920 + 21 + 3, |
| 1337 | .vtotal = 1920 + 21 + 3 + 18, |
| 1338 | .vrefresh = 60, |
| 1339 | .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC, |
| 1340 | }; |
| 1341 | |
| 1342 | static const struct panel_desc_dsi boe_tv080wum_nl0 = { |
| 1343 | .desc = { |
| 1344 | .modes = &boe_tv080wum_nl0_mode, |
| 1345 | .num_modes = 1, |
| 1346 | .size = { |
| 1347 | .width = 107, |
| 1348 | .height = 172, |
| 1349 | }, |
| 1350 | }, |
| 1351 | .flags = MIPI_DSI_MODE_VIDEO | |
| 1352 | MIPI_DSI_MODE_VIDEO_BURST | |
| 1353 | MIPI_DSI_MODE_VIDEO_SYNC_PULSE, |
| 1354 | .format = MIPI_DSI_FMT_RGB888, |
| 1355 | .lanes = 4, |
| 1356 | }; |
| 1357 | |
Alexandre Courbot | 712ac1b | 2014-01-21 18:57:10 +0900 | [diff] [blame] | 1358 | static const struct drm_display_mode lg_ld070wx3_sl01_mode = { |
| 1359 | .clock = 71000, |
| 1360 | .hdisplay = 800, |
| 1361 | .hsync_start = 800 + 32, |
| 1362 | .hsync_end = 800 + 32 + 1, |
| 1363 | .htotal = 800 + 32 + 1 + 57, |
| 1364 | .vdisplay = 1280, |
| 1365 | .vsync_start = 1280 + 28, |
| 1366 | .vsync_end = 1280 + 28 + 1, |
| 1367 | .vtotal = 1280 + 28 + 1 + 14, |
| 1368 | .vrefresh = 60, |
| 1369 | }; |
| 1370 | |
| 1371 | static const struct panel_desc_dsi lg_ld070wx3_sl01 = { |
| 1372 | .desc = { |
| 1373 | .modes = &lg_ld070wx3_sl01_mode, |
| 1374 | .num_modes = 1, |
Thierry Reding | d7a839c | 2014-11-06 10:11:01 +0100 | [diff] [blame] | 1375 | .bpc = 8, |
Alexandre Courbot | 712ac1b | 2014-01-21 18:57:10 +0900 | [diff] [blame] | 1376 | .size = { |
| 1377 | .width = 94, |
| 1378 | .height = 151, |
| 1379 | }, |
| 1380 | }, |
Alexandre Courbot | 5e4cc27 | 2014-07-08 21:32:12 +0900 | [diff] [blame] | 1381 | .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS, |
Alexandre Courbot | 712ac1b | 2014-01-21 18:57:10 +0900 | [diff] [blame] | 1382 | .format = MIPI_DSI_FMT_RGB888, |
| 1383 | .lanes = 4, |
| 1384 | }; |
| 1385 | |
Alexandre Courbot | 499ce85 | 2014-01-21 18:57:09 +0900 | [diff] [blame] | 1386 | static const struct drm_display_mode lg_lh500wx1_sd03_mode = { |
| 1387 | .clock = 67000, |
| 1388 | .hdisplay = 720, |
| 1389 | .hsync_start = 720 + 12, |
| 1390 | .hsync_end = 720 + 12 + 4, |
| 1391 | .htotal = 720 + 12 + 4 + 112, |
| 1392 | .vdisplay = 1280, |
| 1393 | .vsync_start = 1280 + 8, |
| 1394 | .vsync_end = 1280 + 8 + 4, |
| 1395 | .vtotal = 1280 + 8 + 4 + 12, |
| 1396 | .vrefresh = 60, |
| 1397 | }; |
| 1398 | |
| 1399 | static const struct panel_desc_dsi lg_lh500wx1_sd03 = { |
| 1400 | .desc = { |
| 1401 | .modes = &lg_lh500wx1_sd03_mode, |
| 1402 | .num_modes = 1, |
Thierry Reding | d7a839c | 2014-11-06 10:11:01 +0100 | [diff] [blame] | 1403 | .bpc = 8, |
Alexandre Courbot | 499ce85 | 2014-01-21 18:57:09 +0900 | [diff] [blame] | 1404 | .size = { |
| 1405 | .width = 62, |
| 1406 | .height = 110, |
| 1407 | }, |
| 1408 | }, |
| 1409 | .flags = MIPI_DSI_MODE_VIDEO, |
| 1410 | .format = MIPI_DSI_FMT_RGB888, |
| 1411 | .lanes = 4, |
| 1412 | }; |
| 1413 | |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 1414 | static const struct drm_display_mode panasonic_vvx10f004b00_mode = { |
| 1415 | .clock = 157200, |
| 1416 | .hdisplay = 1920, |
| 1417 | .hsync_start = 1920 + 154, |
| 1418 | .hsync_end = 1920 + 154 + 16, |
| 1419 | .htotal = 1920 + 154 + 16 + 32, |
| 1420 | .vdisplay = 1200, |
| 1421 | .vsync_start = 1200 + 17, |
| 1422 | .vsync_end = 1200 + 17 + 2, |
| 1423 | .vtotal = 1200 + 17 + 2 + 16, |
| 1424 | .vrefresh = 60, |
| 1425 | }; |
| 1426 | |
Thierry Reding | 210fcd9 | 2013-11-22 19:27:11 +0100 | [diff] [blame] | 1427 | static const struct panel_desc_dsi panasonic_vvx10f004b00 = { |
| 1428 | .desc = { |
| 1429 | .modes = &panasonic_vvx10f004b00_mode, |
| 1430 | .num_modes = 1, |
Thierry Reding | d7a839c | 2014-11-06 10:11:01 +0100 | [diff] [blame] | 1431 | .bpc = 8, |
Thierry Reding | 210fcd9 | 2013-11-22 19:27:11 +0100 | [diff] [blame] | 1432 | .size = { |
| 1433 | .width = 217, |
| 1434 | .height = 136, |
| 1435 | }, |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 1436 | }, |
Alexandre Courbot | 5e4cc27 | 2014-07-08 21:32:12 +0900 | [diff] [blame] | 1437 | .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | |
| 1438 | MIPI_DSI_CLOCK_NON_CONTINUOUS, |
Thierry Reding | 210fcd9 | 2013-11-22 19:27:11 +0100 | [diff] [blame] | 1439 | .format = MIPI_DSI_FMT_RGB888, |
| 1440 | .lanes = 4, |
| 1441 | }; |
| 1442 | |
Chris Zhong | c852196 | 2015-11-20 16:15:37 +0800 | [diff] [blame] | 1443 | |
Thierry Reding | 210fcd9 | 2013-11-22 19:27:11 +0100 | [diff] [blame] | 1444 | static const struct of_device_id dsi_of_match[] = { |
| 1445 | { |
Thierry Reding | d718d79 | 2015-04-08 16:52:33 +0200 | [diff] [blame] | 1446 | .compatible = "auo,b080uan01", |
| 1447 | .data = &auo_b080uan01 |
| 1448 | }, { |
Chris Zhong | c852196 | 2015-11-20 16:15:37 +0800 | [diff] [blame] | 1449 | .compatible = "boe,tv080wum-nl0", |
| 1450 | .data = &boe_tv080wum_nl0 |
| 1451 | }, { |
Alexandre Courbot | 712ac1b | 2014-01-21 18:57:10 +0900 | [diff] [blame] | 1452 | .compatible = "lg,ld070wx3-sl01", |
| 1453 | .data = &lg_ld070wx3_sl01 |
| 1454 | }, { |
Alexandre Courbot | 499ce85 | 2014-01-21 18:57:09 +0900 | [diff] [blame] | 1455 | .compatible = "lg,lh500wx1-sd03", |
| 1456 | .data = &lg_lh500wx1_sd03 |
| 1457 | }, { |
Thierry Reding | 210fcd9 | 2013-11-22 19:27:11 +0100 | [diff] [blame] | 1458 | .compatible = "panasonic,vvx10f004b00", |
| 1459 | .data = &panasonic_vvx10f004b00 |
| 1460 | }, { |
| 1461 | /* sentinel */ |
| 1462 | } |
| 1463 | }; |
| 1464 | MODULE_DEVICE_TABLE(of, dsi_of_match); |
| 1465 | |
| 1466 | static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi) |
| 1467 | { |
| 1468 | const struct panel_desc_dsi *desc; |
| 1469 | const struct of_device_id *id; |
| 1470 | int err; |
| 1471 | |
| 1472 | id = of_match_node(dsi_of_match, dsi->dev.of_node); |
| 1473 | if (!id) |
| 1474 | return -ENODEV; |
| 1475 | |
| 1476 | desc = id->data; |
| 1477 | |
| 1478 | err = panel_simple_probe(&dsi->dev, &desc->desc); |
| 1479 | if (err < 0) |
| 1480 | return err; |
| 1481 | |
Thierry Reding | 462658b | 2014-03-14 11:24:57 +0100 | [diff] [blame] | 1482 | dsi->mode_flags = desc->flags; |
Thierry Reding | 210fcd9 | 2013-11-22 19:27:11 +0100 | [diff] [blame] | 1483 | dsi->format = desc->format; |
| 1484 | dsi->lanes = desc->lanes; |
| 1485 | |
| 1486 | return mipi_dsi_attach(dsi); |
| 1487 | } |
| 1488 | |
| 1489 | static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi) |
| 1490 | { |
| 1491 | int err; |
| 1492 | |
| 1493 | err = mipi_dsi_detach(dsi); |
| 1494 | if (err < 0) |
| 1495 | dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); |
| 1496 | |
| 1497 | return panel_simple_remove(&dsi->dev); |
| 1498 | } |
| 1499 | |
Thierry Reding | d02fd93 | 2014-04-29 17:21:21 +0200 | [diff] [blame] | 1500 | static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi) |
| 1501 | { |
| 1502 | panel_simple_shutdown(&dsi->dev); |
| 1503 | } |
| 1504 | |
Thierry Reding | 210fcd9 | 2013-11-22 19:27:11 +0100 | [diff] [blame] | 1505 | static struct mipi_dsi_driver panel_simple_dsi_driver = { |
| 1506 | .driver = { |
| 1507 | .name = "panel-simple-dsi", |
Thierry Reding | 210fcd9 | 2013-11-22 19:27:11 +0100 | [diff] [blame] | 1508 | .of_match_table = dsi_of_match, |
| 1509 | }, |
| 1510 | .probe = panel_simple_dsi_probe, |
| 1511 | .remove = panel_simple_dsi_remove, |
Thierry Reding | d02fd93 | 2014-04-29 17:21:21 +0200 | [diff] [blame] | 1512 | .shutdown = panel_simple_dsi_shutdown, |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 1513 | }; |
| 1514 | |
| 1515 | static int __init panel_simple_init(void) |
| 1516 | { |
Thierry Reding | 210fcd9 | 2013-11-22 19:27:11 +0100 | [diff] [blame] | 1517 | int err; |
| 1518 | |
| 1519 | err = platform_driver_register(&panel_simple_platform_driver); |
| 1520 | if (err < 0) |
| 1521 | return err; |
| 1522 | |
| 1523 | if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) { |
| 1524 | err = mipi_dsi_driver_register(&panel_simple_dsi_driver); |
| 1525 | if (err < 0) |
| 1526 | return err; |
| 1527 | } |
| 1528 | |
| 1529 | return 0; |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 1530 | } |
| 1531 | module_init(panel_simple_init); |
| 1532 | |
| 1533 | static void __exit panel_simple_exit(void) |
| 1534 | { |
Thierry Reding | 210fcd9 | 2013-11-22 19:27:11 +0100 | [diff] [blame] | 1535 | if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) |
| 1536 | mipi_dsi_driver_unregister(&panel_simple_dsi_driver); |
| 1537 | |
Thierry Reding | 280921d | 2013-08-30 15:10:14 +0200 | [diff] [blame] | 1538 | platform_driver_unregister(&panel_simple_platform_driver); |
| 1539 | } |
| 1540 | module_exit(panel_simple_exit); |
| 1541 | |
| 1542 | MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>"); |
| 1543 | MODULE_DESCRIPTION("DRM Driver for Simple Panels"); |
| 1544 | MODULE_LICENSE("GPL and additional rights"); |