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

Commit cd4cb1a7 authored by Olof Johansson's avatar Olof Johansson
Browse files

Merge tag 'omap-for-v3.10/dss-signed' of...

Merge tag 'omap-for-v3.10/dss-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into late/cleanup

From Tony Lindgren:
Display related clean-up from Tomi Valkeinen.

These were separated from the DSS driver changes to leave out
a dependency between the driver and arch/arm related code.

* tag 'omap-for-v3.10/dss-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  arm: dss-common: don't use reset_gpio from omap4_panda_dvi_device
  arm: omap boards: Remove unnecessary platform_enable/disable callbacks for VENC devices
  arm: omap: dss-common: use picodlp panel's gpio handling
  arm: omap: board-omap3pandora: use tpo panel's gpio handling
  arm: omap: board-zoom: use NEC panel's gpio handling
  arm: omap: board-rx-51: use acx565akm panel's gpio handling
  arm: omap: board-sdp3430: use sharp panel's gpio handling
  arm: omap: board-omap3evm: use sharp panel's gpio handling
  arm: omap: board-overo: use lb035q02 dpi panel's gpio handling
  arm: omap: board-ldp: use generic dpi panel's gpio handling
  arm: omap: board-am3517: use generic dpi panel's gpio handling
  arm: omap: board-cm-t35: use generic dpi panel's gpio handling
  arm: omap: board-devkit8000: use generic dpi panel's gpio handling
  arm: omap: board-2430: use generic dpi panel's gpio handling
  ARM: OMAP: zoom: Use pwm stack for lcd and keyboard backlight
  OMAPDSS: add fields to panels' platform data
  OMAPDSS: panels: keep platform data of all panels in a single header

Conflicts:
	arch/arm/mach-omap2/board-2430sdp.c
	arch/arm/mach-omap2/board-zoom-display.c
parents ff57270d 4de2a2b4
Loading
Loading
Loading
Loading
+7 −38
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@
#include "gpmc-smc91x.h"

#include <video/omapdss.h>
#include <video/omap-panel-generic-dpi.h>
#include <video/omap-panel-data.h>

