Merge branch '2021-09-22-general-updates' into next
[platform/kernel/u-boot.git] / drivers / video / atmel_lcdfb.c
index ed2bd30..c38cac1 100644 (file)
@@ -1,22 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Driver for AT91/AT32 LCD Controller
  *
  * Copyright (C) 2007 Atmel Corporation
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <atmel_lcd.h>
 #include <dm.h>
 #include <fdtdec.h>
+#include <log.h>
+#include <part.h>
 #include <video.h>
+#include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/clk.h>
 #include <lcd.h>
 #include <bmp_layout.h>
 #include <atmel_lcdc.h>
+#include <linux/delay.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -150,11 +153,7 @@ static void atmel_fb_init(ulong addr, struct display_timing *timing, int bpix,
                            value << ATMEL_LCDC_CLKVAL_OFFSET);
 
        /* Initialize control register 2 */
-#ifdef CONFIG_AVR32
-       value = ATMEL_LCDC_MEMOR_BIG | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE;
-#else
        value = ATMEL_LCDC_MEMOR_LITTLE | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE;
-#endif
        if (tft)
                value |= ATMEL_LCDC_DISTYPE_TFT;
 
@@ -247,7 +246,7 @@ ulong calc_fbsize(void)
 #ifdef CONFIG_DM_VIDEO
 static int atmel_fb_lcd_probe(struct udevice *dev)
 {
-       struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+       struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev);
        struct video_priv *uc_priv = dev_get_uclass_priv(dev);
        struct atmel_fb_priv *priv = dev_get_priv(dev);
        struct display_timing *timing = &priv->timing;
@@ -269,9 +268,9 @@ static int atmel_fb_lcd_probe(struct udevice *dev)
        return 0;
 }
 
-static int atmel_fb_ofdata_to_platdata(struct udevice *dev)
+static int atmel_fb_of_to_plat(struct udevice *dev)
 {
-       struct atmel_lcd_platdata *plat = dev_get_platdata(dev);
+       struct atmel_lcd_plat *plat = dev_get_plat(dev);
        struct atmel_fb_priv *priv = dev_get_priv(dev);
        struct display_timing *timing = &priv->timing;
        const void *blob = gd->fdt_blob;
@@ -287,7 +286,7 @@ static int atmel_fb_ofdata_to_platdata(struct udevice *dev)
 
 static int atmel_fb_lcd_bind(struct udevice *dev)
 {
-       struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
+       struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev);
 
        uc_plat->size = LCD_MAX_WIDTH * LCD_MAX_HEIGHT *
                        (1 << VIDEO_BPP16) / 8;
@@ -306,9 +305,9 @@ U_BOOT_DRIVER(atmel_fb) = {
        .id     = UCLASS_VIDEO,
        .of_match = atmel_fb_lcd_ids,
        .bind   = atmel_fb_lcd_bind,
-       .ofdata_to_platdata     = atmel_fb_ofdata_to_platdata,
+       .of_to_plat     = atmel_fb_of_to_plat,
        .probe  = atmel_fb_lcd_probe,
-       .platdata_auto_alloc_size = sizeof(struct atmel_lcd_platdata),
-       .priv_auto_alloc_size   = sizeof(struct atmel_fb_priv),
+       .plat_auto      = sizeof(struct atmel_lcd_plat),
+       .priv_auto      = sizeof(struct atmel_fb_priv),
 };
 #endif