Merge tag 'ti-v2020.07-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti
[oweals/u-boot.git] / drivers / video / pxa_lcd.c
index fef49c1fe0538b53d338bdb17d018682475bbd8a..67f5266164fa7b75f9c8f4d5ccf032b13bf8aef5 100644 (file)
@@ -1,41 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * PXA LCD Controller
  *
  * (C) Copyright 2001-2002
  * Wolfgang Denk, DENX Software Engineering -- wd@denx.de
- *
- * 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
  */
 
 /************************************************************************/
 /* ** HEADER FILES                                                     */
 /************************************************************************/
 
-#include <config.h>
 #include <common.h>
-#include <version.h>
-#include <stdarg.h>
-#include <linux/types.h>
-#include <stdio_dev.h>
-#include <lcd.h>
+#include <log.h>
 #include <asm/arch/pxa-regs.h>
 #include <asm/io.h>
+#include <lcd.h>
+#include <linux/types.h>
+#include <stdarg.h>
+#include <stdio_dev.h>
 
 /* #define DEBUG */
 
@@ -193,6 +175,7 @@ vidinfo_t panel_info = {
 vidinfo_t panel_info = {
        .vl_col         = 240,
        .vl_row         = 320,
+       .vl_rot         = 3,
        .vl_width       = 240,
        .vl_height      = 320,
        .vl_clkp        = CONFIG_SYS_HIGH,
@@ -248,6 +231,38 @@ vidinfo_t panel_info = {
 };
 #endif /* CONFIG_ACX517AKN */
 
+#ifdef CONFIG_ACX544AKN
+
+# define LCD_BPP       LCD_COLOR16
+
+/* you have to set lccr0 and lccr3 (including pcd) */
+# define REG_LCCR0     0x003008f9
+# define REG_LCCR3     0x04700007 /* 16bpp */
+
+vidinfo_t panel_info = {
+       .vl_col         = 320,
+       .vl_row         = 320,
+       .vl_width       = 320,
+       .vl_height      = 320,
+       .vl_clkp        = CONFIG_SYS_LOW,
+       .vl_oep         = CONFIG_SYS_LOW,
+       .vl_hsp         = CONFIG_SYS_LOW,
+       .vl_vsp         = CONFIG_SYS_LOW,
+       .vl_dp          = CONFIG_SYS_LOW,
+       .vl_bpix        = LCD_BPP,
+       .vl_lbw         = 0,
+       .vl_splt        = 0,
+       .vl_clor        = 1,
+       .vl_tft         = 1,
+       .vl_hpw         = 0x05,
+       .vl_blw         = 0x13,
+       .vl_elw         = 0x08,
+       .vl_vpw         = 0x02,
+       .vl_bfw         = 0x07,
+       .vl_efw         = 0x05,
+};
+#endif /* CONFIG_ACX544AKN */
+
 /*----------------------------------------------------------------------*/
 
 #ifdef CONFIG_LQ038J7DH53
@@ -317,31 +332,21 @@ vidinfo_t panel_info = {
 
 /*----------------------------------------------------------------------*/
 
-#if LCD_BPP == LCD_COLOR8
-void lcd_setcolreg (ushort regno, ushort red, ushort green, ushort blue);
-#endif
-#if LCD_BPP == LCD_MONOCHROME
-void lcd_initcolregs (void);
-#endif
-
-#ifdef NOT_USED_SO_FAR
-void lcd_disable (void);
-void lcd_getcolreg (ushort regno, ushort *red, ushort *green, ushort *blue);
-#endif /* NOT_USED_SO_FAR */
-
-void lcd_ctrl_init     (void *lcdbase);
-void lcd_enable        (void);
-
 static int pxafb_init_mem (void *lcdbase, vidinfo_t *vid);
 static void pxafb_setup_gpio (vidinfo_t *vid);
 static void pxafb_enable_controller (vidinfo_t *vid);
 static int pxafb_init (vidinfo_t *vid);
-/************************************************************************/
 
 /************************************************************************/
 /* ---------------  PXA chipset specific functions  ------------------- */
 /************************************************************************/
 
+ushort *configuration_get_cmap(void)
+{
+       struct pxafb_info *fbi = &panel_info.pxa;
+       return (ushort *)fbi->palette;
+}
+
 void lcd_ctrl_init (void *lcdbase)
 {
        pxafb_init_mem(lcdbase, &panel_info);
@@ -350,14 +355,6 @@ void lcd_ctrl_init (void *lcdbase)
        pxafb_enable_controller(&panel_info);
 }
 
-/*----------------------------------------------------------------------*/
-#ifdef NOT_USED_SO_FAR
-void
-lcd_getcolreg (ushort regno, ushort *red, ushort *green, ushort *blue)
-{
-}
-#endif /* NOT_USED_SO_FAR */
-
 /*----------------------------------------------------------------------*/
 #if LCD_BPP == LCD_COLOR8
 void
@@ -387,33 +384,9 @@ lcd_setcolreg (ushort regno, ushort red, ushort green, ushort blue)
 #endif /* LCD_COLOR8 */
 
 /*----------------------------------------------------------------------*/
-#if LCD_BPP == LCD_MONOCHROME
-void lcd_initcolregs (void)
+__weak void lcd_enable(void)
 {
-       struct pxafb_info *fbi = &panel_info.pxa;
-       cmap = (ushort *)fbi->palette;
-       ushort regno;
-
-       for (regno = 0; regno < 16; regno++) {
-               cmap[regno * 2] = 0;
-               cmap[(regno * 2) + 1] = regno & 0x0f;
-       }
 }
-#endif /* LCD_MONOCHROME */
-
-/*----------------------------------------------------------------------*/
-void lcd_enable (void)
-{
-}
-
-/*----------------------------------------------------------------------*/
-#ifdef NOT_USED_SO_FAR
-static void lcd_disable (void)
-{
-}
-#endif /* NOT_USED_SO_FAR */
-
-/*----------------------------------------------------------------------*/
 
 /************************************************************************/
 /* ** PXA255 specific routines                                         */