Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31b6780c authored by Joe Perches's avatar Joe Perches Committed by Tomi Valkeinen
Browse files

framebuffer: Use fb_<level>



Neaten and shorten the code using the new fb_<level> macros.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent f51a07d0
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -102,8 +102,7 @@ static int cfag12864bfb_probe(struct platform_device *device)

	platform_set_drvdata(device, info);

	printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node,
		info->fix.id);
	fb_info(info, "%s frame buffer device\n", info->fix.id);

	return 0;

+4 −5
Original line number Diff line number Diff line
@@ -478,11 +478,10 @@ int __init mc68x328fb_init(void)
		return -EINVAL;
	}

	printk(KERN_INFO
		"fb%d: %s frame buffer device\n", fb_info.node,	fb_info.fix.id);
	printk(KERN_INFO
		"fb%d: %dx%dx%d at 0x%08lx\n", fb_info.node,
		mc68x328fb_default.xres_virtual, mc68x328fb_default.yres_virtual,
	fb_info(&fb_info, "%s frame buffer device\n", fb_info.fix.id);
	fb_info(&fb_info, "%dx%dx%d at 0x%08lx\n",
		mc68x328fb_default.xres_virtual,
		mc68x328fb_default.yres_virtual,
		1 << mc68x328fb_default.bits_per_pixel, videomemory);

	return 0;
+2 −2
Original line number Diff line number Diff line
@@ -3742,8 +3742,8 @@ default_chipset:
	if (err)
		goto unset_drvdata;

	printk("fb%d: %s frame buffer device, using %dK of video memory\n",
	       info->node, info->fix.id, info->fix.smem_len>>10);
	fb_info(info, "%s frame buffer device, using %dK of video memory\n",
		info->fix.id, info->fix.smem_len>>10);

	return 0;

+3 −5
Original line number Diff line number Diff line
@@ -556,9 +556,8 @@ static int arcfb_probe(struct platform_device *dev)
			goto err1;
		}
	}
	printk(KERN_INFO
	       "fb%d: Arc frame buffer device, using %dK of video memory\n",
	       info->node, videomemorysize >> 10);
	fb_info(info, "Arc frame buffer device, using %dK of video memory\n",
		videomemorysize >> 10);

	/* this inits the lcd but doesn't clear dirty pixels */
	for (i = 0; i < num_cols * num_rows; i++) {
@@ -572,8 +571,7 @@ static int arcfb_probe(struct platform_device *dev)
	/* if we were told to splash the screen, we just clear it */
	if (!nosplash) {
		for (i = 0; i < num_cols * num_rows; i++) {
			printk(KERN_INFO "fb%d: splashing lcd %d\n",
				info->node, i);
			fb_info(info, "splashing lcd %d\n", i);
			ks108_set_start_line(par, i, 0);
			ks108_clear_lcd(par, i);
		}
+23 −23
Original line number Diff line number Diff line
@@ -137,8 +137,7 @@ static void arkfb_settile(struct fb_info *info, struct fb_tilemap *map)

	if ((map->width != 8) || (map->height != 16) ||
	    (map->depth != 1) || (map->length != 256)) {
	    	printk(KERN_ERR "fb%d: unsupported font parameters: width %d, "
		       "height %d, depth %d, length %d\n", info->node,
		fb_err(info, "unsupported font parameters: width %d, height %d, depth %d, length %d\n",
		       map->width, map->height, map->depth, map->length);
		return;
	}
@@ -517,7 +516,7 @@ static void ark_set_pixclock(struct fb_info *info, u32 pixclock)

	int rv = dac_set_freq(par->dac, 0, 1000000000 / pixclock);
	if (rv < 0) {
		printk(KERN_ERR "fb%d: cannot set requested pixclock, keeping old value\n", info->node);
		fb_err(info, "cannot set requested pixclock, keeping old value\n");
		return;
	}

@@ -584,7 +583,7 @@ static int arkfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
	rv = svga_match_format (arkfb_formats, var, NULL);
	if (rv < 0)
	{
		printk(KERN_ERR "fb%d: unsupported mode requested\n", info->node);
		fb_err(info, "unsupported mode requested\n");
		return rv;
	}

@@ -604,14 +603,15 @@ static int arkfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
	mem = ((var->bits_per_pixel * var->xres_virtual) >> 3) * var->yres_virtual;
	if (mem > info->screen_size)
	{
		printk(KERN_ERR "fb%d: not enough framebuffer memory (%d kB requested , %d kB available)\n", info->node, mem >> 10, (unsigned int) (info->screen_size >> 10));
		fb_err(info, "not enough framebuffer memory (%d kB requested, %d kB available)\n",
		       mem >> 10, (unsigned int) (info->screen_size >> 10));
		return -EINVAL;
	}

	rv = svga_check_timings (&ark_timing_regs, var, info->node);
	if (rv < 0)
	{
		printk(KERN_ERR "fb%d: invalid timings requested\n", info->node);
		fb_err(info, "invalid timings requested\n");
		return rv;
	}

@@ -693,7 +693,7 @@ static int arkfb_set_par(struct fb_info *info)
	vga_wseq(par->state.vgabase, 0x18, regval);

	/* Set the offset register */
	pr_debug("fb%d: offset register       : %d\n", info->node, offset_value);
	fb_dbg(info, "offset register       : %d\n", offset_value);
	svga_wcrt_multi(par->state.vgabase, ark_offset_regs, offset_value);

	/* fix for hi-res textmode */
@@ -716,7 +716,7 @@ static int arkfb_set_par(struct fb_info *info)
	/* Set mode-specific register values */
	switch (mode) {
	case 0:
		pr_debug("fb%d: text mode\n", info->node);
		fb_dbg(info, "text mode\n");
		svga_set_textmode_vga_regs(par->state.vgabase);

		vga_wseq(par->state.vgabase, 0x11, 0x10); /* basic VGA mode */
@@ -725,7 +725,7 @@ static int arkfb_set_par(struct fb_info *info)

		break;
	case 1:
		pr_debug("fb%d: 4 bit pseudocolor\n", info->node);
		fb_dbg(info, "4 bit pseudocolor\n");
		vga_wgfx(par->state.vgabase, VGA_GFX_MODE, 0x40);

		vga_wseq(par->state.vgabase, 0x11, 0x10); /* basic VGA mode */
@@ -733,44 +733,44 @@ static int arkfb_set_par(struct fb_info *info)
		dac_set_mode(par->dac, DAC_PSEUDO8_8);
		break;
	case 2:
		pr_debug("fb%d: 4 bit pseudocolor, planar\n", info->node);
		fb_dbg(info, "4 bit pseudocolor, planar\n");

		vga_wseq(par->state.vgabase, 0x11, 0x10); /* basic VGA mode */
		svga_wcrt_mask(par->state.vgabase, 0x46, 0x00, 0x04); /* 8bit pixel path */
		dac_set_mode(par->dac, DAC_PSEUDO8_8);
		break;
	case 3:
		pr_debug("fb%d: 8 bit pseudocolor\n", info->node);
		fb_dbg(info, "8 bit pseudocolor\n");

		vga_wseq(par->state.vgabase, 0x11, 0x16); /* 8bpp accel mode */

		if (info->var.pixclock > 20000) {
			pr_debug("fb%d: not using multiplex\n", info->node);
			fb_dbg(info, "not using multiplex\n");
			svga_wcrt_mask(par->state.vgabase, 0x46, 0x00, 0x04); /* 8bit pixel path */
			dac_set_mode(par->dac, DAC_PSEUDO8_8);
		} else {
			pr_debug("fb%d: using multiplex\n", info->node);
			fb_dbg(info, "using multiplex\n");
			svga_wcrt_mask(par->state.vgabase, 0x46, 0x04, 0x04); /* 16bit pixel path */
			dac_set_mode(par->dac, DAC_PSEUDO8_16);
			hdiv = 2;
		}
		break;
	case 4:
		pr_debug("fb%d: 5/5/5 truecolor\n", info->node);
		fb_dbg(info, "5/5/5 truecolor\n");

		vga_wseq(par->state.vgabase, 0x11, 0x1A); /* 16bpp accel mode */
		svga_wcrt_mask(par->state.vgabase, 0x46, 0x04, 0x04); /* 16bit pixel path */
		dac_set_mode(par->dac, DAC_RGB1555_16);
		break;
	case 5:
		pr_debug("fb%d: 5/6/5 truecolor\n", info->node);
		fb_dbg(info, "5/6/5 truecolor\n");

		vga_wseq(par->state.vgabase, 0x11, 0x1A); /* 16bpp accel mode */
		svga_wcrt_mask(par->state.vgabase, 0x46, 0x04, 0x04); /* 16bit pixel path */
		dac_set_mode(par->dac, DAC_RGB0565_16);
		break;
	case 6:
		pr_debug("fb%d: 8/8/8 truecolor\n", info->node);
		fb_dbg(info, "8/8/8 truecolor\n");

		vga_wseq(par->state.vgabase, 0x11, 0x16); /* 8bpp accel mode ??? */
		svga_wcrt_mask(par->state.vgabase, 0x46, 0x04, 0x04); /* 16bit pixel path */
@@ -779,7 +779,7 @@ static int arkfb_set_par(struct fb_info *info)
		hdiv = 2;
		break;
	case 7:
		pr_debug("fb%d: 8/8/8/8 truecolor\n", info->node);
		fb_dbg(info, "8/8/8/8 truecolor\n");

		vga_wseq(par->state.vgabase, 0x11, 0x1E); /* 32bpp accel mode */
		svga_wcrt_mask(par->state.vgabase, 0x46, 0x04, 0x04); /* 16bit pixel path */
@@ -787,7 +787,7 @@ static int arkfb_set_par(struct fb_info *info)
		hmul = 2;
		break;
	default:
		printk(KERN_ERR "fb%d: unsupported mode - bug\n", info->node);
		fb_err(info, "unsupported mode - bug\n");
		return -EINVAL;
	}

@@ -879,19 +879,19 @@ static int arkfb_blank(int blank_mode, struct fb_info *info)

	switch (blank_mode) {
	case FB_BLANK_UNBLANK:
		pr_debug("fb%d: unblank\n", info->node);
		fb_dbg(info, "unblank\n");
		svga_wseq_mask(par->state.vgabase, 0x01, 0x00, 0x20);
		svga_wcrt_mask(par->state.vgabase, 0x17, 0x80, 0x80);
		break;
	case FB_BLANK_NORMAL:
		pr_debug("fb%d: blank\n", info->node);
		fb_dbg(info, "blank\n");
		svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20);
		svga_wcrt_mask(par->state.vgabase, 0x17, 0x80, 0x80);
		break;
	case FB_BLANK_POWERDOWN:
	case FB_BLANK_HSYNC_SUSPEND:
	case FB_BLANK_VSYNC_SUSPEND:
		pr_debug("fb%d: sync down\n", info->node);
		fb_dbg(info, "sync down\n");
		svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20);
		svga_wcrt_mask(par->state.vgabase, 0x17, 0x00, 0x80);
		break;
@@ -1052,8 +1052,8 @@ static int ark_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
		goto err_reg_fb;
	}

	printk(KERN_INFO "fb%d: %s on %s, %d MB RAM\n", info->node, info->fix.id,
		 pci_name(dev), info->fix.smem_len >> 20);
	fb_info(info, "%s on %s, %d MB RAM\n",
		info->fix.id, pci_name(dev), info->fix.smem_len >> 20);

	/* Record a reference to the driver data */
	pci_set_drvdata(dev, info);
Loading