Lines Matching defs:info
83 struct fb_info *fb[2]; /* fb info for both heads */
112 struct sm501fb_info *info;
136 static inline void sm501fb_sync_regs(struct sm501fb_info *info)
138 smc501_readl(info->regs);
294 struct fb_info *info)
296 struct sm501fb_par *par = info->par;
297 struct sm501fb_info *sm = par->info;
404 struct fb_info *info)
406 return sm501fb_check_var(var, info);
416 struct fb_info *info)
418 return sm501fb_check_var(var, info);
426 static int sm501fb_set_par_common(struct fb_info *info,
429 struct sm501fb_par *par = info->par;
430 struct sm501fb_info *fbi = par->info;
463 info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
467 info->fix.visual = FB_VISUAL_TRUECOLOR;
471 info->fix.visual = FB_VISUAL_TRUECOLOR;
476 info->fix.line_length = (var->xres_virtual * var->bits_per_pixel)/8;
477 smem_len = info->fix.line_length * var->yres_virtual;
480 info->fix.line_length);
487 mutex_lock(&info->mm_lock);
488 info->fix.smem_start = fbi->fbmem_res->start + par->screen.sm_addr;
489 info->fix.smem_len = smem_len;
490 mutex_unlock(&info->mm_lock);
492 info->screen_base = fbi->fbmem + par->screen.sm_addr;
493 info->screen_size = info->fix.smem_len;
523 static void sm501fb_set_par_geometry(struct fb_info *info,
526 struct sm501fb_par *par = info->par;
527 struct sm501fb_info *fbi = par->info;
538 reg = info->fix.line_length;
578 struct fb_info *info)
580 struct sm501fb_par *par = info->par;
581 struct sm501fb_info *fbi = par->info;
582 unsigned int bytes_pixel = info->var.bits_per_pixel / 8;
595 var->yoffset * info->fix.line_length);
608 struct fb_info *info)
610 struct sm501fb_par *par = info->par;
611 struct sm501fb_info *fbi = par->info;
614 reg = var->xoffset | (info->var.xres_virtual << 16);
617 reg = var->yoffset | (info->var.yres_virtual << 16);
629 static int sm501fb_set_par_crt(struct fb_info *info)
631 struct sm501fb_par *par = info->par;
632 struct sm501fb_info *fbi = par->info;
633 struct fb_var_screeninfo *var = &info->var;
639 dev_dbg(fbi->dev, "%s(%p)\n", __func__, info);
665 info->fix.smem_len);
669 ret = sm501fb_set_par_common(info, var);
675 sm501fb_pan_crt(var, info);
676 sm501fb_set_par_geometry(info, var);
799 static int sm501fb_set_par_pnl(struct fb_info *info)
801 struct sm501fb_par *par = info->par;
802 struct sm501fb_info *fbi = par->info;
803 struct fb_var_screeninfo *var = &info->var;
808 dev_dbg(fbi->dev, "%s(%p)\n", __func__, info);
812 ret = sm501fb_set_par_common(info, var);
816 sm501fb_pan_pnl(var, info);
817 sm501fb_set_par_geometry(info, var);
913 unsigned transp, struct fb_info *info)
915 struct sm501fb_par *par = info->par;
916 struct sm501fb_info *fbi = par->info;
925 switch (info->fix.visual) {
932 val = chan_to_field(red, &info->var.red);
933 val |= chan_to_field(green, &info->var.green);
934 val |= chan_to_field(blue, &info->var.blue);
963 static int sm501fb_blank_pnl(int blank_mode, struct fb_info *info)
965 struct sm501fb_par *par = info->par;
966 struct sm501fb_info *fbi = par->info;
968 dev_dbg(fbi->dev, "%s(mode=%d, %p)\n", __func__, blank_mode, info);
994 static int sm501fb_blank_crt(int blank_mode, struct fb_info *info)
996 struct sm501fb_par *par = info->par;
997 struct sm501fb_info *fbi = par->info;
1000 dev_dbg(fbi->dev, "%s(mode=%d, %p)\n", __func__, blank_mode, info);
1038 static int sm501fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
1040 struct sm501fb_par *par = info->par;
1041 struct sm501fb_info *fbi = par->info;
1046 dev_dbg(fbi->dev, "%s(%p,%p)\n", __func__, info, cursor);
1095 bg = ((info->cmap.red[bg_col] & 0xF8) << 8) |
1096 ((info->cmap.green[bg_col] & 0xFC) << 3) |
1097 ((info->cmap.blue[bg_col] & 0xF8) >> 3);
1099 fg = ((info->cmap.red[fg_col] & 0xF8) << 8) |
1100 ((info->cmap.green[fg_col] & 0xFC) << 3) |
1101 ((info->cmap.blue[fg_col] & 0xF8) >> 3);
1163 struct sm501fb_info *info = dev_get_drvdata(dev);
1166 ctrl = smc501_readl(info->regs + SM501_DC_CRT_CONTROL);
1181 struct sm501fb_info *info = dev_get_drvdata(dev);
1197 ctrl = smc501_readl(info->regs + SM501_DC_CRT_CONTROL);
1209 smc501_writel(ctrl, info->regs + SM501_DC_CRT_CONTROL);
1210 sm501fb_sync_regs(info);
1222 static int sm501fb_show_regs(struct sm501fb_info *info, char *ptr,
1225 void __iomem *mem = info->regs;
1244 struct sm501fb_info *info = dev_get_drvdata(dev);
1247 ptr += sm501fb_show_regs(info, ptr, SM501_DC_CRT_CONTROL, 0x40);
1248 ptr += sm501fb_show_regs(info, ptr, SM501_DC_CRT_HWC_BASE, 0x10);
1263 struct sm501fb_info *info = dev_get_drvdata(dev);
1266 ptr += sm501fb_show_regs(info, ptr, 0x0, 0x40);
1267 ptr += sm501fb_show_regs(info, ptr, SM501_DC_PANEL_HWC_BASE, 0x10);
1283 static int sm501fb_sync(struct fb_info *info)
1286 struct sm501fb_par *par = info->par;
1287 struct sm501fb_info *fbi = par->info;
1296 dev_err(info->dev, "Timeout waiting for 2d engine sync\n");
1302 static void sm501fb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
1304 struct sm501fb_par *par = info->par;
1305 struct sm501fb_info *fbi = par->info;
1315 if ((sx >= info->var.xres_virtual) ||
1316 (sy >= info->var.yres_virtual))
1319 if ((sx + width) >= info->var.xres_virtual)
1320 width = info->var.xres_virtual - sx - 1;
1321 if ((sy + height) >= info->var.yres_virtual)
1322 height = info->var.yres_virtual - sy - 1;
1325 if ((dx >= info->var.xres_virtual) ||
1326 (dy >= info->var.yres_virtual))
1329 if ((dx + width) >= info->var.xres_virtual)
1330 width = info->var.xres_virtual - dx - 1;
1331 if ((dy + height) >= info->var.yres_virtual)
1332 height = info->var.yres_virtual - dy - 1;
1342 if (sm501fb_sync(info))
1351 smc501_writel((info->var.xres << 16) | info->var.xres,
1355 smc501_writel((info->var.xres_virtual << 16) | info->var.xres_virtual,
1359 switch (info->var.bits_per_pixel) {
1388 static void sm501fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
1390 struct sm501fb_par *par = info->par;
1391 struct sm501fb_info *fbi = par->info;
1394 if ((rect->dx >= info->var.xres_virtual) ||
1395 (rect->dy >= info->var.yres_virtual))
1398 if ((rect->dx + width) >= info->var.xres_virtual)
1399 width = info->var.xres_virtual - rect->dx - 1;
1400 if ((rect->dy + height) >= info->var.yres_virtual)
1401 height = info->var.yres_virtual - rect->dy - 1;
1403 if (sm501fb_sync(info))
1412 smc501_writel((info->var.xres << 16) | info->var.xres,
1416 smc501_writel((info->var.xres_virtual << 16) | info->var.xres_virtual,
1420 switch (info->var.bits_per_pixel) {
1489 struct sm501fb_info *info;
1496 info = par->info;
1498 par->cursor_regs = info->regs + reg_base;
1500 ret = sm501_alloc_mem(info, &par->cursor, SM501_MEMF_CURSOR, 1024,
1513 sm501fb_sync_regs(info);
1523 static int sm501fb_start(struct sm501fb_info *info,
1531 info->irq = ret = platform_get_irq(pdev, 0);
1546 info->regs_res = request_mem_region(res->start,
1550 if (info->regs_res == NULL) {
1556 info->regs = ioremap(res->start, resource_size(res));
1557 if (info->regs == NULL) {
1572 info->regs2d_res = request_mem_region(res->start,
1576 if (info->regs2d_res == NULL) {
1582 info->regs2d = ioremap(res->start, resource_size(res));
1583 if (info->regs2d == NULL) {
1597 info->fbmem_res = request_mem_region(res->start,
1600 if (info->fbmem_res == NULL) {
1606 info->fbmem = ioremap(res->start, resource_size(res));
1607 if (info->fbmem == NULL) {
1613 info->fbmem_len = resource_size(res);
1616 memset_io(info->fbmem, 0, info->fbmem_len);
1620 smc501_writel(0, info->regs + SM501_DC_PANEL_PALETTE + (k * 4));
1629 sm501_init_cursor(info->fb[HEAD_CRT], SM501_DC_CRT_HWC_ADDR);
1630 sm501_init_cursor(info->fb[HEAD_PANEL], SM501_DC_PANEL_HWC_ADDR);
1635 release_mem_region(info->fbmem_res->start,
1636 resource_size(info->fbmem_res));
1639 iounmap(info->regs2d);
1642 release_mem_region(info->regs2d_res->start,
1643 resource_size(info->regs2d_res));
1646 iounmap(info->regs);
1649 release_mem_region(info->regs_res->start,
1650 resource_size(info->regs_res));
1656 static void sm501fb_stop(struct sm501fb_info *info)
1659 sm501_unit_power(info->dev->parent, SM501_GATE_DISPLAY, 0);
1661 iounmap(info->fbmem);
1662 release_mem_region(info->fbmem_res->start,
1663 resource_size(info->fbmem_res));
1665 iounmap(info->regs2d);
1666 release_mem_region(info->regs2d_res->start,
1667 resource_size(info->regs2d_res));
1669 iounmap(info->regs);
1670 release_mem_region(info->regs_res->start,
1671 resource_size(info->regs_res));
1679 struct sm501fb_info *info = par->info;
1686 pd = info->pdata->fb_crt;
1687 ctrl = smc501_readl(info->regs + SM501_DC_CRT_CONTROL);
1691 if (info->pdata->fb_route != SM501_FB_CRT_PANEL) {
1693 smc501_writel(ctrl, info->regs + SM501_DC_CRT_CONTROL);
1699 pd = info->pdata->fb_pnl;
1700 ctrl = smc501_readl(info->regs + SM501_DC_PANEL_CONTROL);
1711 dev_info(info->dev, "fb %s %sabled at start\n",
1716 if (head == HEAD_CRT && info->pdata->fb_route == SM501_FB_CRT_PANEL) {
1718 smc501_writel(ctrl, info->regs + SM501_DC_CRT_CONTROL);
1740 if (of_get_property(info->dev->parent->of_node, "little-endian", NULL))
1743 if (of_get_property(info->dev->parent->of_node, "big-endian", NULL))
1764 if (info->edid_data) {
1766 fb_edid_to_monspecs(info->edid_data, &fb->monspecs);
1776 dev_info(info->dev, "using supplied mode\n");
1783 if (info->edid_data) {
1789 kfree(info->edid_data);
1797 dev_info(info->dev, "using mode specified in "
1801 dev_info(info->dev, "using mode specified in "
1805 dev_info(info->dev, "using mode default "
1809 dev_info(info->dev, "using mode from list\n");
1812 dev_info(info->dev, "ret = %d\n", ret);
1813 dev_info(info->dev, "failed to find mode\n");
1821 dev_err(info->dev, "failed to allocate cmap memory\n");
1828 dev_err(info->dev, "check_var() failed on initial setup?\n");
1859 static int sm501fb_probe_one(struct sm501fb_info *info,
1867 pd = (head == HEAD_CRT) ? info->pdata->fb_crt : info->pdata->fb_pnl;
1871 dev_info(info->dev, "no data for fb %s (disabled)\n", name);
1875 fbi = framebuffer_alloc(sizeof(struct sm501fb_par), info->dev);
1880 par->info = info;
1884 info->fb[head] = fbi;
1891 static void sm501_free_init_fb(struct sm501fb_info *info,
1894 struct fb_info *fbi = info->fb[head];
1902 static int sm501fb_start_one(struct sm501fb_info *info,
1905 struct fb_info *fbi = info->fb[head];
1911 mutex_init(&info->fb[head]->mm_lock);
1913 ret = sm501fb_init_fb(info->fb[head], head, drvname);
1915 dev_err(info->dev, "cannot initialise fb %s\n", drvname);
1919 ret = register_framebuffer(info->fb[head]);
1921 dev_err(info->dev, "failed to register fb %s\n", drvname);
1922 sm501_free_init_fb(info, head);
1926 dev_info(info->dev, "fb%d: %s frame buffer\n", fbi->node, fbi->fix.id);
1933 struct sm501fb_info *info;
1938 info = kzalloc(sizeof(*info), GFP_KERNEL);
1939 if (!info) {
1944 info->dev = dev = &pdev->dev;
1945 platform_set_drvdata(pdev, info);
1949 info->pdata = pd->fb;
1952 if (info->pdata == NULL) {
1960 info->pdata = &sm501fb_def_pdata;
1968 info->edid_data = kmemdup(prop, EDID_LENGTH,
1970 if (info->edid_data)
1977 info->pdata = &sm501fb_def_pdata;
1983 ret = sm501fb_probe_one(info, HEAD_CRT);
1989 ret = sm501fb_probe_one(info, HEAD_PANEL);
1995 if (info->fb[HEAD_PANEL] == NULL &&
1996 info->fb[HEAD_CRT] == NULL) {
2004 ret = sm501fb_start(info, pdev);
2010 ret = sm501fb_start_one(info, HEAD_CRT, driver_name_crt);
2016 ret = sm501fb_start_one(info, HEAD_PANEL, driver_name_pnl);
2026 unregister_framebuffer(info->fb[HEAD_CRT]);
2027 sm501_free_init_fb(info, HEAD_CRT);
2030 sm501fb_stop(info);
2033 framebuffer_release(info->fb[HEAD_PANEL]);
2036 framebuffer_release(info->fb[HEAD_CRT]);
2039 kfree(info);
2050 struct sm501fb_info *info = platform_get_drvdata(pdev);
2051 struct fb_info *fbinfo_crt = info->fb[0];
2052 struct fb_info *fbinfo_pnl = info->fb[1];
2054 sm501_free_init_fb(info, HEAD_CRT);
2055 sm501_free_init_fb(info, HEAD_PANEL);
2062 sm501fb_stop(info);
2063 kfree(info);
2073 static int sm501fb_suspend_fb(struct sm501fb_info *info,
2076 struct fb_info *fbi = info->fb[head];
2099 dev_err(info->dev, "no memory to store screen\n");
2105 dev_err(info->dev, "no memory to store cursor\n");
2109 dev_dbg(info->dev, "suspending screen to %p\n", par->store_fb);
2110 dev_dbg(info->dev, "suspending cursor to %p\n", par->store_cursor);
2124 static void sm501fb_resume_fb(struct sm501fb_info *info,
2127 struct fb_info *fbi = info->fb[head];
2143 dev_dbg(info->dev, "restoring screen from %p\n", par->store_fb);
2144 dev_dbg(info->dev, "restoring cursor from %p\n", par->store_cursor);
2167 struct sm501fb_info *info = platform_get_drvdata(pdev);
2170 info->pm_crt_ctrl = smc501_readl(info->regs + SM501_DC_CRT_CONTROL);
2172 sm501fb_suspend_fb(info, HEAD_CRT);
2173 sm501fb_suspend_fb(info, HEAD_PANEL);
2176 sm501_unit_power(info->dev->parent, SM501_GATE_DISPLAY, 0);
2187 struct sm501fb_info *info = platform_get_drvdata(pdev);
2190 sm501_unit_power(info->dev->parent, SM501_GATE_DISPLAY, 1);
2194 crt_ctrl = smc501_readl(info->regs + SM501_DC_CRT_CONTROL);
2196 crt_ctrl |= info->pm_crt_ctrl & SM501_CRT_CTRL_SAVE;
2197 smc501_writel(crt_ctrl, info->regs + SM501_DC_CRT_CONTROL);
2199 sm501fb_resume_fb(info, HEAD_CRT);
2200 sm501fb_resume_fb(info, HEAD_PANEL);