Commit edccb594 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull fbdev updates from Bartlomiej Zolnierkiewicz:

 - fix for font color when console is switched to another fb driver

 - deferred probing fixes for simplefb driver

 - preparations to add support of an optional GPIO to enable panel for
   ARM CLCD driver

 - some improvements for ssd1307fb driver

 - cleanups for OMAP fbdev LCD drivers

 - misc fixes/cleanups for various fb drivers

* tag 'fbdev-v4.11' of git://github.com/bzolnier/linux: (30 commits)
  video: fbdev: fsl-diu-fb: fix spelling mistake "palette"
  fbdev: ssd1307fb: include linux/gpio/consumer.h
  video: fbdev: fsl-diu-fb: remove impossible condition
  video: fbdev: amifb: remove impossible condition
  fbdev/ssd1307fb: clear screen in probe
  fbdev/ssd1307fb: add support to enable VBAT
  fbdev: ssd1307fb: Make reset gpio devicetree property optional
  fbdev: ssd1307fb: Remove reset-active-low from the DT binding document
  fbdev: ssd1307fb: Start to use gpiod API for reset gpio
  video: fbdev: sh_mobile_lcdcfb: fix error return code in sh_mobile_lcdc_probe()
  video: fbdev: offb: switch to using for_each_node_by_type
  video/console: use setup_timer and mod_timer instead of init_timer
  fbdev: omap/lcd: Make callbacks optional
  fbdev: omap/lcd: Staticize non-exported lcd_panel structs
  fbdev: omap/lcd: Remove no-op driver callbacks
  video/mbx: use simple_open()
  video: fbdev: stifb: handle NULL return value from ioremap_nocache
  video: fbdev: pmagb-b-fb: Remove bad `__init' annotation
  video: fbdev: pmag-ba-fb: Remove bad `__init' annotation
  video: ARM CLCD: use panel device node for getting backlight and mode
  ...
