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

Commit 8e0c0832 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull fbdev changes from Tomi Valkeinen:
 "Various fbdev fixes and improvements, but nothing big"

* tag 'fbdev-main-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (38 commits)
  fbdev: Make the switch from generic to native driver less alarming
  Video: atmel: avoid the id of fix screen info is overwritten
  video: imxfb: Add DT default contrast control register property.
  video: atmel_lcdfb: ensure the hardware is initialized with the correct mode
  fbdev: vesafb: add dev->remove() callback
  fbdev: efifb: add dev->remove() callback
  video: pxa3xx-gcu: switch to devres functions
  video: pxa3xx-gcu: provide an empty .open call
  video: pxa3xx-gcu: pass around struct device *
  video: pxa3xx-gcu: rename some symbols
  sisfb: fix 1280x720 resolution support
  video: fbdev: uvesafb: Remove impossible code path in uvesafb_init_info
  video: fbdev: uvesafb: Remove redundant NULL check in uvesafb_remove
  fbdev: FB_OPENCORES should depend on HAS_DMA
  OMAPDSS: convert pixel clock to common videomode style
  OMAPDSS: Remove unused get_context_loss_count support
  OMAPDSS: use DISPC register to detect context loss
  video: da8xx-fb: Use "SIMPLE_DEV_PM_OPS" macro
  video: imxfb: Convert to SIMPLE_DEV_PM_OPS
  video: imxfb: Resolve mismatch between backlight/contrast
  ...
parents 05b1332e 13ba0ad4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -15,8 +15,12 @@ Required nodes:
	- fsl,pcr: LCDC PCR value

Optional properties:
- lcd-supply: Regulator for LCD supply voltage.
- fsl,dmacr: DMA Control Register value. This is optional. By default, the
	register is not modified as recommended by the datasheet.
- fsl,lpccr: Contrast Control Register value. This property provides the
	default value for the contrast control register.
	If that property is ommited, the register is zeroed.
- fsl,lscr1: LCDC Sharp Configuration Register value.

Example:
+51 −4
Original line number Diff line number Diff line
@@ -21,6 +21,10 @@
#include <linux/mtd/physmap.h>
#include <linux/i2c.h>
#include <linux/irq.h>

#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>

#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
@@ -195,14 +199,58 @@ static const struct imxi2c_platform_data mx27ads_i2c1_data __initconst = {
static struct i2c_board_info mx27ads_i2c_devices[] = {
};

void lcd_power(int on)
static void vgpio_set(struct gpio_chip *chip, unsigned offset, int value)
{
	if (on)
	if (value)
		__raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_SET_REG);
	else
		__raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_CLEAR_REG);
}

static int vgpio_dir_out(struct gpio_chip *chip, unsigned offset, int value)
{
	return 0;
}

#define MX27ADS_LCD_GPIO	(6 * 32)

static struct regulator_consumer_supply mx27ads_lcd_regulator_consumer =
	REGULATOR_SUPPLY("lcd", "imx-fb.0");

static struct regulator_init_data mx27ads_lcd_regulator_init_data = {
	.constraints	= {
		.valid_ops_mask	= REGULATOR_CHANGE_STATUS,
},
	.consumer_supplies	= &mx27ads_lcd_regulator_consumer,
	.num_consumer_supplies	= 1,
};

static struct fixed_voltage_config mx27ads_lcd_regulator_pdata = {
	.supply_name	= "LCD",
	.microvolts	= 3300000,
	.gpio		= MX27ADS_LCD_GPIO,
	.init_data	= &mx27ads_lcd_regulator_init_data,
};

static void __init mx27ads_regulator_init(void)
{
	struct gpio_chip *vchip;

	vchip = kzalloc(sizeof(*vchip), GFP_KERNEL);
	vchip->owner		= THIS_MODULE;
	vchip->label		= "LCD";
	vchip->base		= MX27ADS_LCD_GPIO;
	vchip->ngpio		= 1;
	vchip->direction_output	= vgpio_dir_out;
	vchip->set		= vgpio_set;
	gpiochip_add(vchip);

	platform_device_register_data(&platform_bus, "reg-fixed-voltage",
				      PLATFORM_DEVID_AUTO,
				      &mx27ads_lcd_regulator_pdata,
				      sizeof(mx27ads_lcd_regulator_pdata));
}

static struct imx_fb_videomode mx27ads_modes[] = {
	{
		.mode = {
@@ -239,8 +287,6 @@ static const struct imx_fb_platform_data mx27ads_fb_data __initconst = {
	.pwmr		= 0x00A903FF,
	.lscr1		= 0x00120300,
	.dmacr		= 0x00020010,

	.lcd_power	= lcd_power,
};

static int mx27ads_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
@@ -304,6 +350,7 @@ static void __init mx27ads_board_init(void)
	i2c_register_board_info(1, mx27ads_i2c_devices,
				ARRAY_SIZE(mx27ads_i2c_devices));
	imx27_add_imx_i2c(1, &mx27ads_i2c1_data);
	mx27ads_regulator_init();
	imx27_add_imx_fb(&mx27ads_fb_data);
	imx27_add_mxc_mmc(0, &sdhc1_pdata);
	imx27_add_mxc_mmc(1, &sdhc2_pdata);
+0 −1
Original line number Diff line number Diff line
@@ -301,7 +301,6 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
	board_data->version = ver;
	board_data->dsi_enable_pads = omap_dsi_enable_pads;
	board_data->dsi_disable_pads = omap_dsi_disable_pads;
	board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count;
	board_data->set_min_bus_tput = omap_dss_set_min_bus_tput;

	omap_display_device.dev.platform_data = board_data;
+3 −3
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ struct omap_connector {
void copy_timings_omap_to_drm(struct drm_display_mode *mode,
		struct omap_video_timings *timings)
{
	mode->clock = timings->pixel_clock;
	mode->clock = timings->pixelclock / 1000;

	mode->hdisplay = timings->x_res;
	mode->hsync_start = mode->hdisplay + timings->hfp;
@@ -68,7 +68,7 @@ void copy_timings_omap_to_drm(struct drm_display_mode *mode,
void copy_timings_drm_to_omap(struct omap_video_timings *timings,
		struct drm_display_mode *mode)
{
	timings->pixel_clock = mode->clock;
	timings->pixelclock = mode->clock * 1000;

	timings->x_res = mode->hdisplay;
	timings->hfp = mode->hsync_start - mode->hdisplay;
@@ -220,7 +220,7 @@ static int omap_connector_mode_valid(struct drm_connector *connector,
	if (!r) {
		/* check if vrefresh is still valid */
		new_mode = drm_mode_duplicate(dev, mode);
		new_mode->clock = timings.pixel_clock;
		new_mode->clock = timings.pixelclock / 1000;
		new_mode->vrefresh = 0;
		if (mode->vrefresh == drm_mode_vrefresh(new_mode))
			ret = MODE_OK;
+1 −1
Original line number Diff line number Diff line
@@ -967,7 +967,7 @@ config FB_PVR2

config FB_OPENCORES
	tristate "OpenCores VGA/LCD core 2.0 framebuffer support"
	depends on FB
	depends on FB && HAS_DMA
	select FB_CFB_FILLRECT
	select FB_CFB_COPYAREA
	select FB_CFB_IMAGEBLIT
Loading