Lines Matching refs:sfb

903 	struct smtcfb_info *sfb;  in smtc_setcolreg()  local
906 sfb = info->par; in smtc_setcolreg()
911 switch (sfb->fb->fix.visual) { in smtc_setcolreg()
919 if (sfb->fb->var.bits_per_pixel == 16) { in smtc_setcolreg()
920 u32 *pal = sfb->fb->pseudo_palette; in smtc_setcolreg()
922 val = chan_to_field(red, &sfb->fb->var.red); in smtc_setcolreg()
923 val |= chan_to_field(green, &sfb->fb->var.green); in smtc_setcolreg()
924 val |= chan_to_field(blue, &sfb->fb->var.blue); in smtc_setcolreg()
927 u32 *pal = sfb->fb->pseudo_palette; in smtc_setcolreg()
929 val = chan_to_field(red, &sfb->fb->var.red); in smtc_setcolreg()
930 val |= chan_to_field(green, &sfb->fb->var.green); in smtc_setcolreg()
931 val |= chan_to_field(blue, &sfb->fb->var.blue); in smtc_setcolreg()
1109 static void sm7xx_set_timing(struct smtcfb_info *sfb) in sm7xx_set_timing() argument
1114 dev_dbg(&sfb->pdev->dev, in sm7xx_set_timing()
1116 sfb->width, sfb->height, sfb->fb->var.bits_per_pixel, sfb->hz); in sm7xx_set_timing()
1119 if (vgamode[j].mmsizex != sfb->width || in sm7xx_set_timing()
1120 vgamode[j].mmsizey != sfb->height || in sm7xx_set_timing()
1121 vgamode[j].bpp != sfb->fb->var.bits_per_pixel || in sm7xx_set_timing()
1122 vgamode[j].hz != sfb->hz) in sm7xx_set_timing()
1125 dev_dbg(&sfb->pdev->dev, in sm7xx_set_timing()
1130 dev_dbg(&sfb->pdev->dev, "vgamode index=%d\n", j); in sm7xx_set_timing()
1184 writel(0x0, sfb->vp_regs + 0x0C); in sm7xx_set_timing()
1185 writel(0x0, sfb->vp_regs + 0x40); in sm7xx_set_timing()
1188 m_nscreenstride = (sfb->width * sfb->fb->var.bits_per_pixel) / 64; in sm7xx_set_timing()
1189 switch (sfb->fb->var.bits_per_pixel) { in sm7xx_set_timing()
1191 writel(0x0, sfb->vp_regs + 0x0); in sm7xx_set_timing()
1194 writel(0x00020000, sfb->vp_regs + 0x0); in sm7xx_set_timing()
1197 writel(0x00040000, sfb->vp_regs + 0x0); in sm7xx_set_timing()
1200 writel(0x00030000, sfb->vp_regs + 0x0); in sm7xx_set_timing()
1204 sfb->vp_regs + 0x10); in sm7xx_set_timing()
1207 static void smtc_set_timing(struct smtcfb_info *sfb) in smtc_set_timing() argument
1209 switch (sfb->chip_id) { in smtc_set_timing()
1213 sm7xx_set_timing(sfb); in smtc_set_timing()
1218 static void smtcfb_setmode(struct smtcfb_info *sfb) in smtcfb_setmode() argument
1220 switch (sfb->fb->var.bits_per_pixel) { in smtcfb_setmode()
1222 sfb->fb->fix.visual = FB_VISUAL_TRUECOLOR; in smtcfb_setmode()
1223 sfb->fb->fix.line_length = sfb->fb->var.xres * 4; in smtcfb_setmode()
1224 sfb->fb->var.red.length = 8; in smtcfb_setmode()
1225 sfb->fb->var.green.length = 8; in smtcfb_setmode()
1226 sfb->fb->var.blue.length = 8; in smtcfb_setmode()
1227 sfb->fb->var.red.offset = 16; in smtcfb_setmode()
1228 sfb->fb->var.green.offset = 8; in smtcfb_setmode()
1229 sfb->fb->var.blue.offset = 0; in smtcfb_setmode()
1232 sfb->fb->fix.visual = FB_VISUAL_TRUECOLOR; in smtcfb_setmode()
1233 sfb->fb->fix.line_length = sfb->fb->var.xres * 3; in smtcfb_setmode()
1234 sfb->fb->var.red.length = 8; in smtcfb_setmode()
1235 sfb->fb->var.green.length = 8; in smtcfb_setmode()
1236 sfb->fb->var.blue.length = 8; in smtcfb_setmode()
1237 sfb->fb->var.red.offset = 16; in smtcfb_setmode()
1238 sfb->fb->var.green.offset = 8; in smtcfb_setmode()
1239 sfb->fb->var.blue.offset = 0; in smtcfb_setmode()
1242 sfb->fb->fix.visual = FB_VISUAL_PSEUDOCOLOR; in smtcfb_setmode()
1243 sfb->fb->fix.line_length = sfb->fb->var.xres; in smtcfb_setmode()
1244 sfb->fb->var.red.length = 3; in smtcfb_setmode()
1245 sfb->fb->var.green.length = 3; in smtcfb_setmode()
1246 sfb->fb->var.blue.length = 2; in smtcfb_setmode()
1247 sfb->fb->var.red.offset = 5; in smtcfb_setmode()
1248 sfb->fb->var.green.offset = 2; in smtcfb_setmode()
1249 sfb->fb->var.blue.offset = 0; in smtcfb_setmode()
1253 sfb->fb->fix.visual = FB_VISUAL_TRUECOLOR; in smtcfb_setmode()
1254 sfb->fb->fix.line_length = sfb->fb->var.xres * 2; in smtcfb_setmode()
1255 sfb->fb->var.red.length = 5; in smtcfb_setmode()
1256 sfb->fb->var.green.length = 6; in smtcfb_setmode()
1257 sfb->fb->var.blue.length = 5; in smtcfb_setmode()
1258 sfb->fb->var.red.offset = 11; in smtcfb_setmode()
1259 sfb->fb->var.green.offset = 5; in smtcfb_setmode()
1260 sfb->fb->var.blue.offset = 0; in smtcfb_setmode()
1264 sfb->width = sfb->fb->var.xres; in smtcfb_setmode()
1265 sfb->height = sfb->fb->var.yres; in smtcfb_setmode()
1266 sfb->hz = 60; in smtcfb_setmode()
1267 smtc_set_timing(sfb); in smtcfb_setmode()
1311 static void smtc_unmap_mmio(struct smtcfb_info *sfb) in smtc_unmap_mmio() argument
1313 if (sfb && smtc_regbaseaddress) in smtc_unmap_mmio()
1321 static int smtc_map_smem(struct smtcfb_info *sfb, in smtc_map_smem() argument
1324 sfb->fb->fix.smem_start = pci_resource_start(pdev, 0); in smtc_map_smem()
1326 if (sfb->fb->var.bits_per_pixel == 32) in smtc_map_smem()
1327 sfb->fb->fix.smem_start += big_addr; in smtc_map_smem()
1329 sfb->fb->fix.smem_len = smem_len; in smtc_map_smem()
1331 sfb->fb->screen_base = sfb->lfb; in smtc_map_smem()
1333 if (!sfb->fb->screen_base) { in smtc_map_smem()
1335 "%s: unable to map screen memory\n", sfb->fb->fix.id); in smtc_map_smem()
1346 static void smtc_unmap_smem(struct smtcfb_info *sfb) in smtc_unmap_smem() argument
1348 if (sfb && sfb->fb->screen_base) { in smtc_unmap_smem()
1349 iounmap(sfb->fb->screen_base); in smtc_unmap_smem()
1350 sfb->fb->screen_base = NULL; in smtc_unmap_smem()
1366 struct smtcfb_info *sfb; in smtcfb_pci_probe() local
1386 info = framebuffer_alloc(sizeof(*sfb), &pdev->dev); in smtcfb_pci_probe()
1393 sfb = info->par; in smtcfb_pci_probe()
1394 sfb->fb = info; in smtcfb_pci_probe()
1395 sfb->chip_id = ent->device; in smtcfb_pci_probe()
1396 sfb->pdev = pdev; in smtcfb_pci_probe()
1401 info->pseudo_palette = sfb->colreg; in smtcfb_pci_probe()
1402 info->par = sfb; in smtcfb_pci_probe()
1404 pci_set_drvdata(pdev, sfb); in smtcfb_pci_probe()
1410 sfb->fb->var.xres = smtc_scr_info.lfb_width; in smtcfb_pci_probe()
1411 sfb->fb->var.yres = smtc_scr_info.lfb_height; in smtcfb_pci_probe()
1412 sfb->fb->var.bits_per_pixel = smtc_scr_info.lfb_depth; in smtcfb_pci_probe()
1415 sfb->fb->var.xres = SCREEN_X_RES; in smtcfb_pci_probe()
1416 sfb->fb->var.yres = SCREEN_Y_RES; in smtcfb_pci_probe()
1417 sfb->fb->var.bits_per_pixel = SCREEN_BPP; in smtcfb_pci_probe()
1420 big_pixel_depth(sfb->fb->var.bits_per_pixel, smtc_scr_info.lfb_depth); in smtcfb_pci_probe()
1423 pci_read_config_byte(pdev, PCI_REVISION_ID, &sfb->chip_rev_id); in smtcfb_pci_probe()
1425 switch (sfb->chip_id) { in smtcfb_pci_probe()
1428 sfb->fb->fix.mmio_start = mmio_base + 0x00400000; in smtcfb_pci_probe()
1429 sfb->fb->fix.mmio_len = 0x00400000; in smtcfb_pci_probe()
1431 sfb->lfb = ioremap(mmio_base, mmio_addr); in smtcfb_pci_probe()
1432 if (!sfb->lfb) { in smtcfb_pci_probe()
1435 sfb->fb->fix.id); in smtcfb_pci_probe()
1440 sfb->mmio = (smtc_regbaseaddress = in smtcfb_pci_probe()
1441 sfb->lfb + 0x00700000); in smtcfb_pci_probe()
1442 sfb->dp_regs = sfb->lfb + 0x00408000; in smtcfb_pci_probe()
1443 sfb->vp_regs = sfb->lfb + 0x0040c000; in smtcfb_pci_probe()
1444 if (sfb->fb->var.bits_per_pixel == 32) { in smtcfb_pci_probe()
1445 sfb->lfb += big_addr; in smtcfb_pci_probe()
1446 dev_info(&pdev->dev, "sfb->lfb=%p\n", sfb->lfb); in smtcfb_pci_probe()
1456 if (sfb->fb->var.bits_per_pixel == 32) in smtcfb_pci_probe()
1460 sfb->fb->fix.mmio_start = mmio_base; in smtcfb_pci_probe()
1461 sfb->fb->fix.mmio_len = 0x00200000; in smtcfb_pci_probe()
1463 sfb->dp_regs = ioremap(mmio_base, 0x00a00000); in smtcfb_pci_probe()
1464 sfb->lfb = sfb->dp_regs + 0x00200000; in smtcfb_pci_probe()
1465 sfb->mmio = (smtc_regbaseaddress = in smtcfb_pci_probe()
1466 sfb->dp_regs + 0x000c0000); in smtcfb_pci_probe()
1467 sfb->vp_regs = sfb->dp_regs + 0x800; in smtcfb_pci_probe()
1481 if (sfb->fb->var.bits_per_pixel == 15) in smtcfb_pci_probe()
1482 sfb->fb->var.bits_per_pixel = 16; in smtcfb_pci_probe()
1484 sfb->fb->var.xres_virtual = sfb->fb->var.xres; in smtcfb_pci_probe()
1485 sfb->fb->var.yres_virtual = sfb->fb->var.yres; in smtcfb_pci_probe()
1486 err = smtc_map_smem(sfb, pdev, smem_size); in smtcfb_pci_probe()
1490 smtcfb_setmode(sfb); in smtcfb_pci_probe()
1498 sfb->chip_id, sfb->chip_rev_id, sfb->fb->var.xres, in smtcfb_pci_probe()
1499 sfb->fb->var.yres, sfb->fb->var.bits_per_pixel); in smtcfb_pci_probe()
1506 smtc_unmap_smem(sfb); in smtcfb_pci_probe()
1507 smtc_unmap_mmio(sfb); in smtcfb_pci_probe()
1536 struct smtcfb_info *sfb; in smtcfb_pci_remove() local
1538 sfb = pci_get_drvdata(pdev); in smtcfb_pci_remove()
1539 smtc_unmap_smem(sfb); in smtcfb_pci_remove()
1540 smtc_unmap_mmio(sfb); in smtcfb_pci_remove()
1541 unregister_framebuffer(sfb->fb); in smtcfb_pci_remove()
1542 framebuffer_release(sfb->fb); in smtcfb_pci_remove()
1550 struct smtcfb_info *sfb; in smtcfb_pci_suspend() local
1552 sfb = pci_get_drvdata(pdev); in smtcfb_pci_suspend()
1561 fb_set_suspend(sfb->fb, 1); in smtcfb_pci_suspend()
1573 struct smtcfb_info *sfb; in smtcfb_pci_resume() local
1575 sfb = pci_get_drvdata(pdev); in smtcfb_pci_resume()
1579 switch (sfb->chip_id) { in smtcfb_pci_resume()
1588 if (sfb->fb->var.bits_per_pixel == 32) in smtcfb_pci_resume()
1601 smtcfb_setmode(sfb); in smtcfb_pci_resume()
1604 fb_set_suspend(sfb->fb, 0); in smtcfb_pci_resume()