/* Configure the LCD controller, download the color palette and start a looped DMA transfer of the frame image data. Called only in internal controller mode.  */
static int omap_lcdc_set_update_mode(enum omapfb_update_mode mode)
/* Configure the LCD controller, download the color palette and start a looped DMA transfer of the frame image data. Called only in internal controller mode.  */
static int omap_lcdc_set_update_mode(enum omapfb_update_mode mode)
{
	int r = 0;
	if (mode != lcdc.update_mode) {
		switch (mode) {
		case OMAPFB_AUTO_UPDATE:
			setup_regs();
			load_palette();
			setup_lcd_dma();
			set_load_mode(OMAP_LCDC_LOAD_FRAME);
			enable_irqs(OMAP_LCDC_IRQ_DONE);
			enable_controller();
			lcdc.update_mode = mode;
			break;
		case OMAPFB_UPDATE_DISABLED:
			disable_controller();
			omap_stop_lcd_dma();
			lcdc.update_mode = mode;
			break;
		default:
			r = -EINVAL;
		}
	}
	return r;
}