Commit 0a582821 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'fbdev-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux

Pull fbdev updates from Tomi Valkeinen:
 - new 6x10 font
 - various small fixes and cleanups

* tag 'fbdev-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (30 commits)
  fonts: Add 6x10 font
  videomode: provide dummy inline functions for !CONFIG_OF
  video/atmel_lcdfb: Introduce regulator support
  fbdev: sh_mobile_hdmi: Re-init regs before irq re-enable on resume
  framebuffer: fix screen corruption when copying
  framebuffer: fix border color
  arm, fbdev, omap2, LLVMLinux: Remove nested function from omapfb
  arm, fbdev, omap2, LLVMLinux: Remove nested function from omap2 dss
  video: fbdev: valkyriefb.c: use container_of to resolve fb_info_valkyrie from fb_info
  video: fbdev: pxafb.c: use container_of to resolve pxafb_info/layer from fb_info
  video: fbdev: cyber2000fb.c: use container_of to resolve cfb_info from fb_info
  video: fbdev: controlfb.c: use container_of to resolve fb_info_control from fb_info
  video: fbdev: sa1100fb.c: use container_of to resolve sa1100fb_info from fb_info
  video: fbdev: stifb.c: use container_of to resolve stifb_info from fb_info
  video: fbdev: sis: sis_main.c: Cleaning up missing null-terminate in conjunction with strncpy
  video: valkyriefb: Fix unused variable warning in set_valkyrie_clock()
  video: fbdev: use %*ph specifier to dump small buffers
  video: mx3fb: always enable BACKLIGHT_LCD_SUPPORT
  video: fbdev: au1200fb: delete double assignment
  video: fbdev: sis: delete double assignment
  ...
