Lines Matching refs:info
148 static void ep93xxfb_set_video_attribs(struct fb_info *info) in ep93xxfb_set_video_attribs() argument
150 struct ep93xx_fbi *fbi = info->par; in ep93xxfb_set_video_attribs()
158 static int ep93xxfb_set_pixelmode(struct fb_info *info) in ep93xxfb_set_pixelmode() argument
160 struct ep93xx_fbi *fbi = info->par; in ep93xxfb_set_pixelmode()
163 info->var.transp.offset = 0; in ep93xxfb_set_pixelmode()
164 info->var.transp.length = 0; in ep93xxfb_set_pixelmode()
166 switch (info->var.bits_per_pixel) { in ep93xxfb_set_pixelmode()
171 info->var.red.offset = 0; in ep93xxfb_set_pixelmode()
172 info->var.red.length = 8; in ep93xxfb_set_pixelmode()
173 info->var.green.offset = 0; in ep93xxfb_set_pixelmode()
174 info->var.green.length = 8; in ep93xxfb_set_pixelmode()
175 info->var.blue.offset = 0; in ep93xxfb_set_pixelmode()
176 info->var.blue.length = 8; in ep93xxfb_set_pixelmode()
177 info->fix.visual = FB_VISUAL_PSEUDOCOLOR; in ep93xxfb_set_pixelmode()
184 info->var.red.offset = 11; in ep93xxfb_set_pixelmode()
185 info->var.red.length = 5; in ep93xxfb_set_pixelmode()
186 info->var.green.offset = 5; in ep93xxfb_set_pixelmode()
187 info->var.green.length = 6; in ep93xxfb_set_pixelmode()
188 info->var.blue.offset = 0; in ep93xxfb_set_pixelmode()
189 info->var.blue.length = 5; in ep93xxfb_set_pixelmode()
190 info->fix.visual = FB_VISUAL_TRUECOLOR; in ep93xxfb_set_pixelmode()
197 info->var.red.offset = 16; in ep93xxfb_set_pixelmode()
198 info->var.red.length = 8; in ep93xxfb_set_pixelmode()
199 info->var.green.offset = 8; in ep93xxfb_set_pixelmode()
200 info->var.green.length = 8; in ep93xxfb_set_pixelmode()
201 info->var.blue.offset = 0; in ep93xxfb_set_pixelmode()
202 info->var.blue.length = 8; in ep93xxfb_set_pixelmode()
203 info->fix.visual = FB_VISUAL_TRUECOLOR; in ep93xxfb_set_pixelmode()
210 info->var.red.offset = 16; in ep93xxfb_set_pixelmode()
211 info->var.red.length = 8; in ep93xxfb_set_pixelmode()
212 info->var.green.offset = 8; in ep93xxfb_set_pixelmode()
213 info->var.green.length = 8; in ep93xxfb_set_pixelmode()
214 info->var.blue.offset = 0; in ep93xxfb_set_pixelmode()
215 info->var.blue.length = 8; in ep93xxfb_set_pixelmode()
216 info->fix.visual = FB_VISUAL_TRUECOLOR; in ep93xxfb_set_pixelmode()
227 static void ep93xxfb_set_timing(struct fb_info *info) in ep93xxfb_set_timing() argument
229 struct ep93xx_fbi *fbi = info->par; in ep93xxfb_set_timing()
232 vlines_total = info->var.yres + info->var.upper_margin + in ep93xxfb_set_timing()
233 info->var.lower_margin + info->var.vsync_len - 1; in ep93xxfb_set_timing()
235 hclks_total = info->var.xres + info->var.left_margin + in ep93xxfb_set_timing()
236 info->var.right_margin + info->var.hsync_len - 1; in ep93xxfb_set_timing()
242 stop = vlines_total - info->var.vsync_len; in ep93xxfb_set_timing()
245 start = vlines_total - info->var.vsync_len - info->var.upper_margin; in ep93xxfb_set_timing()
246 stop = info->var.lower_margin - 1; in ep93xxfb_set_timing()
255 stop = hclks_total - info->var.hsync_len; in ep93xxfb_set_timing()
258 start = hclks_total - info->var.hsync_len - info->var.left_margin; in ep93xxfb_set_timing()
259 stop = info->var.right_margin - 1; in ep93xxfb_set_timing()
270 static int ep93xxfb_set_par(struct fb_info *info) in ep93xxfb_set_par() argument
272 struct ep93xx_fbi *fbi = info->par; in ep93xxfb_set_par()
274 clk_set_rate(fbi->clk, 1000 * PICOS2KHZ(info->var.pixclock)); in ep93xxfb_set_par()
276 ep93xxfb_set_timing(info); in ep93xxfb_set_par()
278 info->fix.line_length = info->var.xres_virtual * in ep93xxfb_set_par()
279 info->var.bits_per_pixel / 8; in ep93xxfb_set_par()
281 ep93xxfb_writel(fbi, info->fix.smem_start, EP93XXFB_SCREEN_PAGE); in ep93xxfb_set_par()
282 ep93xxfb_writel(fbi, info->var.yres - 1, EP93XXFB_SCREEN_LINES); in ep93xxfb_set_par()
283 ep93xxfb_writel(fbi, ((info->var.xres * info->var.bits_per_pixel) in ep93xxfb_set_par()
285 ep93xxfb_writel(fbi, info->fix.line_length / 4, EP93XXFB_VLINE_STEP); in ep93xxfb_set_par()
286 ep93xxfb_set_video_attribs(info); in ep93xxfb_set_par()
291 struct fb_info *info) in ep93xxfb_check_var() argument
295 err = ep93xxfb_set_pixelmode(info); in ep93xxfb_check_var()
310 static int ep93xxfb_mmap(struct fb_info *info, struct vm_area_struct *vma) in ep93xxfb_mmap() argument
314 if (offset < info->fix.smem_len) { in ep93xxfb_mmap()
315 return dma_mmap_wc(info->dev, vma, info->screen_base, in ep93xxfb_mmap()
316 info->fix.smem_start, info->fix.smem_len); in ep93xxfb_mmap()
322 static int ep93xxfb_blank(int blank_mode, struct fb_info *info) in ep93xxfb_blank() argument
324 struct ep93xx_fbi *fbi = info->par; in ep93xxfb_blank()
329 fbi->mach_info->blank(blank_mode, info); in ep93xxfb_blank()
338 fbi->mach_info->blank(blank_mode, info); in ep93xxfb_blank()
351 unsigned int transp, struct fb_info *info) in ep93xxfb_setcolreg() argument
353 struct ep93xx_fbi *fbi = info->par; in ep93xxfb_setcolreg()
354 unsigned int *pal = info->pseudo_palette; in ep93xxfb_setcolreg()
357 switch (info->fix.visual) { in ep93xxfb_setcolreg()
386 red = ep93xxfb_convert_color(red, info->var.red.length); in ep93xxfb_setcolreg()
387 green = ep93xxfb_convert_color(green, info->var.green.length); in ep93xxfb_setcolreg()
388 blue = ep93xxfb_convert_color(blue, info->var.blue.length); in ep93xxfb_setcolreg()
390 info->var.transp.length); in ep93xxfb_setcolreg()
392 pal[regno] = (red << info->var.red.offset) | in ep93xxfb_setcolreg()
393 (green << info->var.green.offset) | in ep93xxfb_setcolreg()
394 (blue << info->var.blue.offset) | in ep93xxfb_setcolreg()
395 (transp << info->var.transp.offset); in ep93xxfb_setcolreg()
417 static int ep93xxfb_alloc_videomem(struct fb_info *info) in ep93xxfb_alloc_videomem() argument
426 virt_addr = dma_alloc_wc(info->dev, fb_size, &phys_addr, GFP_KERNEL); in ep93xxfb_alloc_videomem()
439 dev_err(info->dev, "ep93xx framebuffer bug. phys addr (0x%x) " in ep93xxfb_alloc_videomem()
443 dma_free_coherent(info->dev, fb_size, virt_addr, phys_addr); in ep93xxfb_alloc_videomem()
447 info->fix.smem_start = phys_addr; in ep93xxfb_alloc_videomem()
448 info->fix.smem_len = fb_size; in ep93xxfb_alloc_videomem()
449 info->screen_base = virt_addr; in ep93xxfb_alloc_videomem()
454 static void ep93xxfb_dealloc_videomem(struct fb_info *info) in ep93xxfb_dealloc_videomem() argument
456 if (info->screen_base) in ep93xxfb_dealloc_videomem()
457 dma_free_coherent(info->dev, info->fix.smem_len, in ep93xxfb_dealloc_videomem()
458 info->screen_base, info->fix.smem_start); in ep93xxfb_dealloc_videomem()
464 struct fb_info *info; in ep93xxfb_probe() local
473 info = framebuffer_alloc(sizeof(struct ep93xx_fbi), &pdev->dev); in ep93xxfb_probe()
474 if (!info) in ep93xxfb_probe()
477 platform_set_drvdata(pdev, info); in ep93xxfb_probe()
478 fbi = info->par; in ep93xxfb_probe()
481 err = fb_alloc_cmap(&info->cmap, 256, 0); in ep93xxfb_probe()
485 err = ep93xxfb_alloc_videomem(info); in ep93xxfb_probe()
512 strcpy(info->fix.id, pdev->name); in ep93xxfb_probe()
513 info->fbops = &ep93xxfb_ops; in ep93xxfb_probe()
514 info->fix.type = FB_TYPE_PACKED_PIXELS; in ep93xxfb_probe()
515 info->fix.accel = FB_ACCEL_NONE; in ep93xxfb_probe()
516 info->var.activate = FB_ACTIVATE_NOW; in ep93xxfb_probe()
517 info->var.vmode = FB_VMODE_NONINTERLACED; in ep93xxfb_probe()
518 info->flags = FBINFO_DEFAULT; in ep93xxfb_probe()
519 info->node = -1; in ep93xxfb_probe()
520 info->state = FBINFO_STATE_RUNNING; in ep93xxfb_probe()
521 info->pseudo_palette = &fbi->pseudo_palette; in ep93xxfb_probe()
524 err = fb_find_mode(&info->var, info, video_mode, in ep93xxfb_probe()
527 dev_err(info->dev, "No suitable video mode found\n"); in ep93xxfb_probe()
538 err = ep93xxfb_check_var(&info->var, info); in ep93xxfb_probe()
549 ep93xxfb_set_par(info); in ep93xxfb_probe()
552 err = register_framebuffer(info); in ep93xxfb_probe()
556 dev_info(info->dev, "registered. Mode = %dx%d-%d\n", in ep93xxfb_probe()
557 info->var.xres, info->var.yres, info->var.bits_per_pixel); in ep93xxfb_probe()
566 ep93xxfb_dealloc_videomem(info); in ep93xxfb_probe()
568 fb_dealloc_cmap(&info->cmap); in ep93xxfb_probe()
570 kfree(info); in ep93xxfb_probe()
577 struct fb_info *info = platform_get_drvdata(pdev); in ep93xxfb_remove() local
578 struct ep93xx_fbi *fbi = info->par; in ep93xxfb_remove()
580 unregister_framebuffer(info); in ep93xxfb_remove()
582 ep93xxfb_dealloc_videomem(info); in ep93xxfb_remove()
583 fb_dealloc_cmap(&info->cmap); in ep93xxfb_remove()
588 kfree(info); in ep93xxfb_remove()