Skip to content

Commit

Permalink
Merge branch '3.10-lo/board-cleanup' of git://gitorious.org/linux-oma…
Browse files Browse the repository at this point in the history
…p-dss2/linux into omap-for-v3.10/dss
  • Loading branch information
tmlind committed Apr 18, 2013
2 parents 07961ac + 29cdeca commit 4de2a2b
Show file tree
Hide file tree
Showing 28 changed files with 349 additions and 679 deletions.
45 changes: 7 additions & 38 deletions arch/arm/mach-omap2/board-2430sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 = {
Expand All @@ -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 defined(CONFIG_SMC91X) || defined(CONFIG_SMC91x_MODULE)

static struct omap_smc91x_platform_data board_smc91x_data = {
Expand Down Expand Up @@ -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")
Expand Down
55 changes: 19 additions & 36 deletions arch/arm/mach-omap2/board-3430sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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");

}
pr_err("failed to get LCD Backlight GPIO\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;
}

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 = {
Expand All @@ -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,
};


Expand Down
77 changes: 7 additions & 70 deletions arch/arm/mach-omap2/board-am3517evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 = {
Expand All @@ -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 = {
Expand Down Expand Up @@ -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();
Expand Down
63 changes: 10 additions & 53 deletions arch/arm/mach-omap2/board-cm-t35.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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[] = {
Expand Down Expand Up @@ -293,35 +257,28 @@ 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;

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);
}
}

Expand Down
Loading

0 comments on commit 4de2a2b

Please sign in to comment.