Commit da16dd97 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'fbdev-v4.13' of git://github.com/bzolnier/linux

Pull fbdev updates from Bartlomiej Zolnierkiewicz:
 "There is nothing really major here, just a couple of small bugfixes,
  improvements and cleanups.

   - fix get_fb_unmapped_area() helper handling (Benjamin Gaignard)

   - check return value of clk_prepare_enable() in pxafb driver (Arvind
     Yadav)

   - fix error path handling in vmlfb driver (Alexey Khoroshilov)

   - printks fixes/cleanups for uvesafb driver (Joe Perches)

   - fix unusued variable warning in atyfb driver (Arnd Bergmann)

   - constifications for sh_mobile_lcdcfb, fsl-diu-fb, omapfb (Arvind
     Yadav)

   - mdacon driver cleanups (Jiri Slaby)

   - misc cleanups (Andy Shevchenko, Karim Eshapa, Gustavo A. R. Silva,
     Dan Carpenter)"

* tag 'fbdev-v4.13' of git://github.com/bzolnier/linux:
  fbdev: make get_fb_unmapped_area depends of !MMU
  atyfb: hide unused variable
  video: fbdev: matrox: the list iterator can't be NULL
  video: fbdev: aty: remove useless variable assignments in aty_var_to_crtc()
  fbdev: omapfb: constify ctrl_caps, color_caps, panel_attr_grp and ctrl_attr_grp
  omapfb: panel-dsi-cm: constify dsicm_attr_group
  vmlfb: Fix error handling in cr_pll_init()
  video: fbdev: fsl-diu-fb: constify mfb_template and fsl_diu_match.
  uvesafb: Fix continuation printks without KERN_LEVEL to pr_cont, neatening
  video: fbdev: sh_mobile_lcdcfb: constify sh_mobile_lcdc_bl_ops.
  omapfb: Use sysfs_match_string() helper
  video: fbdev: pxafb: Handle return value of clk_prepare_enable
  video: fbdev: omap2: omapfb: displays: panel-dsi-cm: Use time comparison kernel macro.
  mdacon: replace MDA_ADDR macro by inline function
  mdacon: make mda_vram_base u16 *
  mdacon: align code in mda_detect properly
