Atmel LCDC Driver

The atmel_lcdfb driver, supporting both AT91 and AVR32 chips, was merged during the 2.6.22 release cycle. This was based on the old sidsafb driver, but contains a lot of improvements and will eventually replace it. Platform- and board specific code for AT32AP7000 and ATSTK1000 was merged as well, but not the Ltv350qvDriver, which is necessary for initializing the LCD panel on ATSTK1000.

Using the driver

The atmel_lcdfb driver requires a bit of board-specific code to work. First, to add a PlatformDevice? for the LCDC, you need to call at32_add_device_lcdc() like this:

at32_add_device_lcdc(0, &board_lcdc_data, fbmem_start, fbmem_size);
The parameters have the following meaning: 1. First, the device ID. Since the AP7000 only has one LCDC device, this must be 0. 1. Then, the board-specific data. This will be explained below. 1. fbmem_start is the physical address of a preallocated framebuffer. The AVR32 core code will initialize this global variable if the argument fbmem=_size_[@_start_] is passed on the command line. 1. fbmem_size is the size of a preallocated framebuffer. The AVR32 core code will initialize this as well from the fbmem= argument. Set it to 0 if you don't want to use a preallocated framebuffer.

Board-specific data

The board-specific data is a struct of type struct atmel_lcdfb_info which is defined in

default_bpp
Default colour depth in bits per pixel.
default_dmacon
Set this to ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN. Some chips don't support panning in the x-direction; the AP7000 does.
default_lcdcon2
Make sure this matches your display. This selects between TFT and STN mode among other things. ATMEL_LCDC_MEMOR_BIG should probably always be set on AVR32.
default_monspecs
Set this to the address of a struct fb_monspecs type variable. The struct is defined in and must be initialized based on the specifications of your display.
guard_time
Guard time when the display is powered up. 2 is usually a good value.

Example

The following settings work with the LTV350QV TFT display on ATSTK1000.

static struct fb_videomode __initdata ltv350qv_modes[] = {
   {
      .name      = "320x240 @ 75",
      .refresh   = 75,
      .xres      = 320,      .yres      = 240,
      .pixclock   = KHZ2PICOS(6891),

      .left_margin   = 17,      .right_margin   = 33,
      .upper_margin   = 10,      .lower_margin   = 10,
      .hsync_len   = 16,      .vsync_len   = 1,

      .sync      = 0,
      .vmode      = FB_VMODE_NONINTERLACED,
   },
};

static struct fb_monspecs __initdata atstk1000_default_monspecs = {
   .manufacturer      = "SNG",
   .monitor      = "LTV350QV",
   .modedb         = ltv350qv_modes,
   .modedb_len      = ARRAY_SIZE(ltv350qv_modes),
   .hfmin         = 14820,
   .hfmax         = 22230,
   .vfmin         = 60,
   .vfmax         = 90,
   .dclkmax      = 30000000,
};

struct atmel_lcdfb_info __initdata atstk1000_lcdc_data = {
   .default_bpp      = 24,
   .default_dmacon      = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN,
   .default_lcdcon2   = (ATMEL_LCDC_DISTYPE_TFT
               | ATMEL_LCDC_INVCLK
               | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE
               | ATMEL_LCDC_MEMOR_BIG),
   .default_monspecs   = &atstk1000_default_monspecs,
   .guard_time      = 2,
};

Known issues