video: atmel_hlcdfb: make pixel clock polarity configurable
authorLothar Waßmann <LW@KARO-electronics.de>
Tue, 23 Jun 2015 05:34:51 +0000 (07:34 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 26 Jun 2015 06:07:20 +0000 (08:07 +0200)
drivers/video/atmel_hlcdfb.c

index d27928e..8e5cc3b 100644 (file)
@@ -42,11 +42,13 @@ void lcd_ctrl_init(void *lcdbase)
        unsigned long value;
        struct lcd_dma_desc *desc;
        struct atmel_hlcd_regs *regs;
+       u32 clk_pol;
 
        if (!has_lcdc())
                return;     /* No lcdc */
 
        regs = panel_info.mmio;
+       clk_pol = panel_info.vl_clk_pol ? LCDC_LCDCFG0_CLKPOL : 0;
 
        /* Disable DISP signal */
        lcdc_writel(&regs->lcdc_lcddis, LCDC_LCDDIS_DISPDIS);
@@ -78,8 +80,8 @@ void lcd_ctrl_init(void *lcdbase)
                                        | LCDC_LCDCFG0_CGDISHEO
                                        | LCDC_LCDCFG0_CGDISOVR1
                                        | LCDC_LCDCFG0_CGDISBASE
-                                       | panel_info.vl_clk_pol
-                                       | LCDC_LCDCFG0_CLKSEL);
+                                       | LCDC_LCDCFG0_CLKSEL
+                                       | clk_pol);
 
        } else {
                lcdc_writel(&regs->lcdc_lcdcfg0,
@@ -88,7 +90,7 @@ void lcd_ctrl_init(void *lcdbase)
                                | LCDC_LCDCFG0_CGDISHEO
                                | LCDC_LCDCFG0_CGDISOVR1
                                | LCDC_LCDCFG0_CGDISBASE
-                               | panel_info.vl_clk_pol);
+                               | clk_pol);
        }
 
        /* Initialize control register 5 */