Lines Matching +full:lcd +full:- +full:olinuxino
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.
171 for (i = 0; i < panel->desc->num_timings; i++) { in panel_simple_get_timings_modes()
172 const struct display_timing *dt = &panel->desc->timings[i]; in panel_simple_get_timings_modes()
176 mode = drm_mode_create(connector->dev); in panel_simple_get_timings_modes()
178 dev_err(panel->base.dev, "failed to add mode %ux%u\n", in panel_simple_get_timings_modes()
179 dt->hactive.typ, dt->vactive.typ); in panel_simple_get_timings_modes()
185 mode->type |= DRM_MODE_TYPE_DRIVER; in panel_simple_get_timings_modes()
187 if (panel->desc->num_timings == 1) in panel_simple_get_timings_modes()
188 mode->type |= DRM_MODE_TYPE_PREFERRED; in panel_simple_get_timings_modes()
203 for (i = 0; i < panel->desc->num_modes; i++) { in panel_simple_get_display_modes()
204 const struct drm_display_mode *m = &panel->desc->modes[i]; in panel_simple_get_display_modes()
206 mode = drm_mode_duplicate(connector->dev, m); in panel_simple_get_display_modes()
208 dev_err(panel->base.dev, "failed to add mode %ux%u@%u\n", in panel_simple_get_display_modes()
209 m->hdisplay, m->vdisplay, in panel_simple_get_display_modes()
214 mode->type |= DRM_MODE_TYPE_DRIVER; in panel_simple_get_display_modes()
216 if (panel->desc->num_modes == 1) in panel_simple_get_display_modes()
217 mode->type |= DRM_MODE_TYPE_PREFERRED; in panel_simple_get_display_modes()
232 bool has_override = panel->override_mode.type; in panel_simple_get_non_edid_modes()
235 if (!panel->desc) in panel_simple_get_non_edid_modes()
239 mode = drm_mode_duplicate(connector->dev, in panel_simple_get_non_edid_modes()
240 &panel->override_mode); in panel_simple_get_non_edid_modes()
245 dev_err(panel->base.dev, "failed to add override mode\n"); in panel_simple_get_non_edid_modes()
250 if (num == 0 && panel->desc->num_timings) in panel_simple_get_non_edid_modes()
259 WARN_ON(panel->desc->num_timings && panel->desc->num_modes); in panel_simple_get_non_edid_modes()
263 connector->display_info.bpc = panel->desc->bpc; in panel_simple_get_non_edid_modes()
264 connector->display_info.width_mm = panel->desc->size.width; in panel_simple_get_non_edid_modes()
265 connector->display_info.height_mm = panel->desc->size.height; in panel_simple_get_non_edid_modes()
266 if (panel->desc->bus_format) in panel_simple_get_non_edid_modes()
267 drm_display_info_set_bus_formats(&connector->display_info, in panel_simple_get_non_edid_modes()
268 &panel->desc->bus_format, 1); in panel_simple_get_non_edid_modes()
269 connector->display_info.bus_flags = panel->desc->bus_flags; in panel_simple_get_non_edid_modes()
292 if (!p->enabled) in panel_simple_disable()
295 if (p->desc->delay.disable) in panel_simple_disable()
296 msleep(p->desc->delay.disable); in panel_simple_disable()
298 p->enabled = false; in panel_simple_disable()
307 gpiod_set_value_cansleep(p->enable_gpio, 0); in panel_simple_suspend()
308 regulator_disable(p->supply); in panel_simple_suspend()
309 p->unprepared_time = ktime_get_boottime(); in panel_simple_suspend()
311 kfree(p->edid); in panel_simple_suspend()
312 p->edid = NULL; in panel_simple_suspend()
322 /* Unpreparing when already unprepared is a no-op */ in panel_simple_unprepare()
323 if (!p->prepared) in panel_simple_unprepare()
326 pm_runtime_mark_last_busy(panel->dev); in panel_simple_unprepare()
327 ret = pm_runtime_put_autosuspend(panel->dev); in panel_simple_unprepare()
330 p->prepared = false; in panel_simple_unprepare()
340 panel_simple_wait(p->unprepared_time, p->desc->delay.unprepare); in panel_simple_resume()
342 err = regulator_enable(p->supply); in panel_simple_resume()
348 gpiod_set_value_cansleep(p->enable_gpio, 1); in panel_simple_resume()
350 if (p->desc->delay.prepare) in panel_simple_resume()
351 msleep(p->desc->delay.prepare); in panel_simple_resume()
361 /* Preparing when already prepared is a no-op */ in panel_simple_prepare()
362 if (p->prepared) in panel_simple_prepare()
365 ret = pm_runtime_get_sync(panel->dev); in panel_simple_prepare()
367 pm_runtime_put_autosuspend(panel->dev); in panel_simple_prepare()
371 p->prepared = true; in panel_simple_prepare()
380 if (p->enabled) in panel_simple_enable()
383 if (p->desc->delay.enable) in panel_simple_enable()
384 msleep(p->desc->delay.enable); in panel_simple_enable()
386 p->enabled = true; in panel_simple_enable()
398 if (p->ddc) { in panel_simple_get_modes()
399 pm_runtime_get_sync(panel->dev); in panel_simple_get_modes()
401 if (!p->edid) in panel_simple_get_modes()
402 p->edid = drm_get_edid(connector, p->ddc); in panel_simple_get_modes()
404 if (p->edid) in panel_simple_get_modes()
405 num += drm_add_edid_modes(connector, p->edid); in panel_simple_get_modes()
407 pm_runtime_mark_last_busy(panel->dev); in panel_simple_get_modes()
408 pm_runtime_put_autosuspend(panel->dev); in panel_simple_get_modes()
411 /* add hard-coded panel modes */ in panel_simple_get_modes()
418 drm_connector_set_panel_orientation(connector, p->orientation); in panel_simple_get_modes()
430 if (p->desc->num_timings < num_timings) in panel_simple_get_timings()
431 num_timings = p->desc->num_timings; in panel_simple_get_timings()
435 timings[i] = p->desc->timings[i]; in panel_simple_get_timings()
437 return p->desc->num_timings; in panel_simple_get_timings()
444 return p->orientation; in panel_simple_get_orientation()
469 np = dev->of_node; in panel_dpi_probe()
472 return -ENOMEM; in panel_dpi_probe()
476 return -ENOMEM; in panel_dpi_probe()
478 ret = of_get_display_timing(np, "panel-timing", timing); in panel_dpi_probe()
480 dev_err(dev, "%pOF: no panel-timing node found for \"panel-dpi\" binding\n", in panel_dpi_probe()
485 desc->timings = timing; in panel_dpi_probe()
486 desc->num_timings = 1; in panel_dpi_probe()
488 of_property_read_u32(np, "width-mm", &desc->size.width); in panel_dpi_probe()
489 of_property_read_u32(np, "height-mm", &desc->size.height); in panel_dpi_probe()
493 vm.flags = timing->flags; in panel_dpi_probe()
495 desc->bus_flags = bus_flags; in panel_dpi_probe()
498 desc->connector_type = DRM_MODE_CONNECTOR_DPI; in panel_dpi_probe()
500 panel->desc = desc; in panel_dpi_probe()
506 (to_check->field.typ >= bounds->field.min && \
507 to_check->field.typ <= bounds->field.max)
512 const struct panel_desc *desc = panel->desc; in panel_simple_parse_panel_timing_node()
516 if (WARN_ON(desc->num_modes)) { in panel_simple_parse_panel_timing_node()
520 if (WARN_ON(!desc->num_timings)) { in panel_simple_parse_panel_timing_node()
525 for (i = 0; i < panel->desc->num_timings; i++) { in panel_simple_parse_panel_timing_node()
526 const struct display_timing *dt = &panel->desc->timings[i]; in panel_simple_parse_panel_timing_node()
538 if (ot->flags != dt->flags) in panel_simple_parse_panel_timing_node()
542 drm_display_mode_from_videomode(&vm, &panel->override_mode); in panel_simple_parse_panel_timing_node()
543 panel->override_mode.type |= DRM_MODE_TYPE_DRIVER | in panel_simple_parse_panel_timing_node()
548 if (WARN_ON(!panel->override_mode.type)) in panel_simple_parse_panel_timing_node()
563 return -ENOMEM; in panel_simple_probe()
565 panel->enabled = false; in panel_simple_probe()
566 panel->desc = desc; in panel_simple_probe()
568 panel->supply = devm_regulator_get(dev, "power"); in panel_simple_probe()
569 if (IS_ERR(panel->supply)) in panel_simple_probe()
570 return PTR_ERR(panel->supply); in panel_simple_probe()
572 panel->enable_gpio = devm_gpiod_get_optional(dev, "enable", in panel_simple_probe()
574 if (IS_ERR(panel->enable_gpio)) in panel_simple_probe()
575 return dev_err_probe(dev, PTR_ERR(panel->enable_gpio), in panel_simple_probe()
578 err = of_drm_get_panel_orientation(dev->of_node, &panel->orientation); in panel_simple_probe()
580 dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err); in panel_simple_probe()
584 ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0); in panel_simple_probe()
586 panel->ddc = of_find_i2c_adapter_by_node(ddc); in panel_simple_probe()
589 if (!panel->ddc) in panel_simple_probe()
590 return -EPROBE_DEFER; in panel_simple_probe()
594 /* Handle the generic panel-dpi binding */ in panel_simple_probe()
598 desc = panel->desc; in panel_simple_probe()
600 if (!of_get_display_timing(dev->of_node, "panel-timing", &dt)) in panel_simple_probe()
604 connector_type = desc->connector_type; in panel_simple_probe()
612 WARN_ON(desc->bus_flags & in panel_simple_probe()
617 WARN_ON(desc->bus_format != MEDIA_BUS_FMT_RGB666_1X7X3_SPWG && in panel_simple_probe()
618 desc->bus_format != MEDIA_BUS_FMT_RGB888_1X7X4_SPWG && in panel_simple_probe()
619 desc->bus_format != MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA); in panel_simple_probe()
620 WARN_ON(desc->bus_format == MEDIA_BUS_FMT_RGB666_1X7X3_SPWG && in panel_simple_probe()
621 desc->bpc != 6); in panel_simple_probe()
622 WARN_ON((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 desc->bpc != 8); in panel_simple_probe()
627 dev_warn(dev, "eDP panels moved to panel-edp\n"); in panel_simple_probe()
628 err = -EINVAL; in panel_simple_probe()
631 if (desc->bpc != 6 && desc->bpc != 8) in panel_simple_probe()
632 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc); in panel_simple_probe()
643 if (desc->bus_flags & ~bus_flags) in panel_simple_probe()
644 dev_warn(dev, "Unexpected bus_flags(%d)\n", desc->bus_flags & ~bus_flags); in panel_simple_probe()
645 if (!(desc->bus_flags & bus_flags)) in panel_simple_probe()
647 if (desc->bus_format == 0) in panel_simple_probe()
649 if (desc->bpc != 6 && desc->bpc != 8) in panel_simple_probe()
650 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc); in panel_simple_probe()
653 dev_warn(dev, "Specify a valid connector_type: %d\n", desc->connector_type); in panel_simple_probe()
670 drm_panel_init(&panel->base, dev, &panel_simple_funcs, connector_type); in panel_simple_probe()
672 err = drm_panel_of_backlight(&panel->base); in panel_simple_probe()
678 drm_panel_add(&panel->base); in panel_simple_probe()
686 if (panel->ddc) in panel_simple_probe()
687 put_device(&panel->ddc->dev); in panel_simple_probe()
696 drm_panel_remove(&panel->base); in panel_simple_remove()
697 drm_panel_disable(&panel->base); in panel_simple_remove()
698 drm_panel_unprepare(&panel->base); in panel_simple_remove()
702 if (panel->ddc) in panel_simple_remove()
703 put_device(&panel->ddc->dev); in panel_simple_remove()
710 drm_panel_disable(&panel->base); in panel_simple_shutdown()
711 drm_panel_unprepare(&panel->base); in panel_simple_shutdown()
1354 /* S070PWS19HP-FC21 2017/04/22 */
1381 /* S070SWV29HG-DC44 2017/09/21 */
3149 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
3957 .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
3961 .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
4143 .compatible = "ampire,am-1280800n3tzqw-t00h",
4146 .compatible = "ampire,am-480272h3tmqw-t01h",
4149 .compatible = "ampire,am-800480l1tmqw-t00h",
4155 .compatible = "ampire,am800600p5tmqw-tb8h",
4158 .compatible = "arm,rtsm-display",
4161 .compatible = "armadeus,st0700-adapt",
4206 .compatible = "bananapi,s070wv20-ct16",
4209 .compatible = "boe,ev121wxm-n10-1850",
4212 .compatible = "boe,hv070wsa-100",
4215 .compatible = "cdtech,s043wq26h-ct7",
4218 .compatible = "cdtech,s070pws19hp-fc21",
4221 .compatible = "cdtech,s070swv29hg-dc44",
4224 .compatible = "cdtech,s070wv95-ct16",
4227 .compatible = "chefree,ch101olhlwh-002",
4248 .compatible = "dlc,dlc0700yzg-1",
4287 .compatible = "eink,vb3300-kca",
4293 .compatible = "foxlink,fl500wvr00-a0t",
4326 .compatible = "innolux,g070ace-l01",
4329 .compatible = "innolux,g070y2-l01",
4332 .compatible = "innolux,g070y2-t02",
4335 .compatible = "innolux,g101ice-l01",
4338 .compatible = "innolux,g121i1-l01",
4341 .compatible = "innolux,g121x1-l03",
4344 .compatible = "innolux,g156hce-l01",
4347 .compatible = "innolux,n156bge-l21",
4350 .compatible = "innolux,zj070na-01p",
4365 .compatible = "lemaker,bl035-rgb-002",
4374 .compatible = "logictechno,lt161010-2nhc",
4377 .compatible = "logictechno,lt161010-2nhr",
4380 .compatible = "logictechno,lt170410-2whc",
4383 .compatible = "logictechno,lttd800480070-l2rt",
4386 .compatible = "logictechno,lttd800480070-l6wh-rt",
4389 .compatible = "mitsubishi,aa070mc01-ca1",
4392 .compatible = "multi-inno,mi0700s4t-6",
4395 .compatible = "multi-inno,mi0800ft-9",
4398 .compatible = "multi-inno,mi1010ait-1cp",
4401 .compatible = "nec,nl12880bc20-05",
4404 .compatible = "nec,nl4827hc19-05b",
4407 .compatible = "netron-dy,e231732",
4410 .compatible = "newhaven,nhd-4.3-480272ef-atxl",
4413 .compatible = "nlt,nl192108ac18-02d",
4419 .compatible = "okaya,rs800480t-7x0gp",
4422 .compatible = "olimex,lcd-olinuxino-43-ts",
4437 .compatible = "osddisplays,osd070t1718-19ts",
4440 .compatible = "pda,91-00156-a0",
4443 .compatible = "powertip,ph800480t013-idf02",
4446 .compatible = "qiaodian,qd43003c0-40",
4449 .compatible = "qishenglong,gopher2b-lcd",
4458 .compatible = "rocktech,rk101ii01d-ct",
4482 .compatible = "shelly,sca07010-bfn-lnn",
4491 .compatible = "team-source-display,tst043015cmhx",
4494 .compatible = "tfc,s9700rtwv43tr-01b",
4506 .compatible = "ti,nspire-cx-lcd-panel",
4509 .compatible = "ti,nspire-classic-lcd-panel",
4515 .compatible = "tpk,f07a-0102",
4518 .compatible = "tpk,f10a-0102",
4521 .compatible = "urt,umsh-8596md-t",
4524 .compatible = "urt,umsh-8596md-1t",
4527 .compatible = "urt,umsh-8596md-7t",
4530 .compatible = "urt,umsh-8596md-11t",
4533 .compatible = "urt,umsh-8596md-19t",
4536 .compatible = "urt,umsh-8596md-20t",
4539 .compatible = "vivax,tpc9150-panel",
4542 .compatible = "vxt,vl050-8048nt-c01",
4548 .compatible = "yes-optoelectronics,ytc700tlag-05-201c",
4555 .compatible = "panel-dpi",
4567 desc = of_device_get_match_data(&pdev->dev); in panel_simple_platform_probe()
4569 return -ENODEV; in panel_simple_platform_probe()
4571 return panel_simple_probe(&pdev->dev, desc); in panel_simple_platform_probe()
4576 panel_simple_remove(&pdev->dev); in panel_simple_platform_remove()
4581 panel_simple_shutdown(&pdev->dev); in panel_simple_platform_shutdown()
4592 .name = "panel-simple",
4816 .compatible = "boe,tv080wum-nl0",
4819 .compatible = "lg,ld070wx3-sl01",
4822 .compatible = "lg,lh500wx1-sd03",
4828 .compatible = "lg,acx467akm-7",
4831 .compatible = "osddisplays,osd101t2045-53ts",
4844 desc = of_device_get_match_data(&dsi->dev); in panel_simple_dsi_probe()
4846 return -ENODEV; in panel_simple_dsi_probe()
4848 err = panel_simple_probe(&dsi->dev, &desc->desc); in panel_simple_dsi_probe()
4852 dsi->mode_flags = desc->flags; in panel_simple_dsi_probe()
4853 dsi->format = desc->format; in panel_simple_dsi_probe()
4854 dsi->lanes = desc->lanes; in panel_simple_dsi_probe()
4860 drm_panel_remove(&panel->base); in panel_simple_dsi_probe()
4872 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); in panel_simple_dsi_remove()
4874 panel_simple_remove(&dsi->dev); in panel_simple_dsi_remove()
4879 panel_simple_shutdown(&dsi->dev); in panel_simple_dsi_shutdown()
4884 .name = "panel-simple-dsi",