62
62
static unsigned int default_bus_fmt = MEDIA_BUS_FMT_RGB666_1X18 ;
63
63
module_param (default_bus_fmt , uint , 0644 );
64
64
65
- /*
66
- * Override DRM mode flags to force the use of Composite Sync on GPIO1.
67
- * This is mostly for testing, as neither panel-timing nor command-line
68
- * arguments nor utilities such as "kmstest" can set DRM_MODE_FLAG_CSYNC.
69
- * Sampled on each enable/mode-switch. Default polarity will be -ve.
70
- * (Setting this may break Vertical Sync on GPIO2 for interlaced modes.)
71
- */
72
- static bool force_csync ;
73
- module_param (force_csync , bool , 0644 );
74
-
75
65
/* -------------------------------------------------------------- */
76
66
77
67
static void rp1dpi_pipe_update (struct drm_simple_display_pipe * pipe ,
@@ -100,8 +90,7 @@ static void rp1dpi_pipe_update(struct drm_simple_display_pipe *pipe,
100
90
dpi -> bus_fmt ,
101
91
dpi -> de_inv ,
102
92
& pipe -> crtc .state -> mode );
103
- rp1dpi_pio_start (dpi , & pipe -> crtc .state -> mode ,
104
- force_csync );
93
+ rp1dpi_pio_start (dpi , & pipe -> crtc .state -> mode );
105
94
dpi -> dpi_running = true;
106
95
}
107
96
dpi -> cur_fmt = fb -> format -> format ;
@@ -306,7 +295,6 @@ static int rp1dpi_platform_probe(struct platform_device *pdev)
306
295
struct drm_bridge * bridge = NULL ;
307
296
const char * rgb_order = NULL ;
308
297
struct drm_panel * panel ;
309
- u32 missing_gpios ;
310
298
int i , j , ret ;
311
299
312
300
dev_info (dev , __func__ );
@@ -367,7 +355,6 @@ static int rp1dpi_platform_probe(struct platform_device *pdev)
367
355
if (ret )
368
356
goto done_err ;
369
357
370
- /* RGB order property - to match VC4 */
371
358
dpi -> rgb_order_override = RP1DPI_ORDER_UNCHANGED ;
372
359
if (!of_property_read_string (dev -> of_node , "rgb_order" , & rgb_order )) {
373
360
if (!strcmp (rgb_order , "rgb" ))
@@ -382,9 +369,9 @@ static int rp1dpi_platform_probe(struct platform_device *pdev)
382
369
DRM_ERROR ("Invalid dpi order %s - ignored\n" , rgb_order );
383
370
}
384
371
385
- /* Check if all of GPIOs 1, 2 and 3 are assigned to DPI */
386
- missing_gpios = BIT ( 1 ) | BIT ( 2 ) | BIT ( 3 ) ;
387
- for (i = 0 ; missing_gpios ; i ++ ) {
372
+ /* Check if PIO can snoop on or override DPI's GPIO1 */
373
+ dpi -> gpio1_used = false ;
374
+ for (i = 0 ; ! dpi -> gpio1_used ; i ++ ) {
388
375
u32 p = 0 ;
389
376
const char * str = NULL ;
390
377
struct device_node * np1 = of_parse_phandle (dev -> of_node , "pinctrl-0" , i );
@@ -393,26 +380,21 @@ static int rp1dpi_platform_probe(struct platform_device *pdev)
393
380
break ;
394
381
395
382
if (!of_property_read_string (np1 , "function" , & str ) && !strcmp (str , "dpi" )) {
396
- for (j = 0 ; missing_gpios ; j ++ ) {
383
+ for (j = 0 ; ! dpi -> gpio1_used ; j ++ ) {
397
384
if (of_property_read_string_index (np1 , "pins" , j , & str ))
398
385
break ;
399
386
if (!strcmp (str , "gpio1" ))
400
- missing_gpios &= ~BIT (1 );
401
- else if (!strcmp (str , "gpio2" ))
402
- missing_gpios &= ~BIT (2 );
403
- else if (!strcmp (str , "gpio3" ))
404
- missing_gpios &= ~BIT (3 );
387
+ dpi -> gpio1_used = true;
405
388
}
406
- for (j = 0 ; missing_gpios ; j ++ ) {
389
+ for (j = 0 ; ! dpi -> gpio1_used ; j ++ ) {
407
390
if (of_property_read_u32_index (np1 , "brcm,pins" , j , & p ))
408
391
break ;
409
- if (p < 32 )
410
- missing_gpios &= ~( 1 << p ) ;
392
+ if (p == 1 )
393
+ dpi -> gpio1_used = true ;
411
394
}
412
395
}
413
396
of_node_put (np1 );
414
397
}
415
- dpi -> sync_gpios_mapped = !missing_gpios ;
416
398
417
399
/* Now we have all our resources, finish driver initialization */
418
400
dma_set_mask_and_coherent (dev , DMA_BIT_MASK (64 ));
0 commit comments