|
25 | 25 | #include <drm/drm_atomic.h>
|
26 | 26 | #include <drm/drm_atomic_helper.h>
|
27 | 27 | #include <drm/drm_bridge.h>
|
28 |
| -#include <drm/drm_edid.h> |
29 | 28 | #include <drm/drm_managed.h>
|
30 | 29 | #include <drm/drm_of.h>
|
31 | 30 | #include <drm/drm_panel.h>
|
@@ -70,7 +69,6 @@ struct imx_ldb_channel {
|
70 | 69 | struct drm_bridge *bridge;
|
71 | 70 |
|
72 | 71 | struct device_node *child;
|
73 |
| - struct i2c_adapter *ddc; |
74 | 72 | int chno;
|
75 | 73 | struct drm_display_mode mode;
|
76 | 74 | int mode_valid;
|
@@ -141,18 +139,6 @@ static int imx_ldb_connector_get_modes(struct drm_connector *connector)
|
141 | 139 | if (num_modes > 0)
|
142 | 140 | return num_modes;
|
143 | 141 |
|
144 |
| - if (imx_ldb_ch->ddc) { |
145 |
| - const struct drm_edid *edid = drm_edid_read_ddc(connector, |
146 |
| - imx_ldb_ch->ddc); |
147 |
| - |
148 |
| - if (edid) { |
149 |
| - drm_edid_connector_update(connector, edid); |
150 |
| - drm_edid_free(edid); |
151 |
| - |
152 |
| - return drm_edid_connector_add_modes(connector); |
153 |
| - } |
154 |
| - } |
155 |
| - |
156 | 142 | if (imx_ldb_ch->mode_valid) {
|
157 | 143 | struct drm_display_mode *mode;
|
158 | 144 |
|
@@ -481,10 +467,9 @@ static int imx_ldb_register(struct drm_device *drm,
|
481 | 467 | */
|
482 | 468 | drm_connector_helper_add(connector,
|
483 | 469 | &imx_ldb_connector_helper_funcs);
|
484 |
| - drm_connector_init_with_ddc(drm, connector, |
485 |
| - &imx_ldb_connector_funcs, |
486 |
| - DRM_MODE_CONNECTOR_LVDS, |
487 |
| - imx_ldb_ch->ddc); |
| 470 | + drm_connector_init(drm, connector, |
| 471 | + &imx_ldb_connector_funcs, |
| 472 | + DRM_MODE_CONNECTOR_LVDS); |
488 | 473 | drm_connector_attach_encoder(connector, encoder);
|
489 | 474 | }
|
490 | 475 |
|
@@ -551,39 +536,6 @@ static const struct of_device_id imx_ldb_dt_ids[] = {
|
551 | 536 | };
|
552 | 537 | MODULE_DEVICE_TABLE(of, imx_ldb_dt_ids);
|
553 | 538 |
|
554 |
| -static int imx_ldb_panel_ddc(struct device *dev, |
555 |
| - struct imx_ldb_channel *channel, struct device_node *child) |
556 |
| -{ |
557 |
| - struct device_node *ddc_node; |
558 |
| - int ret; |
559 |
| - |
560 |
| - ddc_node = of_parse_phandle(child, "ddc-i2c-bus", 0); |
561 |
| - if (ddc_node) { |
562 |
| - channel->ddc = of_find_i2c_adapter_by_node(ddc_node); |
563 |
| - of_node_put(ddc_node); |
564 |
| - if (!channel->ddc) { |
565 |
| - dev_warn(dev, "failed to get ddc i2c adapter\n"); |
566 |
| - return -EPROBE_DEFER; |
567 |
| - } |
568 |
| - } |
569 |
| - |
570 |
| - if (!channel->ddc) { |
571 |
| - /* if no DDC available, fallback to hardcoded EDID */ |
572 |
| - dev_dbg(dev, "no ddc available\n"); |
573 |
| - |
574 |
| - if (!channel->panel) { |
575 |
| - /* fallback to display-timings node */ |
576 |
| - ret = of_get_drm_display_mode(child, |
577 |
| - &channel->mode, |
578 |
| - &channel->bus_flags, |
579 |
| - OF_USE_NATIVE_MODE); |
580 |
| - if (!ret) |
581 |
| - channel->mode_valid = 1; |
582 |
| - } |
583 |
| - } |
584 |
| - return 0; |
585 |
| -} |
586 |
| - |
587 | 539 | static int imx_ldb_bind(struct device *dev, struct device *master, void *data)
|
588 | 540 | {
|
589 | 541 | struct drm_device *drm = data;
|
@@ -694,11 +646,15 @@ static int imx_ldb_probe(struct platform_device *pdev)
|
694 | 646 | if (ret && ret != -ENODEV)
|
695 | 647 | goto free_child;
|
696 | 648 |
|
697 |
| - /* panel ddc only if there is no bridge */ |
698 |
| - if (!channel->bridge) { |
699 |
| - ret = imx_ldb_panel_ddc(dev, channel, child); |
| 649 | + if (!channel->bridge && !channel->panel) { |
| 650 | + ret = of_get_drm_display_mode(child, |
| 651 | + &channel->mode, |
| 652 | + &channel->bus_flags, |
| 653 | + OF_USE_NATIVE_MODE); |
700 | 654 | if (ret)
|
701 | 655 | goto free_child;
|
| 656 | + |
| 657 | + channel->mode_valid = 1; |
702 | 658 | }
|
703 | 659 |
|
704 | 660 | bus_format = of_get_bus_format(dev, child);
|
@@ -732,15 +688,6 @@ static int imx_ldb_probe(struct platform_device *pdev)
|
732 | 688 |
|
733 | 689 | static void imx_ldb_remove(struct platform_device *pdev)
|
734 | 690 | {
|
735 |
| - struct imx_ldb *imx_ldb = platform_get_drvdata(pdev); |
736 |
| - int i; |
737 |
| - |
738 |
| - for (i = 0; i < 2; i++) { |
739 |
| - struct imx_ldb_channel *channel = &imx_ldb->channel[i]; |
740 |
| - |
741 |
| - i2c_put_adapter(channel->ddc); |
742 |
| - } |
743 |
| - |
744 | 691 | component_del(&pdev->dev, &imx_ldb_ops);
|
745 | 692 | }
|
746 | 693 |
|
|
0 commit comments