parents 6e5c8381 42f82367
...@@ -8,14 +8,15 @@ Required properties: ...@@ -8,14 +8,15 @@ Required properties:
0x3c or 0x3d 0x3c or 0x3d
- pwm: Should contain the pwm to use according to the OF device tree PWM - pwm: Should contain the pwm to use according to the OF device tree PWM
specification [0]. Only required for the ssd1307. specification [0]. Only required for the ssd1307.
- reset-gpios: Should contain the GPIO used to reset the OLED display
- solomon,height: Height in pixel of the screen driven by the controller - solomon,height: Height in pixel of the screen driven by the controller
- solomon,width: Width in pixel of the screen driven by the controller - solomon,width: Width in pixel of the screen driven by the controller
- solomon,page-offset: Offset of pages (band of 8 pixels) that the screen is - solomon,page-offset: Offset of pages (band of 8 pixels) that the screen is
mapped to. mapped to.
Optional properties: Optional properties:
- reset-active-low: Is the reset gpio is active on physical low? - reset-gpios: The GPIO used to reset the OLED display, if available. See
Documentation/devicetree/bindings/gpio/gpio.txt for details.
- vbat-supply: The supply for VBAT
- solomon,segment-no-remap: Display needs normal (non-inverted) data column - solomon,segment-no-remap: Display needs normal (non-inverted) data column
to segment mapping to segment mapping
- solomon,com-seq: Display uses sequential COM pin configuration - solomon,com-seq: Display uses sequential COM pin configuration
......
...@@ -412,11 +412,9 @@ static void fbcon_add_cursor_timer(struct fb_info *info) ...@@ -412,11 +412,9 @@ static void fbcon_add_cursor_timer(struct fb_info *info)
if (!info->queue.func) if (!info->queue.func)
INIT_WORK(&info->queue, fb_flashcursor); INIT_WORK(&info->queue, fb_flashcursor);
init_timer(&ops->cursor_timer); setup_timer(&ops->cursor_timer, cursor_timer_handler,
ops->cursor_timer.function = cursor_timer_handler; (unsigned long) info);
ops->cursor_timer.expires = jiffies + ops->cur_blink_jiffies; mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies);
ops->cursor_timer.data = (unsigned long ) info;
add_timer(&ops->cursor_timer);
ops->flags |= FBCON_FLAGS_CURSOR_TIMER; ops->flags |= FBCON_FLAGS_CURSOR_TIMER;
} }
} }
...@@ -1165,6 +1163,8 @@ static void fbcon_free_font(struct display *p, bool freefont) ...@@ -1165,6 +1163,8 @@ static void fbcon_free_font(struct display *p, bool freefont)
p->userfont = 0; p->userfont = 0;
} }
static void set_vc_hi_font(struct vc_data *vc, bool set);
static void fbcon_deinit(struct vc_data *vc) static void fbcon_deinit(struct vc_data *vc)
{ {
struct display *p = &fb_display[vc->vc_num]; struct display *p = &fb_display[vc->vc_num];
...@@ -1200,6 +1200,9 @@ static void fbcon_deinit(struct vc_data *vc) ...@@ -1200,6 +1200,9 @@ static void fbcon_deinit(struct vc_data *vc)
if (free_font) if (free_font)
vc->vc_font.data = NULL; vc->vc_font.data = NULL;
if (vc->vc_hi_font_mask)
set_vc_hi_font(vc, false);
if (!con_is_bound(&fb_con)) if (!con_is_bound(&fb_con))
fbcon_exit(); fbcon_exit();
...@@ -2436,32 +2439,10 @@ static int fbcon_get_font(struct vc_data *vc, struct console_font *font) ...@@ -2436,32 +2439,10 @@ static int fbcon_get_font(struct vc_data *vc, struct console_font *font)
return 0; return 0;
} }
static int fbcon_do_set_font(struct vc_data *vc, int w, int h, /* set/clear vc_hi_font_mask and update vc attrs accordingly */
const u8 * data, int userfont) static void set_vc_hi_font(struct vc_data *vc, bool set)
{ {
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; if (!set) {
struct fbcon_ops *ops = info->fbcon_par;
struct display *p = &fb_display[vc->vc_num];
int resize;
int cnt;
char *old_data = NULL;
if (con_is_visible(vc) && softback_lines)
fbcon_set_origin(vc);
resize = (w != vc->vc_font.width) || (h != vc->vc_font.height);
if (p->userfont)
old_data = vc->vc_font.data;
if (userfont)
cnt = FNTCHARCNT(data);
else
cnt = 256;
vc->vc_font.data = (void *)(p->fontdata = data);
if ((p->userfont = userfont))
REFCOUNT(data)++;
vc->vc_font.width = w;
vc->vc_font.height = h;
if (vc->vc_hi_font_mask && cnt == 256) {
vc->vc_hi_font_mask = 0; vc->vc_hi_font_mask = 0;
if (vc->vc_can_do_color) { if (vc->vc_can_do_color) {
vc->vc_complement_mask >>= 1; vc->vc_complement_mask >>= 1;
...@@ -2484,7 +2465,7 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, ...@@ -2484,7 +2465,7 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
((c & 0xfe00) >> 1) | (c & 0xff); ((c & 0xfe00) >> 1) | (c & 0xff);
vc->vc_attr >>= 1; vc->vc_attr >>= 1;
} }
} else if (!vc->vc_hi_font_mask && cnt == 512) { } else {
vc->vc_hi_font_mask = 0x100; vc->vc_hi_font_mask = 0x100;
if (vc->vc_can_do_color) { if (vc->vc_can_do_color) {
vc->vc_complement_mask <<= 1; vc->vc_complement_mask <<= 1;
...@@ -2516,8 +2497,38 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, ...@@ -2516,8 +2497,38 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
} else } else
vc->vc_video_erase_char = c & ~0x100; vc->vc_video_erase_char = c & ~0x100;
} }
} }
}
static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
const u8 * data, int userfont)
{
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
struct fbcon_ops *ops = info->fbcon_par;
struct display *p = &fb_display[vc->vc_num];
int resize;
int cnt;
char *old_data = NULL;
if (con_is_visible(vc) && softback_lines)
fbcon_set_origin(vc);
resize = (w != vc->vc_font.width) || (h != vc->vc_font.height);
if (p->userfont)
old_data = vc->vc_font.data;
if (userfont)
cnt = FNTCHARCNT(data);
else
cnt = 256;
vc->vc_font.data = (void *)(p->fontdata = data);
if ((p->userfont = userfont))
REFCOUNT(data)++;
vc->vc_font.width = w;
vc->vc_font.height = h;
if (vc->vc_hi_font_mask && cnt == 256)
set_vc_hi_font(vc, false);
else if (!vc->vc_hi_font_mask && cnt == 512)
set_vc_hi_font(vc, true);
if (resize) { if (resize) {
int cols, rows; int cols, rows;
......
...@@ -213,15 +213,8 @@ static void tpg110_init(struct device *dev, struct device_node *np, ...@@ -213,15 +213,8 @@ static void tpg110_init(struct device *dev, struct device_node *np,
board->disable = tpg110_disable; board->disable = tpg110_disable;
} }
int nomadik_clcd_init_panel(struct clcd_fb *fb, int nomadik_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel)
struct device_node *endpoint)
{ {
struct device_node *panel;
panel = of_graph_get_remote_port_parent(endpoint);
if (!panel)
return -ENODEV;
if (of_device_is_compatible(panel, "tpo,tpg110")) if (of_device_is_compatible(panel, "tpo,tpg110"))
tpg110_init(&fb->dev->dev, panel, fb->board); tpg110_init(&fb->dev->dev, panel, fb->board);
else else
......
...@@ -6,8 +6,7 @@ ...@@ -6,8 +6,7 @@
#ifdef CONFIG_ARCH_NOMADIK #ifdef CONFIG_ARCH_NOMADIK
int nomadik_clcd_init_board(struct amba_device *adev, int nomadik_clcd_init_board(struct amba_device *adev,
struct clcd_board *board); struct clcd_board *board);
int nomadik_clcd_init_panel(struct clcd_fb *fb, int nomadik_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel);
struct device_node *endpoint);
#else #else
static inline int nomadik_clcd_init_board(struct amba_device *adev, static inline int nomadik_clcd_init_board(struct amba_device *adev,
struct clcd_board *board) struct clcd_board *board)
...@@ -15,7 +14,7 @@ static inline int nomadik_clcd_init_board(struct amba_device *adev, ...@@ -15,7 +14,7 @@ static inline int nomadik_clcd_init_board(struct amba_device *adev,
return 0; return 0;
} }
static inline int nomadik_clcd_init_panel(struct clcd_fb *fb, static inline int nomadik_clcd_init_panel(struct clcd_fb *fb,
struct device_node *endpoint) struct device_node *panel)
{ {
return 0; return 0;
} }
......
...@@ -452,11 +452,9 @@ static const struct versatile_panel versatile_panels[] = { ...@@ -452,11 +452,9 @@ static const struct versatile_panel versatile_panels[] = {
}, },
}; };
static void versatile_panel_probe(struct device *dev, static void versatile_panel_probe(struct device *dev, struct device_node *panel)
struct device_node *endpoint)
{ {
struct versatile_panel const *vpanel = NULL; struct versatile_panel const *vpanel = NULL;
struct device_node *panel = NULL;
u32 val; u32 val;
int ret; int ret;
int i; int i;
...@@ -488,11 +486,6 @@ static void versatile_panel_probe(struct device *dev, ...@@ -488,11 +486,6 @@ static void versatile_panel_probe(struct device *dev,
return; return;
} }
panel = of_graph_get_remote_port_parent(endpoint);
if (!panel) {
dev_err(dev, "could not locate panel in DT\n");
return;
}
if (!of_device_is_compatible(panel, vpanel->compatible)) if (!of_device_is_compatible(panel, vpanel->compatible))
dev_err(dev, "panel in DT is not compatible with the " dev_err(dev, "panel in DT is not compatible with the "
"auto-detected panel, continuing anyway\n"); "auto-detected panel, continuing anyway\n");
...@@ -514,8 +507,7 @@ static void versatile_panel_probe(struct device *dev, ...@@ -514,8 +507,7 @@ static void versatile_panel_probe(struct device *dev,
} }
} }
int versatile_clcd_init_panel(struct clcd_fb *fb, int versatile_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel)
struct device_node *endpoint)
{ {
const struct of_device_id *clcd_id; const struct of_device_id *clcd_id;
enum versatile_clcd versatile_clcd_type; enum versatile_clcd versatile_clcd_type;
...@@ -551,7 +543,7 @@ int versatile_clcd_init_panel(struct clcd_fb *fb, ...@@ -551,7 +543,7 @@ int versatile_clcd_init_panel(struct clcd_fb *fb,
fb->board->enable = versatile_clcd_enable; fb->board->enable = versatile_clcd_enable;
fb->board->disable = versatile_clcd_disable; fb->board->disable = versatile_clcd_disable;
fb->board->decode = versatile_clcd_decode; fb->board->decode = versatile_clcd_decode;
versatile_panel_probe(dev, endpoint); versatile_panel_probe(dev, panel);
dev_info(dev, "set up callbacks for Versatile\n"); dev_info(dev, "set up callbacks for Versatile\n");
break; break;
case REALVIEW_CLCD_EB: case REALVIEW_CLCD_EB:
......
...@@ -6,11 +6,10 @@ ...@@ -6,11 +6,10 @@
#include <linux/platform_data/video-clcd-versatile.h> #include <linux/platform_data/video-clcd-versatile.h>
#if defined(CONFIG_PLAT_VERSATILE_CLCD) && defined(CONFIG_OF) #if defined(CONFIG_PLAT_VERSATILE_CLCD) && defined(CONFIG_OF)
int versatile_clcd_init_panel(struct clcd_fb *fb, int versatile_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel);
struct device_node *endpoint);
#else #else
static inline int versatile_clcd_init_panel(struct clcd_fb *fb, static inline int versatile_clcd_init_panel(struct clcd_fb *fb,
struct device_node *endpoint) struct device_node *panel)
{ {
return 0; return 0;
} }
......
...@@ -10,27 +10,22 @@ ...@@ -10,27 +10,22 @@
* *
* ARM PrimeCell PL110 Color LCD Controller * ARM PrimeCell PL110 Color LCD Controller
*/ */
#include <linux/dma-mapping.h> #include <linux/amba/bus.h>
#include <linux/module.h> #include <linux/amba/clcd.h>
#include <linux/kernel.h> #include <linux/backlight.h>
#include <linux/errno.h> #include <linux/clk.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/mm.h> #include <linux/dma-mapping.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/amba/bus.h> #include <linux/mm.h>
#include <linux/amba/clcd.h> #include <linux/module.h>
#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/hardirq.h>
#include <linux/of.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/of_graph.h> #include <linux/of_graph.h>
#include <linux/backlight.h> #include <linux/slab.h>
#include <linux/string.h>
#include <video/display_timing.h> #include <video/display_timing.h>
#include <video/of_display_timing.h> #include <video/of_display_timing.h>
#include <video/videomode.h> #include <video/videomode.h>
...@@ -629,16 +624,11 @@ static int clcdfb_snprintf_mode(char *buf, int size, struct fb_videomode *mode) ...@@ -629,16 +624,11 @@ static int clcdfb_snprintf_mode(char *buf, int size, struct fb_videomode *mode)
mode->refresh); mode->refresh);
} }
static int clcdfb_of_get_backlight(struct device_node *endpoint, static int clcdfb_of_get_backlight(struct device_node *panel,
struct clcd_panel *clcd_panel) struct clcd_panel *clcd_panel)
{ {
struct device_node *panel;
struct device_node *backlight; struct device_node *backlight;
panel = of_graph_get_remote_port_parent(endpoint);
if (!panel)
return -ENODEV;
/* Look up the optional backlight phandle */ /* Look up the optional backlight phandle */
backlight = of_parse_phandle(panel, "backlight", 0); backlight = of_parse_phandle(panel, "backlight", 0);
if (backlight) { if (backlight) {
...@@ -651,19 +641,14 @@ static int clcdfb_of_get_backlight(struct device_node *endpoint, ...@@ -651,19 +641,14 @@ static int clcdfb_of_get_backlight(struct device_node *endpoint,
return 0; return 0;
} }
static int clcdfb_of_get_mode(struct device *dev, struct device_node *endpoint, static int clcdfb_of_get_mode(struct device *dev, struct device_node *panel,
struct clcd_panel *clcd_panel) struct clcd_panel *clcd_panel)
{ {
int err; int err;
struct device_node *panel;
struct fb_videomode *mode; struct fb_videomode *mode;
char *name; char *name;
int len; int len;
panel = of_graph_get_remote_port_parent(endpoint);
if (!panel)
return -ENODEV;
/* Only directly connected DPI panels supported for now */ /* Only directly connected DPI panels supported for now */
if (of_device_is_compatible(panel, "panel-dpi")) if (of_device_is_compatible(panel, "panel-dpi"))
err = clcdfb_of_get_dpi_panel_mode(panel, clcd_panel); err = clcdfb_of_get_dpi_panel_mode(panel, clcd_panel);
...@@ -769,7 +754,7 @@ static int clcdfb_of_init_tft_panel(struct clcd_fb *fb, u32 r0, u32 g0, u32 b0) ...@@ -769,7 +754,7 @@ static int clcdfb_of_init_tft_panel(struct clcd_fb *fb, u32 r0, u32 g0, u32 b0)
static int clcdfb_of_init_display(struct clcd_fb *fb) static int clcdfb_of_init_display(struct clcd_fb *fb)
{ {
struct device_node *endpoint; struct device_node *endpoint, *panel;
int err; int err;
unsigned int bpp; unsigned int bpp;
u32 max_bandwidth; u32 max_bandwidth;
...@@ -786,17 +771,21 @@ static int clcdfb_of_init_display(struct clcd_fb *fb) ...@@ -786,17 +771,21 @@ static int clcdfb_of_init_display(struct clcd_fb *fb)
if (!endpoint) if (!endpoint)
return -ENODEV; return -ENODEV;
panel = of_graph_get_remote_port_parent(endpoint);
if (!panel)
return -ENODEV;
if (fb->vendor->init_panel) { if (fb->vendor->init_panel) {
err = fb->vendor->init_panel(fb, endpoint); err = fb->vendor->init_panel(fb, panel);
if (err) if (err)
return err; return err;
} }
err = clcdfb_of_get_backlight(endpoint, fb->panel); err = clcdfb_of_get_backlight(panel, fb->panel);
if (err) if (err)
return err; return err;
err = clcdfb_of_get_mode(&fb->dev->dev, endpoint, fb->panel); err = clcdfb_of_get_mode(&fb->dev->dev, panel, fb->panel);
if (err) if (err)
return err; return err;
......
...@@ -1484,13 +1484,11 @@ static int ami_decode_var(struct fb_var_screeninfo *var, struct amifb_par *par, ...@@ -1484,13 +1484,11 @@ static int ami_decode_var(struct fb_var_screeninfo *var, struct amifb_par *par,
par->xoffset = var->xoffset; par->xoffset = var->xoffset;
par->yoffset = var->yoffset; par->yoffset = var->yoffset;
if (par->vmode & FB_VMODE_YWRAP) { if (par->vmode & FB_VMODE_YWRAP) {
if (par->xoffset || par->yoffset < 0 || if (par->yoffset >= par->vyres)
par->yoffset >= par->vyres)
par->xoffset = par->yoffset = 0; par->xoffset = par->yoffset = 0;
} else { } else {
if (par->xoffset < 0 || if (par->xoffset > upx(16 << maxfmode, par->vxres - par->xres) ||
par->xoffset > upx(16 << maxfmode, par->vxres - par->xres) || par->yoffset > par->vyres - par->yres)
par->yoffset < 0 || par->yoffset > par->vyres - par->yres)
par->xoffset = par->yoffset = 0; par->xoffset = par->yoffset = 0;
} }
} else } else
......
...@@ -439,12 +439,12 @@ static struct mfb_info mfb_template[] = { ...@@ -439,12 +439,12 @@ static struct mfb_info mfb_template[] = {
static void __attribute__ ((unused)) fsl_diu_dump(struct diu __iomem *hw) static void __attribute__ ((unused)) fsl_diu_dump(struct diu __iomem *hw)
{ {
mb(); mb();
pr_debug("DIU: desc=%08x,%08x,%08x, gamma=%08x pallete=%08x " pr_debug("DIU: desc=%08x,%08x,%08x, gamma=%08x palette=%08x "
"cursor=%08x curs_pos=%08x diu_mode=%08x bgnd=%08x " "cursor=%08x curs_pos=%08x diu_mode=%08x bgnd=%08x "
"disp_size=%08x hsyn_para=%08x vsyn_para=%08x syn_pol=%08x " "disp_size=%08x hsyn_para=%08x vsyn_para=%08x syn_pol=%08x "
"thresholds=%08x int_mask=%08x plut=%08x\n", "thresholds=%08x int_mask=%08x plut=%08x\n",
hw->desc[0], hw->desc[1], hw->desc[2], hw->gamma, hw->desc[0], hw->desc[1], hw->desc[2], hw->gamma,
hw->pallete, hw->cursor, hw->curs_pos, hw->diu_mode, hw->palette, hw->cursor, hw->curs_pos, hw->diu_mode,
hw->bgnd, hw->disp_size, hw->hsyn_para, hw->vsyn_para, hw->bgnd, hw->disp_size, hw->hsyn_para, hw->vsyn_para,
hw->syn_pol, hw->thresholds, hw->int_mask, hw->plut); hw->syn_pol, hw->thresholds, hw->int_mask, hw->plut);
rmb(); rmb();
...@@ -703,12 +703,6 @@ static int fsl_diu_check_var(struct fb_var_screeninfo *var, ...@@ -703,12 +703,6 @@ static int fsl_diu_check_var(struct fb_var_screeninfo *var,
if (var->yres_virtual < var->yres) if (var->yres_virtual < var->yres)
var->yres_virtual = var->yres; var->yres_virtual = var->yres;
if (var->xoffset < 0)
var->xoffset = 0;
if (var->yoffset < 0)
var->yoffset = 0;
if (var->xoffset + info->var.xres > info->var.xres_virtual) if (var->xoffset + info->var.xres > info->var.xres_virtual)
var->xoffset = info->var.xres_virtual - info->var.xres; var->xoffset = info->var.xres_virtual - info->var.xres;
...@@ -1254,8 +1248,7 @@ static int fsl_diu_pan_display(struct fb_var_screeninfo *var, ...@@ -1254,8 +1248,7 @@ static int fsl_diu_pan_display(struct fb_var_screeninfo *var,
(info->var.yoffset == var->yoffset)) (info->var.yoffset == var->yoffset))
return 0; /* No change, do nothing */ return 0; /* No change, do nothing */
if (var->xoffset < 0 || var->yoffset < 0 if (var->xoffset + info->var.xres > info->var.xres_virtual
|| var->xoffset + info->var.xres > info->var.xres_virtual
|| var->yoffset + info->var.yres > info->var.yres_virtual) || var->yoffset + info->var.yres > info->var.yres_virtual)
return -EINVAL; return -EINVAL;
......
...@@ -985,7 +985,11 @@ static int imxfb_probe(struct platform_device *pdev) ...@@ -985,7 +985,11 @@ static int imxfb_probe(struct platform_device *pdev)
*/ */
imxfb_check_var(&info->var, info); imxfb_check_var(&info->var, info);
ret = fb_alloc_cmap(&info->cmap, 1 << info->var.bits_per_pixel, 0); /*
* For modes > 8bpp, the color map is bypassed.
* Therefore, 256 entries are enough.
*/
ret = fb_alloc_cmap(&info->cmap, 256, 0);
if (ret < 0) if (ret < 0)
goto failed_cmap; goto failed_cmap;
......
...@@ -1088,14 +1088,20 @@ static void MGAG100_restore(struct matrox_fb_info *minfo) ...@@ -1088,14 +1088,20 @@ static void MGAG100_restore(struct matrox_fb_info *minfo)
#ifdef CONFIG_FB_MATROX_MYSTIQUE #ifdef CONFIG_FB_MATROX_MYSTIQUE
struct matrox_switch matrox_mystique = { struct matrox_switch matrox_mystique = {
MGA1064_preinit, MGA1064_reset, MGA1064_init, MGA1064_restore, .preinit = MGA1064_preinit,
.reset = MGA1064_reset,
.init = MGA1064_init,
.restore = MGA1064_restore,
}; };
EXPORT_SYMBOL(matrox_mystique); EXPORT_SYMBOL(matrox_mystique);
#endif #endif
#ifdef CONFIG_FB_MATROX_G #ifdef CONFIG_FB_MATROX_G
struct matrox_switch matrox_G100 = { struct matrox_switch matrox_G100 = {
MGAG100_preinit, MGAG100_reset, MGAG100_init, MGAG100_restore, .preinit = MGAG100_preinit,
.reset = MGAG100_reset,
.init = MGAG100_init,
.restore = MGAG100_restore,
}; };
EXPORT_SYMBOL(matrox_G100); EXPORT_SYMBOL(matrox_G100);
#endif #endif
......
...@@ -738,7 +738,10 @@ static int Ti3026_preinit(struct matrox_fb_info *minfo) ...@@ -738,7 +738,10 @@ static int Ti3026_preinit(struct matrox_fb_info *minfo)
} }
struct matrox_switch matrox_millennium = { struct matrox_switch matrox_millennium = {
Ti3026_preinit, Ti3026_reset, Ti3026_init, Ti3026_restore .preinit = Ti3026_preinit,
.reset = Ti3026_reset,
.init = Ti3026_init,
.restore = Ti3026_restore
}; };
EXPORT_SYMBOL(matrox_millennium); EXPORT_SYMBOL(matrox_millennium);
#endif #endif
......
...@@ -51,7 +51,7 @@ static struct fb_var_screeninfo maxinefb_defined = { ...@@ -51,7 +51,7 @@ static struct fb_var_screeninfo maxinefb_defined = {
.vmode = FB_VMODE_NONINTERLACED, .vmode = FB_VMODE_NONINTERLACED,
}; };
static struct fb_fix_screeninfo maxinefb_fix = { static struct fb_fix_screeninfo maxinefb_fix __initdata = {
.id = "Maxine", .id = "Maxine",
.smem_len = (1024*768), .smem_len = (1024*768),
.type = FB_TYPE_PACKED_PIXELS, .type = FB_TYPE_PACKED_PIXELS,
......
...@@ -15,12 +15,6 @@ struct mbxfb_debugfs_data { ...@@ -15,12 +15,6 @@ struct mbxfb_debugfs_data {
struct dentry *misc; struct dentry *misc;
}; };
static int open_file_generic(struct inode *inode, struct file *file)
{
file->private_data = inode->i_private;
return 0;
}
static ssize_t write_file_dummy(struct file *file, const char __user *buf, static ssize_t write_file_dummy(struct file *file, const char __user *buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
...@@ -174,42 +168,42 @@ static ssize_t misc_read_file(struct file *file, char __user *userbuf, ...@@ -174,42 +168,42 @@ static ssize_t misc_read_file(struct file *file, char __user *userbuf,
static const struct file_operations sysconf_fops = { static const struct file_operations sysconf_fops = {
.read = sysconf_read_file, .read = sysconf_read_file,
.write = write_file_dummy, .write = write_file_dummy,
.open = open_file_generic, .open = simple_open,
.llseek = default_llseek, .llseek = default_llseek,
}; };
static const struct file_operations clock_fops = { static const struct file_operations clock_fops = {
.read = clock_read_file, .read = clock_read_file,
.write = write_file_dummy, .write = write_file_dummy,
.open = open_file_generic, .open = simple_open,
.llseek = default_llseek, .llseek = default_llseek,
}; };
static const struct file_operations display_fops = { static const struct file_operations display_fops = {
.read = display_read_file, .read = display_read_file,
.write = write_file_dummy, .write = write_file_dummy,
.open = open_file_generic, .open = simple_open,
.llseek = default_llseek, .llseek = default_llseek,
}; };
static const struct file_operations gsctl_fops = { static const struct file_operations gsctl_fops = {
.read = gsctl_read_file, .read = gsctl_read_file,
.write = write_file_dummy, .write = write_file_dummy,
.open = open_file_generic, .open = simple_open,
.llseek = default_llseek, .llseek = default_llseek,
}; };
static const struct file_operations sdram_fops = { static const struct file_operations sdram_fops = {
.read = sdram_read_file, .read = sdram_read_file,
.write = write_file_dummy, .write = write_file_dummy,
.open = open_file_generic, .open = simple_open,
.llseek = default_llseek, .llseek = default_llseek,
}; };
static const struct file_operations misc_fops = { static const struct file_operations misc_fops = {
.read = misc_read_file, .read = misc_read_file,
.write = write_file_dummy, .write = write_file_dummy,
.open = open_file_generic, .open = simple_open,
.llseek = default_llseek, .llseek = default_llseek,
}; };
......
...@@ -668,14 +668,14 @@ static int __init offb_init(void) ...@@ -668,14 +668,14 @@ static int __init offb_init(void)
offb_init_nodriver(of_chosen, 1); offb_init_nodriver(of_chosen, 1);
} }
for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { for_each_node_by_type(dp, "display") {
if (of_get_property(dp, "linux,opened", NULL) && if (of_get_property(dp, "linux,opened", NULL) &&
of_get_property(dp, "linux,boot-display", NULL)) { of_get_property(dp, "linux,boot-display", NULL)) {
boot_disp = dp; boot_disp = dp;
offb_init_nodriver(dp, 0); offb_init_nodriver(dp, 0);
} }
} }
for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { for_each_node_by_type(dp, "display") {
if (of_get_property(dp, "linux,opened", NULL) && if (of_get_property(dp, "linux,opened", NULL) &&
dp != boot_disp) dp != boot_disp)
offb_init_nodriver(dp, 0); offb_init_nodriver(dp, 0);
......
...@@ -136,11 +136,6 @@ static void ams_delta_panel_disable(struct lcd_panel *panel) ...@@ -136,11 +136,6 @@ static void ams_delta_panel_disable(struct lcd_panel *panel)
gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_NDISP, 0); gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_NDISP, 0);
} }
static unsigned long ams_delta_panel_get_caps(struct lcd_panel *panel)
{
return 0;
}
static struct lcd_panel ams_delta_panel = { static struct lcd_panel ams_delta_panel = {
.name = "ams-delta", .name = "ams-delta",
.config = 0, .config = 0,
...@@ -163,7 +158,6 @@ static struct lcd_panel ams_delta_panel = { ...@@ -163,7 +158,6 @@ static struct lcd_panel ams_delta_panel = {
.cleanup = ams_delta_panel_cleanup, .cleanup = ams_delta_panel_cleanup,
.enable = ams_delta_panel_enable, .enable = ams_delta_panel_enable,
.disable = ams_delta_panel_disable, .disable = ams_delta_panel_disable,
.get_caps = ams_delta_panel_get_caps,
}; };
...@@ -195,27 +189,8 @@ static int ams_delta_panel_probe(struct platform_device *pdev) ...@@ -195,27 +189,8 @@ static int ams_delta_panel_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int ams_delta_panel_remove(struct platform_device *pdev)
{
return 0;
}
static int ams_delta_panel_suspend(struct platform_device *pdev,
pm_message_t mesg)
{
return 0;
}
static int ams_delta_panel_resume(struct platform_device *pdev)
{
return 0;
}
static struct platform_driver ams_delta_panel_driver = { static struct platform_driver ams_delta_panel_driver = {
.probe = ams_delta_panel_probe, .probe = ams_delta_panel_probe,
.remove = ams_delta_panel_remove,
.suspend = ams_delta_panel_suspend,
.resume = ams_delta_panel_resume,
.driver = { .driver = {
.name = "lcd_ams_delta", .name = "lcd_ams_delta",
}, },
......
...@@ -28,15 +28,6 @@ ...@@ -28,15 +28,6 @@
#define MODULE_NAME "omapfb-lcd_h3" #define MODULE_NAME "omapfb-lcd_h3"
static int h3_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev)
{
return 0;
}
static void h3_panel_cleanup(struct lcd_panel *panel)
{
}
static int h3_panel_enable(struct lcd_panel *panel) static int h3_panel_enable(struct lcd_panel *panel)
{ {
int r = 0; int r = 0;
...@@ -63,12 +54,7 @@ static void h3_panel_disable(struct lcd_panel *panel) ...@@ -63,12 +54,7 @@ static void h3_panel_disable(struct lcd_panel *panel)
pr_err(MODULE_NAME ": Unable to turn off LCD panel\n"); pr_err(MODULE_NAME ": Unable to turn off LCD panel\n");
} }
static unsigned long h3_panel_get_caps(struct lcd_panel *panel) static struct lcd_panel h3_panel = {
{
return 0;
}
struct lcd_panel h3_panel = {
.name = "h3", .name = "h3",
.config = OMAP_LCDC_PANEL_TFT, .config = OMAP_LCDC_PANEL_TFT,
...@@ -85,11 +71,8 @@ struct lcd_panel h3_panel = { ...@@ -85,11 +71,8 @@ struct lcd_panel h3_panel = {
.vbp = 0, .vbp = 0,
.pcd = 0, .pcd = 0,
.init = h3_panel_init,
.cleanup = h3_panel_cleanup,
.enable = h3_panel_enable, .enable = h3_panel_enable,
.disable = h3_panel_disable, .disable = h3_panel_disable,
.get_caps = h3_panel_get_caps,
}; };
static int h3_panel_probe(struct platform_device *pdev) static int h3_panel_probe(struct platform_device *pdev)
...@@ -98,26 +81,8 @@ static int h3_panel_probe(struct platform_device *pdev) ...@@ -98,26 +81,8 @@ static int h3_panel_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int h3_panel_remove(struct platform_device *pdev)
{
return 0;
}
static int h3_panel_suspend(struct platform_device *pdev, pm_message_t mesg)
{
return 0;
}
static int h3_panel_resume(struct platform_device *pdev)
{
return 0;
}
static struct platform_driver h3_panel_driver = { static struct platform_driver h3_panel_driver = {
.probe = h3_panel_probe, .probe = h3_panel_probe,
.remove = h3_panel_remove,
.suspend = h3_panel_suspend,
.resume = h3_panel_resume,
.driver = { .driver = {
.name = "lcd_h3", .name = "lcd_h3",
}, },
......
...@@ -31,32 +31,8 @@ ...@@ -31,32 +31,8 @@
#include "omapfb.h" #include "omapfb.h"
static int htcherald_panel_init(struct lcd_panel *panel,
struct omapfb_device *fbdev)
{
return 0;
}
static void htcherald_panel_cleanup(struct lcd_panel *panel)
{
}
static int htcherald_panel_enable(struct lcd_panel *panel)
{
return 0;
}
static void htcherald_panel_disable(struct lcd_panel *panel)
{
}
static unsigned long htcherald_panel_get_caps(struct lcd_panel *panel)
{
return 0;
}
/* Found on WIZ200 (miknix) and some HERA110 models (darkstar62) */ /* Found on WIZ200 (miknix) and some HERA110 models (darkstar62) */
struct lcd_panel htcherald_panel_1 = { static struct lcd_panel htcherald_panel_1 = {
.name = "lcd_herald", .name = "lcd_herald",
.config = OMAP_LCDC_PANEL_TFT | .config = OMAP_LCDC_PANEL_TFT |
OMAP_LCDC_INV_HSYNC | OMAP_LCDC_INV_HSYNC |
...@@ -74,12 +50,6 @@ struct lcd_panel htcherald_panel_1 = { ...@@ -74,12 +50,6 @@ struct lcd_panel htcherald_panel_1 = {
.vsw = 3, .vsw = 3,
.vfp = 2, .vfp = 2,
.vbp = 2, .vbp = 2,
.init = htcherald_panel_init,
.cleanup = htcherald_panel_cleanup,
.enable = htcherald_panel_enable,
.disable = htcherald_panel_disable,
.get_caps = htcherald_panel_get_caps,
}; };
static int htcherald_panel_probe(struct platform_device *pdev) static int htcherald_panel_probe(struct platform_device *pdev)
...@@ -88,27 +58,8 @@ static int htcherald_panel_probe(struct platform_device *pdev) ...@@ -88,27 +58,8 @@ static int htcherald_panel_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int htcherald_panel_remove(struct platform_device *pdev)
{
return 0;
}
static int htcherald_panel_suspend(struct platform_device *pdev,
pm_message_t mesg)
{
return 0;
}
static int htcherald_panel_resume(struct platform_device *pdev)
{
return 0;
}
static struct platform_driver htcherald_panel_driver = { static struct platform_driver htcherald_panel_driver = {
.probe = htcherald_panel_probe, .probe = htcherald_panel_probe,
.remove = htcherald_panel_remove,
.suspend = htcherald_panel_suspend,
.resume = htcherald_panel_resume,
.driver = { .driver = {
.name = "lcd_htcherald", .name = "lcd_htcherald",
}, },
......
...@@ -27,16 +27,6 @@ ...@@ -27,16 +27,6 @@
#include "omapfb.h" #include "omapfb.h"
static int innovator1510_panel_init(struct lcd_panel *panel,
struct omapfb_device *fbdev)
{
return 0;
}
static void innovator1510_panel_cleanup(struct lcd_panel *panel)
{
}
static int innovator1510_panel_enable(struct lcd_panel *panel) static int innovator1510_panel_enable(struct lcd_panel *panel)
{ {
__raw_writeb(0x7, OMAP1510_FPGA_LCD_PANEL_CONTROL); __raw_writeb(0x7, OMAP1510_FPGA_LCD_PANEL_CONTROL);
...@@ -48,12 +38,7 @@ static void innovator1510_panel_disable(struct lcd_panel *panel) ...@@ -48,12 +38,7 @@ static void innovator1510_panel_disable(struct lcd_panel *panel)
__raw_writeb(0x0, OMAP1510_FPGA_LCD_PANEL_CONTROL); __raw_writeb(0x0, OMAP1510_FPGA_LCD_PANEL_CONTROL);
} }
static unsigned long innovator1510_panel_get_caps(struct lcd_panel *panel) static struct lcd_panel innovator1510_panel = {
{
return 0;
}
struct lcd_panel innovator1510_panel = {
.name = "inn1510", .name = "inn1510",
.config = OMAP_LCDC_PANEL_TFT, .config = OMAP_LCDC_PANEL_TFT,
...@@ -70,11 +55,8 @@ struct lcd_panel innovator1510_panel = { ...@@ -70,11 +55,8 @@ struct lcd_panel innovator1510_panel = {
.vbp = 0, .vbp = 0,
.pcd = 12, .pcd = 12,
.init = innovator1510_panel_init,
.cleanup = innovator1510_panel_cleanup,
.enable = innovator1510_panel_enable, .enable = innovator1510_panel_enable,
.disable = innovator1510_panel_disable, .disable = innovator1510_panel_disable,
.get_caps = innovator1510_panel_get_caps,
}; };
static int innovator1510_panel_probe(struct platform_device *pdev) static int innovator1510_panel_probe(struct platform_device *pdev)
...@@ -83,27 +65,8 @@ static int innovator1510_panel_probe(struct platform_device *pdev) ...@@ -83,27 +65,8 @@ static int innovator1510_panel_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int innovator1510_panel_remove(struct platform_device *pdev)
{
return 0;
}
static int innovator1510_panel_suspend(struct platform_device *pdev,
pm_message_t mesg)
{
return 0;
}
static int innovator1510_panel_resume(struct platform_device *pdev)
{
return 0;
}
static struct platform_driver innovator1510_panel_driver = { static struct platform_driver innovator1510_panel_driver = {
.probe = innovator1510_panel_probe, .probe = innovator1510_panel_probe,
.remove = innovator1510_panel_remove,
.suspend = innovator1510_panel_suspend,
.resume = innovator1510_panel_resume,
.driver = { .driver = {
.name = "lcd_inn1510", .name = "lcd_inn1510",
}, },
......
...@@ -69,12 +69,7 @@ static void innovator1610_panel_disable(struct lcd_panel *panel) ...@@ -69,12 +69,7 @@ static void innovator1610_panel_disable(struct lcd_panel *panel)
gpio_set_value(15, 0); gpio_set_value(15, 0);
} }
static unsigned long innovator1610_panel_get_caps(struct lcd_panel *panel) static struct lcd_panel innovator1610_panel = {
{
return 0;
}
struct lcd_panel innovator1610_panel = {
.name = "inn1610", .name = "inn1610",
.config = OMAP_LCDC_PANEL_TFT, .config = OMAP_LCDC_PANEL_TFT,
...@@ -95,7 +90,6 @@ struct lcd_panel innovator1610_panel = { ...@@ -95,7 +90,6 @@ struct lcd_panel innovator1610_panel = {
.cleanup = innovator1610_panel_cleanup, .cleanup = innovator1610_panel_cleanup,
.enable = innovator1610_panel_enable, .enable = innovator1610_panel_enable,
.disable = innovator1610_panel_disable, .disable = innovator1610_panel_disable,
.get_caps = innovator1610_panel_get_caps,
}; };
static int innovator1610_panel_probe(struct platform_device *pdev) static int innovator1610_panel_probe(struct platform_device *pdev)
...@@ -104,27 +98,8 @@ static int innovator1610_panel_probe(struct platform_device *pdev) ...@@ -104,27 +98,8 @@ static int innovator1610_panel_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int innovator1610_panel_remove(struct platform_device *pdev)
{
return 0;
}
static int innovator1610_panel_suspend(struct platform_device *pdev,
pm_message_t mesg)
{
return 0;
}
static int innovator1610_panel_resume(struct platform_device *pdev)
{
return 0;
}
static struct platform_driver innovator1610_panel_driver = { static struct platform_driver innovator1610_panel_driver = {
.probe = innovator1610_panel_probe, .probe = innovator1610_panel_probe,
.remove = innovator1610_panel_remove,
.suspend = innovator1610_panel_suspend,
.resume = innovator1610_panel_resume,
.driver = { .driver = {
.name = "lcd_inn1610", .name = "lcd_inn1610",
}, },
......
...@@ -29,16 +29,6 @@ ...@@ -29,16 +29,6 @@
#include "omapfb.h" #include "omapfb.h"
static int osk_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev)
{
/* gpio2 was allocated in board init */
return 0;
}
static void osk_panel_cleanup(struct lcd_panel *panel)
{
}
static int osk_panel_enable(struct lcd_panel *panel) static int osk_panel_enable(struct lcd_panel *panel)
{ {
/* configure PWL pin */ /* configure PWL pin */
...@@ -68,12 +58,7 @@ static void osk_panel_disable(struct lcd_panel *panel) ...@@ -68,12 +58,7 @@ static void osk_panel_disable(struct lcd_panel *panel)
gpio_set_value(2, 0); gpio_set_value(2, 0);
} }
static unsigned long osk_panel_get_caps(struct lcd_panel *panel) static struct lcd_panel osk_panel = {
{
return 0;
}
struct lcd_panel osk_panel = {
.name = "osk", .name = "osk",
.config = OMAP_LCDC_PANEL_TFT, .config = OMAP_LCDC_PANEL_TFT,
...@@ -90,11 +75,8 @@ struct lcd_panel osk_panel = { ...@@ -90,11 +75,8 @@ struct lcd_panel osk_panel = {
.vbp = 0, .vbp = 0,
.pcd = 12, .pcd = 12,
.init = osk_panel_init,
.cleanup = osk_panel_cleanup,
.enable = osk_panel_enable, .enable = osk_panel_enable,
.disable = osk_panel_disable, .disable = osk_panel_disable,
.get_caps = osk_panel_get_caps,
}; };
static int osk_panel_probe(struct platform_device *pdev) static int osk_panel_probe(struct platform_device *pdev)
...@@ -103,26 +85,8 @@ static int osk_panel_probe(struct platform_device *pdev) ...@@ -103,26 +85,8 @@ static int osk_panel_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int osk_panel_remove(struct platform_device *pdev)
{
return 0;
}
static int osk_panel_suspend(struct platform_device *pdev, pm_message_t mesg)
{
return 0;
}
static int osk_panel_resume(struct platform_device *pdev)
{
return 0;
}
static struct platform_driver osk_panel_driver = { static struct platform_driver osk_panel_driver = {
.probe = osk_panel_probe, .probe = osk_panel_probe,
.remove = osk_panel_remove,
.suspend = osk_panel_suspend,
.resume = osk_panel_resume,
.driver = { .driver = {
.name = "lcd_osk", .name = "lcd_osk",
}, },
......
...@@ -25,31 +25,7 @@ ...@@ -25,31 +25,7 @@
#include "omapfb.h" #include "omapfb.h"
static int palmte_panel_init(struct lcd_panel *panel, static struct lcd_panel palmte_panel = {
struct omapfb_device *fbdev)
{
return 0;
}
static void palmte_panel_cleanup(struct lcd_panel *panel)
{
}
static int palmte_panel_enable(struct lcd_panel *panel)
{
return 0;
}
static void palmte_panel_disable(struct lcd_panel *panel)
{
}
static unsigned long palmte_panel_get_caps(struct lcd_panel *panel)
{
return 0;
}
struct lcd_panel palmte_panel = {
.name = "palmte", .name = "palmte",
.config = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC | .config = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC |
OMAP_LCDC_INV_HSYNC | OMAP_LCDC_HSVS_RISING_EDGE | OMAP_LCDC_INV_HSYNC | OMAP_LCDC_HSVS_RISING_EDGE |
...@@ -67,12 +43,6 @@ struct lcd_panel palmte_panel = { ...@@ -67,12 +43,6 @@ struct lcd_panel palmte_panel = {
.vfp = 8, .vfp = 8,
.vbp = 7, .vbp = 7,
.pcd = 0, .pcd = 0,
.init = palmte_panel_init,
.cleanup = palmte_panel_cleanup,
.enable = palmte_panel_enable,
.disable = palmte_panel_disable,
.get_caps = palmte_panel_get_caps,
}; };
static int palmte_panel_probe(struct platform_device *pdev) static int palmte_panel_probe(struct platform_device *pdev)
...@@ -81,26 +51,8 @@ static int palmte_panel_probe(struct platform_device *pdev) ...@@ -81,26 +51,8 @@ static int palmte_panel_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int palmte_panel_remove(struct platform_device *pdev)
{
return 0;
}
static int palmte_panel_suspend(struct platform_device *pdev, pm_message_t mesg)
{
return 0;
}
static int palmte_panel_resume(struct platform_device *pdev)
{
return 0;
}
static struct platform_driver palmte_panel_driver = { static struct platform_driver palmte_panel_driver = {
.probe = palmte_panel_probe, .probe = palmte_panel_probe,
.remove = palmte_panel_remove,
.suspend = palmte_panel_suspend,
.resume = palmte_panel_resume,
.driver = { .driver = {
.name = "lcd_palmte", .name = "lcd_palmte",
}, },
......
...@@ -32,31 +32,12 @@ GPIO13 - screen blanking ...@@ -32,31 +32,12 @@ GPIO13 - screen blanking
#include "omapfb.h" #include "omapfb.h"
static int palmtt_panel_init(struct lcd_panel *panel,
struct omapfb_device *fbdev)
{
return 0;
}
static void palmtt_panel_cleanup(struct lcd_panel *panel)
{
}
static int palmtt_panel_enable(struct lcd_panel *panel)
{
return 0;
}
static void palmtt_panel_disable(struct lcd_panel *panel)
{
}
static unsigned long palmtt_panel_get_caps(struct lcd_panel *panel) static unsigned long palmtt_panel_get_caps(struct lcd_panel *panel)
{ {
return OMAPFB_CAPS_SET_BACKLIGHT; return OMAPFB_CAPS_SET_BACKLIGHT;
} }
struct lcd_panel palmtt_panel = { static struct lcd_panel palmtt_panel = {
.name = "palmtt", .name = "palmtt",
.config = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC | .config = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC |
OMAP_LCDC_INV_HSYNC | OMAP_LCDC_HSVS_RISING_EDGE | OMAP_LCDC_INV_HSYNC | OMAP_LCDC_HSVS_RISING_EDGE |
...@@ -74,10 +55,6 @@ struct lcd_panel palmtt_panel = { ...@@ -74,10 +55,6 @@ struct lcd_panel palmtt_panel = {
.vbp = 7, .vbp = 7,
.pcd = 0, .pcd = 0,
.init = palmtt_panel_init,
.cleanup = palmtt_panel_cleanup,
.enable = palmtt_panel_enable,
.disable = palmtt_panel_disable,
.get_caps = palmtt_panel_get_caps, .get_caps = palmtt_panel_get_caps,
}; };
...@@ -87,26 +64,8 @@ static int palmtt_panel_probe(struct platform_device *pdev) ...@@ -87,26 +64,8 @@ static int palmtt_panel_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int palmtt_panel_remove(struct platform_device *pdev)
{
return 0;
}
static int palmtt_panel_suspend(struct platform_device *pdev, pm_message_t mesg)
{
return 0;
}
static int palmtt_panel_resume(struct platform_device *pdev)
{
return 0;
}
static struct platform_driver palmtt_panel_driver = { static struct platform_driver palmtt_panel_driver = {
.probe = palmtt_panel_probe, .probe = palmtt_panel_probe,
.remove = palmtt_panel_remove,
.suspend = palmtt_panel_suspend,
.resume = palmtt_panel_resume,
.driver = { .driver = {
.name = "lcd_palmtt", .name = "lcd_palmtt",
}, },
......
...@@ -26,32 +26,12 @@ ...@@ -26,32 +26,12 @@
#include "omapfb.h" #include "omapfb.h"
static int palmz71_panel_init(struct lcd_panel *panel,
struct omapfb_device *fbdev)
{
return 0;
}
static void palmz71_panel_cleanup(struct lcd_panel *panel)
{
}
static int palmz71_panel_enable(struct lcd_panel *panel)
{
return 0;
}
static void palmz71_panel_disable(struct lcd_panel *panel)
{
}
static unsigned long palmz71_panel_get_caps(struct lcd_panel *panel) static unsigned long palmz71_panel_get_caps(struct lcd_panel *panel)
{ {
return OMAPFB_CAPS_SET_BACKLIGHT; return OMAPFB_CAPS_SET_BACKLIGHT;
} }
struct lcd_panel palmz71_panel = { static struct lcd_panel palmz71_panel = {
.name = "palmz71", .name = "palmz71",
.config = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC | .config = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC |
OMAP_LCDC_INV_HSYNC | OMAP_LCDC_HSVS_RISING_EDGE | OMAP_LCDC_INV_HSYNC | OMAP_LCDC_HSVS_RISING_EDGE |
...@@ -69,10 +49,6 @@ struct lcd_panel palmz71_panel = { ...@@ -69,10 +49,6 @@ struct lcd_panel palmz71_panel = {
.vbp = 7, .vbp = 7,
.pcd = 0, .pcd = 0,
.init = palmz71_panel_init,
.cleanup = palmz71_panel_cleanup,
.enable = palmz71_panel_enable,
.disable = palmz71_panel_disable,
.get_caps = palmz71_panel_get_caps, .get_caps = palmz71_panel_get_caps,
}; };
...@@ -82,27 +58,8 @@ static int palmz71_panel_probe(struct platform_device *pdev) ...@@ -82,27 +58,8 @@ static int palmz71_panel_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int palmz71_panel_remove(struct platform_device *pdev)
{
return 0;
}
static int palmz71_panel_suspend(struct platform_device *pdev,
pm_message_t mesg)
{
return 0;
}
static int palmz71_panel_resume(struct platform_device *pdev)
{
return 0;
}
static struct platform_driver palmz71_panel_driver = { static struct platform_driver palmz71_panel_driver = {
.probe = palmz71_panel_probe, .probe = palmz71_panel_probe,
.remove = palmz71_panel_remove,
.suspend = palmz71_panel_suspend,
.resume = palmz71_panel_resume,
.driver = { .driver = {
.name = "lcd_palmz71", .name = "lcd_palmz71",
}, },
......
...@@ -337,6 +337,7 @@ static int omapfb_blank(int blank, struct fb_info *fbi) ...@@ -337,6 +337,7 @@ static int omapfb_blank(int blank, struct fb_info *fbi)
if (fbdev->state == OMAPFB_SUSPENDED) { if (fbdev->state == OMAPFB_SUSPENDED) {
if (fbdev->ctrl->resume) if (fbdev->ctrl->resume)
fbdev->ctrl->resume(); fbdev->ctrl->resume();
if (fbdev->panel->enable)
fbdev->panel->enable(fbdev->panel); fbdev->panel->enable(fbdev->panel);
fbdev->state = OMAPFB_ACTIVE; fbdev->state = OMAPFB_ACTIVE;
if (fbdev->ctrl->get_update_mode() == if (fbdev->ctrl->get_update_mode() ==
...@@ -346,6 +347,7 @@ static int omapfb_blank(int blank, struct fb_info *fbi) ...@@ -346,6 +347,7 @@ static int omapfb_blank(int blank, struct fb_info *fbi)
break; break;
case FB_BLANK_POWERDOWN: case FB_BLANK_POWERDOWN:
if (fbdev->state == OMAPFB_ACTIVE) { if (fbdev->state == OMAPFB_ACTIVE) {
if (fbdev->panel->disable)
fbdev->panel->disable(fbdev->panel); fbdev->panel->disable(fbdev->panel);
if (fbdev->ctrl->suspend) if (fbdev->ctrl->suspend)
fbdev->ctrl->suspend(); fbdev->ctrl->suspend();
...@@ -1030,6 +1032,7 @@ static void omapfb_get_caps(struct omapfb_device *fbdev, int plane, ...@@ -1030,6 +1032,7 @@ static void omapfb_get_caps(struct omapfb_device *fbdev, int plane,
{ {
memset(caps, 0, sizeof(*caps)); memset(caps, 0, sizeof(*caps));
fbdev->ctrl->get_caps(plane, caps); fbdev->ctrl->get_caps(plane, caps);
if (fbdev->panel->get_caps)
caps->ctrl |= fbdev->panel->get_caps(fbdev->panel); caps->ctrl |= fbdev->panel->get_caps(fbdev->panel);
} }
...@@ -1549,6 +1552,7 @@ static void omapfb_free_resources(struct omapfb_device *fbdev, int state) ...@@ -1549,6 +1552,7 @@ static void omapfb_free_resources(struct omapfb_device *fbdev, int state)
case 7: case 7:
omapfb_unregister_sysfs(fbdev); omapfb_unregister_sysfs(fbdev);
case 6: case 6:
if (fbdev->panel->disable)
fbdev->panel->disable(fbdev->panel); fbdev->panel->disable(fbdev->panel);
case 5: case 5:
omapfb_set_update_mode(fbdev, OMAPFB_UPDATE_DISABLED); omapfb_set_update_mode(fbdev, OMAPFB_UPDATE_DISABLED);
...@@ -1557,6 +1561,7 @@ static void omapfb_free_resources(struct omapfb_device *fbdev, int state) ...@@ -1557,6 +1561,7 @@ static void omapfb_free_resources(struct omapfb_device *fbdev, int state)
case 3: case 3:
ctrl_cleanup(fbdev); ctrl_cleanup(fbdev);
case 2: case 2:
if (fbdev->panel->cleanup)
fbdev->panel->cleanup(fbdev->panel); fbdev->panel->cleanup(fbdev->panel);
case 1: case 1:
dev_set_drvdata(fbdev->dev, NULL); dev_set_drvdata(fbdev->dev, NULL);
...@@ -1680,9 +1685,11 @@ static int omapfb_do_probe(struct platform_device *pdev, ...@@ -1680,9 +1685,11 @@ static int omapfb_do_probe(struct platform_device *pdev,
goto cleanup; goto cleanup;
} }
if (fbdev->panel->init) {
r = fbdev->panel->init(fbdev->panel, fbdev); r = fbdev->panel->init(fbdev->panel, fbdev);
if (r) if (r)
goto cleanup; goto cleanup;
}
pr_info("omapfb: configured for panel %s\n", fbdev->panel->name); pr_info("omapfb: configured for panel %s\n", fbdev->panel->name);
...@@ -1725,9 +1732,11 @@ static int omapfb_do_probe(struct platform_device *pdev, ...@@ -1725,9 +1732,11 @@ static int omapfb_do_probe(struct platform_device *pdev,
OMAPFB_MANUAL_UPDATE : OMAPFB_AUTO_UPDATE); OMAPFB_MANUAL_UPDATE : OMAPFB_AUTO_UPDATE);
init_state++; init_state++;
if (fbdev->panel->enable) {
r = fbdev->panel->enable(fbdev->panel); r = fbdev->panel->enable(fbdev->panel);
if (r) if (r)
goto cleanup; goto cleanup;
}
init_state++; init_state++;
r = omapfb_register_sysfs(fbdev); r = omapfb_register_sysfs(fbdev);
......
...@@ -129,7 +129,7 @@ static struct fb_ops pmagbafb_ops = { ...@@ -129,7 +129,7 @@ static struct fb_ops pmagbafb_ops = {
/* /*
* Turn the hardware cursor off. * Turn the hardware cursor off.
*/ */
static void __init pmagbafb_erase_cursor(struct fb_info *info) static void pmagbafb_erase_cursor(struct fb_info *info)
{ {
struct pmagbafb_par *par = info->par; struct pmagbafb_par *par = info->par;
......
...@@ -133,7 +133,7 @@ static struct fb_ops pmagbbfb_ops = { ...@@ -133,7 +133,7 @@ static struct fb_ops pmagbbfb_ops = {
/* /*
* Turn the hardware cursor off. * Turn the hardware cursor off.
*/ */
static void __init pmagbbfb_erase_cursor(struct fb_info *info) static void pmagbbfb_erase_cursor(struct fb_info *info)
{ {
struct pmagbbfb_par *par = info->par; struct pmagbbfb_par *par = info->par;
......
...@@ -439,9 +439,9 @@ static unsigned long lcdc_sys_read_data(void *handle) ...@@ -439,9 +439,9 @@ static unsigned long lcdc_sys_read_data(void *handle)
} }
static struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = { static struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = {
lcdc_sys_write_index, .write_index = lcdc_sys_write_index,
lcdc_sys_write_data, .write_data = lcdc_sys_write_data,
lcdc_sys_read_data, .read_data = lcdc_sys_read_data,
}; };
static int sh_mobile_lcdc_sginit(struct fb_info *info, static int sh_mobile_lcdc_sginit(struct fb_info *info,
...@@ -2782,8 +2782,10 @@ static int sh_mobile_lcdc_probe(struct platform_device *pdev) ...@@ -2782,8 +2782,10 @@ static int sh_mobile_lcdc_probe(struct platform_device *pdev)
priv->forced_fourcc = pdata->ch[0].fourcc; priv->forced_fourcc = pdata->ch[0].fourcc;
priv->base = ioremap_nocache(res->start, resource_size(res)); priv->base = ioremap_nocache(res->start, resource_size(res));
if (!priv->base) if (!priv->base) {
error = -ENOMEM;
goto err1; goto err1;
}
error = sh_mobile_lcdc_setup_clocks(priv, pdata->clock_source); error = sh_mobile_lcdc_setup_clocks(priv, pdata->clock_source);
if (error) { if (error) {
......
...@@ -180,10 +180,12 @@ static int simplefb_parse_pd(struct platform_device *pdev, ...@@ -180,10 +180,12 @@ static int simplefb_parse_pd(struct platform_device *pdev,
struct simplefb_par { struct simplefb_par {
u32 palette[PSEUDO_PALETTE_SIZE]; u32 palette[PSEUDO_PALETTE_SIZE];
#if defined CONFIG_OF && defined CONFIG_COMMON_CLK #if defined CONFIG_OF && defined CONFIG_COMMON_CLK
bool clks_enabled;
unsigned int clk_count; unsigned int clk_count;
struct clk **clks; struct clk **clks;
#endif #endif
#if defined CONFIG_OF && defined CONFIG_REGULATOR #if defined CONFIG_OF && defined CONFIG_REGULATOR
bool regulators_enabled;
u32 regulator_count; u32 regulator_count;
struct regulator **regulators; struct regulator **regulators;
#endif #endif
...@@ -208,12 +210,12 @@ struct simplefb_par { ...@@ -208,12 +210,12 @@ struct simplefb_par {
* the fb probe will not help us much either. So just complain and carry on, * the fb probe will not help us much either. So just complain and carry on,
* and hope that the user actually gets a working fb at the end of things. * and hope that the user actually gets a working fb at the end of things.
*/ */
static int simplefb_clocks_init(struct simplefb_par *par, static int simplefb_clocks_get(struct simplefb_par *par,
struct platform_device *pdev) struct platform_device *pdev)
{ {
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct clk *clock; struct clk *clock;
int i, ret; int i;
if (dev_get_platdata(&pdev->dev) || !np) if (dev_get_platdata(&pdev->dev) || !np)
return 0; return 0;
...@@ -244,6 +246,14 @@ static int simplefb_clocks_init(struct simplefb_par *par, ...@@ -244,6 +246,14 @@ static int simplefb_clocks_init(struct simplefb_par *par,
par->clks[i] = clock; par->clks[i] = clock;
} }
return 0;
}
static void simplefb_clocks_enable(struct simplefb_par *par,
struct platform_device *pdev)
{
int i, ret;
for (i = 0; i < par->clk_count; i++) { for (i = 0; i < par->clk_count; i++) {
if (par->clks[i]) { if (par->clks[i]) {
ret = clk_prepare_enable(par->clks[i]); ret = clk_prepare_enable(par->clks[i]);
...@@ -256,8 +266,7 @@ static int simplefb_clocks_init(struct simplefb_par *par, ...@@ -256,8 +266,7 @@ static int simplefb_clocks_init(struct simplefb_par *par,
} }
} }
} }
par->clks_enabled = true;
return 0;
} }
static void simplefb_clocks_destroy(struct simplefb_par *par) static void simplefb_clocks_destroy(struct simplefb_par *par)
...@@ -269,6 +278,7 @@ static void simplefb_clocks_destroy(struct simplefb_par *par) ...@@ -269,6 +278,7 @@ static void simplefb_clocks_destroy(struct simplefb_par *par)
for (i = 0; i < par->clk_count; i++) { for (i = 0; i < par->clk_count; i++) {
if (par->clks[i]) { if (par->clks[i]) {
if (par->clks_enabled)
clk_disable_unprepare(par->clks[i]); clk_disable_unprepare(par->clks[i]);
clk_put(par->clks[i]); clk_put(par->clks[i]);
} }
...@@ -277,8 +287,10 @@ static void simplefb_clocks_destroy(struct simplefb_par *par) ...@@ -277,8 +287,10 @@ static void simplefb_clocks_destroy(struct simplefb_par *par)
kfree(par->clks); kfree(par->clks);
} }
#else #else
static int simplefb_clocks_init(struct simplefb_par *par, static int simplefb_clocks_get(struct simplefb_par *par,
struct platform_device *pdev) { return 0; } struct platform_device *pdev) { return 0; }
static void simplefb_clocks_enable(struct simplefb_par *par,
struct platform_device *pdev) { }
static void simplefb_clocks_destroy(struct simplefb_par *par) { } static void simplefb_clocks_destroy(struct simplefb_par *par) { }
#endif #endif
...@@ -305,14 +317,14 @@ static void simplefb_clocks_destroy(struct simplefb_par *par) { } ...@@ -305,14 +317,14 @@ static void simplefb_clocks_destroy(struct simplefb_par *par) { }
* the fb probe will not help us much either. So just complain and carry on, * the fb probe will not help us much either. So just complain and carry on,
* and hope that the user actually gets a working fb at the end of things. * and hope that the user actually gets a working fb at the end of things.
*/ */
static int simplefb_regulators_init(struct simplefb_par *par, static int simplefb_regulators_get(struct simplefb_par *par,
struct platform_device *pdev) struct platform_device *pdev)
{ {
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct property *prop; struct property *prop;
struct regulator *regulator; struct regulator *regulator;
const char *p; const char *p;
int count = 0, i = 0, ret; int count = 0, i = 0;
if (dev_get_platdata(&pdev->dev) || !np) if (dev_get_platdata(&pdev->dev) || !np)
return 0; return 0;
...@@ -354,6 +366,14 @@ static int simplefb_regulators_init(struct simplefb_par *par, ...@@ -354,6 +366,14 @@ static int simplefb_regulators_init(struct simplefb_par *par,
} }
par->regulator_count = i; par->regulator_count = i;
return 0;
}
static void simplefb_regulators_enable(struct simplefb_par *par,
struct platform_device *pdev)
{
int i, ret;
/* Enable all the regulators */ /* Enable all the regulators */
for (i = 0; i < par->regulator_count; i++) { for (i = 0; i < par->regulator_count; i++) {
ret = regulator_enable(par->regulators[i]); ret = regulator_enable(par->regulators[i]);
...@@ -365,15 +385,14 @@ static int simplefb_regulators_init(struct simplefb_par *par, ...@@ -365,15 +385,14 @@ static int simplefb_regulators_init(struct simplefb_par *par,
par->regulators[i] = NULL; par->regulators[i] = NULL;
} }
} }
par->regulators_enabled = true;
return 0;
} }
static void simplefb_regulators_destroy(struct simplefb_par *par) static void simplefb_regulators_destroy(struct simplefb_par *par)
{ {
int i; int i;
if (!par->regulators) if (!par->regulators || !par->regulators_enabled)
return; return;
for (i = 0; i < par->regulator_count; i++) for (i = 0; i < par->regulator_count; i++)
...@@ -381,8 +400,10 @@ static void simplefb_regulators_destroy(struct simplefb_par *par) ...@@ -381,8 +400,10 @@ static void simplefb_regulators_destroy(struct simplefb_par *par)
regulator_disable(par->regulators[i]); regulator_disable(par->regulators[i]);
} }
#else #else
static int simplefb_regulators_init(struct simplefb_par *par, static int simplefb_regulators_get(struct simplefb_par *par,
struct platform_device *pdev) { return 0; } struct platform_device *pdev) { return 0; }
static void simplefb_regulators_enable(struct simplefb_par *par,
struct platform_device *pdev) { }
static void simplefb_regulators_destroy(struct simplefb_par *par) { } static void simplefb_regulators_destroy(struct simplefb_par *par) { }
#endif #endif
...@@ -453,14 +474,17 @@ static int simplefb_probe(struct platform_device *pdev) ...@@ -453,14 +474,17 @@ static int simplefb_probe(struct platform_device *pdev)
} }
info->pseudo_palette = par->palette; info->pseudo_palette = par->palette;
ret = simplefb_clocks_init(par, pdev); ret = simplefb_clocks_get(par, pdev);
if (ret < 0) if (ret < 0)
goto error_unmap; goto error_unmap;
ret = simplefb_regulators_init(par, pdev); ret = simplefb_regulators_get(par, pdev);
if (ret < 0) if (ret < 0)
goto error_clocks; goto error_clocks;
simplefb_clocks_enable(par, pdev);
simplefb_regulators_enable(par, pdev);
dev_info(&pdev->dev, "framebuffer at 0x%lx, 0x%x bytes, mapped to 0x%p\n", dev_info(&pdev->dev, "framebuffer at 0x%lx, 0x%x bytes, mapped to 0x%p\n",
info->fix.smem_start, info->fix.smem_len, info->fix.smem_start, info->fix.smem_len,
info->screen_base); info->screen_base);
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/backlight.h> #include <linux/backlight.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -16,6 +17,7 @@ ...@@ -16,6 +17,7 @@
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
#include <linux/pwm.h> #include <linux/pwm.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/regulator/consumer.h>
#define SSD1307FB_DATA 0x40 #define SSD1307FB_DATA 0x40
#define SSD1307FB_COMMAND 0x80 #define SSD1307FB_COMMAND 0x80
...@@ -73,7 +75,8 @@ struct ssd1307fb_par { ...@@ -73,7 +75,8 @@ struct ssd1307fb_par {
u32 prechargep2; u32 prechargep2;
struct pwm_device *pwm; struct pwm_device *pwm;
u32 pwm_period; u32 pwm_period;
int reset; struct gpio_desc *reset;
struct regulator *vbat_reg;
u32 seg_remap; u32 seg_remap;
u32 vcomh; u32 vcomh;
u32 width; u32 width;
...@@ -439,6 +442,9 @@ static int ssd1307fb_init(struct ssd1307fb_par *par) ...@@ -439,6 +442,9 @@ static int ssd1307fb_init(struct ssd1307fb_par *par)
if (ret < 0) if (ret < 0)
return ret; return ret;
/* Clear the screen */
ssd1307fb_update_display(par);
/* Turn on the display */ /* Turn on the display */
ret = ssd1307fb_write_cmd(par->client, SSD1307FB_DISPLAY_ON); ret = ssd1307fb_write_cmd(par->client, SSD1307FB_DISPLAY_ON);
if (ret < 0) if (ret < 0)
...@@ -561,10 +567,20 @@ static int ssd1307fb_probe(struct i2c_client *client, ...@@ -561,10 +567,20 @@ static int ssd1307fb_probe(struct i2c_client *client,
par->device_info = of_device_get_match_data(&client->dev); par->device_info = of_device_get_match_data(&client->dev);
par->reset = of_get_named_gpio(client->dev.of_node, par->reset = devm_gpiod_get_optional(&client->dev, "reset",
"reset-gpios", 0); GPIOD_OUT_LOW);
if (!gpio_is_valid(par->reset)) { if (IS_ERR(par->reset)) {
ret = -EINVAL; dev_err(&client->dev, "failed to get reset gpio: %ld\n",
PTR_ERR(par->reset));
ret = PTR_ERR(par->reset);
goto fb_alloc_error;
}
par->vbat_reg = devm_regulator_get_optional(&client->dev, "vbat");
if (IS_ERR(par->vbat_reg)) {
dev_err(&client->dev, "failed to get VBAT regulator: %ld\n",
PTR_ERR(par->vbat_reg));
ret = PTR_ERR(par->vbat_reg);
goto fb_alloc_error; goto fb_alloc_error;
} }
...@@ -642,27 +658,25 @@ static int ssd1307fb_probe(struct i2c_client *client, ...@@ -642,27 +658,25 @@ static int ssd1307fb_probe(struct i2c_client *client,
fb_deferred_io_init(info); fb_deferred_io_init(info);
ret = devm_gpio_request_one(&client->dev, par->reset,
GPIOF_OUT_INIT_HIGH,
"oled-reset");
if (ret) {
dev_err(&client->dev,
"failed to request gpio %d: %d\n",
par->reset, ret);
goto reset_oled_error;
}
i2c_set_clientdata(client, info); i2c_set_clientdata(client, info);
if (par->reset) {
/* Reset the screen */ /* Reset the screen */
gpio_set_value(par->reset, 0); gpiod_set_value(par->reset, 0);
udelay(4); udelay(4);
gpio_set_value(par->reset, 1); gpiod_set_value(par->reset, 1);
udelay(4); udelay(4);
}
ret = regulator_enable(par->vbat_reg);
if (ret) {
dev_err(&client->dev, "failed to enable VBAT: %d\n", ret);
goto reset_oled_error;
}
ret = ssd1307fb_init(par); ret = ssd1307fb_init(par);
if (ret) if (ret)
goto reset_oled_error; goto regulator_enable_error;
ret = register_framebuffer(info); ret = register_framebuffer(info);
if (ret) { if (ret) {
...@@ -695,6 +709,8 @@ static int ssd1307fb_probe(struct i2c_client *client, ...@@ -695,6 +709,8 @@ static int ssd1307fb_probe(struct i2c_client *client,
pwm_disable(par->pwm); pwm_disable(par->pwm);
pwm_put(par->pwm); pwm_put(par->pwm);
}; };
regulator_enable_error:
regulator_disable(par->vbat_reg);
reset_oled_error: reset_oled_error:
fb_deferred_io_cleanup(info); fb_deferred_io_cleanup(info);
fb_alloc_error: fb_alloc_error:
......
...@@ -1294,6 +1294,10 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) ...@@ -1294,6 +1294,10 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref)
strcpy(fix->id, "stifb"); strcpy(fix->id, "stifb");
info->fbops = &stifb_ops; info->fbops = &stifb_ops;
info->screen_base = ioremap_nocache(REGION_BASE(fb,1), fix->smem_len); info->screen_base = ioremap_nocache(REGION_BASE(fb,1), fix->smem_len);
if (!info->screen_base) {
printk(KERN_ERR "stifb: failed to map memory\n");
goto out_err0;
}
info->screen_size = fix->smem_len; info->screen_size = fix->smem_len;
info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA; info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA;
info->pseudo_palette = &fb->pseudo_palette; info->pseudo_palette = &fb->pseudo_palette;
......
...@@ -182,7 +182,7 @@ static ssize_t contrast_store(struct device *dev, ...@@ -182,7 +182,7 @@ static ssize_t contrast_store(struct device *dev,
return count; return count;
} }
static DEVICE_ATTR(contrast, 0644, contrast_show, contrast_store); static DEVICE_ATTR_RW(contrast);
static inline u_int chan_to_field(u_int chan, struct fb_bitfield *bf) static inline u_int chan_to_field(u_int chan, struct fb_bitfield *bf)
{ {
......
...@@ -73,7 +73,7 @@ struct diu_ad { ...@@ -73,7 +73,7 @@ struct diu_ad {
/* Word 0(32-bit) in DDR memory */ /* Word 0(32-bit) in DDR memory */
/* __u16 comp; */ /* __u16 comp; */
/* __u16 pixel_s:2; */ /* __u16 pixel_s:2; */
/* __u16 pallete:1; */ /* __u16 palette:1; */
/* __u16 red_c:2; */ /* __u16 red_c:2; */
/* __u16 green_c:2; */ /* __u16 green_c:2; */
/* __u16 blue_c:2; */ /* __u16 blue_c:2; */
...@@ -142,7 +142,7 @@ struct diu_ad { ...@@ -142,7 +142,7 @@ struct diu_ad {
struct diu { struct diu {
__be32 desc[3]; __be32 desc[3];
__be32 gamma; __be32 gamma;
__be32 pallete; __be32 palette;
__be32 cursor; __be32 cursor;
__be32 curs_pos; __be32 curs_pos;
__be32 diu_mode; __be32 diu_mode;
......
...@@ -47,10 +47,6 @@ ...@@ -47,10 +47,6 @@
#define LSCR1_GRAY2(x) (((x) & 0xf) << 4) #define LSCR1_GRAY2(x) (((x) & 0xf) << 4)
#define LSCR1_GRAY1(x) (((x) & 0xf)) #define LSCR1_GRAY1(x) (((x) & 0xf))
#define DMACR_BURST (1 << 31)
#define DMACR_HM(x) (((x) & 0xf) << 16)
#define DMACR_TM(x) ((x) & 0xf)
struct imx_fb_videomode { struct imx_fb_videomode {
struct fb_videomode mode; struct fb_videomode mode;
u32 pcr; u32 pcr;
......
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