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