Lines Matching refs:sfb
890 struct smtcfb_info *sfb = info->par; in smtc_blank() local
897 switch (sfb->chip_id) { in smtc_blank()
976 struct smtcfb_info *sfb; in smtc_setcolreg() local
979 sfb = info->par; in smtc_setcolreg()
984 switch (sfb->fb->fix.visual) { in smtc_setcolreg()
992 if (sfb->fb->var.bits_per_pixel == 16) { in smtc_setcolreg()
993 u32 *pal = sfb->fb->pseudo_palette; in smtc_setcolreg()
995 val = chan_to_field(red, &sfb->fb->var.red); in smtc_setcolreg()
996 val |= chan_to_field(green, &sfb->fb->var.green); in smtc_setcolreg()
997 val |= chan_to_field(blue, &sfb->fb->var.blue); in smtc_setcolreg()
1000 u32 *pal = sfb->fb->pseudo_palette; in smtc_setcolreg()
1002 val = chan_to_field(red, &sfb->fb->var.red); in smtc_setcolreg()
1003 val |= chan_to_field(green, &sfb->fb->var.green); in smtc_setcolreg()
1004 val |= chan_to_field(blue, &sfb->fb->var.blue); in smtc_setcolreg()
1158 static void sm7xx_set_timing(struct smtcfb_info *sfb) in sm7xx_set_timing() argument
1163 dev_dbg(&sfb->pdev->dev, in sm7xx_set_timing()
1165 sfb->width, sfb->height, sfb->fb->var.bits_per_pixel, sfb->hz); in sm7xx_set_timing()
1168 if (vgamode[j].mmsizex != sfb->width || in sm7xx_set_timing()
1169 vgamode[j].mmsizey != sfb->height || in sm7xx_set_timing()
1170 vgamode[j].bpp != sfb->fb->var.bits_per_pixel || in sm7xx_set_timing()
1171 vgamode[j].hz != sfb->hz) in sm7xx_set_timing()
1174 dev_dbg(&sfb->pdev->dev, in sm7xx_set_timing()
1179 dev_dbg(&sfb->pdev->dev, "vgamode index=%d\n", j); in sm7xx_set_timing()
1239 writel(0x0, sfb->vp_regs + 0x0C); in sm7xx_set_timing()
1240 writel(0x0, sfb->vp_regs + 0x40); in sm7xx_set_timing()
1243 m_nscreenstride = (sfb->width * sfb->fb->var.bits_per_pixel) / 64; in sm7xx_set_timing()
1244 switch (sfb->fb->var.bits_per_pixel) { in sm7xx_set_timing()
1246 writel(0x0, sfb->vp_regs + 0x0); in sm7xx_set_timing()
1249 writel(0x00020000, sfb->vp_regs + 0x0); in sm7xx_set_timing()
1252 writel(0x00040000, sfb->vp_regs + 0x0); in sm7xx_set_timing()
1255 writel(0x00030000, sfb->vp_regs + 0x0); in sm7xx_set_timing()
1259 sfb->vp_regs + 0x10); in sm7xx_set_timing()
1262 static void smtc_set_timing(struct smtcfb_info *sfb) in smtc_set_timing() argument
1264 switch (sfb->chip_id) { in smtc_set_timing()
1268 sm7xx_set_timing(sfb); in smtc_set_timing()
1273 static void smtcfb_setmode(struct smtcfb_info *sfb) in smtcfb_setmode() argument
1275 switch (sfb->fb->var.bits_per_pixel) { in smtcfb_setmode()
1277 sfb->fb->fix.visual = FB_VISUAL_TRUECOLOR; in smtcfb_setmode()
1278 sfb->fb->fix.line_length = sfb->fb->var.xres * 4; in smtcfb_setmode()
1279 sfb->fb->var.red.length = 8; in smtcfb_setmode()
1280 sfb->fb->var.green.length = 8; in smtcfb_setmode()
1281 sfb->fb->var.blue.length = 8; in smtcfb_setmode()
1282 sfb->fb->var.red.offset = 16; in smtcfb_setmode()
1283 sfb->fb->var.green.offset = 8; in smtcfb_setmode()
1284 sfb->fb->var.blue.offset = 0; in smtcfb_setmode()
1287 sfb->fb->fix.visual = FB_VISUAL_TRUECOLOR; in smtcfb_setmode()
1288 sfb->fb->fix.line_length = sfb->fb->var.xres * 3; in smtcfb_setmode()
1289 sfb->fb->var.red.length = 8; in smtcfb_setmode()
1290 sfb->fb->var.green.length = 8; in smtcfb_setmode()
1291 sfb->fb->var.blue.length = 8; in smtcfb_setmode()
1292 sfb->fb->var.red.offset = 16; in smtcfb_setmode()
1293 sfb->fb->var.green.offset = 8; in smtcfb_setmode()
1294 sfb->fb->var.blue.offset = 0; in smtcfb_setmode()
1297 sfb->fb->fix.visual = FB_VISUAL_PSEUDOCOLOR; in smtcfb_setmode()
1298 sfb->fb->fix.line_length = sfb->fb->var.xres; in smtcfb_setmode()
1299 sfb->fb->var.red.length = 3; in smtcfb_setmode()
1300 sfb->fb->var.green.length = 3; in smtcfb_setmode()
1301 sfb->fb->var.blue.length = 2; in smtcfb_setmode()
1302 sfb->fb->var.red.offset = 5; in smtcfb_setmode()
1303 sfb->fb->var.green.offset = 2; in smtcfb_setmode()
1304 sfb->fb->var.blue.offset = 0; in smtcfb_setmode()
1308 sfb->fb->fix.visual = FB_VISUAL_TRUECOLOR; in smtcfb_setmode()
1309 sfb->fb->fix.line_length = sfb->fb->var.xres * 2; in smtcfb_setmode()
1310 sfb->fb->var.red.length = 5; in smtcfb_setmode()
1311 sfb->fb->var.green.length = 6; in smtcfb_setmode()
1312 sfb->fb->var.blue.length = 5; in smtcfb_setmode()
1313 sfb->fb->var.red.offset = 11; in smtcfb_setmode()
1314 sfb->fb->var.green.offset = 5; in smtcfb_setmode()
1315 sfb->fb->var.blue.offset = 0; in smtcfb_setmode()
1319 sfb->width = sfb->fb->var.xres; in smtcfb_setmode()
1320 sfb->height = sfb->fb->var.yres; in smtcfb_setmode()
1321 sfb->hz = 60; in smtcfb_setmode()
1322 smtc_set_timing(sfb); in smtcfb_setmode()
1366 static void smtc_unmap_mmio(struct smtcfb_info *sfb) in smtc_unmap_mmio() argument
1368 if (sfb && smtc_regbaseaddress) in smtc_unmap_mmio()
1376 static int smtc_map_smem(struct smtcfb_info *sfb, in smtc_map_smem() argument
1379 sfb->fb->fix.smem_start = pci_resource_start(pdev, 0); in smtc_map_smem()
1381 if (sfb->chip_id == 0x720) in smtc_map_smem()
1383 sfb->fb->fix.smem_start += 0x00200000; in smtc_map_smem()
1386 if (sfb->fb->var.bits_per_pixel == 32) in smtc_map_smem()
1387 sfb->fb->fix.smem_start += big_addr; in smtc_map_smem()
1389 sfb->fb->fix.smem_len = smem_len; in smtc_map_smem()
1391 sfb->fb->screen_base = sfb->lfb; in smtc_map_smem()
1393 if (!sfb->fb->screen_base) { in smtc_map_smem()
1395 "%s: unable to map screen memory\n", sfb->fb->fix.id); in smtc_map_smem()
1406 static void smtc_unmap_smem(struct smtcfb_info *sfb) in smtc_unmap_smem() argument
1408 if (sfb && sfb->fb->screen_base) { in smtc_unmap_smem()
1409 if (sfb->chip_id == 0x720) in smtc_unmap_smem()
1410 sfb->fb->screen_base -= 0x00200000; in smtc_unmap_smem()
1411 iounmap(sfb->fb->screen_base); in smtc_unmap_smem()
1412 sfb->fb->screen_base = NULL; in smtc_unmap_smem()
1425 static u_long sm7xx_vram_probe(struct smtcfb_info *sfb) in sm7xx_vram_probe() argument
1429 switch (sfb->chip_id) { in sm7xx_vram_probe()
1458 static void sm7xx_resolution_probe(struct smtcfb_info *sfb) in sm7xx_resolution_probe() argument
1462 sfb->fb->var.xres = smtc_scr_info.lfb_width; in sm7xx_resolution_probe()
1463 sfb->fb->var.yres = smtc_scr_info.lfb_height; in sm7xx_resolution_probe()
1464 sfb->fb->var.bits_per_pixel = smtc_scr_info.lfb_depth; in sm7xx_resolution_probe()
1474 sfb->fb->var.xres = SCREEN_X_RES; in sm7xx_resolution_probe()
1475 sfb->fb->var.yres = SCREEN_Y_RES_PC; in sm7xx_resolution_probe()
1476 sfb->fb->var.bits_per_pixel = SCREEN_BPP; in sm7xx_resolution_probe()
1488 sfb->fb->var.yres = SCREEN_Y_RES_NETBOOK; in sm7xx_resolution_probe()
1492 big_pixel_depth(sfb->fb->var.bits_per_pixel, smtc_scr_info.lfb_depth); in sm7xx_resolution_probe()
1498 struct smtcfb_info *sfb; in smtcfb_pci_probe() local
1522 info = framebuffer_alloc(sizeof(*sfb), &pdev->dev); in smtcfb_pci_probe()
1528 sfb = info->par; in smtcfb_pci_probe()
1529 sfb->fb = info; in smtcfb_pci_probe()
1530 sfb->chip_id = ent->device; in smtcfb_pci_probe()
1531 sfb->pdev = pdev; in smtcfb_pci_probe()
1536 info->pseudo_palette = sfb->colreg; in smtcfb_pci_probe()
1537 info->par = sfb; in smtcfb_pci_probe()
1539 pci_set_drvdata(pdev, sfb); in smtcfb_pci_probe()
1545 pci_read_config_byte(pdev, PCI_REVISION_ID, &sfb->chip_rev_id); in smtcfb_pci_probe()
1547 smem_size = sm7xx_vram_probe(sfb); in smtcfb_pci_probe()
1551 switch (sfb->chip_id) { in smtcfb_pci_probe()
1554 sfb->fb->fix.mmio_start = mmio_base + 0x00400000; in smtcfb_pci_probe()
1555 sfb->fb->fix.mmio_len = 0x00400000; in smtcfb_pci_probe()
1556 sfb->lfb = ioremap(mmio_base, mmio_addr); in smtcfb_pci_probe()
1557 if (!sfb->lfb) { in smtcfb_pci_probe()
1560 sfb->fb->fix.id); in smtcfb_pci_probe()
1565 sfb->mmio = (smtc_regbaseaddress = in smtcfb_pci_probe()
1566 sfb->lfb + 0x00700000); in smtcfb_pci_probe()
1567 sfb->dp_regs = sfb->lfb + 0x00408000; in smtcfb_pci_probe()
1568 sfb->vp_regs = sfb->lfb + 0x0040c000; in smtcfb_pci_probe()
1569 if (sfb->fb->var.bits_per_pixel == 32) { in smtcfb_pci_probe()
1570 sfb->lfb += big_addr; in smtcfb_pci_probe()
1571 dev_info(&pdev->dev, "sfb->lfb=%p\n", sfb->lfb); in smtcfb_pci_probe()
1581 if (sfb->fb->var.bits_per_pixel == 32) in smtcfb_pci_probe()
1585 sfb->fb->fix.mmio_start = mmio_base; in smtcfb_pci_probe()
1586 sfb->fb->fix.mmio_len = 0x00200000; in smtcfb_pci_probe()
1587 sfb->dp_regs = ioremap(mmio_base, 0x00200000 + smem_size); in smtcfb_pci_probe()
1588 if (!sfb->dp_regs) { in smtcfb_pci_probe()
1591 sfb->fb->fix.id); in smtcfb_pci_probe()
1596 sfb->lfb = sfb->dp_regs + 0x00200000; in smtcfb_pci_probe()
1597 sfb->mmio = (smtc_regbaseaddress = in smtcfb_pci_probe()
1598 sfb->dp_regs + 0x000c0000); in smtcfb_pci_probe()
1599 sfb->vp_regs = sfb->dp_regs + 0x800; in smtcfb_pci_probe()
1613 sm7xx_resolution_probe(sfb); in smtcfb_pci_probe()
1616 if (sfb->fb->var.bits_per_pixel == 15) in smtcfb_pci_probe()
1617 sfb->fb->var.bits_per_pixel = 16; in smtcfb_pci_probe()
1619 sfb->fb->var.xres_virtual = sfb->fb->var.xres; in smtcfb_pci_probe()
1620 sfb->fb->var.yres_virtual = sfb->fb->var.yres; in smtcfb_pci_probe()
1621 err = smtc_map_smem(sfb, pdev, smem_size); in smtcfb_pci_probe()
1629 memset_io(sfb->lfb, 0, sfb->fb->fix.smem_len); in smtcfb_pci_probe()
1637 sfb->chip_id, sfb->chip_rev_id, sfb->fb->var.xres, in smtcfb_pci_probe()
1638 sfb->fb->var.yres, sfb->fb->var.bits_per_pixel); in smtcfb_pci_probe()
1645 smtc_unmap_smem(sfb); in smtcfb_pci_probe()
1646 smtc_unmap_mmio(sfb); in smtcfb_pci_probe()
1675 struct smtcfb_info *sfb; in smtcfb_pci_remove() local
1677 sfb = pci_get_drvdata(pdev); in smtcfb_pci_remove()
1678 smtc_unmap_smem(sfb); in smtcfb_pci_remove()
1679 smtc_unmap_mmio(sfb); in smtcfb_pci_remove()
1680 unregister_framebuffer(sfb->fb); in smtcfb_pci_remove()
1681 framebuffer_release(sfb->fb); in smtcfb_pci_remove()
1688 struct smtcfb_info *sfb = dev_get_drvdata(device); in smtcfb_pci_suspend() local
1698 fb_set_suspend(sfb->fb, 1); in smtcfb_pci_suspend()
1709 struct smtcfb_info *sfb = dev_get_drvdata(device); in smtcfb_pci_resume() local
1714 switch (sfb->chip_id) { in smtcfb_pci_resume()
1723 if (sfb->fb->var.bits_per_pixel == 32) in smtcfb_pci_resume()
1736 smtcfb_setmode(sfb); in smtcfb_pci_resume()
1739 fb_set_suspend(sfb->fb, 0); in smtcfb_pci_resume()