Lines Matching +full:dpi +full:- +full:to +full:- +full:lvds
4 * Permission is hereby granted, free of charge, to any person obtaining a
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:
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
27 #include <linux/media-bus-format.h>
45 * struct panel_desc - Describes a simple panel.
49 * @modes: Pointer to array of fixed modes appropriate for this panel.
61 * @timings: Pointer to array of display timings
63 * NOTE: cannot be used with "modes" and also these will be used to
90 * @delay.prepare: Time for the panel to become ready.
92 * The time (in milliseconds) that it takes for the panel to
98 * @delay.enable: Time for the panel to display a valid frame.
100 * The time (in milliseconds) that it takes for the panel to
101 * display the first valid frame after starting to receive
107 * @delay.disable: Time for the panel to turn the display off.
109 * The time (in milliseconds) that it takes for the panel to
115 * @delay.unprepare: Time to power down completely.
118 * to power itself down completely.
120 * This time is used to prevent a future "prepare" from
134 /** @connector_type: LVDS, eDP, DSI, DPI, etc. */
172 for (i = 0; i < panel->desc->num_timings; i++) { in panel_simple_get_timings_modes()
173 const struct display_timing *dt = &panel->desc->timings[i]; in panel_simple_get_timings_modes()
177 mode = drm_mode_create(connector->dev); in panel_simple_get_timings_modes()
179 dev_err(panel->base.dev, "failed to add mode %ux%u\n", in panel_simple_get_timings_modes()
180 dt->hactive.typ, dt->vactive.typ); in panel_simple_get_timings_modes()
186 mode->type |= DRM_MODE_TYPE_DRIVER; in panel_simple_get_timings_modes()
188 if (panel->desc->num_timings == 1) in panel_simple_get_timings_modes()
189 mode->type |= DRM_MODE_TYPE_PREFERRED; in panel_simple_get_timings_modes()
204 for (i = 0; i < panel->desc->num_modes; i++) { in panel_simple_get_display_modes()
205 const struct drm_display_mode *m = &panel->desc->modes[i]; in panel_simple_get_display_modes()
207 mode = drm_mode_duplicate(connector->dev, m); in panel_simple_get_display_modes()
209 dev_err(panel->base.dev, "failed to add mode %ux%u@%u\n", in panel_simple_get_display_modes()
210 m->hdisplay, m->vdisplay, in panel_simple_get_display_modes()
215 mode->type |= DRM_MODE_TYPE_DRIVER; in panel_simple_get_display_modes()
217 if (panel->desc->num_modes == 1) in panel_simple_get_display_modes()
218 mode->type |= DRM_MODE_TYPE_PREFERRED; in panel_simple_get_display_modes()
233 bool has_override = panel->override_mode.type; in panel_simple_get_non_edid_modes()
236 if (!panel->desc) in panel_simple_get_non_edid_modes()
240 mode = drm_mode_duplicate(connector->dev, in panel_simple_get_non_edid_modes()
241 &panel->override_mode); in panel_simple_get_non_edid_modes()
246 dev_err(panel->base.dev, "failed to add override mode\n"); in panel_simple_get_non_edid_modes()
250 /* Only add timings if override was not there or failed to validate */ in panel_simple_get_non_edid_modes()
251 if (num == 0 && panel->desc->num_timings) in panel_simple_get_non_edid_modes()
260 WARN_ON(panel->desc->num_timings && panel->desc->num_modes); in panel_simple_get_non_edid_modes()
264 connector->display_info.bpc = panel->desc->bpc; in panel_simple_get_non_edid_modes()
265 connector->display_info.width_mm = panel->desc->size.width; in panel_simple_get_non_edid_modes()
266 connector->display_info.height_mm = panel->desc->size.height; in panel_simple_get_non_edid_modes()
267 if (panel->desc->bus_format) in panel_simple_get_non_edid_modes()
268 drm_display_info_set_bus_formats(&connector->display_info, in panel_simple_get_non_edid_modes()
269 &panel->desc->bus_format, 1); in panel_simple_get_non_edid_modes()
270 connector->display_info.bus_flags = panel->desc->bus_flags; in panel_simple_get_non_edid_modes()
293 if (!p->enabled) in panel_simple_disable()
296 if (p->desc->delay.disable) in panel_simple_disable()
297 msleep(p->desc->delay.disable); in panel_simple_disable()
299 p->enabled = false; in panel_simple_disable()
308 gpiod_set_value_cansleep(p->enable_gpio, 0); in panel_simple_suspend()
309 regulator_disable(p->supply); in panel_simple_suspend()
310 p->unprepared_time = ktime_get(); in panel_simple_suspend()
312 kfree(p->edid); in panel_simple_suspend()
313 p->edid = NULL; in panel_simple_suspend()
323 /* Unpreparing when already unprepared is a no-op */ in panel_simple_unprepare()
324 if (!p->prepared) in panel_simple_unprepare()
327 pm_runtime_mark_last_busy(panel->dev); in panel_simple_unprepare()
328 ret = pm_runtime_put_autosuspend(panel->dev); in panel_simple_unprepare()
331 p->prepared = false; in panel_simple_unprepare()
341 panel_simple_wait(p->unprepared_time, p->desc->delay.unprepare); in panel_simple_resume()
343 err = regulator_enable(p->supply); in panel_simple_resume()
345 dev_err(dev, "failed to enable supply: %d\n", err); in panel_simple_resume()
349 gpiod_set_value_cansleep(p->enable_gpio, 1); in panel_simple_resume()
351 if (p->desc->delay.prepare) in panel_simple_resume()
352 msleep(p->desc->delay.prepare); in panel_simple_resume()
354 p->prepared_time = ktime_get(); in panel_simple_resume()
364 /* Preparing when already prepared is a no-op */ in panel_simple_prepare()
365 if (p->prepared) in panel_simple_prepare()
368 ret = pm_runtime_get_sync(panel->dev); in panel_simple_prepare()
370 pm_runtime_put_autosuspend(panel->dev); in panel_simple_prepare()
374 p->prepared = true; in panel_simple_prepare()
383 if (p->enabled) in panel_simple_enable()
386 if (p->desc->delay.enable) in panel_simple_enable()
387 msleep(p->desc->delay.enable); in panel_simple_enable()
389 p->enabled = true; in panel_simple_enable()
401 if (p->ddc) { in panel_simple_get_modes()
402 pm_runtime_get_sync(panel->dev); in panel_simple_get_modes()
404 if (!p->edid) in panel_simple_get_modes()
405 p->edid = drm_get_edid(connector, p->ddc); in panel_simple_get_modes()
407 if (p->edid) in panel_simple_get_modes()
408 num += drm_add_edid_modes(connector, p->edid); in panel_simple_get_modes()
410 pm_runtime_mark_last_busy(panel->dev); in panel_simple_get_modes()
411 pm_runtime_put_autosuspend(panel->dev); in panel_simple_get_modes()
414 /* add hard-coded panel modes */ in panel_simple_get_modes()
421 drm_connector_set_panel_orientation(connector, p->orientation); in panel_simple_get_modes()
433 if (p->desc->num_timings < num_timings) in panel_simple_get_timings()
434 num_timings = p->desc->num_timings; in panel_simple_get_timings()
438 timings[i] = p->desc->timings[i]; in panel_simple_get_timings()
440 return p->desc->num_timings; in panel_simple_get_timings()
447 return p->orientation; in panel_simple_get_orientation()
472 np = dev->of_node; in panel_dpi_probe()
475 return -ENOMEM; in panel_dpi_probe()
479 return -ENOMEM; in panel_dpi_probe()
481 ret = of_get_display_timing(np, "panel-timing", timing); in panel_dpi_probe()
483 dev_err(dev, "%pOF: no panel-timing node found for \"panel-dpi\" binding\n", in panel_dpi_probe()
488 desc->timings = timing; in panel_dpi_probe()
489 desc->num_timings = 1; in panel_dpi_probe()
491 of_property_read_u32(np, "width-mm", &desc->size.width); in panel_dpi_probe()
492 of_property_read_u32(np, "height-mm", &desc->size.height); in panel_dpi_probe()
496 vm.flags = timing->flags; in panel_dpi_probe()
498 desc->bus_flags = bus_flags; in panel_dpi_probe()
501 desc->connector_type = DRM_MODE_CONNECTOR_DPI; in panel_dpi_probe()
503 panel->desc = desc; in panel_dpi_probe()
509 (to_check->field.typ >= bounds->field.min && \
510 to_check->field.typ <= bounds->field.max)
515 const struct panel_desc *desc = panel->desc; in panel_simple_parse_panel_timing_node()
519 if (WARN_ON(desc->num_modes)) { in panel_simple_parse_panel_timing_node()
523 if (WARN_ON(!desc->num_timings)) { in panel_simple_parse_panel_timing_node()
528 for (i = 0; i < panel->desc->num_timings; i++) { in panel_simple_parse_panel_timing_node()
529 const struct display_timing *dt = &panel->desc->timings[i]; in panel_simple_parse_panel_timing_node()
541 if (ot->flags != dt->flags) in panel_simple_parse_panel_timing_node()
545 drm_display_mode_from_videomode(&vm, &panel->override_mode); in panel_simple_parse_panel_timing_node()
546 panel->override_mode.type |= DRM_MODE_TYPE_DRIVER | in panel_simple_parse_panel_timing_node()
551 if (WARN_ON(!panel->override_mode.type)) in panel_simple_parse_panel_timing_node()
566 return -ENOMEM; in panel_simple_probe()
568 panel->enabled = false; in panel_simple_probe()
569 panel->prepared_time = 0; in panel_simple_probe()
570 panel->desc = desc; in panel_simple_probe()
572 panel->supply = devm_regulator_get(dev, "power"); in panel_simple_probe()
573 if (IS_ERR(panel->supply)) in panel_simple_probe()
574 return PTR_ERR(panel->supply); in panel_simple_probe()
576 panel->enable_gpio = devm_gpiod_get_optional(dev, "enable", in panel_simple_probe()
578 if (IS_ERR(panel->enable_gpio)) in panel_simple_probe()
579 return dev_err_probe(dev, PTR_ERR(panel->enable_gpio), in panel_simple_probe()
580 "failed to request GPIO\n"); in panel_simple_probe()
582 err = of_drm_get_panel_orientation(dev->of_node, &panel->orientation); in panel_simple_probe()
584 dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err); in panel_simple_probe()
588 ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0); in panel_simple_probe()
590 panel->ddc = of_find_i2c_adapter_by_node(ddc); in panel_simple_probe()
593 if (!panel->ddc) in panel_simple_probe()
594 return -EPROBE_DEFER; in panel_simple_probe()
598 /* Handle the generic panel-dpi binding */ in panel_simple_probe()
602 desc = panel->desc; in panel_simple_probe()
604 if (!of_get_display_timing(dev->of_node, "panel-timing", &dt)) in panel_simple_probe()
608 connector_type = desc->connector_type; in panel_simple_probe()
616 WARN_ON(desc->bus_flags & in panel_simple_probe()
621 WARN_ON(desc->bus_format != MEDIA_BUS_FMT_RGB666_1X7X3_SPWG && in panel_simple_probe()
622 desc->bus_format != MEDIA_BUS_FMT_RGB888_1X7X4_SPWG && in panel_simple_probe()
623 desc->bus_format != MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA); in panel_simple_probe()
624 WARN_ON(desc->bus_format == MEDIA_BUS_FMT_RGB666_1X7X3_SPWG && in panel_simple_probe()
625 desc->bpc != 6); in panel_simple_probe()
626 WARN_ON((desc->bus_format == MEDIA_BUS_FMT_RGB888_1X7X4_SPWG || in panel_simple_probe()
627 desc->bus_format == MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA) && in panel_simple_probe()
628 desc->bpc != 8); in panel_simple_probe()
631 dev_warn(dev, "eDP panels moved to panel-edp\n"); in panel_simple_probe()
632 err = -EINVAL; in panel_simple_probe()
635 if (desc->bpc != 6 && desc->bpc != 8) in panel_simple_probe()
636 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc); in panel_simple_probe()
647 if (desc->bus_flags & ~bus_flags) in panel_simple_probe()
648 dev_warn(dev, "Unexpected bus_flags(%d)\n", desc->bus_flags & ~bus_flags); in panel_simple_probe()
649 if (!(desc->bus_flags & bus_flags)) in panel_simple_probe()
651 if (desc->bus_format == 0) in panel_simple_probe()
653 if (desc->bpc != 6 && desc->bpc != 8) in panel_simple_probe()
654 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc); in panel_simple_probe()
657 dev_warn(dev, "Specify a valid connector_type: %d\n", desc->connector_type); in panel_simple_probe()
667 * to optimize powering the panel on briefly to read the EDID before in panel_simple_probe()
674 drm_panel_init(&panel->base, dev, &panel_simple_funcs, connector_type); in panel_simple_probe()
676 err = drm_panel_of_backlight(&panel->base); in panel_simple_probe()
682 drm_panel_add(&panel->base); in panel_simple_probe()
690 if (panel->ddc) in panel_simple_probe()
691 put_device(&panel->ddc->dev); in panel_simple_probe()
700 drm_panel_remove(&panel->base); in panel_simple_remove()
701 drm_panel_disable(&panel->base); in panel_simple_remove()
702 drm_panel_unprepare(&panel->base); in panel_simple_remove()
706 if (panel->ddc) in panel_simple_remove()
707 put_device(&panel->ddc->dev); in panel_simple_remove()
714 drm_panel_disable(&panel->base); in panel_simple_shutdown()
715 drm_panel_unprepare(&panel->base); in panel_simple_shutdown()
1263 /* S070PWS19HP-FC21 2017/04/22 */
1290 /* S070SWV29HG-DC44 2017/09/21 */
1998 * According to the data sheet, the minimum horizontal blanking interval
2000 * minimum working horizontal blanking interval to be 60 clocks.
2970 * 800x480 CVT. The panel appears to be quite accepting, at least as far as
2989 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
3767 .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
3771 .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
3928 .compatible = "ampire,am-1280800n3tzqw-t00h",
3931 .compatible = "ampire,am-480272h3tmqw-t01h",
3937 .compatible = "ampire,am800600p5tmqw-tb8h",
3940 .compatible = "arm,rtsm-display",
3943 .compatible = "armadeus,st0700-adapt",
3985 .compatible = "bananapi,s070wv20-ct16",
3988 .compatible = "boe,hv070wsa-100",
3991 .compatible = "cdtech,s043wq26h-ct7",
3994 .compatible = "cdtech,s070pws19hp-fc21",
3997 .compatible = "cdtech,s070swv29hg-dc44",
4000 .compatible = "cdtech,s070wv95-ct16",
4003 .compatible = "chefree,ch101olhlwh-002",
4024 .compatible = "dlc,dlc0700yzg-1",
4063 .compatible = "eink,vb3300-kca",
4069 .compatible = "foxlink,fl500wvr00-a0t",
4102 .compatible = "innolux,g070y2-l01",
4105 .compatible = "innolux,g070y2-t02",
4108 .compatible = "innolux,g101ice-l01",
4111 .compatible = "innolux,g121i1-l01",
4114 .compatible = "innolux,g121x1-l03",
4117 .compatible = "innolux,n156bge-l21",
4120 .compatible = "innolux,zj070na-01p",
4135 .compatible = "lemaker,bl035-rgb-002",
4144 .compatible = "logictechno,lt161010-2nhc",
4147 .compatible = "logictechno,lt161010-2nhr",
4150 .compatible = "logictechno,lt170410-2whc",
4153 .compatible = "logictechno,lttd800480070-l2rt",
4156 .compatible = "logictechno,lttd800480070-l6wh-rt",
4159 .compatible = "mitsubishi,aa070mc01-ca1",
4162 .compatible = "multi-inno,mi0700s4t-6",
4165 .compatible = "multi-inno,mi0800ft-9",
4168 .compatible = "multi-inno,mi1010ait-1cp",
4171 .compatible = "nec,nl12880bc20-05",
4174 .compatible = "nec,nl4827hc19-05b",
4177 .compatible = "netron-dy,e231732",
4180 .compatible = "newhaven,nhd-4.3-480272ef-atxl",
4183 .compatible = "nlt,nl192108ac18-02d",
4189 .compatible = "okaya,rs800480t-7x0gp",
4192 .compatible = "olimex,lcd-olinuxino-43-ts",
4207 .compatible = "osddisplays,osd070t1718-19ts",
4210 .compatible = "pda,91-00156-a0",
4213 .compatible = "powertip,ph800480t013-idf02",
4216 .compatible = "qiaodian,qd43003c0-40",
4219 .compatible = "qishenglong,gopher2b-lcd",
4225 .compatible = "rocktech,rk101ii01d-ct",
4249 .compatible = "shelly,sca07010-bfn-lnn",
4258 .compatible = "team-source-display,tst043015cmhx",
4261 .compatible = "tfc,s9700rtwv43tr-01b",
4273 .compatible = "ti,nspire-cx-lcd-panel",
4276 .compatible = "ti,nspire-classic-lcd-panel",
4282 .compatible = "tpk,f07a-0102",
4285 .compatible = "tpk,f10a-0102",
4288 .compatible = "urt,umsh-8596md-t",
4291 .compatible = "urt,umsh-8596md-1t",
4294 .compatible = "urt,umsh-8596md-7t",
4297 .compatible = "urt,umsh-8596md-11t",
4300 .compatible = "urt,umsh-8596md-19t",
4303 .compatible = "urt,umsh-8596md-20t",
4306 .compatible = "vivax,tpc9150-panel",
4309 .compatible = "vxt,vl050-8048nt-c01",
4315 .compatible = "yes-optoelectronics,ytc700tlag-05-201c",
4319 .compatible = "panel-dpi",
4331 id = of_match_node(platform_of_match, pdev->dev.of_node); in panel_simple_platform_probe()
4333 return -ENODEV; in panel_simple_platform_probe()
4335 return panel_simple_probe(&pdev->dev, id->data); in panel_simple_platform_probe()
4340 panel_simple_remove(&pdev->dev); in panel_simple_platform_remove()
4347 panel_simple_shutdown(&pdev->dev); in panel_simple_platform_shutdown()
4358 .name = "panel-simple",
4582 .compatible = "boe,tv080wum-nl0",
4585 .compatible = "lg,ld070wx3-sl01",
4588 .compatible = "lg,lh500wx1-sd03",
4594 .compatible = "lg,acx467akm-7",
4597 .compatible = "osddisplays,osd101t2045-53ts",
4611 id = of_match_node(dsi_of_match, dsi->dev.of_node); in panel_simple_dsi_probe()
4613 return -ENODEV; in panel_simple_dsi_probe()
4615 desc = id->data; in panel_simple_dsi_probe()
4617 err = panel_simple_probe(&dsi->dev, &desc->desc); in panel_simple_dsi_probe()
4621 dsi->mode_flags = desc->flags; in panel_simple_dsi_probe()
4622 dsi->format = desc->format; in panel_simple_dsi_probe()
4623 dsi->lanes = desc->lanes; in panel_simple_dsi_probe()
4629 drm_panel_remove(&panel->base); in panel_simple_dsi_probe()
4641 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); in panel_simple_dsi_remove()
4643 panel_simple_remove(&dsi->dev); in panel_simple_dsi_remove()
4648 panel_simple_shutdown(&dsi->dev); in panel_simple_dsi_shutdown()
4653 .name = "panel-simple-dsi",