Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit edccb594 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -8,14 +8,15 @@ Required properties:
         0x3c or 0x3d
  - pwm: Should contain the pwm to use according to the OF device tree PWM
         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,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
    mapped to.

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
                              to segment mapping
  - solomon,com-seq: Display uses sequential COM pin configuration
+43 −32
Original line number Diff line number Diff line
@@ -412,11 +412,9 @@ static void fbcon_add_cursor_timer(struct fb_info *info)
		if (!info->queue.func)
			INIT_WORK(&info->queue, fb_flashcursor);

		init_timer(&ops->cursor_timer);
		ops->cursor_timer.function = cursor_timer_handler;
		ops->cursor_timer.expires = jiffies + ops->cur_blink_jiffies;
		ops->cursor_timer.data = (unsigned long ) info;
		add_timer(&ops->cursor_timer);
		setup_timer(&ops->cursor_timer, cursor_timer_handler,
			    (unsigned long) info);
		mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies);
		ops->flags |= FBCON_FLAGS_CURSOR_TIMER;
	}
}
@@ -1165,6 +1163,8 @@ static void fbcon_free_font(struct display *p, bool freefont)
	p->userfont = 0;
}

static void set_vc_hi_font(struct vc_data *vc, bool set);

static void fbcon_deinit(struct vc_data *vc)
{
	struct display *p = &fb_display[vc->vc_num];
@@ -1200,6 +1200,9 @@ static void fbcon_deinit(struct vc_data *vc)
	if (free_font)
		vc->vc_font.data = NULL;

	if (vc->vc_hi_font_mask)
		set_vc_hi_font(vc, false);

	if (!con_is_bound(&fb_con))
		fbcon_exit();

@@ -2436,32 +2439,10 @@ static int fbcon_get_font(struct vc_data *vc, struct console_font *font)
	return 0;
}

static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
			     const u8 * data, int userfont)
/* set/clear vc_hi_font_mask and update vc attrs accordingly */
static void set_vc_hi_font(struct vc_data *vc, bool set)
{
	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) {
	if (!set) {
		vc->vc_hi_font_mask = 0;
		if (vc->vc_can_do_color) {
			vc->vc_complement_mask >>= 1;
@@ -2484,7 +2465,7 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
			    ((c & 0xfe00) >> 1) | (c & 0xff);
			vc->vc_attr >>= 1;
		}
	} else if (!vc->vc_hi_font_mask && cnt == 512) {
	} else {
		vc->vc_hi_font_mask = 0x100;
		if (vc->vc_can_do_color) {
			vc->vc_complement_mask <<= 1;
@@ -2516,8 +2497,38 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
			} else
				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) {
		int cols, rows;
+1 −8
Original line number Diff line number Diff line
@@ -213,15 +213,8 @@ static void tpg110_init(struct device *dev, struct device_node *np,
	board->disable = tpg110_disable;
}

int nomadik_clcd_init_panel(struct clcd_fb *fb,
			    struct device_node *endpoint)
int nomadik_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel)
{
	struct device_node *panel;

	panel = of_graph_get_remote_port_parent(endpoint);
	if (!panel)
		return -ENODEV;

	if (of_device_is_compatible(panel, "tpo,tpg110"))
		tpg110_init(&fb->dev->dev, panel, fb->board);
	else
+2 −3
Original line number Diff line number Diff line
@@ -6,8 +6,7 @@
#ifdef CONFIG_ARCH_NOMADIK
int nomadik_clcd_init_board(struct amba_device *adev,
			     struct clcd_board *board);
int nomadik_clcd_init_panel(struct clcd_fb *fb,
			    struct device_node *endpoint);
int nomadik_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel);
#else
static inline int nomadik_clcd_init_board(struct amba_device *adev,
					  struct clcd_board *board)
@@ -15,7 +14,7 @@ static inline int nomadik_clcd_init_board(struct amba_device *adev,
	return 0;
}
static inline int nomadik_clcd_init_panel(struct clcd_fb *fb,
					  struct device_node *endpoint)
					  struct device_node *panel)
{
	return 0;
}
+3 −11
Original line number Diff line number Diff line
@@ -452,11 +452,9 @@ static const struct versatile_panel versatile_panels[] = {
	},
};

static void versatile_panel_probe(struct device *dev,
				  struct device_node *endpoint)
static void versatile_panel_probe(struct device *dev, struct device_node *panel)
{
	struct versatile_panel const *vpanel = NULL;
	struct device_node *panel = NULL;
	u32 val;
	int ret;
	int i;
@@ -488,11 +486,6 @@ static void versatile_panel_probe(struct device *dev,
		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))
		dev_err(dev, "panel in DT is not compatible with the "
			"auto-detected panel, continuing anyway\n");
@@ -514,8 +507,7 @@ static void versatile_panel_probe(struct device *dev,
	}
}

int versatile_clcd_init_panel(struct clcd_fb *fb,
			      struct device_node *endpoint)
int versatile_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel)
{
	const struct of_device_id *clcd_id;
	enum versatile_clcd versatile_clcd_type;
@@ -551,7 +543,7 @@ int versatile_clcd_init_panel(struct clcd_fb *fb,
		fb->board->enable = versatile_clcd_enable;
		fb->board->disable = versatile_clcd_disable;
		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");
		break;
	case REALVIEW_CLCD_EB:
Loading