diff options
Diffstat (limited to 'drivers/staging/fbtft/fbtft-core.c')
-rw-r--r-- | drivers/staging/fbtft/fbtft-core.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index 53b748be2..9cc81412b 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -47,9 +47,11 @@ static unsigned long debug; module_param(debug, ulong, 0); MODULE_PARM_DESC(debug, "override device debug level"); +#ifdef CONFIG_HAS_DMA static bool dma = true; module_param(dma, bool, 0); MODULE_PARM_DESC(dma, "Use DMA buffer"); +#endif void fbtft_dbg_hex(const struct device *dev, int groupsize, @@ -484,7 +486,7 @@ static void fbtft_deferred_io(struct fb_info *info, struct list_head *pagelist) index = page->index << PAGE_SHIFT; y_low = index / info->fix.line_length; y_high = (index + PAGE_SIZE - 1) / info->fix.line_length; - fbtft_dev_dbg(DEBUG_DEFERRED_IO, par, info->device, + dev_dbg(info->device, "page->index=%lu y_low=%d y_high=%d\n", page->index, y_low, y_high); if (y_high > info->var.yres - 1) @@ -505,7 +507,7 @@ static void fbtft_fb_fillrect(struct fb_info *info, { struct fbtft_par *par = info->par; - fbtft_dev_dbg(DEBUG_FB_FILLRECT, par, info->dev, + dev_dbg(info->dev, "%s: dx=%d, dy=%d, width=%d, height=%d\n", __func__, rect->dx, rect->dy, rect->width, rect->height); sys_fillrect(info, rect); @@ -518,7 +520,7 @@ static void fbtft_fb_copyarea(struct fb_info *info, { struct fbtft_par *par = info->par; - fbtft_dev_dbg(DEBUG_FB_COPYAREA, par, info->dev, + dev_dbg(info->dev, "%s: dx=%d, dy=%d, width=%d, height=%d\n", __func__, area->dx, area->dy, area->width, area->height); sys_copyarea(info, area); @@ -531,7 +533,7 @@ static void fbtft_fb_imageblit(struct fb_info *info, { struct fbtft_par *par = info->par; - fbtft_dev_dbg(DEBUG_FB_IMAGEBLIT, par, info->dev, + dev_dbg(info->dev, "%s: dx=%d, dy=%d, width=%d, height=%d\n", __func__, image->dx, image->dy, image->width, image->height); sys_imageblit(info, image); @@ -545,7 +547,7 @@ static ssize_t fbtft_fb_write(struct fb_info *info, const char __user *buf, struct fbtft_par *par = info->par; ssize_t res; - fbtft_dev_dbg(DEBUG_FB_WRITE, par, info->dev, + dev_dbg(info->dev, "%s: count=%zd, ppos=%llu\n", __func__, count, *ppos); res = fb_sys_write(info, buf, count, ppos); @@ -568,11 +570,10 @@ static int fbtft_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *info) { - struct fbtft_par *par = info->par; unsigned val; int ret = 1; - fbtft_dev_dbg(DEBUG_FB_SETCOLREG, par, info->dev, + dev_dbg(info->dev, "%s(regno=%u, red=0x%X, green=0x%X, blue=0x%X, trans=0x%X)\n", __func__, regno, red, green, blue, transp); @@ -599,7 +600,7 @@ static int fbtft_fb_blank(int blank, struct fb_info *info) struct fbtft_par *par = info->par; int ret = -EINVAL; - fbtft_dev_dbg(DEBUG_FB_BLANK, par, info->dev, "%s(blank=%d)\n", + dev_dbg(info->dev, "%s(blank=%d)\n", __func__, blank); if (!par->fbtftops.blank) @@ -856,10 +857,13 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display, #endif if (txbuflen > 0) { +#ifdef CONFIG_HAS_DMA if (dma) { dev->coherent_dma_mask = ~0; txbuf = dmam_alloc_coherent(dev, txbuflen, &par->txbuf.dma, GFP_DMA); - } else { + } else +#endif + { txbuf = devm_kzalloc(par->info->device, txbuflen, GFP_KERNEL); } if (!txbuf) @@ -1062,8 +1066,6 @@ static int fbtft_init_display_dt(struct fbtft_par *par) const __be32 *p; u32 val; int buf[64], i, j; - char msg[128]; - char str[16]; fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__); @@ -1089,13 +1091,11 @@ static int fbtft_init_display_dt(struct fbtft_par *par) p = of_prop_next_u32(prop, p, &val); } /* make debug message */ - msg[0] = '\0'; - for (j = 0; j < i; j++) { - snprintf(str, 128, " %02X", buf[j]); - strcat(msg, str); - } fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, - "init: write_register:%s\n", msg); + "init: write_register:\n"); + for (j = 0; j < i; j++) + fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, + "buf[%d] = %02X\n", j, buf[j]); par->fbtftops.write_register(par, i, buf[0], buf[1], buf[2], buf[3], |