Lines Matching refs:sp

34 static int s3d_get_props(struct s3d_info *sp)  in s3d_get_props()  argument
36 sp->width = of_getintprop_default(sp->of_node, "width", 0); in s3d_get_props()
37 sp->height = of_getintprop_default(sp->of_node, "height", 0); in s3d_get_props()
38 sp->depth = of_getintprop_default(sp->of_node, "depth", 8); in s3d_get_props()
40 if (!sp->width || !sp->height) { in s3d_get_props()
42 pci_name(sp->pdev)); in s3d_get_props()
73 static int s3d_set_fbinfo(struct s3d_info *sp) in s3d_set_fbinfo() argument
75 struct fb_info *info = sp->info; in s3d_set_fbinfo()
79 info->screen_base = sp->fb_base; in s3d_set_fbinfo()
80 info->screen_size = sp->fb_size; in s3d_set_fbinfo()
82 info->pseudo_palette = sp->pseudo_palette; in s3d_set_fbinfo()
86 info->fix.smem_start = sp->fb_base_phys; in s3d_set_fbinfo()
87 info->fix.smem_len = sp->fb_size; in s3d_set_fbinfo()
89 if (sp->depth == 32 || sp->depth == 24) in s3d_set_fbinfo()
94 var->xres = sp->width; in s3d_set_fbinfo()
95 var->yres = sp->height; in s3d_set_fbinfo()
98 var->bits_per_pixel = sp->depth; in s3d_set_fbinfo()
121 struct s3d_info *sp; in s3d_pci_register() local
141 sp = info->par; in s3d_pci_register()
142 sp->info = info; in s3d_pci_register()
143 sp->pdev = pdev; in s3d_pci_register()
144 sp->of_node = pci_device_to_OF_node(pdev); in s3d_pci_register()
145 if (!sp->of_node) { in s3d_pci_register()
152 sp->fb_base_phys = pci_resource_start (pdev, 1); in s3d_pci_register()
161 err = s3d_get_props(sp); in s3d_pci_register()
169 switch (sp->depth) { in s3d_pci_register()
171 info->fix.line_length = sp->width; in s3d_pci_register()
174 info->fix.line_length = sp->width * 2; in s3d_pci_register()
177 info->fix.line_length = sp->width * 3; in s3d_pci_register()
180 info->fix.line_length = sp->width * 4; in s3d_pci_register()
183 sp->fb_size = info->fix.line_length * sp->height; in s3d_pci_register()
185 sp->fb_base = ioremap(sp->fb_base_phys, sp->fb_size); in s3d_pci_register()
186 if (!sp->fb_base) { in s3d_pci_register()
191 err = s3d_set_fbinfo(sp); in s3d_pci_register()
209 iounmap(sp->fb_base); in s3d_pci_register()