Lines Matching refs:pinfo

88 static int read_platinum_sense(struct fb_info_platinum *pinfo);
89 static void set_platinum_clock(struct fb_info_platinum *pinfo);
90 static void platinum_set_hardware(struct fb_info_platinum *pinfo);
92 struct fb_info_platinum *pinfo,
121 struct fb_info_platinum *pinfo = info->par; in platinumfb_set_par() local
125 if((err = platinum_var_to_par(&info->var, pinfo, 0))) { in platinumfb_set_par()
131 platinum_set_hardware(pinfo); in platinumfb_set_par()
133 init = platinum_reg_init[pinfo->vmode-1]; in platinumfb_set_par()
135 if ((pinfo->vmode == VMODE_832_624_75) && (pinfo->cmode > CMODE_8)) in platinumfb_set_par()
138 info->screen_base = pinfo->frame_buffer + init->fb_offset + offset; in platinumfb_set_par()
140 info->fix.smem_start = (pinfo->frame_buffer_phys) + init->fb_offset + offset; in platinumfb_set_par()
142 info->fix.visual = (pinfo->cmode == CMODE_8) ? in platinumfb_set_par()
144 info->fix.line_length = vmode_attrs[pinfo->vmode-1].hres * (1<<pinfo->cmode) in platinumfb_set_par()
183 struct fb_info_platinum *pinfo = info->par; in platinumfb_setcolreg() local
184 volatile struct cmap_regs __iomem *cmap_regs = pinfo->cmap_regs; in platinumfb_setcolreg()
193 pinfo->palette[regno].red = red; in platinumfb_setcolreg()
194 pinfo->palette[regno].green = green; in platinumfb_setcolreg()
195 pinfo->palette[regno].blue = blue; in platinumfb_setcolreg()
205 switch (pinfo->cmode) { in platinumfb_setcolreg()
236 static void set_platinum_clock(struct fb_info_platinum *pinfo) in set_platinum_clock() argument
238 volatile struct cmap_regs __iomem *cmap_regs = pinfo->cmap_regs; in set_platinum_clock()
241 init = platinum_reg_init[pinfo->vmode-1]; in set_platinum_clock()
247 STORE_D2(7, init->clock_params[pinfo->clktype][0]); in set_platinum_clock()
248 STORE_D2(8, init->clock_params[pinfo->clktype][1]); in set_platinum_clock()
251 STORE_D2(4, init->clock_params[pinfo->clktype][0]); in set_platinum_clock()
252 STORE_D2(5, init->clock_params[pinfo->clktype][1]); in set_platinum_clock()
263 static void platinum_set_hardware(struct fb_info_platinum *pinfo) in platinum_set_hardware() argument
265 volatile struct platinum_regs __iomem *platinum_regs = pinfo->platinum_regs; in platinum_set_hardware()
266 volatile struct cmap_regs __iomem *cmap_regs = pinfo->cmap_regs; in platinum_set_hardware()
271 vmode = pinfo->vmode; in platinum_set_hardware()
272 cmode = pinfo->cmode; in platinum_set_hardware()
282 out_be32(&platinum_regs->reg[26+32].r, (pinfo->total_vram == 0x100000 ? in platinum_set_hardware()
285 out_be32(&platinum_regs->reg[16].r, (unsigned) pinfo->frame_buffer_phys+init->fb_offset+0x10); in platinum_set_hardware()
287 out_be32(&platinum_regs->reg[19].r, (pinfo->total_vram == 0x100000 ? in platinum_set_hardware()
290 out_be32(&platinum_regs->reg[20].r, (pinfo->total_vram == 0x100000 ? 0x11 : 0x1011)); in platinum_set_hardware()
298 STORE_D2(0, (pinfo->total_vram == 0x100000 ? in platinum_set_hardware()
304 set_platinum_clock(pinfo); in platinum_set_hardware()
313 struct fb_info_platinum *pinfo) in platinum_init_info() argument
317 info->pseudo_palette = pinfo->pseudo_palette; in platinum_init_info()
318 info->screen_base = pinfo->frame_buffer + 0x20; in platinum_init_info()
324 info->fix.mmio_start = pinfo->platinum_regs_phys; in platinum_init_info()
327 info->fix.smem_start = pinfo->frame_buffer_phys + 0x20; /* will be updated later */ in platinum_init_info()
328 info->fix.smem_len = pinfo->total_vram - 0x20; in platinum_init_info()
339 struct fb_info_platinum *pinfo = info->par; in platinum_init_fb() local
343 sense = read_platinum_sense(pinfo); in platinum_init_fb()
363 platinum_vram_reqd(default_vmode, default_cmode) > pinfo->total_vram) in platinum_init_fb()
382 platinum_init_info(info, pinfo); in platinum_init_fb()
437 struct fb_info_platinum *pinfo, in platinum_var_to_par() argument
459 if (platinum_vram_reqd(vmode, cmode) > pinfo->total_vram) { in platinum_var_to_par()
470 pinfo->vmode = vmode; in platinum_var_to_par()
471 pinfo->cmode = cmode; in platinum_var_to_par()
472 pinfo->xres = vmode_attrs[vmode-1].hres; in platinum_var_to_par()
473 pinfo->yres = vmode_attrs[vmode-1].vres; in platinum_var_to_par()
474 pinfo->xoffset = 0; in platinum_var_to_par()
475 pinfo->yoffset = 0; in platinum_var_to_par()
476 pinfo->vxres = pinfo->xres; in platinum_var_to_par()
477 pinfo->vyres = pinfo->yres; in platinum_var_to_par()
531 struct fb_info_platinum *pinfo; in platinumfb_probe() local
537 info = framebuffer_alloc(sizeof(*pinfo), &odev->dev); in platinumfb_probe()
541 pinfo = info->par; in platinumfb_probe()
543 if (of_address_to_resource(dp, 0, &pinfo->rsrc_reg) || in platinumfb_probe()
544 of_address_to_resource(dp, 1, &pinfo->rsrc_fb)) { in platinumfb_probe()
550 (unsigned long long)pinfo->rsrc_reg.start, in platinumfb_probe()
551 (unsigned long long)pinfo->rsrc_reg.end); in platinumfb_probe()
553 (unsigned long long)pinfo->rsrc_fb.start, in platinumfb_probe()
554 (unsigned long long)pinfo->rsrc_fb.end); in platinumfb_probe()
559 if (!request_mem_region(pinfo->rsrc_fb.start, in platinumfb_probe()
560 resource_size(&pinfo->rsrc_fb), in platinumfb_probe()
568 pinfo->frame_buffer_phys = pinfo->rsrc_fb.start; in platinumfb_probe()
569 pinfo->frame_buffer = ioremap_wt(pinfo->rsrc_fb.start, 0x400000); in platinumfb_probe()
570 pinfo->base_frame_buffer = pinfo->frame_buffer; in platinumfb_probe()
573 pinfo->platinum_regs_phys = pinfo->rsrc_reg.start; in platinumfb_probe()
574 pinfo->platinum_regs = ioremap(pinfo->rsrc_reg.start, 0x1000); in platinumfb_probe()
576 pinfo->cmap_regs_phys = 0xf301b000; /* XXX not in prom? */ in platinumfb_probe()
577 request_mem_region(pinfo->cmap_regs_phys, 0x1000, "platinumfb cmap"); in platinumfb_probe()
578 pinfo->cmap_regs = ioremap(pinfo->cmap_regs_phys, 0x1000); in platinumfb_probe()
581 out_be32(&pinfo->platinum_regs->reg[16].r, (unsigned)pinfo->frame_buffer_phys); in platinumfb_probe()
582 out_be32(&pinfo->platinum_regs->reg[20].r, 0x1011); /* select max vram */ in platinumfb_probe()
583 out_be32(&pinfo->platinum_regs->reg[24].r, 0); /* switch in vram */ in platinumfb_probe()
585 fbuffer = pinfo->base_frame_buffer; in platinumfb_probe()
599 pinfo->total_vram = (bank0 + bank1 + bank2 + bank3) * 0x100000; in platinumfb_probe()
601 (unsigned int) (pinfo->total_vram / 1024 / 1024), in platinumfb_probe()
607 out_8(&pinfo->cmap_regs->addr, 0x40); in platinumfb_probe()
608 pinfo->dactype = in_8(&pinfo->cmap_regs->d2); in platinumfb_probe()
609 switch (pinfo->dactype) { in platinumfb_probe()
611 pinfo->clktype = 1; in platinumfb_probe()
615 pinfo->clktype = 0; in platinumfb_probe()
619 pinfo->clktype = 0; in platinumfb_probe()
620 printk(KERN_INFO "platinumfb: Unknown DACula type: %x\n", pinfo->dactype); in platinumfb_probe()
627 iounmap(pinfo->frame_buffer); in platinumfb_probe()
628 iounmap(pinfo->platinum_regs); in platinumfb_probe()
629 iounmap(pinfo->cmap_regs); in platinumfb_probe()
639 struct fb_info_platinum *pinfo = info->par; in platinumfb_remove() local
644 iounmap(pinfo->frame_buffer); in platinumfb_remove()
645 iounmap(pinfo->platinum_regs); in platinumfb_remove()
646 iounmap(pinfo->cmap_regs); in platinumfb_remove()
648 release_mem_region(pinfo->rsrc_fb.start, in platinumfb_remove()
649 resource_size(&pinfo->rsrc_fb)); in platinumfb_remove()
651 release_mem_region(pinfo->cmap_regs_phys, 0x1000); in platinumfb_remove()