27
27
#include <drm/drm_bridge.h>
28
28
#include <drm/drm_managed.h>
29
29
#include <drm/drm_of.h>
30
- #include <drm/drm_panel.h>
31
30
#include <drm/drm_print.h>
32
31
#include <drm/drm_probe_helper.h>
33
32
#include <drm/drm_simple_kms_helper.h>
@@ -64,8 +63,6 @@ struct imx_ldb;
64
63
struct imx_ldb_channel {
65
64
struct imx_ldb * ldb ;
66
65
67
- /* Defines what is connected to the ldb, only one at a time */
68
- struct drm_panel * panel ;
69
66
struct drm_bridge * bridge ;
70
67
71
68
struct device_node * child ;
@@ -135,10 +132,6 @@ static int imx_ldb_connector_get_modes(struct drm_connector *connector)
135
132
struct imx_ldb_channel * imx_ldb_ch = con_to_imx_ldb_ch (connector );
136
133
int num_modes ;
137
134
138
- num_modes = drm_panel_get_modes (imx_ldb_ch -> panel , connector );
139
- if (num_modes > 0 )
140
- return num_modes ;
141
-
142
135
if (imx_ldb_ch -> mode_valid ) {
143
136
struct drm_display_mode * mode ;
144
137
@@ -193,8 +186,6 @@ static void imx_ldb_encoder_enable(struct drm_encoder *encoder)
193
186
return ;
194
187
}
195
188
196
- drm_panel_prepare (imx_ldb_ch -> panel );
197
-
198
189
if (dual ) {
199
190
clk_set_parent (ldb -> clk_sel [mux ], ldb -> clk [0 ]);
200
191
clk_set_parent (ldb -> clk_sel [mux ], ldb -> clk [1 ]);
@@ -233,8 +224,6 @@ static void imx_ldb_encoder_enable(struct drm_encoder *encoder)
233
224
}
234
225
235
226
regmap_write (ldb -> regmap , IOMUXC_GPR2 , ldb -> ldb_ctrl );
236
-
237
- drm_panel_enable (imx_ldb_ch -> panel );
238
227
}
239
228
240
229
static void
@@ -311,8 +300,6 @@ static void imx_ldb_encoder_disable(struct drm_encoder *encoder)
311
300
int dual = ldb -> ldb_ctrl & LDB_SPLIT_MODE_EN ;
312
301
int mux , ret ;
313
302
314
- drm_panel_disable (imx_ldb_ch -> panel );
315
-
316
303
if (imx_ldb_ch == & ldb -> channel [0 ] || dual )
317
304
ldb -> ldb_ctrl &= ~LDB_CH0_MODE_EN_MASK ;
318
305
if (imx_ldb_ch == & ldb -> channel [1 ] || dual )
@@ -346,8 +333,6 @@ static void imx_ldb_encoder_disable(struct drm_encoder *encoder)
346
333
dev_err (ldb -> dev ,
347
334
"unable to set di%d parent clock to original parent\n" ,
348
335
mux );
349
-
350
- drm_panel_unprepare (imx_ldb_ch -> panel );
351
336
}
352
337
353
338
static int imx_ldb_encoder_atomic_check (struct drm_encoder * encoder ,
@@ -640,13 +625,15 @@ static int imx_ldb_probe(struct platform_device *pdev)
640
625
* The output port is port@4 with an external 4-port mux or
641
626
* port@2 with the internal 2-port mux.
642
627
*/
643
- ret = drm_of_find_panel_or_bridge (child ,
644
- imx_ldb -> lvds_mux ? 4 : 2 , 0 ,
645
- & channel -> panel , & channel -> bridge );
646
- if (ret && ret != - ENODEV )
647
- goto free_child ;
628
+ channel -> bridge = devm_drm_of_get_bridge (dev , child ,
629
+ imx_ldb -> lvds_mux ? 4 : 2 , 0 );
630
+ if (IS_ERR (channel -> bridge )) {
631
+ ret = PTR_ERR (channel -> bridge );
632
+ if (ret != - ENODEV )
633
+ goto free_child ;
634
+
635
+ channel -> bridge = NULL ;
648
636
649
- if (!channel -> bridge && !channel -> panel ) {
650
637
ret = of_get_drm_display_mode (child ,
651
638
& channel -> mode ,
652
639
& channel -> bus_flags ,
@@ -658,15 +645,12 @@ static int imx_ldb_probe(struct platform_device *pdev)
658
645
}
659
646
660
647
bus_format = of_get_bus_format (dev , child );
661
- if (bus_format == - EINVAL ) {
662
- /*
663
- * If no bus format was specified in the device tree,
664
- * we can still get it from the connected panel later.
665
- */
666
- if (channel -> panel && channel -> panel -> funcs &&
667
- channel -> panel -> funcs -> get_modes )
668
- bus_format = 0 ;
669
- }
648
+ /*
649
+ * If no bus format was specified in the device tree,
650
+ * we can still get it from the connected panel later.
651
+ */
652
+ if (bus_format == - EINVAL && channel -> bridge )
653
+ bus_format = 0 ;
670
654
if (bus_format < 0 ) {
671
655
dev_err (dev , "could not determine data mapping: %d\n" ,
672
656
bus_format );
0 commit comments