#include "mux.h"
#include "hsmmc.h"
@@ -108,24 +108,13 @@ static struct platform_device *sdp2430_devices[] __initdata = {
#define SDP2430_LCD_PANEL_BACKLIGHT_GPIO	91
#define SDP2430_LCD_PANEL_ENABLE_GPIO		154

static int sdp2430_panel_enable_lcd(struct omap_dss_device *dssdev)
{
	gpio_direction_output(SDP2430_LCD_PANEL_ENABLE_GPIO, 1);
	gpio_direction_output(SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 1);

	return 0;
}

static void sdp2430_panel_disable_lcd(struct omap_dss_device *dssdev)
{
	gpio_direction_output(SDP2430_LCD_PANEL_ENABLE_GPIO, 0);
	gpio_direction_output(SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 0);
}

static struct panel_generic_dpi_data sdp2430_panel_data = {
	.name			= "nec_nl2432dr22-11b",
	.platform_enable	= sdp2430_panel_enable_lcd,
	.platform_disable	= sdp2430_panel_disable_lcd,
	.num_gpios		= 2,
	.gpios			= {
		SDP2430_LCD_PANEL_ENABLE_GPIO,
		SDP2430_LCD_PANEL_BACKLIGHT_GPIO,
	},
};

static struct omap_dss_device sdp2430_lcd_device = {
@@ -146,26 +135,6 @@ static struct omap_dss_board_info sdp2430_dss_data = {
	.default_device	= &sdp2430_lcd_device,
};

static void __init sdp2430_display_init(void)
{
	int r;

	static struct gpio gpios[] __initdata = {
		{ SDP2430_LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW,
			"LCD reset" },
		{ SDP2430_LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW,
			"LCD Backlight" },
	};

	r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
	if (r) {
		pr_err("Cannot request LCD GPIOs, error %d\n", r);
		return;
	}

	omap_display_init(&sdp2430_dss_data);
}

#if IS_ENABLED(CONFIG_SMC91X)

static struct omap_smc91x_platform_data board_smc91x_data = {
@@ -273,7 +242,7 @@ static void __init omap_2430sdp_init(void)
	gpio_request_one(SECONDARY_LCD_GPIO, GPIOF_OUT_INIT_LOW,
			 "Secondary LCD backlight");

	sdp2430_display_init();
	omap_display_init(&sdp2430_dss_data);
}

MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
+19 −36
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@
#include "common.h"
#include <linux/omap-dma.h>
#include <video/omapdss.h>
#include <video/omap-panel-tfp410.h>
#include <video/omap-panel-data.h>

#include "gpmc.h"
#include "gpmc-smc91x.h"
@@ -108,53 +108,38 @@ static struct twl4030_keypad_data sdp3430_kp_data = {
#define SDP3430_LCD_PANEL_BACKLIGHT_GPIO	8
#define SDP3430_LCD_PANEL_ENABLE_GPIO		5

static struct gpio sdp3430_dss_gpios[] __initdata = {
	{SDP3430_LCD_PANEL_ENABLE_GPIO,    GPIOF_OUT_INIT_LOW, "LCD reset"    },
	{SDP3430_LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD Backlight"},
};

static void __init sdp3430_display_init(void)
{
	int r;

	r = gpio_request_array(sdp3430_dss_gpios,
			       ARRAY_SIZE(sdp3430_dss_gpios));
	/*
	 * the backlight GPIO doesn't directly go to the panel, it enables
	 * an internal circuit on 3430sdp to create the signal V_BKL_28V,
	 * this is connected to LED+ pin of the sharp panel. This GPIO
	 * is left enabled in the board file, and not passed to the panel
	 * as platform_data.
	 */
	r = gpio_request_one(SDP3430_LCD_PANEL_BACKLIGHT_GPIO,
				GPIOF_OUT_INIT_HIGH, "LCD Backlight");
	if (r)
		printk(KERN_ERR "failed to get LCD control GPIOs\n");

}

static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev)
{
	gpio_direction_output(SDP3430_LCD_PANEL_ENABLE_GPIO, 1);
	gpio_direction_output(SDP3430_LCD_PANEL_BACKLIGHT_GPIO, 1);

	return 0;
}

static void sdp3430_panel_disable_lcd(struct omap_dss_device *dssdev)
{
	gpio_direction_output(SDP3430_LCD_PANEL_ENABLE_GPIO, 0);
	gpio_direction_output(SDP3430_LCD_PANEL_BACKLIGHT_GPIO, 0);
}

static int sdp3430_panel_enable_tv(struct omap_dss_device *dssdev)
{
	return 0;
}
		pr_err("failed to get LCD Backlight GPIO\n");

static void sdp3430_panel_disable_tv(struct omap_dss_device *dssdev)
{
}

static struct panel_sharp_ls037v7dw01_data sdp3430_lcd_data = {
	.resb_gpio = SDP3430_LCD_PANEL_ENABLE_GPIO,
	.ini_gpio = -1,
	.mo_gpio = -1,
	.lr_gpio = -1,
	.ud_gpio = -1,
};

static struct omap_dss_device sdp3430_lcd_device = {
	.name			= "lcd",
	.driver_name		= "sharp_ls_panel",
	.type			= OMAP_DISPLAY_TYPE_DPI,
	.phy.dpi.data_lines	= 16,
	.platform_enable	= sdp3430_panel_enable_lcd,
	.platform_disable	= sdp3430_panel_disable_lcd,
	.data			= &sdp3430_lcd_data,
};

static struct tfp410_platform_data dvi_panel = {
@@ -175,8 +160,6 @@ static struct omap_dss_device sdp3430_tv_device = {
	.driver_name		= "venc",
	.type			= OMAP_DISPLAY_TYPE_VENC,
	.phy.venc.type		= OMAP_DSS_VENC_TYPE_SVIDEO,
	.platform_enable	= sdp3430_panel_enable_tv,
	.platform_disable	= sdp3430_panel_disable_tv,
};


+7 −70
Original line number Diff line number Diff line
@@ -35,8 +35,7 @@

#include "common.h"
#include <video/omapdss.h>
#include <video/omap-panel-generic-dpi.h>
#include <video/omap-panel-tfp410.h>
#include <video/omap-panel-data.h>

#include "am35xx-emac.h"
#include "mux.h"
@@ -121,63 +120,14 @@ static int __init am3517_evm_i2c_init(void)
	return 0;
}

static int lcd_enabled;
static int dvi_enabled;

#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
		defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
static struct gpio am3517_evm_dss_gpios[] __initdata = {
	/* GPIO 182 = LCD Backlight Power */
	{ LCD_PANEL_BKLIGHT_PWR, GPIOF_OUT_INIT_HIGH, "lcd_backlight_pwr" },
	/* GPIO 181 = LCD Panel PWM */
	{ LCD_PANEL_PWM,	 GPIOF_OUT_INIT_HIGH, "lcd bl enable"	  },
	/* GPIO 176 = LCD Panel Power enable pin */
	{ LCD_PANEL_PWR,	 GPIOF_OUT_INIT_HIGH, "dvi enable"	  },
};

static void __init am3517_evm_display_init(void)
{
	int r;

	omap_mux_init_gpio(LCD_PANEL_PWR, OMAP_PIN_INPUT_PULLUP);
	omap_mux_init_gpio(LCD_PANEL_BKLIGHT_PWR, OMAP_PIN_INPUT_PULLDOWN);
	omap_mux_init_gpio(LCD_PANEL_PWM, OMAP_PIN_INPUT_PULLDOWN);

	r = gpio_request_array(am3517_evm_dss_gpios,
			       ARRAY_SIZE(am3517_evm_dss_gpios));
	if (r) {
		printk(KERN_ERR "failed to get DSS panel control GPIOs\n");
		return;
	}

	printk(KERN_INFO "Display initialized successfully\n");
}
#else
static void __init am3517_evm_display_init(void) {}
#endif

static int am3517_evm_panel_enable_lcd(struct omap_dss_device *dssdev)
{
	if (dvi_enabled) {
		printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
		return -EINVAL;
	}
	gpio_set_value(LCD_PANEL_PWR, 1);
	lcd_enabled = 1;

	return 0;
}

static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev)
{
	gpio_set_value(LCD_PANEL_PWR, 0);
	lcd_enabled = 0;
}

static struct panel_generic_dpi_data lcd_panel = {
	.name			= "sharp_lq",
	.platform_enable	= am3517_evm_panel_enable_lcd,
	.platform_disable	= am3517_evm_panel_disable_lcd,
	.num_gpios		= 3,
	.gpios			= {
		LCD_PANEL_PWR,
		LCD_PANEL_BKLIGHT_PWR,
		LCD_PANEL_PWM,
	},
};

static struct omap_dss_device am3517_evm_lcd_device = {
@@ -188,22 +138,11 @@ static struct omap_dss_device am3517_evm_lcd_device = {
	.phy.dpi.data_lines 	= 16,
};

static int am3517_evm_panel_enable_tv(struct omap_dss_device *dssdev)
{
	return 0;
}

static void am3517_evm_panel_disable_tv(struct omap_dss_device *dssdev)
{
}

static struct omap_dss_device am3517_evm_tv_device = {
	.type 			= OMAP_DISPLAY_TYPE_VENC,
	.name 			= "tv",
	.driver_name		= "venc",
	.phy.venc.type		= OMAP_DSS_VENC_TYPE_SVIDEO,
	.platform_enable	= am3517_evm_panel_enable_tv,
	.platform_disable	= am3517_evm_panel_disable_tv,
};

static struct tfp410_platform_data dvi_panel = {
@@ -363,8 +302,6 @@ static void __init am3517_evm_init(void)
	omap_mux_init_gpio(57, OMAP_PIN_OUTPUT);
	usbhs_init(&usbhs_bdata);
	am3517_evm_hecc_init(&am3517_evm_hecc_pdata);
	/* DSS */
	am3517_evm_display_init();

	/* RTC - S35390A */
	am3517_evm_rtc_init();
+10 −53
Original line number Diff line number Diff line
@@ -41,8 +41,7 @@

#include <linux/platform_data/mtd-nand-omap2.h>
#include <video/omapdss.h>
#include <video/omap-panel-generic-dpi.h>
#include <video/omap-panel-tfp410.h>
#include <video/omap-panel-data.h>
#include <linux/platform_data/spi-omap2-mcspi.h>

#include "common.h"
@@ -191,45 +190,12 @@ static inline void cm_t35_init_nand(void) {}
#define CM_T35_LCD_BL_GPIO 58
#define CM_T35_DVI_EN_GPIO 54

static int lcd_enabled;
static int dvi_enabled;

static int cm_t35_panel_enable_lcd(struct omap_dss_device *dssdev)
{
	if (dvi_enabled) {
		printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
		return -EINVAL;
	}

	gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
	gpio_set_value(CM_T35_LCD_BL_GPIO, 1);

	lcd_enabled = 1;

	return 0;
}

static void cm_t35_panel_disable_lcd(struct omap_dss_device *dssdev)
{
	lcd_enabled = 0;

	gpio_set_value(CM_T35_LCD_BL_GPIO, 0);
	gpio_set_value(CM_T35_LCD_EN_GPIO, 0);
}

static int cm_t35_panel_enable_tv(struct omap_dss_device *dssdev)
{
	return 0;
}

static void cm_t35_panel_disable_tv(struct omap_dss_device *dssdev)
{
}

static struct panel_generic_dpi_data lcd_panel = {
	.name			= "toppoly_tdo35s",
	.platform_enable	= cm_t35_panel_enable_lcd,
	.platform_disable	= cm_t35_panel_disable_lcd,
	.num_gpios		= 1,
	.gpios			= {
		CM_T35_LCD_BL_GPIO,
	},
};

static struct omap_dss_device cm_t35_lcd_device = {
@@ -258,8 +224,6 @@ static struct omap_dss_device cm_t35_tv_device = {
	.driver_name		= "venc",
	.type			= OMAP_DISPLAY_TYPE_VENC,
	.phy.venc.type		= OMAP_DSS_VENC_TYPE_SVIDEO,
	.platform_enable	= cm_t35_panel_enable_tv,
	.platform_disable	= cm_t35_panel_disable_tv,
};

static struct omap_dss_device *cm_t35_dss_devices[] = {
@@ -293,11 +257,6 @@ static struct spi_board_info cm_t35_lcd_spi_board_info[] __initdata = {
	},
};

static struct gpio cm_t35_dss_gpios[] __initdata = {
	{ CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW,  "lcd enable"    },
	{ CM_T35_LCD_BL_GPIO, GPIOF_OUT_INIT_LOW,  "lcd bl enable" },
};

static void __init cm_t35_init_display(void)
{
	int err;
@@ -305,23 +264,21 @@ static void __init cm_t35_init_display(void)
	spi_register_board_info(cm_t35_lcd_spi_board_info,
				ARRAY_SIZE(cm_t35_lcd_spi_board_info));

	err = gpio_request_array(cm_t35_dss_gpios,
				 ARRAY_SIZE(cm_t35_dss_gpios));

	err = gpio_request_one(CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW,
			"lcd bl enable");
	if (err) {
		pr_err("CM-T35: failed to request DSS control GPIOs\n");
		pr_err("CM-T35: failed to request LCD EN GPIO\n");
		return;
	}

	gpio_export(CM_T35_LCD_EN_GPIO, 0);
	gpio_export(CM_T35_LCD_BL_GPIO, 0);

	msleep(50);
	gpio_set_value(CM_T35_LCD_EN_GPIO, 1);

	err = omap_display_init(&cm_t35_dss_data);
	if (err) {
		pr_err("CM-T35: failed to register DSS device\n");
		gpio_free_array(cm_t35_dss_gpios, ARRAY_SIZE(cm_t35_dss_gpios));
		gpio_free(CM_T35_LCD_EN_GPIO);
	}
}

+4 −26
Original line number Diff line number Diff line
@@ -43,8 +43,7 @@
#include "gpmc.h"
#include <linux/platform_data/mtd-nand-omap2.h>
#include <video/omapdss.h>
#include <video/omap-panel-generic-dpi.h>
#include <video/omap-panel-tfp410.h>
#include <video/omap-panel-data.h>

#include <linux/platform_data/spi-omap2-mcspi.h>
#include <linux/input/matrix_keypad.h>
@@ -104,19 +103,6 @@ static struct omap2_hsmmc_info mmc[] = {
	{}	/* Terminator */
};

static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
{
	if (gpio_is_valid(dssdev->reset_gpio))
		gpio_set_value_cansleep(dssdev->reset_gpio, 1);
	return 0;
}

static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
{
	if (gpio_is_valid(dssdev->reset_gpio))
		gpio_set_value_cansleep(dssdev->reset_gpio, 0);
}

static struct regulator_consumer_supply devkit8000_vmmc1_supply[] = {
	REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
};
@@ -128,8 +114,7 @@ static struct regulator_consumer_supply devkit8000_vio_supply[] = {

static struct panel_generic_dpi_data lcd_panel = {
	.name			= "innolux_at070tn83",
	.platform_enable        = devkit8000_panel_enable_lcd,
	.platform_disable       = devkit8000_panel_disable_lcd,
	/* gpios filled in code */
};

static struct omap_dss_device devkit8000_lcd_device = {
@@ -211,8 +196,6 @@ static struct gpio_led gpio_leds[];
static int devkit8000_twl_gpio_setup(struct device *dev,
		unsigned gpio, unsigned ngpio)
{
	int ret;

	/* gpio + 0 is "mmc0_cd" (input/IRQ) */
	mmc[0].gpio_cd = gpio + 0;
	omap_hsmmc_late_init(mmc);
@@ -221,13 +204,8 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
	gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;

	/* TWL4030_GPIO_MAX + 0 is "LCD_PWREN" (out, active high) */
	devkit8000_lcd_device.reset_gpio = gpio + TWL4030_GPIO_MAX + 0;
	ret = gpio_request_one(devkit8000_lcd_device.reset_gpio,
			       GPIOF_OUT_INIT_LOW, "LCD_PWREN");
	if (ret < 0) {
		devkit8000_lcd_device.reset_gpio = -EINVAL;
		printk(KERN_ERR "Failed to request GPIO for LCD_PWRN\n");
	}
	lcd_panel.num_gpios = 1;
	lcd_panel.gpios[0] = gpio + TWL4030_GPIO_MAX + 0;

	/* gpio + 7 is "DVI_PD" (out, active low) */
	dvi_panel.power_down_gpio = gpio + 7;
Loading