提交 0a582821 编写于 作者: L 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
  ...
...@@ -20,6 +20,9 @@ Required nodes: ...@@ -20,6 +20,9 @@ Required nodes:
- default-mode: a videomode within the display with timing parameters - default-mode: a videomode within the display with timing parameters
as specified below. as specified below.
Optional properties:
- lcd-supply: Regulator for LCD supply voltage.
Example: Example:
fb0: fb@0x00500000 { fb0: fb@0x00500000 {
......
...@@ -205,7 +205,6 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info, ...@@ -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, static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
int bottom_only) int bottom_only)
{ {
int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
unsigned int cw = vc->vc_font.width; unsigned int cw = vc->vc_font.width;
unsigned int ch = vc->vc_font.height; unsigned int ch = vc->vc_font.height;
unsigned int rw = info->var.xres - (vc->vc_cols*cw); 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, ...@@ -214,7 +213,7 @@ static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
unsigned int bs = info->var.yres - bh; unsigned int bs = info->var.yres - bh;
struct fb_fillrect region; struct fb_fillrect region;
region.color = attr_bgcol_ec(bgshift, vc, info); region.color = 0;
region.rop = ROP_COPY; region.rop = ROP_COPY;
if (rw && !bottom_only) { if (rw && !bottom_only) {
......
...@@ -197,9 +197,8 @@ static void ccw_clear_margins(struct vc_data *vc, struct fb_info *info, ...@@ -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 bh = info->var.xres - (vc->vc_rows*ch);
unsigned int bs = vc->vc_rows*ch; unsigned int bs = vc->vc_rows*ch;
struct fb_fillrect region; 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; region.rop = ROP_COPY;
if (rw && !bottom_only) { if (rw && !bottom_only) {
......
...@@ -180,9 +180,8 @@ static void cw_clear_margins(struct vc_data *vc, struct fb_info *info, ...@@ -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 bh = info->var.xres - (vc->vc_rows*ch);
unsigned int rs = info->var.yres - rw; unsigned int rs = info->var.yres - rw;
struct fb_fillrect region; 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; region.rop = ROP_COPY;
if (rw && !bottom_only) { if (rw && !bottom_only) {
......
...@@ -227,9 +227,8 @@ static void ud_clear_margins(struct vc_data *vc, struct fb_info *info, ...@@ -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 rw = info->var.xres - (vc->vc_cols*cw);
unsigned int bh = info->var.yres - (vc->vc_rows*ch); unsigned int bh = info->var.yres - (vc->vc_rows*ch);
struct fb_fillrect region; 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; region.rop = ROP_COPY;
if (rw && !bottom_only) { if (rw && !bottom_only) {
......
...@@ -2356,10 +2356,11 @@ config FB_MSM ...@@ -2356,10 +2356,11 @@ config FB_MSM
config FB_MX3 config FB_MX3
tristate "MX3 Framebuffer support" tristate "MX3 Framebuffer support"
depends on FB && MX3_IPU depends on FB && MX3_IPU
select BACKLIGHT_CLASS_DEVICE
select BACKLIGHT_LCD_SUPPORT
select FB_CFB_FILLRECT select FB_CFB_FILLRECT
select FB_CFB_COPYAREA select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT select FB_CFB_IMAGEBLIT
select BACKLIGHT_CLASS_DEVICE
default y default y
help help
This is a framebuffer device for the i.MX31 LCD Controller. So This is a framebuffer device for the i.MX31 LCD Controller. So
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
#include <video/of_display_timing.h> #include <video/of_display_timing.h>
#include <linux/regulator/consumer.h>
#include <video/videomode.h> #include <video/videomode.h>
#include <mach/cpu.h> #include <mach/cpu.h>
...@@ -60,6 +61,7 @@ struct atmel_lcdfb_info { ...@@ -60,6 +61,7 @@ struct atmel_lcdfb_info {
struct atmel_lcdfb_pdata pdata; struct atmel_lcdfb_pdata pdata;
struct atmel_lcdfb_config *config; struct atmel_lcdfb_config *config;
struct regulator *reg_lcd;
}; };
struct atmel_lcdfb_power_ctrl_gpio { struct atmel_lcdfb_power_ctrl_gpio {
...@@ -302,10 +304,24 @@ static void init_contrast(struct atmel_lcdfb_info *sinfo) ...@@ -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) static inline void atmel_lcdfb_power_control(struct atmel_lcdfb_info *sinfo, int on)
{ {
int ret;
struct atmel_lcdfb_pdata *pdata = &sinfo->pdata; struct atmel_lcdfb_pdata *pdata = &sinfo->pdata;
if (pdata->atmel_lcdfb_power_control) if (pdata->atmel_lcdfb_power_control)
pdata->atmel_lcdfb_power_control(pdata, on); 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 = { static struct fb_fix_screeninfo atmel_lcdfb_fix __initdata = {
...@@ -1195,6 +1211,10 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) ...@@ -1195,6 +1211,10 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
if (!sinfo->config) if (!sinfo->config)
goto free_info; 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->flags = ATMEL_LCDFB_FBINFO_DEFAULT;
info->pseudo_palette = sinfo->pseudo_palette; info->pseudo_palette = sinfo->pseudo_palette;
info->fbops = &atmel_lcdfb_ops; info->fbops = &atmel_lcdfb_ops;
......
...@@ -324,14 +324,61 @@ struct aty128_meminfo { ...@@ -324,14 +324,61 @@ struct aty128_meminfo {
}; };
/* various memory configurations */ /* various memory configurations */
static const struct aty128_meminfo sdr_128 = static const struct aty128_meminfo sdr_128 = {
{ 4, 4, 3, 3, 1, 3, 1, 16, 30, 16, "128-bit SDR SGRAM (1:1)" }; .ML = 4,
static const struct aty128_meminfo sdr_64 = .MB = 4,
{ 4, 8, 3, 3, 1, 3, 1, 17, 46, 17, "64-bit SDR SGRAM (1:1)" }; .Trcd = 3,
static const struct aty128_meminfo sdr_sgram = .Trp = 3,
{ 4, 4, 1, 2, 1, 2, 1, 16, 24, 16, "64-bit SDR SGRAM (2:1)" }; .Twr = 1,
static const struct aty128_meminfo ddr_sgram = .CL = 3,
{ 4, 4, 3, 3, 2, 3, 1, 16, 31, 16, "64-bit DDR SGRAM" }; .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 = { static struct fb_fix_screeninfo aty128fb_fix = {
.id = "ATY Rage128", .id = "ATY Rage128",
......
...@@ -1254,7 +1254,6 @@ static void set_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata) ...@@ -1254,7 +1254,6 @@ static void set_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata)
pdata->brightness = 30; pdata->brightness = 30;
} }
divider = (lcd->pwmdiv & 0x3FFFF) + 1; divider = (lcd->pwmdiv & 0x3FFFF) + 1;
hi1 = (lcd->pwmhi >> 16) + 1;
hi1 = (((pdata->brightness & 0xFF)+1) * divider >> 8); hi1 = (((pdata->brightness & 0xFF)+1) * divider >> 8);
lcd->pwmhi &= 0xFFFF; lcd->pwmhi &= 0xFFFF;
lcd->pwmhi |= (hi1 << 16); lcd->pwmhi |= (hi1 << 16);
......
...@@ -218,7 +218,8 @@ static int controlfb_check_var (struct fb_var_screeninfo *var, struct fb_info *i ...@@ -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) 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; struct fb_par_control par;
int err; int err;
...@@ -258,7 +259,8 @@ static int controlfb_pan_display(struct fb_var_screeninfo *var, ...@@ -258,7 +259,8 @@ static int controlfb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info) struct fb_info *info)
{ {
unsigned int xoffset, hstep; 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; struct fb_par_control *par = &p->par;
/* /*
...@@ -309,7 +311,8 @@ static int controlfb_mmap(struct fb_info *info, ...@@ -309,7 +311,8 @@ static int controlfb_mmap(struct fb_info *info,
static int controlfb_blank(int blank_mode, 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; unsigned ctrl;
ctrl = ld_le32(CNTRL_REG(p,ctrl)); ctrl = ld_le32(CNTRL_REG(p,ctrl));
...@@ -342,7 +345,8 @@ static int controlfb_blank(int blank_mode, struct fb_info *info) ...@@ -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, static int controlfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int transp, struct fb_info *info) 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; __u8 r, g, b;
if (regno > 255) if (regno > 255)
...@@ -833,7 +837,8 @@ static int control_var_to_par(struct fb_var_screeninfo *var, ...@@ -833,7 +837,8 @@ static int control_var_to_par(struct fb_var_screeninfo *var,
unsigned hperiod, hssync, hsblank, hesync, heblank, piped, heq, hlfln, unsigned hperiod, hssync, hsblank, hesync, heblank, piped, heq, hlfln,
hserr, vperiod, vssync, vesync, veblank, vsblank, vswin, vewin; hserr, vperiod, vssync, vesync, veblank, vsblank, vswin, vewin;
unsigned long pixclock; 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; struct control_regvals *r = &par->regvals;
switch (var->bits_per_pixel) { switch (var->bits_per_pixel) {
......
...@@ -55,8 +55,8 @@ bitcpy(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx, ...@@ -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 * If you suspect bug in this function, compare it with this simple
* memmove implementation. * memmove implementation.
*/ */
fb_memmove((char *)dst + ((dst_idx & (bits - 1))) / 8, memmove((char *)dst + ((dst_idx & (bits - 1))) / 8,
(char *)src + ((src_idx & (bits - 1))) / 8, n / 8); (char *)src + ((src_idx & (bits - 1))) / 8, n / 8);
return; return;
#endif #endif
...@@ -221,8 +221,8 @@ bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx, ...@@ -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 * If you suspect bug in this function, compare it with this simple
* memmove implementation. * memmove implementation.
*/ */
fb_memmove((char *)dst + ((dst_idx & (bits - 1))) / 8, memmove((char *)dst + ((dst_idx & (bits - 1))) / 8,
(char *)src + ((src_idx & (bits - 1))) / 8, n / 8); (char *)src + ((src_idx & (bits - 1))) / 8, n / 8);
return; return;
#endif #endif
...@@ -324,7 +324,10 @@ bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx, ...@@ -324,7 +324,10 @@ bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx,
d0 = d0 << left | d1 >> right; d0 = d0 << left | d1 >> right;
} }
d0 = fb_rev_pixels_in_long(d0, bswapmask); 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; d0 = d1;
dst--; dst--;
n -= dst_idx+1; n -= dst_idx+1;
......
...@@ -485,16 +485,8 @@ static ssize_t show_bl_curve(struct device *device, ...@@ -485,16 +485,8 @@ static ssize_t show_bl_curve(struct device *device,
mutex_lock(&fb_info->bl_curve_mutex); mutex_lock(&fb_info->bl_curve_mutex);
for (i = 0; i < FB_BACKLIGHT_LEVELS; i += 8) for (i = 0; i < FB_BACKLIGHT_LEVELS; i += 8)
len += snprintf(&buf[len], PAGE_SIZE, len += snprintf(&buf[len], PAGE_SIZE, "%8ph\n",
"%02x %02x %02x %02x %02x %02x %02x %02x\n", fb_info->bl_curve + i);
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]);
mutex_unlock(&fb_info->bl_curve_mutex); mutex_unlock(&fb_info->bl_curve_mutex);
return len; return len;
......
...@@ -159,7 +159,7 @@ cyber2000_seqw(unsigned int reg, unsigned int val, struct cfb_info *cfb) ...@@ -159,7 +159,7 @@ cyber2000_seqw(unsigned int reg, unsigned int val, struct cfb_info *cfb)
static void static void
cyber2000fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) 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; unsigned long dst, col;
if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT)) { if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT)) {
...@@ -191,7 +191,7 @@ cyber2000fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) ...@@ -191,7 +191,7 @@ cyber2000fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
static void static void
cyber2000fb_copyarea(struct fb_info *info, const struct fb_copyarea *region) 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 int cmd = CO_CMD_L_PATTERN_FGCOL;
unsigned long src, dst; unsigned long src, dst;
...@@ -241,7 +241,7 @@ cyber2000fb_imageblit(struct fb_info *info, const struct fb_image *image) ...@@ -241,7 +241,7 @@ cyber2000fb_imageblit(struct fb_info *info, const struct fb_image *image)
static int cyber2000fb_sync(struct fb_info *info) 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; int count = 100000;
if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT)) if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT))
...@@ -276,7 +276,7 @@ static int ...@@ -276,7 +276,7 @@ static int
cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int transp, struct fb_info *info) 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; struct fb_var_screeninfo *var = &cfb->fb.var;
u32 pseudo_val; u32 pseudo_val;
int ret = 1; int ret = 1;
...@@ -758,7 +758,7 @@ cyber2000fb_decode_clock(struct par_info *hw, struct cfb_info *cfb, ...@@ -758,7 +758,7 @@ cyber2000fb_decode_clock(struct par_info *hw, struct cfb_info *cfb,
static int static int
cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) 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; struct par_info hw;
unsigned int mem; unsigned int mem;
int err; int err;
...@@ -861,7 +861,7 @@ cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) ...@@ -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) 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 fb_var_screeninfo *var = &cfb->fb.var;
struct par_info hw; struct par_info hw;
unsigned int mem; unsigned int mem;
...@@ -971,7 +971,7 @@ static int cyber2000fb_set_par(struct fb_info *info) ...@@ -971,7 +971,7 @@ static int cyber2000fb_set_par(struct fb_info *info)
static int static int
cyber2000fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) 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)) if (cyber2000fb_update_start(cfb, var))
return -EINVAL; return -EINVAL;
...@@ -1007,7 +1007,7 @@ cyber2000fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) ...@@ -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) 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; unsigned int sync = 0;
int i; int i;
......
...@@ -1191,7 +1191,6 @@ int intelfbhw_mode_to_hw(struct intelfb_info *dinfo, ...@@ -1191,7 +1191,6 @@ int intelfbhw_mode_to_hw(struct intelfb_info *dinfo,
vsync_end = vsync_start + var->vsync_len; vsync_end = vsync_start + var->vsync_len;
vtotal = vsync_end + var->upper_margin; vtotal = vsync_end + var->upper_margin;
vblank_start = vactive; vblank_start = vactive;
vblank_end = vtotal;
vblank_end = vsync_end + 1; vblank_end = vsync_end + 1;
DBG_MSG("V: act %d, ss %d, se %d, tot %d bs %d, be %d\n", 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) ...@@ -1859,7 +1858,7 @@ void intelfbhw_cursor_init(struct intelfb_info *dinfo)
tmp = INREG(CURSOR_CONTROL); tmp = INREG(CURSOR_CONTROL);
tmp &= ~(CURSOR_FORMAT_MASK | CURSOR_GAMMA_ENABLE | tmp &= ~(CURSOR_FORMAT_MASK | CURSOR_GAMMA_ENABLE |
CURSOR_ENABLE | CURSOR_STRIDE_MASK); CURSOR_ENABLE | CURSOR_STRIDE_MASK);
tmp = CURSOR_FORMAT_3C; tmp |= CURSOR_FORMAT_3C;
OUTREG(CURSOR_CONTROL, tmp); OUTREG(CURSOR_CONTROL, tmp);
OUTREG(CURSOR_A_BASEADDR, dinfo->cursor.offset << 12); OUTREG(CURSOR_A_BASEADDR, dinfo->cursor.offset << 12);
tmp = (64 << CURSOR_SIZE_H_SHIFT) | tmp = (64 << CURSOR_SIZE_H_SHIFT) |
......
...@@ -1341,19 +1341,57 @@ struct video_board { ...@@ -1341,19 +1341,57 @@ struct video_board {
struct matrox_switch* lowlevel; struct matrox_switch* lowlevel;
}; };
#ifdef CONFIG_FB_MATROX_MILLENIUM #ifdef CONFIG_FB_MATROX_MILLENIUM
static struct video_board vbMillennium = {0x0800000, 0x0800000, FB_ACCEL_MATROX_MGA2064W, &matrox_millennium}; static struct video_board vbMillennium = {
static struct video_board vbMillennium2 = {0x1000000, 0x0800000, FB_ACCEL_MATROX_MGA2164W, &matrox_millennium}; .maxvram = 0x0800000,
static struct video_board vbMillennium2A = {0x1000000, 0x0800000, FB_ACCEL_MATROX_MGA2164W_AGP, &matrox_millennium}; .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 */ #endif /* CONFIG_FB_MATROX_MILLENIUM */
#ifdef CONFIG_FB_MATROX_MYSTIQUE #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 */ #endif /* CONFIG_FB_MATROX_MYSTIQUE */
#ifdef CONFIG_FB_MATROX_G #ifdef CONFIG_FB_MATROX_G
static struct video_board vbG100 = {0x0800000, 0x0800000, FB_ACCEL_MATROX_MGAG100, &matrox_G100}; static struct video_board vbG100 = {
static struct video_board vbG200 = {0x1000000, 0x1000000, FB_ACCEL_MATROX_MGAG200, &matrox_G100}; .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 /* from doc it looks like that accelerator can draw only to low 16MB :-( Direct accesses & displaying are OK for
whole 32MB */ 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 #endif
#define DEVF_VIDEO64BIT 0x0001 #define DEVF_VIDEO64BIT 0x0001
......
...@@ -201,21 +201,23 @@ struct matrox_pll_ctl { ...@@ -201,21 +201,23 @@ struct matrox_pll_ctl {
}; };
static const struct matrox_pll_features2 maven1000_pll = { static const struct matrox_pll_features2 maven1000_pll = {
50000000, .vco_freq_min = 50000000,
300000000, .vco_freq_max = 300000000,
5, 128, .feed_div_min = 5,
3, 32, .feed_div_max = 128,
3 .in_div_min = 3,
.in_div_max = 32,
.post_shift_max = 3
}; };
static const struct matrox_pll_ctl maven_PAL = { static const struct matrox_pll_ctl maven_PAL = {
540000, .ref_freq = 540000,
50 .den = 50
}; };
static const struct matrox_pll_ctl maven_NTSC = { static const struct matrox_pll_ctl maven_NTSC = {
450450, /* 27027000/60 == 27000000/59.94005994 */ .ref_freq = 450450, /* 27027000/60 == 27000000/59.94005994 */
60 .den = 60
}; };
static int matroxfb_PLL_mavenclock(const struct matrox_pll_features2* pll, static int matroxfb_PLL_mavenclock(const struct matrox_pll_features2* pll,
......
...@@ -569,8 +569,13 @@ static int msmfb_probe(struct platform_device *pdev) ...@@ -569,8 +569,13 @@ static int msmfb_probe(struct platform_device *pdev)
mutex_init(&msmfb->panel_init_lock); mutex_init(&msmfb->panel_init_lock);
init_waitqueue_head(&msmfb->frame_wq); init_waitqueue_head(&msmfb->frame_wq);
INIT_WORK(&msmfb->resume_work, power_on_panel); INIT_WORK(&msmfb->resume_work, power_on_panel);
msmfb->black = kzalloc(msmfb->fb->var.bits_per_pixel*msmfb->xres, msmfb->black = devm_kzalloc(&pdev->dev,
GFP_KERNEL); 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", printk(KERN_INFO "msmfb_probe() installing %d x %d panel\n",
msmfb->xres, msmfb->yres); msmfb->xres, msmfb->yres);
...@@ -589,6 +594,8 @@ static int msmfb_probe(struct platform_device *pdev) ...@@ -589,6 +594,8 @@ static int msmfb_probe(struct platform_device *pdev)
msmfb->sleeping = WAKING; msmfb->sleeping = WAKING;
platform_set_drvdata(pdev, msmfb);
return 0; return 0;
error_register_framebuffer: error_register_framebuffer:
...@@ -598,9 +605,23 @@ static int msmfb_probe(struct platform_device *pdev) ...@@ -598,9 +605,23 @@ static int msmfb_probe(struct platform_device *pdev)
return ret; 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 = { static struct platform_driver msm_panel_driver = {
/* need to write remove */ /* need to write remove */
.probe = msmfb_probe, .probe = msmfb_probe,
.remove = msmfb_remove,
.driver = {.name = "msm_panel"}, .driver = {.name = "msm_panel"},
}; };
......
...@@ -1179,7 +1179,7 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var, ...@@ -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, * 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. * IRQ-handler will disable the IRQ again.
*/ */
init_completion(&mx3_fbi->flip_cmpl); init_completion(&mx3_fbi->flip_cmpl);
......
...@@ -634,13 +634,14 @@ void dispc_mgr_disable_sync(enum omap_channel channel) ...@@ -634,13 +634,14 @@ void dispc_mgr_disable_sync(enum omap_channel channel)
WARN_ON(1); 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, int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
unsigned long timeout) unsigned long timeout)
{ {
void dispc_irq_wait_handler(void *data, u32 mask)
{
complete((struct completion *)data);
}
int r; int r;
DECLARE_COMPLETION_ONSTACK(completion); DECLARE_COMPLETION_ONSTACK(completion);
......
...@@ -2571,7 +2571,10 @@ static int dsi_sync_vc_vp(struct platform_device *dsidev, int channel) ...@@ -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); struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
DECLARE_COMPLETION_ONSTACK(completion); 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; int r = 0;
u8 bit; u8 bit;
...@@ -2617,7 +2620,10 @@ static void dsi_packet_sent_handler_l4(void *data, u32 mask) ...@@ -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) static int dsi_sync_vc_l4(struct platform_device *dsidev, int channel)
{ {
DECLARE_COMPLETION_ONSTACK(completion); 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; int r = 0;
r = dsi_register_isr_vc(dsidev, channel, dsi_packet_sent_handler_l4, 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) ...@@ -44,6 +44,13 @@ static ssize_t manager_display_show(struct omap_overlay_manager *mgr, char *buf)
dssdev->name : "<none>"); 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, static ssize_t manager_display_store(struct omap_overlay_manager *mgr,
const char *buf, size_t size) const char *buf, size_t size)
{ {
...@@ -52,17 +59,12 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr, ...@@ -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 *dssdev = NULL;
struct omap_dss_device *old_dssdev; 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') if (buf[size-1] == '\n')
--len; --len;
if (len > 0) 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) if (len > 0 && dssdev == NULL)
return -EINVAL; return -EINVAL;
......
...@@ -273,16 +273,16 @@ static struct omapfb_colormode omapfb_colormodes[] = { ...@@ -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, static bool cmp_var_to_colormode(struct fb_var_screeninfo *var,
struct omapfb_colormode *color) 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 || if (var->bits_per_pixel == 0 ||
var->red.length == 0 || var->red.length == 0 ||
var->blue.length == 0 || var->blue.length == 0 ||
......
...@@ -138,7 +138,7 @@ static int ...@@ -138,7 +138,7 @@ static int
pxafb_setpalettereg(u_int regno, u_int red, u_int green, u_int blue, pxafb_setpalettereg(u_int regno, u_int red, u_int green, u_int blue,
u_int trans, struct fb_info *info) 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; u_int val;
if (regno >= fbi->palette_size) if (regno >= fbi->palette_size)
...@@ -183,7 +183,7 @@ static int ...@@ -183,7 +183,7 @@ static int
pxafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, pxafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int trans, struct fb_info *info) 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; unsigned int val;
int ret = 1; int ret = 1;
...@@ -456,7 +456,7 @@ static int pxafb_adjust_timing(struct pxafb_info *fbi, ...@@ -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) 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); struct pxafb_mach_info *inf = dev_get_platdata(fbi->dev);
int err; int err;
...@@ -494,7 +494,7 @@ static int pxafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) ...@@ -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) 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; struct fb_var_screeninfo *var = &info->var;
if (var->bits_per_pixel >= 16) if (var->bits_per_pixel >= 16)
...@@ -533,7 +533,7 @@ static int pxafb_set_par(struct fb_info *info) ...@@ -533,7 +533,7 @@ static int pxafb_set_par(struct fb_info *info)
static int pxafb_pan_display(struct fb_var_screeninfo *var, static int pxafb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info) 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 newvar; struct fb_var_screeninfo newvar;
int dma = DMA_MAX + DMA_BASE; int dma = DMA_MAX + DMA_BASE;
...@@ -566,7 +566,7 @@ static int pxafb_pan_display(struct fb_var_screeninfo *var, ...@@ -566,7 +566,7 @@ static int pxafb_pan_display(struct fb_var_screeninfo *var,
*/ */
static int pxafb_blank(int blank, struct fb_info *info) static int pxafb_blank(int blank, struct fb_info *info)
{ {
struct pxafb_info *fbi = (struct pxafb_info *)info; struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb);
int i; int i;
switch (blank) { switch (blank) {
...@@ -725,7 +725,7 @@ static struct pxafb_layer_ops ofb_ops[] = { ...@@ -725,7 +725,7 @@ static struct pxafb_layer_ops ofb_ops[] = {
static int overlayfb_open(struct fb_info *info, int user) static int overlayfb_open(struct fb_info *info, int user)
{ {
struct pxafb_layer *ofb = (struct pxafb_layer *)info; struct pxafb_layer *ofb = container_of(info, struct pxafb_layer, fb);
/* no support for framebuffer console on overlay */ /* no support for framebuffer console on overlay */
if (user == 0) if (user == 0)
...@@ -743,7 +743,7 @@ static int overlayfb_open(struct fb_info *info, int user) ...@@ -743,7 +743,7 @@ static int overlayfb_open(struct fb_info *info, int user)
static int overlayfb_release(struct fb_info *info, int user) static int overlayfb_release(struct fb_info *info, int user)
{ {
struct pxafb_layer *ofb = (struct pxafb_layer*) info; struct pxafb_layer *ofb = container_of(info, struct pxafb_layer, fb);
if (ofb->usage == 1) { if (ofb->usage == 1) {
ofb->ops->disable(ofb); ofb->ops->disable(ofb);
...@@ -760,7 +760,7 @@ static int overlayfb_release(struct fb_info *info, int user) ...@@ -760,7 +760,7 @@ static int overlayfb_release(struct fb_info *info, int user)
static int overlayfb_check_var(struct fb_var_screeninfo *var, static int overlayfb_check_var(struct fb_var_screeninfo *var,
struct fb_info *info) struct fb_info *info)
{ {
struct pxafb_layer *ofb = (struct pxafb_layer *)info; struct pxafb_layer *ofb = container_of(info, struct pxafb_layer, fb);
struct fb_var_screeninfo *base_var = &ofb->fbi->fb.var; struct fb_var_screeninfo *base_var = &ofb->fbi->fb.var;
int xpos, ypos, pfor, bpp; int xpos, ypos, pfor, bpp;
...@@ -836,7 +836,7 @@ static int overlayfb_check_video_memory(struct pxafb_layer *ofb) ...@@ -836,7 +836,7 @@ static int overlayfb_check_video_memory(struct pxafb_layer *ofb)
static int overlayfb_set_par(struct fb_info *info) static int overlayfb_set_par(struct fb_info *info)
{ {
struct pxafb_layer *ofb = (struct pxafb_layer *)info; struct pxafb_layer *ofb = container_of(info, struct pxafb_layer, fb);
struct fb_var_screeninfo *var = &info->var; struct fb_var_screeninfo *var = &info->var;
int xpos, ypos, pfor, bpp, ret; int xpos, ypos, pfor, bpp, ret;
......
...@@ -430,7 +430,6 @@ static char nv3_arb(nv3_fifo_info * res_info, nv3_sim_state * state, nv3_arb_in ...@@ -430,7 +430,6 @@ static char nv3_arb(nv3_fifo_info * res_info, nv3_sim_state * state, nv3_arb_in
int mmisses, gmisses, vmisses, eburst_size, mburst_size; int mmisses, gmisses, vmisses, eburst_size, mburst_size;
int refresh_cycle; int refresh_cycle;
refresh_cycle = 0;
refresh_cycle = 2*(state->mclk_khz/state->pclk_khz) + 5; refresh_cycle = 2*(state->mclk_khz/state->pclk_khz) + 5;
mmisses = 2; mmisses = 2;
if (state->mem_aligned) gmisses = 2; if (state->mem_aligned) gmisses = 2;
......
...@@ -268,7 +268,8 @@ static int ...@@ -268,7 +268,8 @@ static int
sa1100fb_setpalettereg(u_int regno, u_int red, u_int green, u_int blue, sa1100fb_setpalettereg(u_int regno, u_int red, u_int green, u_int blue,
u_int trans, struct fb_info *info) u_int trans, struct fb_info *info)
{ {
struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; struct sa1100fb_info *fbi =
container_of(info, struct sa1100fb_info, fb);
u_int val, ret = 1; u_int val, ret = 1;
if (regno < fbi->palette_size) { if (regno < fbi->palette_size) {
...@@ -289,7 +290,8 @@ static int ...@@ -289,7 +290,8 @@ static int
sa1100fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, sa1100fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int trans, struct fb_info *info) u_int trans, struct fb_info *info)
{ {
struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; struct sa1100fb_info *fbi =
container_of(info, struct sa1100fb_info, fb);
unsigned int val; unsigned int val;
int ret = 1; int ret = 1;
...@@ -366,7 +368,8 @@ static inline unsigned int sa1100fb_display_dma_period(struct fb_var_screeninfo ...@@ -366,7 +368,8 @@ static inline unsigned int sa1100fb_display_dma_period(struct fb_var_screeninfo
static int static int
sa1100fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) sa1100fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{ {
struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; struct sa1100fb_info *fbi =
container_of(info, struct sa1100fb_info, fb);
int rgbidx; int rgbidx;
if (var->xres < MIN_XRES) if (var->xres < MIN_XRES)
...@@ -433,7 +436,8 @@ static void sa1100fb_set_visual(struct sa1100fb_info *fbi, u32 visual) ...@@ -433,7 +436,8 @@ static void sa1100fb_set_visual(struct sa1100fb_info *fbi, u32 visual)
*/ */
static int sa1100fb_set_par(struct fb_info *info) static int sa1100fb_set_par(struct fb_info *info)
{ {
struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; struct sa1100fb_info *fbi =
container_of(info, struct sa1100fb_info, fb);
struct fb_var_screeninfo *var = &info->var; struct fb_var_screeninfo *var = &info->var;
unsigned long palette_mem_size; unsigned long palette_mem_size;
...@@ -526,7 +530,8 @@ sa1100fb_set_cmap(struct fb_cmap *cmap, int kspc, int con, ...@@ -526,7 +530,8 @@ sa1100fb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
*/ */
static int sa1100fb_blank(int blank, struct fb_info *info) static int sa1100fb_blank(int blank, struct fb_info *info)
{ {
struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; struct sa1100fb_info *fbi =
container_of(info, struct sa1100fb_info, fb);
int i; int i;
dev_dbg(fbi->dev, "sa1100fb_blank: blank=%d\n", blank); dev_dbg(fbi->dev, "sa1100fb_blank: blank=%d\n", blank);
...@@ -555,7 +560,8 @@ static int sa1100fb_blank(int blank, struct fb_info *info) ...@@ -555,7 +560,8 @@ static int sa1100fb_blank(int blank, struct fb_info *info)
static int sa1100fb_mmap(struct fb_info *info, static int sa1100fb_mmap(struct fb_info *info,
struct vm_area_struct *vma) struct vm_area_struct *vma)
{ {
struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; struct sa1100fb_info *fbi =
container_of(info, struct sa1100fb_info, fb);
unsigned long off = vma->vm_pgoff << PAGE_SHIFT; unsigned long off = vma->vm_pgoff << PAGE_SHIFT;
if (off < info->fix.smem_len) { if (off < info->fix.smem_len) {
......
...@@ -281,6 +281,7 @@ struct sh_hdmi { ...@@ -281,6 +281,7 @@ struct sh_hdmi {
u8 edid_block_addr; u8 edid_block_addr;
u8 edid_segment_nr; u8 edid_segment_nr;
u8 edid_blocks; u8 edid_blocks;
int irq;
struct clk *hdmi_clk; struct clk *hdmi_clk;
struct device *dev; struct device *dev;
struct delayed_work edid_work; struct delayed_work edid_work;
...@@ -1299,6 +1300,7 @@ static int __init sh_hdmi_probe(struct platform_device *pdev) ...@@ -1299,6 +1300,7 @@ static int __init sh_hdmi_probe(struct platform_device *pdev)
hdmi->dev = &pdev->dev; hdmi->dev = &pdev->dev;
hdmi->entity.owner = THIS_MODULE; hdmi->entity.owner = THIS_MODULE;
hdmi->entity.ops = &sh_hdmi_ops; hdmi->entity.ops = &sh_hdmi_ops;
hdmi->irq = irq;
hdmi->hdmi_clk = clk_get(&pdev->dev, "ick"); hdmi->hdmi_clk = clk_get(&pdev->dev, "ick");
if (IS_ERR(hdmi->hdmi_clk)) { if (IS_ERR(hdmi->hdmi_clk)) {
...@@ -1415,12 +1417,11 @@ static int __exit sh_hdmi_remove(struct platform_device *pdev) ...@@ -1415,12 +1417,11 @@ static int __exit sh_hdmi_remove(struct platform_device *pdev)
{ {
struct sh_hdmi *hdmi = entity_to_sh_hdmi(platform_get_drvdata(pdev)); struct sh_hdmi *hdmi = entity_to_sh_hdmi(platform_get_drvdata(pdev));
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
int irq = platform_get_irq(pdev, 0);
snd_soc_unregister_codec(&pdev->dev); snd_soc_unregister_codec(&pdev->dev);
/* No new work will be scheduled, wait for running ISR */ /* No new work will be scheduled, wait for running ISR */
free_irq(irq, hdmi); free_irq(hdmi->irq, hdmi);
/* Wait for already scheduled work */ /* Wait for already scheduled work */
cancel_delayed_work_sync(&hdmi->edid_work); cancel_delayed_work_sync(&hdmi->edid_work);
pm_runtime_put(&pdev->dev); pm_runtime_put(&pdev->dev);
...@@ -1435,10 +1436,49 @@ static int __exit sh_hdmi_remove(struct platform_device *pdev) ...@@ -1435,10 +1436,49 @@ static int __exit sh_hdmi_remove(struct platform_device *pdev)
return 0; return 0;
} }
static int sh_hdmi_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct sh_hdmi *hdmi = entity_to_sh_hdmi(platform_get_drvdata(pdev));
disable_irq(hdmi->irq);
/* Wait for already scheduled work */
cancel_delayed_work_sync(&hdmi->edid_work);
return 0;
}
static int sh_hdmi_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct sh_mobile_hdmi_info *pdata = dev_get_platdata(dev);
struct sh_hdmi *hdmi = entity_to_sh_hdmi(platform_get_drvdata(pdev));
/* Re-init interrupt polarity */
if (pdata->flags & HDMI_OUTPUT_PUSH_PULL)
hdmi_bit_set(hdmi, 0x02, 0x02, HDMI_SYSTEM_CTRL);
if (pdata->flags & HDMI_OUTPUT_POLARITY_HI)
hdmi_bit_set(hdmi, 0x01, 0x01, HDMI_SYSTEM_CTRL);
/* Re-init htop1 */
if (hdmi->htop1)
sh_hdmi_htop1_init(hdmi);
/* Now it's safe to enable interrupts again */
enable_irq(hdmi->irq);
return 0;
}
static const struct dev_pm_ops sh_hdmi_pm_ops = {
.suspend = sh_hdmi_suspend,
.resume = sh_hdmi_resume,
};
static struct platform_driver sh_hdmi_driver = { static struct platform_driver sh_hdmi_driver = {
.remove = __exit_p(sh_hdmi_remove), .remove = __exit_p(sh_hdmi_remove),
.driver = { .driver = {
.name = "sh-mobile-hdmi", .name = "sh-mobile-hdmi",
.pm = &sh_hdmi_pm_ops,
}, },
}; };
......
...@@ -1714,7 +1714,7 @@ SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned sh ...@@ -1714,7 +1714,7 @@ SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned sh
SiS_Pr->PanelVCLKIdx315 = VCLK81_315; /* ? */ SiS_Pr->PanelVCLKIdx315 = VCLK81_315; /* ? */
} else { } else {
SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 802; SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 802;
SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRS = 112; SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112;
SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6;
SiS_Pr->PanelVCLKIdx300 = VCLK81_300; SiS_Pr->PanelVCLKIdx300 = VCLK81_300;
SiS_Pr->PanelVCLKIdx315 = VCLK81_315; SiS_Pr->PanelVCLKIdx315 = VCLK81_315;
......
...@@ -5830,7 +5830,7 @@ static int sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -5830,7 +5830,7 @@ static int sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ivideo->cardnumber++; ivideo->cardnumber++;
} }
strncpy(ivideo->myid, chipinfo->chip_name, 30); strlcpy(ivideo->myid, chipinfo->chip_name, sizeof(ivideo->myid));
ivideo->warncount = 0; ivideo->warncount = 0;
ivideo->chip_id = pdev->device; ivideo->chip_id = pdev->device;
......
...@@ -918,7 +918,7 @@ static int ...@@ -918,7 +918,7 @@ static int
stifb_setcolreg(u_int regno, u_int red, u_int green, stifb_setcolreg(u_int regno, u_int red, u_int green,
u_int blue, u_int transp, struct fb_info *info) u_int blue, u_int transp, struct fb_info *info)
{ {
struct stifb_info *fb = (struct stifb_info *) info; struct stifb_info *fb = container_of(info, struct stifb_info, info);
u32 color; u32 color;
if (regno >= NR_PALETTE) if (regno >= NR_PALETTE)
...@@ -978,7 +978,7 @@ stifb_setcolreg(u_int regno, u_int red, u_int green, ...@@ -978,7 +978,7 @@ stifb_setcolreg(u_int regno, u_int red, u_int green,
static int static int
stifb_blank(int blank_mode, struct fb_info *info) stifb_blank(int blank_mode, struct fb_info *info)
{ {
struct stifb_info *fb = (struct stifb_info *) info; struct stifb_info *fb = container_of(info, struct stifb_info, info);
int enable = (blank_mode == 0) ? ENABLE : DISABLE; int enable = (blank_mode == 0) ? ENABLE : DISABLE;
switch (fb->id) { switch (fb->id) {
......
...@@ -1528,11 +1528,8 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev, ...@@ -1528,11 +1528,8 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev,
} }
if (total_len > 5) { if (total_len > 5) {
pr_info("vendor descriptor length:%x data:%02x %02x %02x %02x" \ pr_info("vendor descriptor length:%x data:%11ph\n", total_len,
"%02x %02x %02x %02x %02x %02x %02x\n", desc);
total_len, desc[0],
desc[1], desc[2], desc[3], desc[4], desc[5], desc[6],
desc[7], desc[8], desc[9], desc[10]);
if ((desc[0] != total_len) || /* descriptor length */ if ((desc[0] != total_len) || /* descriptor length */
(desc[1] != 0x5f) || /* vendor descriptor type */ (desc[1] != 0x5f) || /* vendor descriptor type */
......
...@@ -136,7 +136,8 @@ static struct fb_ops valkyriefb_ops = { ...@@ -136,7 +136,8 @@ static struct fb_ops valkyriefb_ops = {
/* Sets the video mode according to info->var */ /* Sets the video mode according to info->var */
static int valkyriefb_set_par(struct fb_info *info) static int valkyriefb_set_par(struct fb_info *info)
{ {
struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) info; struct fb_info_valkyrie *p =
container_of(info, struct fb_info_valkyrie, info);
volatile struct valkyrie_regs __iomem *valkyrie_regs = p->valkyrie_regs; volatile struct valkyrie_regs __iomem *valkyrie_regs = p->valkyrie_regs;
struct fb_par_valkyrie *par = info->par; struct fb_par_valkyrie *par = info->par;
struct valkyrie_regvals *init; struct valkyrie_regvals *init;
...@@ -194,7 +195,8 @@ valkyriefb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) ...@@ -194,7 +195,8 @@ valkyriefb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
*/ */
static int valkyriefb_blank(int blank_mode, struct fb_info *info) static int valkyriefb_blank(int blank_mode, struct fb_info *info)
{ {
struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) info; struct fb_info_valkyrie *p =
container_of(info, struct fb_info_valkyrie, info);
struct fb_par_valkyrie *par = info->par; struct fb_par_valkyrie *par = info->par;
struct valkyrie_regvals *init = par->init; struct valkyrie_regvals *init = par->init;
...@@ -226,7 +228,8 @@ static int valkyriefb_blank(int blank_mode, struct fb_info *info) ...@@ -226,7 +228,8 @@ static int valkyriefb_blank(int blank_mode, struct fb_info *info)
static int valkyriefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, static int valkyriefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int transp, struct fb_info *info) u_int transp, struct fb_info *info)
{ {
struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) info; struct fb_info_valkyrie *p =
container_of(info, struct fb_info_valkyrie, info);
volatile struct cmap_regs __iomem *cmap_regs = p->cmap_regs; volatile struct cmap_regs __iomem *cmap_regs = p->cmap_regs;
struct fb_par_valkyrie *par = info->par; struct fb_par_valkyrie *par = info->par;
...@@ -263,10 +266,10 @@ static inline int valkyrie_vram_reqd(int video_mode, int color_mode) ...@@ -263,10 +266,10 @@ static inline int valkyrie_vram_reqd(int video_mode, int color_mode)
static void set_valkyrie_clock(unsigned char *params) static void set_valkyrie_clock(unsigned char *params)
{ {
#ifdef CONFIG_ADB_CUDA
struct adb_request req; struct adb_request req;
int i; int i;
#ifdef CONFIG_ADB_CUDA
for (i = 0; i < 3; ++i) { for (i = 0; i < 3; ++i) {
cuda_request(&req, NULL, 5, CUDA_PACKET, CUDA_GET_SET_IIC, cuda_request(&req, NULL, 5, CUDA_PACKET, CUDA_GET_SET_IIC,
0x50, i + 1, params[i]); 0x50, i + 1, params[i]);
...@@ -465,7 +468,8 @@ static int valkyrie_var_to_par(struct fb_var_screeninfo *var, ...@@ -465,7 +468,8 @@ static int valkyrie_var_to_par(struct fb_var_screeninfo *var,
{ {
int vmode, cmode; int vmode, cmode;
struct valkyrie_regvals *init; struct valkyrie_regvals *init;
struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) fb_info; struct fb_info_valkyrie *p =
container_of(fb_info, struct fb_info_valkyrie, info);
if (mac_var_to_vmode(var, &vmode, &cmode) != 0) { if (mac_var_to_vmode(var, &vmode, &cmode) != 0) {
printk(KERN_ERR "valkyriefb: can't do %dx%dx%d.\n", printk(KERN_ERR "valkyriefb: can't do %dx%dx%d.\n",
......
...@@ -481,7 +481,6 @@ static int vml_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -481,7 +481,6 @@ static int vml_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
default: default:
err = -ENODEV; err = -ENODEV;
goto out_err_1; goto out_err_1;
break;
} }
info = &vinfo->info; info = &vinfo->info;
......
...@@ -233,8 +233,7 @@ struct display_timings *of_get_display_timings(struct device_node *np) ...@@ -233,8 +233,7 @@ struct display_timings *of_get_display_timings(struct device_node *np)
return disp; return disp;
timingfail: timingfail:
if (native_mode) of_node_put(native_mode);
of_node_put(native_mode);
display_timings_release(disp); display_timings_release(disp);
disp = NULL; disp = NULL;
entryfail: entryfail:
......
...@@ -31,6 +31,7 @@ struct font_desc { ...@@ -31,6 +31,7 @@ struct font_desc {
#define SUN12x22_IDX 7 #define SUN12x22_IDX 7
#define ACORN8x8_IDX 8 #define ACORN8x8_IDX 8
#define MINI4x6_IDX 9 #define MINI4x6_IDX 9
#define FONT6x10_IDX 10
extern const struct font_desc font_vga_8x8, extern const struct font_desc font_vga_8x8,
font_vga_8x16, font_vga_8x16,
...@@ -41,7 +42,8 @@ extern const struct font_desc font_vga_8x8, ...@@ -41,7 +42,8 @@ extern const struct font_desc font_vga_8x8,
font_sun_8x16, font_sun_8x16,
font_sun_12x22, font_sun_12x22,
font_acorn_8x8, font_acorn_8x8,
font_mini_4x6; font_mini_4x6,
font_6x10;
/* Find a font with a specific name */ /* Find a font with a specific name */
......
...@@ -15,9 +15,25 @@ struct display_timings; ...@@ -15,9 +15,25 @@ struct display_timings;
#define OF_USE_NATIVE_MODE -1 #define OF_USE_NATIVE_MODE -1
#ifdef CONFIG_OF
int of_get_display_timing(struct device_node *np, const char *name, int of_get_display_timing(struct device_node *np, const char *name,
struct display_timing *dt); struct display_timing *dt);
struct display_timings *of_get_display_timings(struct device_node *np); struct display_timings *of_get_display_timings(struct device_node *np);
int of_display_timings_exist(struct device_node *np); int of_display_timings_exist(struct device_node *np);
#else
static inline int of_get_display_timing(struct device_node *np, const char *name,
struct display_timing *dt)
{
return -ENOSYS;
}
static inline struct display_timings *of_get_display_timings(struct device_node *np)
{
return NULL;
}
static inline int of_display_timings_exist(struct device_node *np)
{
return -ENOSYS;
}
#endif
#endif #endif
...@@ -79,6 +79,14 @@ config FONT_MINI_4x6 ...@@ -79,6 +79,14 @@ config FONT_MINI_4x6
bool "Mini 4x6 font" bool "Mini 4x6 font"
depends on !SPARC && FONTS depends on !SPARC && FONTS
config FONT_6x10
bool "Medium-size 6x10 font"
depends on !SPARC && FONTS
help
Medium-size console font. Suitable for framebuffer consoles on
embedded devices with a 320x240 screen, to get a reasonable number
of characters (53x24) that are still at a readable size.
config FONT_SUN8x16 config FONT_SUN8x16
bool "Sparc console 8x16 font" bool "Sparc console 8x16 font"
depends on FRAMEBUFFER_CONSOLE && (!SPARC && FONTS || SPARC) depends on FRAMEBUFFER_CONSOLE && (!SPARC && FONTS || SPARC)
...@@ -109,6 +117,7 @@ config FONT_AUTOSELECT ...@@ -109,6 +117,7 @@ config FONT_AUTOSELECT
depends on !FONT_PEARL_8x8 depends on !FONT_PEARL_8x8
depends on !FONT_ACORN_8x8 depends on !FONT_ACORN_8x8
depends on !FONT_MINI_4x6 depends on !FONT_MINI_4x6
depends on !FONT_6x10
depends on !FONT_SUN8x16 depends on !FONT_SUN8x16
depends on !FONT_SUN12x22 depends on !FONT_SUN12x22
depends on !FONT_10x18 depends on !FONT_10x18
......
...@@ -12,6 +12,7 @@ font-objs-$(CONFIG_FONT_10x18) += font_10x18.o ...@@ -12,6 +12,7 @@ font-objs-$(CONFIG_FONT_10x18) += font_10x18.o
font-objs-$(CONFIG_FONT_PEARL_8x8) += font_pearl_8x8.o font-objs-$(CONFIG_FONT_PEARL_8x8) += font_pearl_8x8.o
font-objs-$(CONFIG_FONT_ACORN_8x8) += font_acorn_8x8.o font-objs-$(CONFIG_FONT_ACORN_8x8) += font_acorn_8x8.o
font-objs-$(CONFIG_FONT_MINI_4x6) += font_mini_4x6.o font-objs-$(CONFIG_FONT_MINI_4x6) += font_mini_4x6.o
font-objs-$(CONFIG_FONT_6x10) += font_6x10.o
font-objs += $(font-objs-y) font-objs += $(font-objs-y)
......
此差异已折叠。
...@@ -63,6 +63,10 @@ static const struct font_desc *fonts[] = { ...@@ -63,6 +63,10 @@ static const struct font_desc *fonts[] = {
#undef NO_FONTS #undef NO_FONTS
&font_mini_4x6, &font_mini_4x6,
#endif #endif
#ifdef CONFIG_FONT_6x10
#undef NO_FONTS
&font_6x10,
#endif
}; };
#define num_fonts ARRAY_SIZE(fonts) #define num_fonts ARRAY_SIZE(fonts)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册