Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Driver for AT91/AT32 LCD Controller |
| 4 | * |
| 5 | * Copyright (C) 2007 Atmel Corporation |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <common.h> |
Simon Glass | 31f56b4 | 2016-05-05 07:28:20 -0600 | [diff] [blame] | 9 | #include <atmel_lcd.h> |
| 10 | #include <dm.h> |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 11 | #include <fdtdec.h> |
Simon Glass | 0f2af88 | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 12 | #include <log.h> |
Simon Glass | 655306c | 2020-05-10 11:39:58 -0600 | [diff] [blame] | 13 | #include <part.h> |
Simon Glass | 31f56b4 | 2016-05-05 07:28:20 -0600 | [diff] [blame] | 14 | #include <video.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 15 | #include <asm/global_data.h> |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 16 | #include <asm/io.h> |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 17 | #include <asm/arch/gpio.h> |
| 18 | #include <asm/arch/clk.h> |
| 19 | #include <lcd.h> |
Nikita Kiryanov | 1dce1e7 | 2015-02-03 13:32:27 +0200 | [diff] [blame] | 20 | #include <bmp_layout.h> |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 21 | #include <atmel_lcdc.h> |
Simon Glass | dbd7954 | 2020-05-10 11:40:11 -0600 | [diff] [blame] | 22 | #include <linux/delay.h> |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 23 | |
Simon Glass | 31f56b4 | 2016-05-05 07:28:20 -0600 | [diff] [blame] | 24 | DECLARE_GLOBAL_DATA_PTR; |
| 25 | |
| 26 | #ifdef CONFIG_DM_VIDEO |
| 27 | enum { |
| 28 | /* Maximum LCD size we support */ |
| 29 | LCD_MAX_WIDTH = 1366, |
| 30 | LCD_MAX_HEIGHT = 768, |
| 31 | LCD_MAX_LOG2_BPP = VIDEO_BPP16, |
| 32 | }; |
| 33 | #endif |
| 34 | |
| 35 | struct atmel_fb_priv { |
| 36 | struct display_timing timing; |
| 37 | }; |
| 38 | |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 39 | /* configurable parameters */ |
| 40 | #define ATMEL_LCDC_CVAL_DEFAULT 0xc8 |
| 41 | #define ATMEL_LCDC_DMA_BURST_LEN 8 |
Mark Jackson | d180d28 | 2009-06-29 15:59:10 +0100 | [diff] [blame] | 42 | #ifndef ATMEL_LCDC_GUARD_TIME |
| 43 | #define ATMEL_LCDC_GUARD_TIME 1 |
| 44 | #endif |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 45 | |
Bo Shen | 6834865 | 2015-01-16 10:55:46 +0800 | [diff] [blame] | 46 | #if defined(CONFIG_AT91SAM9263) |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 47 | #define ATMEL_LCDC_FIFO_SIZE 2048 |
| 48 | #else |
| 49 | #define ATMEL_LCDC_FIFO_SIZE 512 |
| 50 | #endif |
| 51 | |
| 52 | #define lcdc_readl(mmio, reg) __raw_readl((mmio)+(reg)) |
| 53 | #define lcdc_writel(mmio, reg, val) __raw_writel((val), (mmio)+(reg)) |
| 54 | |
Simon Glass | 31f56b4 | 2016-05-05 07:28:20 -0600 | [diff] [blame] | 55 | #ifndef CONFIG_DM_VIDEO |
Nikita Kiryanov | ec3685d | 2015-02-03 13:32:21 +0200 | [diff] [blame] | 56 | ushort *configuration_get_cmap(void) |
| 57 | { |
| 58 | return (ushort *)(panel_info.mmio + ATMEL_LCDC_LUT(0)); |
| 59 | } |
| 60 | |
Nikita Kiryanov | c6cc065 | 2015-02-03 13:32:22 +0200 | [diff] [blame] | 61 | #if defined(CONFIG_BMP_16BPP) && defined(CONFIG_ATMEL_LCD_BGR555) |
| 62 | void fb_put_word(uchar **fb, uchar **from) |
| 63 | { |
| 64 | *(*fb)++ = (((*from)[0] & 0x1f) << 2) | ((*from)[1] & 0x03); |
| 65 | *(*fb)++ = ((*from)[0] & 0xe0) | (((*from)[1] & 0x7c) >> 2); |
| 66 | *from += 2; |
| 67 | } |
| 68 | #endif |
| 69 | |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 70 | void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue) |
| 71 | { |
| 72 | #if defined(CONFIG_ATMEL_LCD_BGR555) |
| 73 | lcdc_writel(panel_info.mmio, ATMEL_LCDC_LUT(regno), |
| 74 | (red >> 3) | ((green & 0xf8) << 2) | ((blue & 0xf8) << 7)); |
| 75 | #else |
| 76 | lcdc_writel(panel_info.mmio, ATMEL_LCDC_LUT(regno), |
| 77 | (blue >> 3) | ((green & 0xfc) << 3) | ((red & 0xf8) << 8)); |
| 78 | #endif |
| 79 | } |
| 80 | |
Simon Glass | 92e1f85 | 2015-05-13 07:02:27 -0600 | [diff] [blame] | 81 | void lcd_set_cmap(struct bmp_image *bmp, unsigned colors) |
Nikita Kiryanov | 1dce1e7 | 2015-02-03 13:32:27 +0200 | [diff] [blame] | 82 | { |
| 83 | int i; |
| 84 | |
| 85 | for (i = 0; i < colors; ++i) { |
Simon Glass | 92e1f85 | 2015-05-13 07:02:27 -0600 | [diff] [blame] | 86 | struct bmp_color_table_entry cte = bmp->color_table[i]; |
Nikita Kiryanov | 1dce1e7 | 2015-02-03 13:32:27 +0200 | [diff] [blame] | 87 | lcd_setcolreg(i, cte.red, cte.green, cte.blue); |
| 88 | } |
| 89 | } |
Simon Glass | 31f56b4 | 2016-05-05 07:28:20 -0600 | [diff] [blame] | 90 | #endif |
Nikita Kiryanov | 1dce1e7 | 2015-02-03 13:32:27 +0200 | [diff] [blame] | 91 | |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 92 | static void atmel_fb_init(ulong addr, struct display_timing *timing, int bpix, |
| 93 | bool tft, bool cont_pol_low, ulong lcdbase) |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 94 | { |
| 95 | unsigned long value; |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 96 | void *reg = (void *)addr; |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 97 | |
| 98 | /* Turn off the LCD controller and the DMA controller */ |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 99 | lcdc_writel(reg, ATMEL_LCDC_PWRCON, |
Mark Jackson | d180d28 | 2009-06-29 15:59:10 +0100 | [diff] [blame] | 100 | ATMEL_LCDC_GUARD_TIME << ATMEL_LCDC_GUARDT_OFFSET); |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 101 | |
| 102 | /* Wait for the LCDC core to become idle */ |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 103 | while (lcdc_readl(reg, ATMEL_LCDC_PWRCON) & ATMEL_LCDC_BUSY) |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 104 | udelay(10); |
| 105 | |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 106 | lcdc_writel(reg, ATMEL_LCDC_DMACON, 0); |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 107 | |
| 108 | /* Reset LCDC DMA */ |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 109 | lcdc_writel(reg, ATMEL_LCDC_DMACON, ATMEL_LCDC_DMARST); |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 110 | |
| 111 | /* ...set frame size and burst length = 8 words (?) */ |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 112 | value = (timing->hactive.typ * timing->vactive.typ * |
| 113 | (1 << bpix)) / 32; |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 114 | value |= ((ATMEL_LCDC_DMA_BURST_LEN - 1) << ATMEL_LCDC_BLENGTH_OFFSET); |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 115 | lcdc_writel(reg, ATMEL_LCDC_DMAFRMCFG, value); |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 116 | |
| 117 | /* Set pixel clock */ |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 118 | value = get_lcdc_clk_rate(0) / timing->pixelclock.typ; |
| 119 | if (get_lcdc_clk_rate(0) % timing->pixelclock.typ) |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 120 | value++; |
| 121 | value = (value / 2) - 1; |
| 122 | |
| 123 | if (!value) { |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 124 | lcdc_writel(reg, ATMEL_LCDC_LCDCON1, ATMEL_LCDC_BYPASS); |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 125 | } else |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 126 | lcdc_writel(reg, ATMEL_LCDC_LCDCON1, |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 127 | value << ATMEL_LCDC_CLKVAL_OFFSET); |
| 128 | |
| 129 | /* Initialize control register 2 */ |
| 130 | value = ATMEL_LCDC_MEMOR_LITTLE | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE; |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 131 | if (tft) |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 132 | value |= ATMEL_LCDC_DISTYPE_TFT; |
| 133 | |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 134 | if (!(timing->flags & DISPLAY_FLAGS_HSYNC_HIGH)) |
| 135 | value |= ATMEL_LCDC_INVLINE_INVERTED; |
| 136 | if (!(timing->flags & DISPLAY_FLAGS_VSYNC_HIGH)) |
| 137 | value |= ATMEL_LCDC_INVFRAME_INVERTED; |
| 138 | value |= bpix << 5; |
| 139 | lcdc_writel(reg, ATMEL_LCDC_LCDCON2, value); |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 140 | |
| 141 | /* Vertical timing */ |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 142 | value = (timing->vsync_len.typ - 1) << ATMEL_LCDC_VPW_OFFSET; |
| 143 | value |= timing->vback_porch.typ << ATMEL_LCDC_VBP_OFFSET; |
| 144 | value |= timing->vfront_porch.typ; |
| 145 | /* Magic! (Datasheet says "Bit 31 must be written to 1") */ |
| 146 | value |= 1U << 31; |
| 147 | lcdc_writel(reg, ATMEL_LCDC_TIM1, value); |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 148 | |
| 149 | /* Horizontal timing */ |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 150 | value = (timing->hfront_porch.typ - 1) << ATMEL_LCDC_HFP_OFFSET; |
| 151 | value |= (timing->hsync_len.typ - 1) << ATMEL_LCDC_HPW_OFFSET; |
| 152 | value |= (timing->hback_porch.typ - 1); |
| 153 | lcdc_writel(reg, ATMEL_LCDC_TIM2, value); |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 154 | |
| 155 | /* Display size */ |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 156 | value = (timing->hactive.typ - 1) << ATMEL_LCDC_HOZVAL_OFFSET; |
| 157 | value |= timing->vactive.typ - 1; |
| 158 | lcdc_writel(reg, ATMEL_LCDC_LCDFRMCFG, value); |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 159 | |
| 160 | /* FIFO Threshold: Use formula from data sheet */ |
| 161 | value = ATMEL_LCDC_FIFO_SIZE - (2 * ATMEL_LCDC_DMA_BURST_LEN + 3); |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 162 | lcdc_writel(reg, ATMEL_LCDC_FIFO, value); |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 163 | |
| 164 | /* Toggle LCD_MODE every frame */ |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 165 | lcdc_writel(reg, ATMEL_LCDC_MVAL, 0); |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 166 | |
| 167 | /* Disable all interrupts */ |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 168 | lcdc_writel(reg, ATMEL_LCDC_IDR, ~0UL); |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 169 | |
| 170 | /* Set contrast */ |
| 171 | value = ATMEL_LCDC_PS_DIV8 | |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 172 | ATMEL_LCDC_ENA_PWMENABLE; |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 173 | if (!cont_pol_low) |
Alexander Stein | 7fd4ea5 | 2010-07-20 08:55:40 +0200 | [diff] [blame] | 174 | value |= ATMEL_LCDC_POL_POSITIVE; |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 175 | lcdc_writel(reg, ATMEL_LCDC_CONTRAST_CTR, value); |
| 176 | lcdc_writel(reg, ATMEL_LCDC_CONTRAST_VAL, ATMEL_LCDC_CVAL_DEFAULT); |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 177 | |
| 178 | /* Set framebuffer DMA base address and pixel offset */ |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 179 | lcdc_writel(reg, ATMEL_LCDC_DMABADDR1, lcdbase); |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 180 | |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 181 | lcdc_writel(reg, ATMEL_LCDC_DMACON, ATMEL_LCDC_DMAEN); |
| 182 | lcdc_writel(reg, ATMEL_LCDC_PWRCON, |
Mark Jackson | d180d28 | 2009-06-29 15:59:10 +0100 | [diff] [blame] | 183 | (ATMEL_LCDC_GUARD_TIME << ATMEL_LCDC_GUARDT_OFFSET) | ATMEL_LCDC_PWR); |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 184 | } |
| 185 | |
Simon Glass | 31f56b4 | 2016-05-05 07:28:20 -0600 | [diff] [blame] | 186 | #ifndef CONFIG_DM_VIDEO |
Simon Glass | f3e7f01 | 2016-05-05 07:28:19 -0600 | [diff] [blame] | 187 | void lcd_ctrl_init(void *lcdbase) |
| 188 | { |
| 189 | struct display_timing timing; |
| 190 | |
| 191 | timing.flags = 0; |
| 192 | if (!(panel_info.vl_sync & ATMEL_LCDC_INVLINE_INVERTED)) |
| 193 | timing.flags |= DISPLAY_FLAGS_HSYNC_HIGH; |
| 194 | if (!(panel_info.vl_sync & ATMEL_LCDC_INVFRAME_INVERTED)) |
| 195 | timing.flags |= DISPLAY_FLAGS_VSYNC_LOW; |
| 196 | timing.pixelclock.typ = panel_info.vl_clk; |
| 197 | |
| 198 | timing.hactive.typ = panel_info.vl_col; |
| 199 | timing.hfront_porch.typ = panel_info.vl_right_margin; |
| 200 | timing.hback_porch.typ = panel_info.vl_left_margin; |
| 201 | timing.hsync_len.typ = panel_info.vl_hsync_len; |
| 202 | |
| 203 | timing.vactive.typ = panel_info.vl_row; |
| 204 | timing.vfront_porch.typ = panel_info.vl_clk; |
| 205 | timing.vback_porch.typ = panel_info.vl_clk; |
| 206 | timing.vsync_len.typ = panel_info.vl_clk; |
| 207 | |
| 208 | atmel_fb_init(panel_info.mmio, &timing, panel_info.vl_bpix, |
| 209 | panel_info.vl_tft, panel_info.vl_cont_pol_low, |
| 210 | (ulong)lcdbase); |
| 211 | } |
| 212 | |
Stelian Pop | f6f8665 | 2008-05-09 21:57:18 +0200 | [diff] [blame] | 213 | ulong calc_fbsize(void) |
| 214 | { |
| 215 | return ((panel_info.vl_col * panel_info.vl_row * |
| 216 | NBITS(panel_info.vl_bpix)) / 8) + PAGE_SIZE; |
| 217 | } |
Simon Glass | 31f56b4 | 2016-05-05 07:28:20 -0600 | [diff] [blame] | 218 | #endif |
| 219 | |
| 220 | #ifdef CONFIG_DM_VIDEO |
| 221 | static int atmel_fb_lcd_probe(struct udevice *dev) |
| 222 | { |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 223 | struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev); |
Simon Glass | 31f56b4 | 2016-05-05 07:28:20 -0600 | [diff] [blame] | 224 | struct video_priv *uc_priv = dev_get_uclass_priv(dev); |
| 225 | struct atmel_fb_priv *priv = dev_get_priv(dev); |
| 226 | struct display_timing *timing = &priv->timing; |
| 227 | |
| 228 | /* |
| 229 | * For now some values are hard-coded. We could use the device tree |
| 230 | * bindings in simple-framebuffer.txt to specify the format/bpp and |
| 231 | * some Atmel-specific binding for tft and cont_pol_low. |
| 232 | */ |
| 233 | atmel_fb_init(ATMEL_BASE_LCDC, timing, VIDEO_BPP16, true, false, |
| 234 | uc_plat->base); |
| 235 | uc_priv->xsize = timing->hactive.typ; |
| 236 | uc_priv->ysize = timing->vactive.typ; |
| 237 | uc_priv->bpix = VIDEO_BPP16; |
| 238 | video_set_flush_dcache(dev, true); |
| 239 | debug("LCD frame buffer at %lx, size %x, %dx%d pixels\n", uc_plat->base, |
| 240 | uc_plat->size, uc_priv->xsize, uc_priv->ysize); |
| 241 | |
| 242 | return 0; |
| 243 | } |
| 244 | |
Simon Glass | aad29ae | 2020-12-03 16:55:21 -0700 | [diff] [blame] | 245 | static int atmel_fb_of_to_plat(struct udevice *dev) |
Simon Glass | 31f56b4 | 2016-05-05 07:28:20 -0600 | [diff] [blame] | 246 | { |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 247 | struct atmel_lcd_plat *plat = dev_get_plat(dev); |
Simon Glass | 31f56b4 | 2016-05-05 07:28:20 -0600 | [diff] [blame] | 248 | struct atmel_fb_priv *priv = dev_get_priv(dev); |
| 249 | struct display_timing *timing = &priv->timing; |
| 250 | const void *blob = gd->fdt_blob; |
| 251 | |
Simon Glass | dd79d6e | 2017-01-17 16:52:55 -0700 | [diff] [blame] | 252 | if (fdtdec_decode_display_timing(blob, dev_of_offset(dev), |
Simon Glass | 31f56b4 | 2016-05-05 07:28:20 -0600 | [diff] [blame] | 253 | plat->timing_index, timing)) { |
| 254 | debug("%s: Failed to decode display timing\n", __func__); |
| 255 | return -EINVAL; |
| 256 | } |
| 257 | |
| 258 | return 0; |
| 259 | } |
| 260 | |
| 261 | static int atmel_fb_lcd_bind(struct udevice *dev) |
| 262 | { |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 263 | struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev); |
Simon Glass | 31f56b4 | 2016-05-05 07:28:20 -0600 | [diff] [blame] | 264 | |
| 265 | uc_plat->size = LCD_MAX_WIDTH * LCD_MAX_HEIGHT * |
| 266 | (1 << VIDEO_BPP16) / 8; |
| 267 | debug("%s: Frame buffer size %x\n", __func__, uc_plat->size); |
| 268 | |
| 269 | return 0; |
| 270 | } |
| 271 | |
| 272 | static const struct udevice_id atmel_fb_lcd_ids[] = { |
| 273 | { .compatible = "atmel,at91sam9g45-lcdc" }, |
| 274 | { } |
| 275 | }; |
| 276 | |
| 277 | U_BOOT_DRIVER(atmel_fb) = { |
| 278 | .name = "atmel_fb", |
| 279 | .id = UCLASS_VIDEO, |
| 280 | .of_match = atmel_fb_lcd_ids, |
| 281 | .bind = atmel_fb_lcd_bind, |
Simon Glass | aad29ae | 2020-12-03 16:55:21 -0700 | [diff] [blame] | 282 | .of_to_plat = atmel_fb_of_to_plat, |
Simon Glass | 31f56b4 | 2016-05-05 07:28:20 -0600 | [diff] [blame] | 283 | .probe = atmel_fb_lcd_probe, |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 284 | .plat_auto = sizeof(struct atmel_lcd_plat), |
Simon Glass | 8a2b47f | 2020-12-03 16:55:17 -0700 | [diff] [blame] | 285 | .priv_auto = sizeof(struct atmel_fb_priv), |
Simon Glass | 31f56b4 | 2016-05-05 07:28:20 -0600 | [diff] [blame] | 286 | }; |
| 287 | #endif |