Lines Matching refs:sfb

904 	struct smtcfb_info *sfb;  in smtc_setcolreg()  local
907 sfb = info->par; in smtc_setcolreg()
912 switch (sfb->fb->fix.visual) { in smtc_setcolreg()
920 if (sfb->fb->var.bits_per_pixel == 16) { in smtc_setcolreg()
921 u32 *pal = sfb->fb->pseudo_palette; in smtc_setcolreg()
923 val = chan_to_field(red, &sfb->fb->var.red); in smtc_setcolreg()
924 val |= chan_to_field(green, &sfb->fb->var.green); in smtc_setcolreg()
925 val |= chan_to_field(blue, &sfb->fb->var.blue); in smtc_setcolreg()
928 u32 *pal = sfb->fb->pseudo_palette; in smtc_setcolreg()
930 val = chan_to_field(red, &sfb->fb->var.red); in smtc_setcolreg()
931 val |= chan_to_field(green, &sfb->fb->var.green); in smtc_setcolreg()
932 val |= chan_to_field(blue, &sfb->fb->var.blue); in smtc_setcolreg()
1110 static void sm7xx_set_timing(struct smtcfb_info *sfb) in sm7xx_set_timing() argument
1115 dev_dbg(&sfb->pdev->dev, in sm7xx_set_timing()
1117 sfb->width, sfb->height, sfb->fb->var.bits_per_pixel, sfb->hz); in sm7xx_set_timing()
1120 if (vgamode[j].mmsizex != sfb->width || in sm7xx_set_timing()
1121 vgamode[j].mmsizey != sfb->height || in sm7xx_set_timing()
1122 vgamode[j].bpp != sfb->fb->var.bits_per_pixel || in sm7xx_set_timing()
1123 vgamode[j].hz != sfb->hz) in sm7xx_set_timing()
1126 dev_dbg(&sfb->pdev->dev, in sm7xx_set_timing()
1131 dev_dbg(&sfb->pdev->dev, "vgamode index=%d\n", j); in sm7xx_set_timing()
1185 writel(0x0, sfb->vp_regs + 0x0C); in sm7xx_set_timing()
1186 writel(0x0, sfb->vp_regs + 0x40); in sm7xx_set_timing()
1189 m_nscreenstride = (sfb->width * sfb->fb->var.bits_per_pixel) / 64; in sm7xx_set_timing()
1190 switch (sfb->fb->var.bits_per_pixel) { in sm7xx_set_timing()
1192 writel(0x0, sfb->vp_regs + 0x0); in sm7xx_set_timing()
1195 writel(0x00020000, sfb->vp_regs + 0x0); in sm7xx_set_timing()
1198 writel(0x00040000, sfb->vp_regs + 0x0); in sm7xx_set_timing()
1201 writel(0x00030000, sfb->vp_regs + 0x0); in sm7xx_set_timing()
1205 sfb->vp_regs + 0x10); in sm7xx_set_timing()
1208 static void smtc_set_timing(struct smtcfb_info *sfb) in smtc_set_timing() argument
1210 switch (sfb->chip_id) { in smtc_set_timing()
1214 sm7xx_set_timing(sfb); in smtc_set_timing()
1219 static void smtcfb_setmode(struct smtcfb_info *sfb) in smtcfb_setmode() argument
1221 switch (sfb->fb->var.bits_per_pixel) { in smtcfb_setmode()
1223 sfb->fb->fix.visual = FB_VISUAL_TRUECOLOR; in smtcfb_setmode()
1224 sfb->fb->fix.line_length = sfb->fb->var.xres * 4; in smtcfb_setmode()
1225 sfb->fb->var.red.length = 8; in smtcfb_setmode()
1226 sfb->fb->var.green.length = 8; in smtcfb_setmode()
1227 sfb->fb->var.blue.length = 8; in smtcfb_setmode()
1228 sfb->fb->var.red.offset = 16; in smtcfb_setmode()
1229 sfb->fb->var.green.offset = 8; in smtcfb_setmode()
1230 sfb->fb->var.blue.offset = 0; in smtcfb_setmode()
1233 sfb->fb->fix.visual = FB_VISUAL_TRUECOLOR; in smtcfb_setmode()
1234 sfb->fb->fix.line_length = sfb->fb->var.xres * 3; in smtcfb_setmode()
1235 sfb->fb->var.red.length = 8; in smtcfb_setmode()
1236 sfb->fb->var.green.length = 8; in smtcfb_setmode()
1237 sfb->fb->var.blue.length = 8; in smtcfb_setmode()
1238 sfb->fb->var.red.offset = 16; in smtcfb_setmode()
1239 sfb->fb->var.green.offset = 8; in smtcfb_setmode()
1240 sfb->fb->var.blue.offset = 0; in smtcfb_setmode()
1243 sfb->fb->fix.visual = FB_VISUAL_PSEUDOCOLOR; in smtcfb_setmode()
1244 sfb->fb->fix.line_length = sfb->fb->var.xres; in smtcfb_setmode()
1245 sfb->fb->var.red.length = 3; in smtcfb_setmode()
1246 sfb->fb->var.green.length = 3; in smtcfb_setmode()
1247 sfb->fb->var.blue.length = 2; in smtcfb_setmode()
1248 sfb->fb->var.red.offset = 5; in smtcfb_setmode()
1249 sfb->fb->var.green.offset = 2; in smtcfb_setmode()
1250 sfb->fb->var.blue.offset = 0; in smtcfb_setmode()
1254 sfb->fb->fix.visual = FB_VISUAL_TRUECOLOR; in smtcfb_setmode()
1255 sfb->fb->fix.line_length = sfb->fb->var.xres * 2; in smtcfb_setmode()
1256 sfb->fb->var.red.length = 5; in smtcfb_setmode()
1257 sfb->fb->var.green.length = 6; in smtcfb_setmode()
1258 sfb->fb->var.blue.length = 5; in smtcfb_setmode()
1259 sfb->fb->var.red.offset = 11; in smtcfb_setmode()
1260 sfb->fb->var.green.offset = 5; in smtcfb_setmode()
1261 sfb->fb->var.blue.offset = 0; in smtcfb_setmode()
1265 sfb->width = sfb->fb->var.xres; in smtcfb_setmode()
1266 sfb->height = sfb->fb->var.yres; in smtcfb_setmode()
1267 sfb->hz = 60; in smtcfb_setmode()
1268 smtc_set_timing(sfb); in smtcfb_setmode()
1312 static void smtc_unmap_mmio(struct smtcfb_info *sfb) in smtc_unmap_mmio() argument
1314 if (sfb && smtc_regbaseaddress) in smtc_unmap_mmio()
1322 static int smtc_map_smem(struct smtcfb_info *sfb, in smtc_map_smem() argument
1325 sfb->fb->fix.smem_start = pci_resource_start(pdev, 0); in smtc_map_smem()
1327 if (sfb->fb->var.bits_per_pixel == 32) in smtc_map_smem()
1328 sfb->fb->fix.smem_start += big_addr; in smtc_map_smem()
1330 sfb->fb->fix.smem_len = smem_len; in smtc_map_smem()
1332 sfb->fb->screen_base = sfb->lfb; in smtc_map_smem()
1334 if (!sfb->fb->screen_base) { in smtc_map_smem()
1336 "%s: unable to map screen memory\n", sfb->fb->fix.id); in smtc_map_smem()
1347 static void smtc_unmap_smem(struct smtcfb_info *sfb) in smtc_unmap_smem() argument
1349 if (sfb && sfb->fb->screen_base) { in smtc_unmap_smem()
1350 iounmap(sfb->fb->screen_base); in smtc_unmap_smem()
1351 sfb->fb->screen_base = NULL; in smtc_unmap_smem()
1367 struct smtcfb_info *sfb; in smtcfb_pci_probe() local
1387 info = framebuffer_alloc(sizeof(*sfb), &pdev->dev); in smtcfb_pci_probe()
1394 sfb = info->par; in smtcfb_pci_probe()
1395 sfb->fb = info; in smtcfb_pci_probe()
1396 sfb->chip_id = ent->device; in smtcfb_pci_probe()
1397 sfb->pdev = pdev; in smtcfb_pci_probe()
1402 info->pseudo_palette = sfb->colreg; in smtcfb_pci_probe()
1403 info->par = sfb; in smtcfb_pci_probe()
1405 pci_set_drvdata(pdev, sfb); in smtcfb_pci_probe()
1411 sfb->fb->var.xres = smtc_scr_info.lfb_width; in smtcfb_pci_probe()
1412 sfb->fb->var.yres = smtc_scr_info.lfb_height; in smtcfb_pci_probe()
1413 sfb->fb->var.bits_per_pixel = smtc_scr_info.lfb_depth; in smtcfb_pci_probe()
1416 sfb->fb->var.xres = SCREEN_X_RES; in smtcfb_pci_probe()
1417 sfb->fb->var.yres = SCREEN_Y_RES; in smtcfb_pci_probe()
1418 sfb->fb->var.bits_per_pixel = SCREEN_BPP; in smtcfb_pci_probe()
1421 big_pixel_depth(sfb->fb->var.bits_per_pixel, smtc_scr_info.lfb_depth); in smtcfb_pci_probe()
1424 pci_read_config_byte(pdev, PCI_REVISION_ID, &sfb->chip_rev_id); in smtcfb_pci_probe()
1426 switch (sfb->chip_id) { in smtcfb_pci_probe()
1429 sfb->fb->fix.mmio_start = mmio_base + 0x00400000; in smtcfb_pci_probe()
1430 sfb->fb->fix.mmio_len = 0x00400000; in smtcfb_pci_probe()
1432 sfb->lfb = ioremap(mmio_base, mmio_addr); in smtcfb_pci_probe()
1433 if (!sfb->lfb) { in smtcfb_pci_probe()
1436 sfb->fb->fix.id); in smtcfb_pci_probe()
1441 sfb->mmio = (smtc_regbaseaddress = in smtcfb_pci_probe()
1442 sfb->lfb + 0x00700000); in smtcfb_pci_probe()
1443 sfb->dp_regs = sfb->lfb + 0x00408000; in smtcfb_pci_probe()
1444 sfb->vp_regs = sfb->lfb + 0x0040c000; in smtcfb_pci_probe()
1445 if (sfb->fb->var.bits_per_pixel == 32) { in smtcfb_pci_probe()
1446 sfb->lfb += big_addr; in smtcfb_pci_probe()
1447 dev_info(&pdev->dev, "sfb->lfb=%p\n", sfb->lfb); in smtcfb_pci_probe()
1457 if (sfb->fb->var.bits_per_pixel == 32) in smtcfb_pci_probe()
1461 sfb->fb->fix.mmio_start = mmio_base; in smtcfb_pci_probe()
1462 sfb->fb->fix.mmio_len = 0x00200000; in smtcfb_pci_probe()
1464 sfb->dp_regs = ioremap(mmio_base, 0x00a00000); in smtcfb_pci_probe()
1465 sfb->lfb = sfb->dp_regs + 0x00200000; in smtcfb_pci_probe()
1466 sfb->mmio = (smtc_regbaseaddress = in smtcfb_pci_probe()
1467 sfb->dp_regs + 0x000c0000); in smtcfb_pci_probe()
1468 sfb->vp_regs = sfb->dp_regs + 0x800; in smtcfb_pci_probe()
1482 if (15 == sfb->fb->var.bits_per_pixel) in smtcfb_pci_probe()
1483 sfb->fb->var.bits_per_pixel = 16; in smtcfb_pci_probe()
1485 sfb->fb->var.xres_virtual = sfb->fb->var.xres; in smtcfb_pci_probe()
1486 sfb->fb->var.yres_virtual = sfb->fb->var.yres; in smtcfb_pci_probe()
1487 err = smtc_map_smem(sfb, pdev, smem_size); in smtcfb_pci_probe()
1491 smtcfb_setmode(sfb); in smtcfb_pci_probe()
1499 sfb->chip_id, sfb->chip_rev_id, sfb->fb->var.xres, in smtcfb_pci_probe()
1500 sfb->fb->var.yres, sfb->fb->var.bits_per_pixel); in smtcfb_pci_probe()
1507 smtc_unmap_smem(sfb); in smtcfb_pci_probe()
1508 smtc_unmap_mmio(sfb); in smtcfb_pci_probe()
1537 struct smtcfb_info *sfb; in smtcfb_pci_remove() local
1539 sfb = pci_get_drvdata(pdev); in smtcfb_pci_remove()
1540 smtc_unmap_smem(sfb); in smtcfb_pci_remove()
1541 smtc_unmap_mmio(sfb); in smtcfb_pci_remove()
1542 unregister_framebuffer(sfb->fb); in smtcfb_pci_remove()
1543 framebuffer_release(sfb->fb); in smtcfb_pci_remove()
1552 struct smtcfb_info *sfb; in smtcfb_pci_suspend() local
1554 sfb = pci_get_drvdata(pdev); in smtcfb_pci_suspend()
1563 fb_set_suspend(sfb->fb, 1); in smtcfb_pci_suspend()
1575 struct smtcfb_info *sfb; in smtcfb_pci_resume() local
1577 sfb = pci_get_drvdata(pdev); in smtcfb_pci_resume()
1581 switch (sfb->chip_id) { in smtcfb_pci_resume()
1590 if (sfb->fb->var.bits_per_pixel == 32) in smtcfb_pci_resume()
1603 smtcfb_setmode(sfb); in smtcfb_pci_resume()
1606 fb_set_suspend(sfb->fb, 0); in smtcfb_pci_resume()