parents 38f7d2da 4c99ceda
...@@ -48,7 +48,7 @@ static DEFINE_SPINLOCK(mda_lock); ...@@ -48,7 +48,7 @@ static DEFINE_SPINLOCK(mda_lock);
/* description of the hardware layout */ /* description of the hardware layout */
static unsigned long mda_vram_base; /* Base of video memory */ static u16 *mda_vram_base; /* Base of video memory */
static unsigned long mda_vram_len; /* Size of video memory */ static unsigned long mda_vram_len; /* Size of video memory */
static unsigned int mda_num_columns; /* Number of text columns */ static unsigned int mda_num_columns; /* Number of text columns */
static unsigned int mda_num_lines; /* Number of text lines */ static unsigned int mda_num_lines; /* Number of text lines */
...@@ -205,13 +205,20 @@ static int mda_detect(void) ...@@ -205,13 +205,20 @@ static int mda_detect(void)
/* do a memory check */ /* do a memory check */
p = (u16 *) mda_vram_base; p = mda_vram_base;
q = (u16 *) (mda_vram_base + 0x01000); q = mda_vram_base + 0x01000 / 2;
p_save = scr_readw(p); q_save = scr_readw(q); p_save = scr_readw(p);
q_save = scr_readw(q);
scr_writew(0xAA55, p);
if (scr_readw(p) == 0xAA55)
count++;
scr_writew(0x55AA, p);
if (scr_readw(p) == 0x55AA)
count++;
scr_writew(0xAA55, p); if (scr_readw(p) == 0xAA55) count++;
scr_writew(0x55AA, p); if (scr_readw(p) == 0x55AA) count++;
scr_writew(p_save, p); scr_writew(p_save, p);
if (count != 2) { if (count != 2) {
...@@ -220,13 +227,18 @@ static int mda_detect(void) ...@@ -220,13 +227,18 @@ static int mda_detect(void)
/* check if we have 4K or 8K */ /* check if we have 4K or 8K */
scr_writew(0xA55A, q); scr_writew(0x0000, p); scr_writew(0xA55A, q);
if (scr_readw(q) == 0xA55A) count++; scr_writew(0x0000, p);
if (scr_readw(q) == 0xA55A)
count++;
scr_writew(0x5AA5, q); scr_writew(0x0000, p); scr_writew(0x5AA5, q);
if (scr_readw(q) == 0x5AA5) count++; scr_writew(0x0000, p);
if (scr_readw(q) == 0x5AA5)
count++;
scr_writew(p_save, p); scr_writew(q_save, q); scr_writew(p_save, p);
scr_writew(q_save, q);
if (count == 4) { if (count == 4) {
mda_vram_len = 0x02000; mda_vram_len = 0x02000;
...@@ -240,14 +252,12 @@ static int mda_detect(void) ...@@ -240,14 +252,12 @@ static int mda_detect(void)
/* Edward: These two mess `tests' mess up my cursor on bootup */ /* Edward: These two mess `tests' mess up my cursor on bootup */
/* cursor low register */ /* cursor low register */
if (! test_mda_b(0x66, 0x0f)) { if (!test_mda_b(0x66, 0x0f))
return 0; return 0;
}
/* cursor low register */ /* cursor low register */
if (! test_mda_b(0x99, 0x0f)) { if (!test_mda_b(0x99, 0x0f))
return 0; return 0;
}
#endif #endif
/* See if the card is a Hercules, by checking whether the vsync /* See if the card is a Hercules, by checking whether the vsync
...@@ -257,7 +267,7 @@ static int mda_detect(void) ...@@ -257,7 +267,7 @@ static int mda_detect(void)
p_save = q_save = inb_p(mda_status_port) & MDA_STATUS_VSYNC; p_save = q_save = inb_p(mda_status_port) & MDA_STATUS_VSYNC;
for (count=0; count < 50000 && p_save == q_save; count++) { for (count = 0; count < 50000 && p_save == q_save; count++) {
q_save = inb(mda_status_port) & MDA_STATUS_VSYNC; q_save = inb(mda_status_port) & MDA_STATUS_VSYNC;
udelay(2); udelay(2);
} }
...@@ -313,7 +323,7 @@ static const char *mdacon_startup(void) ...@@ -313,7 +323,7 @@ static const char *mdacon_startup(void)
mda_num_lines = 25; mda_num_lines = 25;
mda_vram_len = 0x01000; mda_vram_len = 0x01000;
mda_vram_base = VGA_MAP_MEM(0xb0000, mda_vram_len); mda_vram_base = (u16 *)VGA_MAP_MEM(0xb0000, mda_vram_len);
mda_index_port = 0x3b4; mda_index_port = 0x3b4;
mda_value_port = 0x3b5; mda_value_port = 0x3b5;
...@@ -410,17 +420,20 @@ static void mdacon_invert_region(struct vc_data *c, u16 *p, int count) ...@@ -410,17 +420,20 @@ static void mdacon_invert_region(struct vc_data *c, u16 *p, int count)
} }
} }
#define MDA_ADDR(x,y) ((u16 *) mda_vram_base + (y)*mda_num_columns + (x)) static inline u16 *mda_addr(unsigned int x, unsigned int y)
{
return mda_vram_base + y * mda_num_columns + x;
}
static void mdacon_putc(struct vc_data *c, int ch, int y, int x) static void mdacon_putc(struct vc_data *c, int ch, int y, int x)
{ {
scr_writew(mda_convert_attr(ch), MDA_ADDR(x, y)); scr_writew(mda_convert_attr(ch), mda_addr(x, y));
} }
static void mdacon_putcs(struct vc_data *c, const unsigned short *s, static void mdacon_putcs(struct vc_data *c, const unsigned short *s,
int count, int y, int x) int count, int y, int x)
{ {
u16 *dest = MDA_ADDR(x, y); u16 *dest = mda_addr(x, y);
for (; count > 0; count--) { for (; count > 0; count--) {
scr_writew(mda_convert_attr(scr_readw(s++)), dest++); scr_writew(mda_convert_attr(scr_readw(s++)), dest++);
...@@ -430,7 +443,7 @@ static void mdacon_putcs(struct vc_data *c, const unsigned short *s, ...@@ -430,7 +443,7 @@ static void mdacon_putcs(struct vc_data *c, const unsigned short *s,
static void mdacon_clear(struct vc_data *c, int y, int x, static void mdacon_clear(struct vc_data *c, int y, int x,
int height, int width) int height, int width)
{ {
u16 *dest = MDA_ADDR(x, y); u16 *dest = mda_addr(x, y);
u16 eattr = mda_convert_attr(c->vc_video_erase_char); u16 eattr = mda_convert_attr(c->vc_video_erase_char);
if (width <= 0 || height <= 0) if (width <= 0 || height <= 0)
...@@ -453,7 +466,7 @@ static int mdacon_blank(struct vc_data *c, int blank, int mode_switch) ...@@ -453,7 +466,7 @@ static int mdacon_blank(struct vc_data *c, int blank, int mode_switch)
{ {
if (mda_type == TYPE_MDA) { if (mda_type == TYPE_MDA) {
if (blank) if (blank)
scr_memsetw((void *)mda_vram_base, scr_memsetw(mda_vram_base,
mda_convert_attr(c->vc_video_erase_char), mda_convert_attr(c->vc_video_erase_char),
c->vc_screenbuf_size); c->vc_screenbuf_size);
/* Tell console.c that it has to restore the screen itself */ /* Tell console.c that it has to restore the screen itself */
...@@ -502,16 +515,16 @@ static bool mdacon_scroll(struct vc_data *c, unsigned int t, unsigned int b, ...@@ -502,16 +515,16 @@ static bool mdacon_scroll(struct vc_data *c, unsigned int t, unsigned int b,
switch (dir) { switch (dir) {
case SM_UP: case SM_UP:
scr_memmovew(MDA_ADDR(0,t), MDA_ADDR(0,t+lines), scr_memmovew(mda_addr(0, t), mda_addr(0, t + lines),
(b-t-lines)*mda_num_columns*2); (b-t-lines)*mda_num_columns*2);
scr_memsetw(MDA_ADDR(0,b-lines), eattr, scr_memsetw(mda_addr(0, b - lines), eattr,
lines*mda_num_columns*2); lines*mda_num_columns*2);
break; break;
case SM_DOWN: case SM_DOWN:
scr_memmovew(MDA_ADDR(0,t+lines), MDA_ADDR(0,t), scr_memmovew(mda_addr(0, t + lines), mda_addr(0, t),
(b-t-lines)*mda_num_columns*2); (b-t-lines)*mda_num_columns*2);
scr_memsetw(MDA_ADDR(0,t), eattr, lines*mda_num_columns*2); scr_memsetw(mda_addr(0, t), eattr, lines*mda_num_columns*2);
break; break;
} }
......
...@@ -802,7 +802,7 @@ static int aty_var_to_crtc(const struct fb_info *info, ...@@ -802,7 +802,7 @@ static int aty_var_to_crtc(const struct fb_info *info,
{ {
struct atyfb_par *par = (struct atyfb_par *) info->par; struct atyfb_par *par = (struct atyfb_par *) info->par;
u32 xres, yres, vxres, vyres, xoffset, yoffset, bpp; u32 xres, yres, vxres, vyres, xoffset, yoffset, bpp;
u32 sync, vmode, vdisplay; u32 sync, vmode;
u32 h_total, h_disp, h_sync_strt, h_sync_end, h_sync_dly, h_sync_wid, h_sync_pol; u32 h_total, h_disp, h_sync_strt, h_sync_end, h_sync_dly, h_sync_wid, h_sync_pol;
u32 v_total, v_disp, v_sync_strt, v_sync_end, v_sync_wid, v_sync_pol, c_sync; u32 v_total, v_disp, v_sync_strt, v_sync_end, v_sync_wid, v_sync_pol, c_sync;
u32 pix_width, dp_pix_width, dp_chain_mask; u32 pix_width, dp_pix_width, dp_chain_mask;
...@@ -984,12 +984,6 @@ static int aty_var_to_crtc(const struct fb_info *info, ...@@ -984,12 +984,6 @@ static int aty_var_to_crtc(const struct fb_info *info,
v_total <<= 1; v_total <<= 1;
} }
vdisplay = yres;
#ifdef CONFIG_FB_ATY_GENERIC_LCD
if ((par->lcd_table != 0) && (crtc->lcd_gen_cntl & LCD_ON))
vdisplay = par->lcd_height;
#endif
v_disp--; v_disp--;
v_sync_strt--; v_sync_strt--;
v_sync_end--; v_sync_end--;
...@@ -1036,7 +1030,7 @@ static int aty_var_to_crtc(const struct fb_info *info, ...@@ -1036,7 +1030,7 @@ static int aty_var_to_crtc(const struct fb_info *info,
crtc->gen_cntl |= CRTC_INTERLACE_EN; crtc->gen_cntl |= CRTC_INTERLACE_EN;
#ifdef CONFIG_FB_ATY_GENERIC_LCD #ifdef CONFIG_FB_ATY_GENERIC_LCD
if (par->lcd_table != 0) { if (par->lcd_table != 0) {
vdisplay = yres; u32 vdisplay = yres;
if (vmode & FB_VMODE_DOUBLE) if (vmode & FB_VMODE_DOUBLE)
vdisplay <<= 1; vdisplay <<= 1;
crtc->gen_cntl &= ~(CRTC2_EN | CRTC2_PIX_WIDTH); crtc->gen_cntl &= ~(CRTC2_EN | CRTC2_PIX_WIDTH);
......
...@@ -1483,7 +1483,7 @@ __releases(&info->lock) ...@@ -1483,7 +1483,7 @@ __releases(&info->lock)
return 0; return 0;
} }
#ifdef CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA #if defined(CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA) && !defined(CONFIG_MMU)
unsigned long get_fb_unmapped_area(struct file *filp, unsigned long get_fb_unmapped_area(struct file *filp,
unsigned long addr, unsigned long len, unsigned long addr, unsigned long len,
unsigned long pgoff, unsigned long flags) unsigned long pgoff, unsigned long flags)
...@@ -1510,7 +1510,8 @@ static const struct file_operations fb_fops = { ...@@ -1510,7 +1510,8 @@ static const struct file_operations fb_fops = {
.open = fb_open, .open = fb_open,
.release = fb_release, .release = fb_release,
#if defined(HAVE_ARCH_FB_UNMAPPED_AREA) || \ #if defined(HAVE_ARCH_FB_UNMAPPED_AREA) || \
defined(CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA) (defined(CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA) && \
!defined(CONFIG_MMU))
.get_unmapped_area = get_fb_unmapped_area, .get_unmapped_area = get_fb_unmapped_area,
#endif #endif
#ifdef CONFIG_FB_DEFERRED_IO #ifdef CONFIG_FB_DEFERRED_IO
......
...@@ -388,7 +388,7 @@ struct fsl_diu_data { ...@@ -388,7 +388,7 @@ struct fsl_diu_data {
/* Determine the DMA address of a member of the fsl_diu_data structure */ /* Determine the DMA address of a member of the fsl_diu_data structure */
#define DMA_ADDR(p, f) ((p)->dma_addr + offsetof(struct fsl_diu_data, f)) #define DMA_ADDR(p, f) ((p)->dma_addr + offsetof(struct fsl_diu_data, f))
static struct mfb_info mfb_template[] = { static const struct mfb_info mfb_template[] = {
{ {
.index = PLANE0, .index = PLANE0,
.id = "Panel0", .id = "Panel0",
...@@ -1868,7 +1868,7 @@ static int __init fsl_diu_setup(char *options) ...@@ -1868,7 +1868,7 @@ static int __init fsl_diu_setup(char *options)
} }
#endif #endif
static struct of_device_id fsl_diu_match[] = { static const struct of_device_id fsl_diu_match[] = {
#ifdef CONFIG_PPC_MPC512x #ifdef CONFIG_PPC_MPC512x
{ {
.compatible = "fsl,mpc5121-diu", .compatible = "fsl,mpc5121-diu",
......
...@@ -2001,7 +2001,7 @@ static void matroxfb_register_device(struct matrox_fb_info* minfo) { ...@@ -2001,7 +2001,7 @@ static void matroxfb_register_device(struct matrox_fb_info* minfo) {
for (drv = matroxfb_driver_l(matroxfb_driver_list.next); for (drv = matroxfb_driver_l(matroxfb_driver_list.next);
drv != matroxfb_driver_l(&matroxfb_driver_list); drv != matroxfb_driver_l(&matroxfb_driver_list);
drv = matroxfb_driver_l(drv->node.next)) { drv = matroxfb_driver_l(drv->node.next)) {
if (drv && drv->probe) { if (drv->probe) {
void *p = drv->probe(minfo); void *p = drv->probe(minfo);
if (p) { if (p) {
minfo->drivers_data[i] = p; minfo->drivers_data[i] = p;
......
...@@ -62,7 +62,7 @@ struct caps_table_struct { ...@@ -62,7 +62,7 @@ struct caps_table_struct {
const char *name; const char *name;
}; };
static struct caps_table_struct ctrl_caps[] = { static const struct caps_table_struct ctrl_caps[] = {
{ OMAPFB_CAPS_MANUAL_UPDATE, "manual update" }, { OMAPFB_CAPS_MANUAL_UPDATE, "manual update" },
{ OMAPFB_CAPS_TEARSYNC, "tearing synchronization" }, { OMAPFB_CAPS_TEARSYNC, "tearing synchronization" },
{ OMAPFB_CAPS_PLANE_RELOCATE_MEM, "relocate plane memory" }, { OMAPFB_CAPS_PLANE_RELOCATE_MEM, "relocate plane memory" },
...@@ -74,7 +74,7 @@ static struct caps_table_struct ctrl_caps[] = { ...@@ -74,7 +74,7 @@ static struct caps_table_struct ctrl_caps[] = {
{ OMAPFB_CAPS_SET_BACKLIGHT, "backlight setting" }, { OMAPFB_CAPS_SET_BACKLIGHT, "backlight setting" },
}; };
static struct caps_table_struct color_caps[] = { static const struct caps_table_struct color_caps[] = {
{ 1 << OMAPFB_COLOR_RGB565, "RGB565", }, { 1 << OMAPFB_COLOR_RGB565, "RGB565", },
{ 1 << OMAPFB_COLOR_YUV422, "YUV422", }, { 1 << OMAPFB_COLOR_YUV422, "YUV422", },
{ 1 << OMAPFB_COLOR_YUV420, "YUV420", }, { 1 << OMAPFB_COLOR_YUV420, "YUV420", },
...@@ -1384,7 +1384,7 @@ static struct attribute *panel_attrs[] = { ...@@ -1384,7 +1384,7 @@ static struct attribute *panel_attrs[] = {
NULL, NULL,
}; };
static struct attribute_group panel_attr_grp = { static const struct attribute_group panel_attr_grp = {
.name = "panel", .name = "panel",
.attrs = panel_attrs, .attrs = panel_attrs,
}; };
...@@ -1406,7 +1406,7 @@ static struct attribute *ctrl_attrs[] = { ...@@ -1406,7 +1406,7 @@ static struct attribute *ctrl_attrs[] = {
NULL, NULL,
}; };
static struct attribute_group ctrl_attr_grp = { static const struct attribute_group ctrl_attr_grp = {
.name = "ctrl", .name = "ctrl",
.attrs = ctrl_attrs, .attrs = ctrl_attrs,
}; };
......
...@@ -100,7 +100,7 @@ static void hw_guard_wait(struct panel_drv_data *ddata) ...@@ -100,7 +100,7 @@ static void hw_guard_wait(struct panel_drv_data *ddata)
{ {
unsigned long wait = ddata->hw_guard_end - jiffies; unsigned long wait = ddata->hw_guard_end - jiffies;
if ((long)wait > 0 && wait <= ddata->hw_guard_wait) { if ((long)wait > 0 && time_before_eq(wait, ddata->hw_guard_wait)) {
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(wait); schedule_timeout(wait);
} }
...@@ -559,7 +559,7 @@ static struct attribute *dsicm_attrs[] = { ...@@ -559,7 +559,7 @@ static struct attribute *dsicm_attrs[] = {
NULL, NULL,
}; };
static struct attribute_group dsicm_attr_group = { static const struct attribute_group dsicm_attr_group = {
.attrs = dsicm_attrs, .attrs = dsicm_attrs,
}; };
......
...@@ -182,22 +182,16 @@ static ssize_t manager_trans_key_type_show(struct omap_overlay_manager *mgr, ...@@ -182,22 +182,16 @@ static ssize_t manager_trans_key_type_show(struct omap_overlay_manager *mgr,
static ssize_t manager_trans_key_type_store(struct omap_overlay_manager *mgr, static ssize_t manager_trans_key_type_store(struct omap_overlay_manager *mgr,
const char *buf, size_t size) const char *buf, size_t size)
{ {
enum omap_dss_trans_key_type key_type;
struct omap_overlay_manager_info info; struct omap_overlay_manager_info info;
int r; int r;
for (key_type = OMAP_DSS_COLOR_KEY_GFX_DST; r = sysfs_match_string(trans_key_type_str, buf);
key_type < ARRAY_SIZE(trans_key_type_str); key_type++) { if (r < 0)
if (sysfs_streq(buf, trans_key_type_str[key_type])) return r;
break;
}
if (key_type == ARRAY_SIZE(trans_key_type_str))
return -EINVAL;
mgr->get_manager_info(mgr, &info); mgr->get_manager_info(mgr, &info);
info.trans_key_type = key_type; info.trans_key_type = r;
r = mgr->set_manager_info(mgr, &info); r = mgr->set_manager_info(mgr, &info);
if (r) if (r)
......
...@@ -1436,7 +1436,10 @@ static void pxafb_enable_controller(struct pxafb_info *fbi) ...@@ -1436,7 +1436,10 @@ static void pxafb_enable_controller(struct pxafb_info *fbi)
pr_debug("reg_lccr3 0x%08x\n", (unsigned int) fbi->reg_lccr3); pr_debug("reg_lccr3 0x%08x\n", (unsigned int) fbi->reg_lccr3);
/* enable LCD controller clock */ /* enable LCD controller clock */
clk_prepare_enable(fbi->clk); if (clk_prepare_enable(fbi->clk)) {
pr_err("%s: Failed to prepare clock\n", __func__);
return;
}
if (fbi->lccr0 & LCCR0_LCDT) if (fbi->lccr0 & LCCR0_LCDT)
return; return;
......
...@@ -2301,7 +2301,7 @@ static int sh_mobile_lcdc_check_fb(struct backlight_device *bdev, ...@@ -2301,7 +2301,7 @@ static int sh_mobile_lcdc_check_fb(struct backlight_device *bdev,
return (info->bl_dev == bdev); return (info->bl_dev == bdev);
} }
static struct backlight_ops sh_mobile_lcdc_bl_ops = { static const struct backlight_ops sh_mobile_lcdc_bl_ops = {
.options = BL_CORE_SUSPENDRESUME, .options = BL_CORE_SUSPENDRESUME,
.update_status = sh_mobile_lcdc_update_bl, .update_status = sh_mobile_lcdc_update_bl,
.get_brightness = sh_mobile_lcdc_get_brightness, .get_brightness = sh_mobile_lcdc_get_brightness,
......
This diff is collapsed.
...@@ -185,6 +185,7 @@ static int __init cr_pll_init(void) ...@@ -185,6 +185,7 @@ static int __init cr_pll_init(void)
if (err) { if (err) {
printk(KERN_ERR printk(KERN_ERR
"Carillo Ranch failed to initialize vml_sys.\n"); "Carillo Ranch failed to initialize vml_sys.\n");
iounmap(mch_regs_base);
pci_dev_put(mch_dev); pci_dev_put(mch_dev);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment