Lines Matching refs:fbi
56 static int is_s3c2412(struct s3c2410fb_info *fbi) in is_s3c2412() argument
58 return (fbi->drv_type == DRV_S3C2412); in is_s3c2412()
68 struct s3c2410fb_info *fbi = info->par; in s3c2410fb_set_lcdaddr() local
69 void __iomem *regs = fbi->io; in s3c2410fb_set_lcdaddr()
92 static unsigned int s3c2410fb_calc_pixclk(struct s3c2410fb_info *fbi, in s3c2410fb_calc_pixclk() argument
95 unsigned long clk = fbi->clk_rate; in s3c2410fb_calc_pixclk()
120 struct s3c2410fb_info *fbi = info->par; in s3c2410fb_check_var() local
121 struct s3c2410fb_mach_info *mach_info = dev_get_platdata(fbi->dev); in s3c2410fb_check_var()
167 fbi->regs.lcdcon5 = display->lcdcon5; in s3c2410fb_check_var()
169 fbi->regs.lcdcon1 = display->type; in s3c2410fb_check_var()
249 const struct s3c2410fb_info *fbi = info->par; in s3c2410fb_calculate_stn_lcd_regs() local
280 dev_err(fbi->dev, "invalid bpp %d\n", in s3c2410fb_calculate_stn_lcd_regs()
309 const struct s3c2410fb_info *fbi = info->par; in s3c2410fb_calculate_tft_lcd_regs() local
341 dev_err(fbi->dev, "invalid bpp %d\n", in s3c2410fb_calculate_tft_lcd_regs()
370 struct s3c2410fb_info *fbi = info->par; in s3c2410fb_activate_var() local
371 void __iomem *regs = fbi->io; in s3c2410fb_activate_var()
372 int type = fbi->regs.lcdcon1 & S3C2410_LCDCON1_TFT; in s3c2410fb_activate_var()
376 clkdiv = DIV_ROUND_UP(s3c2410fb_calc_pixclk(fbi, var->pixclock), 2); in s3c2410fb_activate_var()
383 s3c2410fb_calculate_tft_lcd_regs(info, &fbi->regs); in s3c2410fb_activate_var()
388 s3c2410fb_calculate_stn_lcd_regs(info, &fbi->regs); in s3c2410fb_activate_var()
393 fbi->regs.lcdcon1 |= S3C2410_LCDCON1_CLKVAL(clkdiv); in s3c2410fb_activate_var()
398 dprintk("lcdcon[1] = 0x%08lx\n", fbi->regs.lcdcon1); in s3c2410fb_activate_var()
399 dprintk("lcdcon[2] = 0x%08lx\n", fbi->regs.lcdcon2); in s3c2410fb_activate_var()
400 dprintk("lcdcon[3] = 0x%08lx\n", fbi->regs.lcdcon3); in s3c2410fb_activate_var()
401 dprintk("lcdcon[4] = 0x%08lx\n", fbi->regs.lcdcon4); in s3c2410fb_activate_var()
402 dprintk("lcdcon[5] = 0x%08lx\n", fbi->regs.lcdcon5); in s3c2410fb_activate_var()
404 writel(fbi->regs.lcdcon1 & ~S3C2410_LCDCON1_ENVID, in s3c2410fb_activate_var()
406 writel(fbi->regs.lcdcon2, regs + S3C2410_LCDCON2); in s3c2410fb_activate_var()
407 writel(fbi->regs.lcdcon3, regs + S3C2410_LCDCON3); in s3c2410fb_activate_var()
408 writel(fbi->regs.lcdcon4, regs + S3C2410_LCDCON4); in s3c2410fb_activate_var()
409 writel(fbi->regs.lcdcon5, regs + S3C2410_LCDCON5); in s3c2410fb_activate_var()
414 fbi->regs.lcdcon1 |= S3C2410_LCDCON1_ENVID, in s3c2410fb_activate_var()
415 writel(fbi->regs.lcdcon1, regs + S3C2410_LCDCON1); in s3c2410fb_activate_var()
449 static void schedule_palette_update(struct s3c2410fb_info *fbi, in schedule_palette_update() argument
454 void __iomem *irq_base = fbi->irq_base; in schedule_palette_update()
458 fbi->palette_buffer[regno] = val; in schedule_palette_update()
460 if (!fbi->palette_ready) { in schedule_palette_update()
461 fbi->palette_ready = 1; in schedule_palette_update()
485 struct s3c2410fb_info *fbi = info->par; in s3c2410fb_setcolreg() local
486 void __iomem *regs = fbi->io; in s3c2410fb_setcolreg()
516 schedule_palette_update(fbi, regno, val); in s3c2410fb_setcolreg()
532 static void s3c2410fb_lcd_enable(struct s3c2410fb_info *fbi, int enable) in s3c2410fb_lcd_enable() argument
539 fbi->regs.lcdcon1 |= S3C2410_LCDCON1_ENVID; in s3c2410fb_lcd_enable()
541 fbi->regs.lcdcon1 &= ~S3C2410_LCDCON1_ENVID; in s3c2410fb_lcd_enable()
543 writel(fbi->regs.lcdcon1, fbi->io + S3C2410_LCDCON1); in s3c2410fb_lcd_enable()
564 struct s3c2410fb_info *fbi = info->par; in s3c2410fb_blank() local
565 void __iomem *tpal_reg = fbi->io; in s3c2410fb_blank()
569 tpal_reg += is_s3c2412(fbi) ? S3C2412_TPAL : S3C2410_TPAL; in s3c2410fb_blank()
572 s3c2410fb_lcd_enable(fbi, 0); in s3c2410fb_blank()
574 s3c2410fb_lcd_enable(fbi, 1); in s3c2410fb_blank()
637 struct s3c2410fb_info *fbi = info->par; in s3c2410fb_map_video_memory() local
641 dprintk("map_video_memory(fbi=%p) map_size %u\n", fbi, map_size); in s3c2410fb_map_video_memory()
643 info->screen_base = dma_alloc_wc(fbi->dev, map_size, &map_dma, in s3c2410fb_map_video_memory()
663 struct s3c2410fb_info *fbi = info->par; in s3c2410fb_unmap_video_memory() local
665 dma_free_wc(fbi->dev, PAGE_ALIGN(info->fix.smem_len), in s3c2410fb_unmap_video_memory()
686 struct s3c2410fb_info *fbi = info->par; in s3c2410fb_init_registers() local
687 struct s3c2410fb_mach_info *mach_info = dev_get_platdata(fbi->dev); in s3c2410fb_init_registers()
689 void __iomem *regs = fbi->io; in s3c2410fb_init_registers()
693 if (is_s3c2412(fbi)) { in s3c2410fb_init_registers()
725 static void s3c2410fb_write_palette(struct s3c2410fb_info *fbi) in s3c2410fb_write_palette() argument
728 void __iomem *regs = fbi->io; in s3c2410fb_write_palette()
730 fbi->palette_ready = 0; in s3c2410fb_write_palette()
733 unsigned long ent = fbi->palette_buffer[i]; in s3c2410fb_write_palette()
745 fbi->palette_buffer[i] = PALETTE_BUFF_CLEAR; in s3c2410fb_write_palette()
747 fbi->palette_ready = 1; /* retry */ in s3c2410fb_write_palette()
753 struct s3c2410fb_info *fbi = dev_id; in s3c2410fb_irq() local
754 void __iomem *irq_base = fbi->irq_base; in s3c2410fb_irq()
758 if (fbi->palette_ready) in s3c2410fb_irq()
759 s3c2410fb_write_palette(fbi); in s3c2410fb_irq()