]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/video/atmel_lcdfb.c
Merge git://git.denx.de/u-boot-arm
[karo-tx-uboot.git] / drivers / video / atmel_lcdfb.c
index 3a51cc7c560becba966855d9692d63ed8a82433e..4bc0f195fe25df1654556b55c3251037b70f89e8 100644 (file)
@@ -3,23 +3,7 @@
  *
  * Copyright (C) 2007 Atmel Corporation
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+ 
  */
 
 #include <common.h>
 #include <lcd.h>
 #include <atmel_lcdc.h>
 
-int lcd_line_length;
-int lcd_color_fg;
-int lcd_color_bg;
-
-void *lcd_base;                                /* Start of framebuffer memory  */
-void *lcd_console_address;             /* Start of console buffer      */
-
-short console_col;
-short console_row;
-
 /* configurable parameters */
 #define ATMEL_LCDC_CVAL_DEFAULT                0xc8
 #define ATMEL_LCDC_DMA_BURST_LEN       8
+#ifndef ATMEL_LCDC_GUARD_TIME
+#define ATMEL_LCDC_GUARD_TIME          1
+#endif
 
 #if defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91CAP9)
 #define ATMEL_LCDC_FIFO_SIZE           2048
@@ -69,7 +46,7 @@ void lcd_ctrl_init(void *lcdbase)
 
        /* Turn off the LCD controller and the DMA controller */
        lcdc_writel(panel_info.mmio, ATMEL_LCDC_PWRCON,
-                   1 << ATMEL_LCDC_GUARDT_OFFSET);
+                   ATMEL_LCDC_GUARD_TIME << ATMEL_LCDC_GUARDT_OFFSET);
 
        /* Wait for the LCDC core to become idle */
        while (lcdc_readl(panel_info.mmio, ATMEL_LCDC_PWRCON) & ATMEL_LCDC_BUSY)
@@ -140,8 +117,9 @@ void lcd_ctrl_init(void *lcdbase)
 
        /* Set contrast */
        value = ATMEL_LCDC_PS_DIV8 |
-               ATMEL_LCDC_POL_POSITIVE |
                ATMEL_LCDC_ENA_PWMENABLE;
+       if (!panel_info.vl_cont_pol_low)
+               value |= ATMEL_LCDC_POL_POSITIVE;
        lcdc_writel(panel_info.mmio, ATMEL_LCDC_CONTRAST_CTR, value);
        lcdc_writel(panel_info.mmio, ATMEL_LCDC_CONTRAST_VAL, ATMEL_LCDC_CVAL_DEFAULT);
 
@@ -150,7 +128,7 @@ void lcd_ctrl_init(void *lcdbase)
 
        lcdc_writel(panel_info.mmio, ATMEL_LCDC_DMACON, ATMEL_LCDC_DMAEN);
        lcdc_writel(panel_info.mmio, ATMEL_LCDC_PWRCON,
-                   (1 << ATMEL_LCDC_GUARDT_OFFSET) | ATMEL_LCDC_PWR);
+                   (ATMEL_LCDC_GUARD_TIME << ATMEL_LCDC_GUARDT_OFFSET) | ATMEL_LCDC_PWR);
 }
 
 ulong calc_fbsize(void)