+// 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;
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;
#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;
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;
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;
.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