parents 8a5de182 33ac9dba
......@@ -20,6 +20,9 @@ Required nodes:
- default-mode: a videomode within the display with timing parameters
as specified below.
Optional properties:
- lcd-supply: Regulator for LCD supply voltage.
Example:
fb0: fb@0x00500000 {
......
......@@ -205,7 +205,6 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info,
static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
int bottom_only)
{
int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
unsigned int cw = vc->vc_font.width;
unsigned int ch = vc->vc_font.height;
unsigned int rw = info->var.xres - (vc->vc_cols*cw);
......@@ -214,7 +213,7 @@ static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
unsigned int bs = info->var.yres - bh;
struct fb_fillrect region;
region.color = attr_bgcol_ec(bgshift, vc, info);
region.color = 0;
region.rop = ROP_COPY;
if (rw && !bottom_only) {
......
......@@ -197,9 +197,8 @@ static void ccw_clear_margins(struct vc_data *vc, struct fb_info *info,
unsigned int bh = info->var.xres - (vc->vc_rows*ch);
unsigned int bs = vc->vc_rows*ch;
struct fb_fillrect region;
int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
region.color = attr_bgcol_ec(bgshift,vc,info);
region.color = 0;
region.rop = ROP_COPY;
if (rw && !bottom_only) {
......
......@@ -180,9 +180,8 @@ static void cw_clear_margins(struct vc_data *vc, struct fb_info *info,
unsigned int bh = info->var.xres - (vc->vc_rows*ch);
unsigned int rs = info->var.yres - rw;
struct fb_fillrect region;
int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
region.color = attr_bgcol_ec(bgshift,vc,info);
region.color = 0;
region.rop = ROP_COPY;
if (rw && !bottom_only) {
......
......@@ -227,9 +227,8 @@ static void ud_clear_margins(struct vc_data *vc, struct fb_info *info,
unsigned int rw = info->var.xres - (vc->vc_cols*cw);
unsigned int bh = info->var.yres - (vc->vc_rows*ch);
struct fb_fillrect region;
int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
region.color = attr_bgcol_ec(bgshift,vc,info);
region.color = 0;
region.rop = ROP_COPY;
if (rw && !bottom_only) {
......
......@@ -2356,10 +2356,11 @@ config FB_MSM
config FB_MX3
tristate "MX3 Framebuffer support"
depends on FB && MX3_IPU
select BACKLIGHT_CLASS_DEVICE
select BACKLIGHT_LCD_SUPPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
select BACKLIGHT_CLASS_DEVICE
default y
help
This is a framebuffer device for the i.MX31 LCD Controller. So
......
......@@ -24,6 +24,7 @@
#include <linux/of_device.h>
#include <linux/of_gpio.h>
#include <video/of_display_timing.h>
#include <linux/regulator/consumer.h>
#include <video/videomode.h>
#include <mach/cpu.h>
......@@ -60,6 +61,7 @@ struct atmel_lcdfb_info {
struct atmel_lcdfb_pdata pdata;
struct atmel_lcdfb_config *config;
struct regulator *reg_lcd;
};
struct atmel_lcdfb_power_ctrl_gpio {
......@@ -302,10 +304,24 @@ static void init_contrast(struct atmel_lcdfb_info *sinfo)
static inline void atmel_lcdfb_power_control(struct atmel_lcdfb_info *sinfo, int on)
{
int ret;
struct atmel_lcdfb_pdata *pdata = &sinfo->pdata;
if (pdata->atmel_lcdfb_power_control)
pdata->atmel_lcdfb_power_control(pdata, on);
else if (sinfo->reg_lcd) {
if (on) {
ret = regulator_enable(sinfo->reg_lcd);
if (ret)
dev_err(&sinfo->pdev->dev,
"lcd regulator enable failed: %d\n", ret);
} else {
ret = regulator_disable(sinfo->reg_lcd);
if (ret)
dev_err(&sinfo->pdev->dev,
"lcd regulator disable failed: %d\n", ret);
}
}
}
static struct fb_fix_screeninfo atmel_lcdfb_fix __initdata = {
......@@ -1195,6 +1211,10 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
if (!sinfo->config)
goto free_info;
sinfo->reg_lcd = devm_regulator_get(&pdev->dev, "lcd");
if (IS_ERR(sinfo->reg_lcd))
sinfo->reg_lcd = NULL;
info->flags = ATMEL_LCDFB_FBINFO_DEFAULT;
info->pseudo_palette = sinfo->pseudo_palette;
info->fbops = &atmel_lcdfb_ops;
......
......@@ -324,14 +324,61 @@ struct aty128_meminfo {
};
/* various memory configurations */
static const struct aty128_meminfo sdr_128 =
{ 4, 4, 3, 3, 1, 3, 1, 16, 30, 16, "128-bit SDR SGRAM (1:1)" };
static const struct aty128_meminfo sdr_64 =
{ 4, 8, 3, 3, 1, 3, 1, 17, 46, 17, "64-bit SDR SGRAM (1:1)" };
static const struct aty128_meminfo sdr_sgram =
{ 4, 4, 1, 2, 1, 2, 1, 16, 24, 16, "64-bit SDR SGRAM (2:1)" };
static const struct aty128_meminfo ddr_sgram =
{ 4, 4, 3, 3, 2, 3, 1, 16, 31, 16, "64-bit DDR SGRAM" };
static const struct aty128_meminfo sdr_128 = {
.ML = 4,
.MB = 4,
.Trcd = 3,
.Trp = 3,
.Twr = 1,
.CL = 3,
.Tr2w = 1,
.LoopLatency = 16,
.DspOn = 30,
.Rloop = 16,
.name = "128-bit SDR SGRAM (1:1)",
};
static const struct aty128_meminfo sdr_64 = {
.ML = 4,
.MB = 8,
.Trcd = 3,
.Trp = 3,
.Twr = 1,
.CL = 3,
.Tr2w = 1,
.LoopLatency = 17,
.DspOn = 46,
.Rloop = 17,
.name = "64-bit SDR SGRAM (1:1)",
};
static const struct aty128_meminfo sdr_sgram = {
.ML = 4,
.MB = 4,
.Trcd = 1,
.Trp = 2,
.Twr = 1,
.CL = 2,
.Tr2w = 1,
.LoopLatency = 16,
.DspOn = 24,
.Rloop = 16,
.name = "64-bit SDR SGRAM (2:1)",
};
static const struct aty128_meminfo ddr_sgram = {
.ML = 4,
.MB = 4,
.Trcd = 3,
.Trp = 3,
.Twr = 2,
.CL = 3,
.Tr2w = 1,
.LoopLatency = 16,
.DspOn = 31,
.Rloop = 16,
.name = "64-bit DDR SGRAM",
};
static struct fb_fix_screeninfo aty128fb_fix = {
.id = "ATY Rage128",
......
......@@ -1254,7 +1254,6 @@ static void set_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata)
pdata->brightness = 30;
}
divider = (lcd->pwmdiv & 0x3FFFF) + 1;
hi1 = (lcd->pwmhi >> 16) + 1;
hi1 = (((pdata->brightness & 0xFF)+1) * divider >> 8);
lcd->pwmhi &= 0xFFFF;
lcd->pwmhi |= (hi1 << 16);
......
......@@ -218,7 +218,8 @@ static int controlfb_check_var (struct fb_var_screeninfo *var, struct fb_info *i
*/
static int controlfb_set_par (struct fb_info *info)
{
struct fb_info_control *p = (struct fb_info_control *) info;
struct fb_info_control *p =
container_of(info, struct fb_info_control, info);
struct fb_par_control par;
int err;
......@@ -258,7 +259,8 @@ static int controlfb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info)
{
unsigned int xoffset, hstep;
struct fb_info_control *p = (struct fb_info_control *)info;
struct fb_info_control *p =
container_of(info, struct fb_info_control, info);
struct fb_par_control *par = &p->par;
/*
......@@ -309,7 +311,8 @@ static int controlfb_mmap(struct fb_info *info,
static int controlfb_blank(int blank_mode, struct fb_info *info)
{
struct fb_info_control *p = (struct fb_info_control *) info;
struct fb_info_control *p =
container_of(info, struct fb_info_control, info);
unsigned ctrl;
ctrl = ld_le32(CNTRL_REG(p,ctrl));
......@@ -342,7 +345,8 @@ static int controlfb_blank(int blank_mode, struct fb_info *info)
static int controlfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int transp, struct fb_info *info)
{
struct fb_info_control *p = (struct fb_info_control *) info;
struct fb_info_control *p =
container_of(info, struct fb_info_control, info);
__u8 r, g, b;
if (regno > 255)
......@@ -833,7 +837,8 @@ static int control_var_to_par(struct fb_var_screeninfo *var,
unsigned hperiod, hssync, hsblank, hesync, heblank, piped, heq, hlfln,
hserr, vperiod, vssync, vesync, veblank, vsblank, vswin, vewin;
unsigned long pixclock;
struct fb_info_control *p = (struct fb_info_control *) fb_info;
struct fb_info_control *p =
container_of(fb_info, struct fb_info_control, info);
struct control_regvals *r = &par->regvals;
switch (var->bits_per_pixel) {
......
......@@ -55,8 +55,8 @@ bitcpy(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx,
* If you suspect bug in this function, compare it with this simple
* memmove implementation.
*/
fb_memmove((char *)dst + ((dst_idx & (bits - 1))) / 8,
(char *)src + ((src_idx & (bits - 1))) / 8, n / 8);
memmove((char *)dst + ((dst_idx & (bits - 1))) / 8,
(char *)src + ((src_idx & (bits - 1))) / 8, n / 8);
return;
#endif
......@@ -221,8 +221,8 @@ bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx,
* If you suspect bug in this function, compare it with this simple
* memmove implementation.
*/
fb_memmove((char *)dst + ((dst_idx & (bits - 1))) / 8,
(char *)src + ((src_idx & (bits - 1))) / 8, n / 8);
memmove((char *)dst + ((dst_idx & (bits - 1))) / 8,
(char *)src + ((src_idx & (bits - 1))) / 8, n / 8);
return;
#endif
......@@ -324,7 +324,10 @@ bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx,
d0 = d0 << left | d1 >> right;
}
d0 = fb_rev_pixels_in_long(d0, bswapmask);
FB_WRITEL(comp(d0, FB_READL(dst), first), dst);
if (!first)
FB_WRITEL(d0, dst);
else
FB_WRITEL(comp(d0, FB_READL(dst), first), dst);
d0 = d1;
dst--;
n -= dst_idx+1;
......
......@@ -485,16 +485,8 @@ static ssize_t show_bl_curve(struct device *device,
mutex_lock(&fb_info->bl_curve_mutex);
for (i = 0; i < FB_BACKLIGHT_LEVELS; i += 8)
len += snprintf(&buf[len], PAGE_SIZE,
"%02x %02x %02x %02x %02x %02x %02x %02x\n",
fb_info->bl_curve[i + 0],
fb_info->bl_curve[i + 1],
fb_info->bl_curve[i + 2],
fb_info->bl_curve[i + 3],
fb_info->bl_curve[i + 4],
fb_info->bl_curve[i + 5],
fb_info->bl_curve[i + 6],
fb_info->bl_curve[i + 7]);
len += snprintf(&buf[len], PAGE_SIZE, "%8ph\n",
fb_info->bl_curve + i);
mutex_unlock(&fb_info->bl_curve_mutex);
return len;
......
......@@ -159,7 +159,7 @@ cyber2000_seqw(unsigned int reg, unsigned int val, struct cfb_info *cfb)
static void
cyber2000fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{
struct cfb_info *cfb = (struct cfb_info *)info;
struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
unsigned long dst, col;
if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT)) {
......@@ -191,7 +191,7 @@ cyber2000fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
static void
cyber2000fb_copyarea(struct fb_info *info, const struct fb_copyarea *region)
{
struct cfb_info *cfb = (struct cfb_info *)info;
struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
unsigned int cmd = CO_CMD_L_PATTERN_FGCOL;
unsigned long src, dst;
......@@ -241,7 +241,7 @@ cyber2000fb_imageblit(struct fb_info *info, const struct fb_image *image)
static int cyber2000fb_sync(struct fb_info *info)
{
struct cfb_info *cfb = (struct cfb_info *)info;
struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
int count = 100000;
if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT))
......@@ -276,7 +276,7 @@ static int
cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int transp, struct fb_info *info)
{
struct cfb_info *cfb = (struct cfb_info *)info;
struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
struct fb_var_screeninfo *var = &cfb->fb.var;
u32 pseudo_val;
int ret = 1;
......@@ -758,7 +758,7 @@ cyber2000fb_decode_clock(struct par_info *hw, struct cfb_info *cfb,
static int
cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{
struct cfb_info *cfb = (struct cfb_info *)info;
struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
struct par_info hw;
unsigned int mem;
int err;
......@@ -861,7 +861,7 @@ cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
static int cyber2000fb_set_par(struct fb_info *info)
{
struct cfb_info *cfb = (struct cfb_info *)info;
struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
struct fb_var_screeninfo *var = &cfb->fb.var;
struct par_info hw;
unsigned int mem;
......@@ -971,7 +971,7 @@ static int cyber2000fb_set_par(struct fb_info *info)
static int
cyber2000fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
{
struct cfb_info *cfb = (struct cfb_info *)info;
struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
if (cyber2000fb_update_start(cfb, var))
return -EINVAL;
......@@ -1007,7 +1007,7 @@ cyber2000fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
*/
static int cyber2000fb_blank(int blank, struct fb_info *info)
{
struct cfb_info *cfb = (struct cfb_info *)info;
struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
unsigned int sync = 0;
int i;
......
......@@ -1191,7 +1191,6 @@ int intelfbhw_mode_to_hw(struct intelfb_info *dinfo,
vsync_end = vsync_start + var->vsync_len;
vtotal = vsync_end + var->upper_margin;
vblank_start = vactive;
vblank_end = vtotal;
vblank_end = vsync_end + 1;
DBG_MSG("V: act %d, ss %d, se %d, tot %d bs %d, be %d\n",
......@@ -1859,7 +1858,7 @@ void intelfbhw_cursor_init(struct intelfb_info *dinfo)
tmp = INREG(CURSOR_CONTROL);
tmp &= ~(CURSOR_FORMAT_MASK | CURSOR_GAMMA_ENABLE |
CURSOR_ENABLE | CURSOR_STRIDE_MASK);
tmp = CURSOR_FORMAT_3C;
tmp |= CURSOR_FORMAT_3C;
OUTREG(CURSOR_CONTROL, tmp);
OUTREG(CURSOR_A_BASEADDR, dinfo->cursor.offset << 12);
tmp = (64 << CURSOR_SIZE_H_SHIFT) |
......
......@@ -1341,19 +1341,57 @@ struct video_board {
struct matrox_switch* lowlevel;
};
#ifdef CONFIG_FB_MATROX_MILLENIUM
static struct video_board vbMillennium = {0x0800000, 0x0800000, FB_ACCEL_MATROX_MGA2064W, &matrox_millennium};
static struct video_board vbMillennium2 = {0x1000000, 0x0800000, FB_ACCEL_MATROX_MGA2164W, &matrox_millennium};
static struct video_board vbMillennium2A = {0x1000000, 0x0800000, FB_ACCEL_MATROX_MGA2164W_AGP, &matrox_millennium};
static struct video_board vbMillennium = {
.maxvram = 0x0800000,
.maxdisplayable = 0x0800000,
.accelID = FB_ACCEL_MATROX_MGA2064W,
.lowlevel = &matrox_millennium
};
static struct video_board vbMillennium2 = {
.maxvram = 0x1000000,
.maxdisplayable = 0x0800000,
.accelID = FB_ACCEL_MATROX_MGA2164W,
.lowlevel = &matrox_millennium
};
static struct video_board vbMillennium2A = {
.maxvram = 0x1000000,
.maxdisplayable = 0x0800000,
.accelID = FB_ACCEL_MATROX_MGA2164W_AGP,
.lowlevel = &matrox_millennium
};
#endif /* CONFIG_FB_MATROX_MILLENIUM */
#ifdef CONFIG_FB_MATROX_MYSTIQUE
static struct video_board vbMystique = {0x0800000, 0x0800000, FB_ACCEL_MATROX_MGA1064SG, &matrox_mystique};
static struct video_board vbMystique = {
.maxvram = 0x0800000,
.maxdisplayable = 0x0800000,
.accelID = FB_ACCEL_MATROX_MGA1064SG,
.lowlevel = &matrox_mystique
};
#endif /* CONFIG_FB_MATROX_MYSTIQUE */
#ifdef CONFIG_FB_MATROX_G
static struct video_board vbG100 = {0x0800000, 0x0800000, FB_ACCEL_MATROX_MGAG100, &matrox_G100};
static struct video_board vbG200 = {0x1000000, 0x1000000, FB_ACCEL_MATROX_MGAG200, &matrox_G100};
static struct video_board vbG100 = {
.maxvram = 0x0800000,
.maxdisplayable = 0x0800000,
.accelID = FB_ACCEL_MATROX_MGAG100,
.lowlevel = &matrox_G100
};
static struct video_board vbG200 = {
.maxvram = 0x1000000,
.maxdisplayable = 0x1000000,
.accelID = FB_ACCEL_MATROX_MGAG200,
.lowlevel = &matrox_G100
};
/* from doc it looks like that accelerator can draw only to low 16MB :-( Direct accesses & displaying are OK for
whole 32MB */
static struct video_board vbG400 = {0x2000000, 0x1000000, FB_ACCEL_MATROX_MGAG400, &matrox_G100};
static struct video_board vbG400 = {
.maxvram = 0x2000000,
.maxdisplayable = 0x1000000,
.accelID = FB_ACCEL_MATROX_MGAG400,
.lowlevel = &matrox_G100
};
#endif
#define DEVF_VIDEO64BIT 0x0001
......
......@@ -201,21 +201,23 @@ struct matrox_pll_ctl {
};
static const struct matrox_pll_features2 maven1000_pll = {
50000000,
300000000,
5, 128,
3, 32,
3
.vco_freq_min = 50000000,
.vco_freq_max = 300000000,
.feed_div_min = 5,
.feed_div_max = 128,
.in_div_min = 3,
.in_div_max = 32,
.post_shift_max = 3
};
static const struct matrox_pll_ctl maven_PAL = {
540000,
50
.ref_freq = 540000,
.den = 50
};
static const struct matrox_pll_ctl maven_NTSC = {
450450, /* 27027000/60 == 27000000/59.94005994 */
60
.ref_freq = 450450, /* 27027000/60 == 27000000/59.94005994 */
.den = 60
};
static int matroxfb_PLL_mavenclock(const struct matrox_pll_features2* pll,
......
......@@ -569,8 +569,13 @@ static int msmfb_probe(struct platform_device *pdev)
mutex_init(&msmfb->panel_init_lock);
init_waitqueue_head(&msmfb->frame_wq);
INIT_WORK(&msmfb->resume_work, power_on_panel);
msmfb->black = kzalloc(msmfb->fb->var.bits_per_pixel*msmfb->xres,
GFP_KERNEL);
msmfb->black = devm_kzalloc(&pdev->dev,
msmfb->fb->var.bits_per_pixel*msmfb->xres,
GFP_KERNEL);
if (!msmfb->black) {
ret = -ENOMEM;
goto error_register_framebuffer;
}
printk(KERN_INFO "msmfb_probe() installing %d x %d panel\n",
msmfb->xres, msmfb->yres);
......@@ -589,6 +594,8 @@ static int msmfb_probe(struct platform_device *pdev)
msmfb->sleeping = WAKING;
platform_set_drvdata(pdev, msmfb);
return 0;
error_register_framebuffer:
......@@ -598,9 +605,23 @@ error_setup_fbmem:
return ret;
}
static int msmfb_remove(struct platform_device *pdev)
{
struct msmfb_info *msmfb;
msmfb = platform_get_drvdata(pdev);
unregister_framebuffer(msmfb->fb);
iounmap(msmfb->fb->screen_base);
framebuffer_release(msmfb->fb);
return 0;
}
static struct platform_driver msm_panel_driver = {
/* need to write remove */
.probe = msmfb_probe,
.remove = msmfb_remove,
.driver = {.name = "msm_panel"},
};
......
......@@ -1179,7 +1179,7 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var,
/*
* We enable the End of Frame interrupt, which will free a tx-descriptor,
* which we will need for the next device_prep_slave_sg(). The
* which we will need for the next dmaengine_prep_slave_sg(). The
* IRQ-handler will disable the IRQ again.
*/
init_completion(&mx3_fbi->flip_cmpl);
......
......@@ -634,13 +634,14 @@ void dispc_mgr_disable_sync(enum omap_channel channel)
WARN_ON(1);
}
static inline void dispc_irq_wait_handler(void *data, u32 mask)
{
complete((struct completion *)data);
}
int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
unsigned long timeout)
{
void dispc_irq_wait_handler(void *data, u32 mask)
{
complete((struct completion *)data);
}
int r;
DECLARE_COMPLETION_ONSTACK(completion);
......
......@@ -2571,7 +2571,10 @@ static int dsi_sync_vc_vp(struct platform_device *dsidev, int channel)
{
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
DECLARE_COMPLETION_ONSTACK(completion);
struct dsi_packet_sent_handler_data vp_data = { dsidev, &completion };
struct dsi_packet_sent_handler_data vp_data = {
.dsidev = dsidev,
.completion = &completion
};
int r = 0;
u8 bit;
......@@ -2617,7 +2620,10 @@ static void dsi_packet_sent_handler_l4(void *data, u32 mask)
static int dsi_sync_vc_l4(struct platform_device *dsidev, int channel)
{
DECLARE_COMPLETION_ONSTACK(completion);
struct dsi_packet_sent_handler_data l4_data = { dsidev, &completion };
struct dsi_packet_sent_handler_data l4_data = {
.dsidev = dsidev,
.completion = &completion
};
int r = 0;
r = dsi_register_isr_vc(dsidev, channel, dsi_packet_sent_handler_l4,
......
......@@ -44,6 +44,13 @@ static ssize_t manager_display_show(struct omap_overlay_manager *mgr, char *buf)
dssdev->name : "<none>");
}
static int manager_display_match(struct omap_dss_device *dssdev, void *data)
{
const char *str = data;
return sysfs_streq(dssdev->name, str);
}
static ssize_t manager_display_store(struct omap_overlay_manager *mgr,
const char *buf, size_t size)
{
......@@ -52,17 +59,12 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr,
struct omap_dss_device *dssdev = NULL;
struct omap_dss_device *old_dssdev;
int match(struct omap_dss_device *dssdev, void *data)
{
const char *str = data;
return sysfs_streq(dssdev->name, str);
}
if (buf[size-1] == '\n')
--len;
if (len > 0)
dssdev = omap_dss_find_device((void *)buf, match);
dssdev = omap_dss_find_device((void *)buf,
manager_display_match);
if (len > 0 && dssdev == NULL)
return -EINVAL;
......
......@@ -273,16 +273,16 @@ static struct omapfb_colormode omapfb_colormodes[] = {
},
};
static bool cmp_component(struct fb_bitfield *f1, struct fb_bitfield *f2)
{
return f1->length == f2->length &&
f1->offset == f2->offset &&
f1->msb_right == f2->msb_right;
}
static bool cmp_var_to_colormode(struct fb_var_screeninfo *var,
struct omapfb_colormode *color)
{
bool cmp_component(struct fb_bitfield *f1, struct fb_bitfield *f2)
{
return f1->length == f2->length &&
f1->offset == f2->offset &&
f1->msb_right == f2->msb_right;
}
if (var->bits_per_pixel == 0 ||
var->red.length == 0 ||
var->blue.length == 0 ||
......
......@@ -138,7 +138,7 @@ static int
pxafb_setpalettereg(u_int regno, u_int red, u_int green, u_int blue,
u_int trans, struct fb_info *info)
{
struct pxafb_info *fbi = (struct pxafb_info *)info;
struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb);
u_int val;
if (regno >= fbi->palette_size)
......@@ -183,7 +183,7 @@ static int
pxafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int trans, struct fb_info *info)
{
struct pxafb_info *fbi = (struct pxafb_info *)info;
struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb);
unsigned int val;
int ret = 1;
......@@ -456,7 +456,7 @@ static int pxafb_adjust_timing(struct pxafb_info *fbi,
*/
static int pxafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{
struct pxafb_info *fbi = (struct pxafb_info *)info;
struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb);
struct pxafb_mach_info *inf = dev_get_platdata(fbi->dev);
int err;
......@@ -494,7 +494,7 @@ static int pxafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
*/
static int pxafb_set_par(struct fb_info *info)
{
struct pxafb_info *fbi = (struct pxafb_info *)info;
struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb);
struct fb_var_screeninfo *var = &info->var;
if (var->bits_per_pixel >= 16)
......@@ -533,7 +533,7 @@ static int pxafb_set_par(struct fb_info *info)
static int pxafb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info)
{
struct pxafb_info *fbi = (struct pxafb_info *)info;
struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb);