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