Lines Matching refs:sp
33 static int s3d_get_props(struct s3d_info *sp) in s3d_get_props() argument
35 sp->width = of_getintprop_default(sp->of_node, "width", 0); in s3d_get_props()
36 sp->height = of_getintprop_default(sp->of_node, "height", 0); in s3d_get_props()
37 sp->depth = of_getintprop_default(sp->of_node, "depth", 8); in s3d_get_props()
39 if (!sp->width || !sp->height) { in s3d_get_props()
41 pci_name(sp->pdev)); in s3d_get_props()
74 static int s3d_set_fbinfo(struct s3d_info *sp) in s3d_set_fbinfo() argument
76 struct fb_info *info = sp->info; in s3d_set_fbinfo()
81 info->screen_base = sp->fb_base; in s3d_set_fbinfo()
82 info->screen_size = sp->fb_size; in s3d_set_fbinfo()
84 info->pseudo_palette = sp->pseudo_palette; in s3d_set_fbinfo()
88 info->fix.smem_start = sp->fb_base_phys; in s3d_set_fbinfo()
89 info->fix.smem_len = sp->fb_size; in s3d_set_fbinfo()
91 if (sp->depth == 32 || sp->depth == 24) in s3d_set_fbinfo()
96 var->xres = sp->width; in s3d_set_fbinfo()
97 var->yres = sp->height; in s3d_set_fbinfo()
100 var->bits_per_pixel = sp->depth; in s3d_set_fbinfo()
123 struct s3d_info *sp; in s3d_pci_register() local
139 sp = info->par; in s3d_pci_register()
140 sp->info = info; in s3d_pci_register()
141 sp->pdev = pdev; in s3d_pci_register()
142 sp->of_node = pci_device_to_OF_node(pdev); in s3d_pci_register()
143 if (!sp->of_node) { in s3d_pci_register()
150 sp->fb_base_phys = pci_resource_start (pdev, 1); in s3d_pci_register()
159 err = s3d_get_props(sp); in s3d_pci_register()
167 switch (sp->depth) { in s3d_pci_register()
169 info->fix.line_length = sp->width; in s3d_pci_register()
172 info->fix.line_length = sp->width * 2; in s3d_pci_register()
175 info->fix.line_length = sp->width * 3; in s3d_pci_register()
178 info->fix.line_length = sp->width * 4; in s3d_pci_register()
181 sp->fb_size = info->fix.line_length * sp->height; in s3d_pci_register()
183 sp->fb_base = ioremap(sp->fb_base_phys, sp->fb_size); in s3d_pci_register()
184 if (!sp->fb_base) { in s3d_pci_register()
189 err = s3d_set_fbinfo(sp); in s3d_pci_register()
207 iounmap(sp->fb_base); in s3d_pci_register()