Lines Matching refs:fbi

41 	struct vt8500lcd_info *fbi = to_vt8500lcd_info(info);  in vt8500lcd_set_par()  local
46 if (!fbi) in vt8500lcd_set_par()
112 control0 = readl(fbi->regbase) & ~0xf; in vt8500lcd_set_par()
113 writel(0, fbi->regbase); in vt8500lcd_set_par()
114 while (readl(fbi->regbase + 0x38) & 0x10) in vt8500lcd_set_par()
119 | (info->var.right_margin & 0xff), fbi->regbase + 0x4); in vt8500lcd_set_par()
123 | (info->var.lower_margin & 0xff), fbi->regbase + 0x8); in vt8500lcd_set_par()
125 | ((info->var.xres - 1) & 0x400), fbi->regbase + 0x10); in vt8500lcd_set_par()
126 writel(0x80000000, fbi->regbase + 0x20); in vt8500lcd_set_par()
127 writel(control0 | (reg_bpp << 1) | 0x100, fbi->regbase); in vt8500lcd_set_par()
142 struct vt8500lcd_info *fbi = to_vt8500lcd_info(info); in vt8500lcd_setcolreg() local
152 switch (fbi->fb.fix.visual) { in vt8500lcd_setcolreg()
155 u32 *pal = fbi->fb.pseudo_palette; in vt8500lcd_setcolreg()
157 val = chan_to_field(red, &fbi->fb.var.red); in vt8500lcd_setcolreg()
158 val |= chan_to_field(green, &fbi->fb.var.green); in vt8500lcd_setcolreg()
159 val |= chan_to_field(blue, &fbi->fb.var.blue); in vt8500lcd_setcolreg()
171 fbi->palette_cpu + sizeof(u16) * regno); in vt8500lcd_setcolreg()
182 struct vt8500lcd_info *fbi = to_vt8500lcd_info(info); in vt8500lcd_ioctl() local
186 writel(0xffffffff ^ (1 << 3), fbi->regbase + 0x3c); in vt8500lcd_ioctl()
187 ret = wait_event_interruptible_timeout(fbi->wait, in vt8500lcd_ioctl()
188 readl(fbi->regbase + 0x38) & (1 << 3), HZ / 10); in vt8500lcd_ioctl()
190 writel(0xffffffff, fbi->regbase + 0x3c); in vt8500lcd_ioctl()
206 struct vt8500lcd_info *fbi = to_vt8500lcd_info(info); in vt8500lcd_pan_display() local
210 | (off >> 2), fbi->regbase + 0x20); in vt8500lcd_pan_display()
257 struct vt8500lcd_info *fbi = dev_id; in vt8500lcd_handle_irq() local
259 if (readl(fbi->regbase + 0x38) & (1 << 3)) in vt8500lcd_handle_irq()
260 wake_up_interruptible(&fbi->wait); in vt8500lcd_handle_irq()
262 writel(0xffffffff, fbi->regbase + 0x38); in vt8500lcd_handle_irq()
268 struct vt8500lcd_info *fbi; in vt8500lcd_probe() local
281 fbi = NULL; in vt8500lcd_probe()
283 fbi = devm_kzalloc(&pdev->dev, sizeof(struct vt8500lcd_info) in vt8500lcd_probe()
285 if (!fbi) in vt8500lcd_probe()
288 strcpy(fbi->fb.fix.id, "VT8500 LCD"); in vt8500lcd_probe()
290 fbi->fb.fix.type = FB_TYPE_PACKED_PIXELS; in vt8500lcd_probe()
291 fbi->fb.fix.xpanstep = 0; in vt8500lcd_probe()
292 fbi->fb.fix.ypanstep = 1; in vt8500lcd_probe()
293 fbi->fb.fix.ywrapstep = 0; in vt8500lcd_probe()
294 fbi->fb.fix.accel = FB_ACCEL_NONE; in vt8500lcd_probe()
296 fbi->fb.var.nonstd = 0; in vt8500lcd_probe()
297 fbi->fb.var.activate = FB_ACTIVATE_NOW; in vt8500lcd_probe()
298 fbi->fb.var.height = -1; in vt8500lcd_probe()
299 fbi->fb.var.width = -1; in vt8500lcd_probe()
300 fbi->fb.var.vmode = FB_VMODE_NONINTERLACED; in vt8500lcd_probe()
302 fbi->fb.fbops = &vt8500lcd_ops; in vt8500lcd_probe()
303 fbi->fb.flags = FBINFO_DEFAULT in vt8500lcd_probe()
309 fbi->fb.node = -1; in vt8500lcd_probe()
311 addr = fbi; in vt8500lcd_probe()
313 fbi->fb.pseudo_palette = addr; in vt8500lcd_probe()
327 fbi->regbase = ioremap(res->start, resource_size(res)); in vt8500lcd_probe()
328 if (fbi->regbase == NULL) { in vt8500lcd_probe()
359 fbi->fb.fix.smem_start = fb_mem_phys; in vt8500lcd_probe()
360 fbi->fb.fix.smem_len = fb_mem_len; in vt8500lcd_probe()
361 fbi->fb.screen_base = fb_mem_virt; in vt8500lcd_probe()
363 fbi->palette_size = PAGE_ALIGN(512); in vt8500lcd_probe()
364 fbi->palette_cpu = dma_alloc_coherent(&pdev->dev, in vt8500lcd_probe()
365 fbi->palette_size, in vt8500lcd_probe()
366 &fbi->palette_phys, in vt8500lcd_probe()
368 if (fbi->palette_cpu == NULL) { in vt8500lcd_probe()
381 ret = request_irq(irq, vt8500lcd_handle_irq, 0, "LCD", fbi); in vt8500lcd_probe()
388 init_waitqueue_head(&fbi->wait); in vt8500lcd_probe()
390 if (fb_alloc_cmap(&fbi->fb.cmap, 256, 0) < 0) { in vt8500lcd_probe()
396 fb_videomode_to_var(&fbi->fb.var, &of_mode); in vt8500lcd_probe()
398 fbi->fb.var.xres_virtual = of_mode.xres; in vt8500lcd_probe()
399 fbi->fb.var.yres_virtual = of_mode.yres * 2; in vt8500lcd_probe()
400 fbi->fb.var.bits_per_pixel = bpp; in vt8500lcd_probe()
402 ret = vt8500lcd_set_par(&fbi->fb); in vt8500lcd_probe()
408 writel(fbi->fb.fix.smem_start >> 22, fbi->regbase + 0x1c); in vt8500lcd_probe()
409 writel((fbi->palette_phys & 0xfffffe00) | 1, fbi->regbase + 0x18); in vt8500lcd_probe()
411 platform_set_drvdata(pdev, fbi); in vt8500lcd_probe()
413 ret = register_framebuffer(&fbi->fb); in vt8500lcd_probe()
423 writel(readl(fbi->regbase) | 1, fbi->regbase); in vt8500lcd_probe()
428 if (fbi->fb.cmap.len) in vt8500lcd_probe()
429 fb_dealloc_cmap(&fbi->fb.cmap); in vt8500lcd_probe()
431 free_irq(irq, fbi); in vt8500lcd_probe()
433 dma_free_coherent(&pdev->dev, fbi->palette_size, in vt8500lcd_probe()
434 fbi->palette_cpu, fbi->palette_phys); in vt8500lcd_probe()
436 iounmap(fbi->regbase); in vt8500lcd_probe()
444 struct vt8500lcd_info *fbi = platform_get_drvdata(pdev); in vt8500lcd_remove() local
448 unregister_framebuffer(&fbi->fb); in vt8500lcd_remove()
450 writel(0, fbi->regbase); in vt8500lcd_remove()
452 if (fbi->fb.cmap.len) in vt8500lcd_remove()
453 fb_dealloc_cmap(&fbi->fb.cmap); in vt8500lcd_remove()
456 free_irq(irq, fbi); in vt8500lcd_remove()
458 dma_free_coherent(&pdev->dev, fbi->palette_size, in vt8500lcd_remove()
459 fbi->palette_cpu, fbi->palette_phys); in vt8500lcd_remove()
461 iounmap(fbi->regbase); in vt8500lcd_remove()