Commit 1f7f314b authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://gitorious.org/linux-omap-dss2/linux

* 'for-linus' of git://gitorious.org/linux-omap-dss2/linux: (23 commits)
  OMAP: DSS2: Fix omap_dss_probe() error path
  OMAP: DSS2: omap_dss_probe() conditional compilation cleanup
  board-omap3-beagle: add DSS2 support
  OMAP2: DSS: Add missing line for update bg color
  OMAP3630: DSS2: Updating MAX divider value
  OMAP: RX51: Update board defconfig
  OMAP: DSS2: Add ACX565AKM Panel Driver
  OMAP: RX51: Add Touch Controller in SPI board info
  OMAP: RX51: Add LCD Panel support
  OMAP: DSS2: TPO-TD03MTEA1: fix Kconfig dependency
  OMAP: LCD LS037V7DW01: Add Backlight driver support
  OMAP: DSS2: Taal: Fix DSI bus locking problem
  OMAP: DSS2: Taal: add mutex to protect panel data
  OMAP: DSS2: Make partial update width even
  OMAP: DSS2: Fix device disable when driver is not loaded
  OMAP: DSS2: VENC: don't call platform_enable/disable() twice
  OMAP: DSS2: check lock_fb_info() return value
  OMAP: DSS2: fix lock_fb_info() and omapfb_lock() locking order
  OMAP: DSS2: Use vdds_sdi regulator supply in SDI
  OMAP: DSS2: Remove redundant enable/disable calls from SDI
  ...
parents 2a8ba8f0 fce064cb
...@@ -774,7 +774,57 @@ CONFIG_SSB_POSSIBLE=y ...@@ -774,7 +774,57 @@ CONFIG_SSB_POSSIBLE=y
# #
# CONFIG_VGASTATE is not set # CONFIG_VGASTATE is not set
# CONFIG_VIDEO_OUTPUT_CONTROL is not set # CONFIG_VIDEO_OUTPUT_CONTROL is not set
# CONFIG_FB is not set CONFIG_FB=y
# CONFIG_FIRMWARE_EDID is not set
# CONFIG_FB_DDC is not set
# CONFIG_FB_BOOT_VESA_SUPPORT is not set
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
# CONFIG_FB_SYS_FILLRECT is not set
# CONFIG_FB_SYS_COPYAREA is not set
# CONFIG_FB_SYS_IMAGEBLIT is not set
# CONFIG_FB_FOREIGN_ENDIAN is not set
# CONFIG_FB_SYS_FOPS is not set
# CONFIG_FB_SVGALIB is not set
# CONFIG_FB_MACMODES is not set
# CONFIG_FB_BACKLIGHT is not set
# CONFIG_FB_MODE_HELPERS is not set
# CONFIG_FB_TILEBLITTING is not set
#
# Frame buffer hardware drivers
#
# CONFIG_FB_ARMCLCD is not set
# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_VIRTUAL is not set
# CONFIG_FB_METRONOME is not set
# CONFIG_FB_MB862XX is not set
# CONFIG_FB_BROADSHEET is not set
# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
CONFIG_OMAP2_VRAM=y
CONFIG_OMAP2_VRFB=y
CONFIG_OMAP2_DSS=y
CONFIG_OMAP2_VRAM_SIZE=4
CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y
# CONFIG_OMAP2_DSS_RFBI is not set
CONFIG_OMAP2_DSS_VENC=y
# CONFIG_OMAP2_DSS_SDI is not set
# CONFIG_OMAP2_DSS_DSI is not set
# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=4
CONFIG_FB_OMAP2=y
CONFIG_FB_OMAP2_DEBUG_SUPPORT=y
# CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE is not set
CONFIG_FB_OMAP2_NUM_FBS=3
#
# OMAP2/3 Display Device Drivers
#
CONFIG_PANEL_GENERIC=y
# CONFIG_PANEL_SHARP_LS037V7DW01 is not set
CONFIG_PANEL_SHARP_LQ043T1DG01=y
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
# #
......
...@@ -911,7 +911,56 @@ CONFIG_DAB=y ...@@ -911,7 +911,56 @@ CONFIG_DAB=y
# #
# CONFIG_VGASTATE is not set # CONFIG_VGASTATE is not set
CONFIG_VIDEO_OUTPUT_CONTROL=m CONFIG_VIDEO_OUTPUT_CONTROL=m
# CONFIG_FB is not set CONFIG_FB=y
# CONFIG_FIRMWARE_EDID is not set
# CONFIG_FB_DDC is not set
# CONFIG_FB_BOOT_VESA_SUPPORT is not set
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
# CONFIG_FB_SYS_FILLRECT is not set
# CONFIG_FB_SYS_COPYAREA is not set
# CONFIG_FB_SYS_IMAGEBLIT is not set
# CONFIG_FB_FOREIGN_ENDIAN is not set
# CONFIG_FB_SYS_FOPS is not set
# CONFIG_FB_SVGALIB is not set
# CONFIG_FB_MACMODES is not set
# CONFIG_FB_BACKLIGHT is not set
# CONFIG_FB_MODE_HELPERS is not set
# CONFIG_FB_TILEBLITTING is not set
#
# Frame buffer hardware drivers
#
# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_VIRTUAL is not set
# CONFIG_FB_METRONOME is not set
# CONFIG_FB_MB862XX is not set
# CONFIG_FB_BROADSHEET is not set
# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
CONFIG_OMAP2_VRAM=y
CONFIG_OMAP2_VRFB=y
CONFIG_OMAP2_DSS=y
CONFIG_OMAP2_VRAM_SIZE=4
# CONFIG_OMAP2_DSS_DEBUG_SUPPORT is not set
# CONFIG_OMAP2_DSS_RFBI is not set
CONFIG_OMAP2_DSS_VENC=y
# CONFIG_OMAP2_DSS_SDI is not set
# CONFIG_OMAP2_DSS_DSI is not set
# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=4
CONFIG_FB_OMAP2=y
# CONFIG_FB_OMAP2_DEBUG_SUPPORT is not set
# CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE is not set
CONFIG_FB_OMAP2_NUM_FBS=3
#
# OMAP2/3 Display Device Drivers
#
CONFIG_PANEL_GENERIC=y
# CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C is not set
CONFIG_PANEL_SHARP_LS037V7DW01=y
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
# #
......
...@@ -784,6 +784,7 @@ CONFIG_INPUT_KEYBOARD=y ...@@ -784,6 +784,7 @@ CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_NEWTON is not set # CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_STOWAWAY is not set # CONFIG_KEYBOARD_STOWAWAY is not set
CONFIG_KEYBOARD_GPIO=m CONFIG_KEYBOARD_GPIO=m
CONFIG_KEYBOARD_TWL4030=y
# CONFIG_INPUT_MOUSE is not set # CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TABLET is not set # CONFIG_INPUT_TABLET is not set
...@@ -809,6 +810,7 @@ CONFIG_INPUT_MISC=y ...@@ -809,6 +810,7 @@ CONFIG_INPUT_MISC=y
# CONFIG_INPUT_POWERMATE is not set # CONFIG_INPUT_POWERMATE is not set
# CONFIG_INPUT_YEALINK is not set # CONFIG_INPUT_YEALINK is not set
# CONFIG_INPUT_CM109 is not set # CONFIG_INPUT_CM109 is not set
CONFIG_INPUT_TWL4030_PWRBUTTON=y
CONFIG_INPUT_UINPUT=m CONFIG_INPUT_UINPUT=m
# #
...@@ -1110,7 +1112,40 @@ CONFIG_RADIO_ADAPTERS=y ...@@ -1110,7 +1112,40 @@ CONFIG_RADIO_ADAPTERS=y
# #
# CONFIG_VGASTATE is not set # CONFIG_VGASTATE is not set
# CONFIG_VIDEO_OUTPUT_CONTROL is not set # CONFIG_VIDEO_OUTPUT_CONTROL is not set
# CONFIG_FB is not set CONFIG_FB=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
# Frame buffer hardware drivers
#
CONFIG_OMAP2_VRAM=y
CONFIG_OMAP2_VRFB=y
CONFIG_OMAP2_DSS=y
CONFIG_OMAP2_VRAM_SIZE=0
# CONFIG_OMAP2_DSS_DEBUG_SUPPORT is not set
# CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS is not set
# CONFIG_OMAP2_DSS_DPI is not set
# CONFIG_OMAP2_DSS_RFBI is not set
# CONFIG_OMAP2_DSS_VENC is not set
CONFIG_OMAP2_DSS_SDI=y
# CONFIG_OMAP2_DSS_DSI is not set
# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0
CONFIG_FB_OMAP2=y
CONFIG_FB_OMAP2_DEBUG_SUPPORT=y
CONFIG_FB_OMAP2_NUM_FBS=3
#
# OMAP2/3 Display Device Drivers
#
# CONFIG_PANEL_GENERIC is not set
# CONFIG_PANEL_SHARP_LS037V7DW01 is not set
# CONFIG_PANEL_SHARP_LQ043T1DG01 is not set
# CONFIG_PANEL_TOPPOLY_TDO35S is not set
# CONFIG_PANEL_TPO_TD043MTEA1 is not set
CONFIG_PANEL_ACX565AKM=y
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
# #
...@@ -1127,6 +1162,8 @@ CONFIG_DISPLAY_SUPPORT=y ...@@ -1127,6 +1162,8 @@ CONFIG_DISPLAY_SUPPORT=y
# #
# CONFIG_VGA_CONSOLE is not set # CONFIG_VGA_CONSOLE is not set
CONFIG_DUMMY_CONSOLE=y CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_LOGO=y
CONFIG_SOUND=y CONFIG_SOUND=y
# CONFIG_SOUND_OSS_CORE is not set # CONFIG_SOUND_OSS_CORE is not set
CONFIG_SND=y CONFIG_SND=y
......
...@@ -119,6 +119,7 @@ obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o ...@@ -119,6 +119,7 @@ obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o
obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \
board-rx51-sdram.o \ board-rx51-sdram.o \
board-rx51-peripherals.o \ board-rx51-peripherals.o \
board-rx51-video.o \
hsmmc.o hsmmc.o
obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom2.o \ obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom2.o \
board-zoom-peripherals.o \ board-zoom-peripherals.o \
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <plat/board.h> #include <plat/board.h>
#include <plat/common.h> #include <plat/common.h>
#include <plat/display.h>
#include <plat/gpmc.h> #include <plat/gpmc.h>
#include <plat/nand.h> #include <plat/nand.h>
#include <plat/usb.h> #include <plat/usb.h>
...@@ -106,6 +107,77 @@ static struct platform_device omap3beagle_nand_device = { ...@@ -106,6 +107,77 @@ static struct platform_device omap3beagle_nand_device = {
.resource = &omap3beagle_nand_resource, .resource = &omap3beagle_nand_resource,
}; };
/* DSS */
static int beagle_enable_dvi(struct omap_dss_device *dssdev)
{
if (gpio_is_valid(dssdev->reset_gpio))
gpio_set_value(dssdev->reset_gpio, 1);
return 0;
}
static void beagle_disable_dvi(struct omap_dss_device *dssdev)
{
if (gpio_is_valid(dssdev->reset_gpio))
gpio_set_value(dssdev->reset_gpio, 0);
}
static struct omap_dss_device beagle_dvi_device = {
.type = OMAP_DISPLAY_TYPE_DPI,
.name = "dvi",
.driver_name = "generic_panel",
.phy.dpi.data_lines = 24,
.reset_gpio = 170,
.platform_enable = beagle_enable_dvi,
.platform_disable = beagle_disable_dvi,
};
static struct omap_dss_device beagle_tv_device = {
.name = "tv",
.driver_name = "venc",
.type = OMAP_DISPLAY_TYPE_VENC,
.phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
};
static struct omap_dss_device *beagle_dss_devices[] = {
&beagle_dvi_device,
&beagle_tv_device,
};
static struct omap_dss_board_info beagle_dss_data = {
.num_devices = ARRAY_SIZE(beagle_dss_devices),
.devices = beagle_dss_devices,
.default_device = &beagle_dvi_device,
};
static struct platform_device beagle_dss_device = {
.name = "omapdss",
.id = -1,
.dev = {
.platform_data = &beagle_dss_data,
},
};
static struct regulator_consumer_supply beagle_vdac_supply =
REGULATOR_SUPPLY("vdda_dac", "omapdss");
static struct regulator_consumer_supply beagle_vdvi_supply =
REGULATOR_SUPPLY("vdds_dsi", "omapdss");
static void __init beagle_display_init(void)
{
int r;
r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset");
if (r < 0) {
printk(KERN_ERR "Unable to get DVI reset GPIO\n");
return;
}
gpio_direction_output(beagle_dvi_device.reset_gpio, 0);
}
#include "sdram-micron-mt46h32m32lf-6.h" #include "sdram-micron-mt46h32m32lf-6.h"
static struct omap2_hsmmc_info mmc[] = { static struct omap2_hsmmc_info mmc[] = {
...@@ -117,15 +189,6 @@ static struct omap2_hsmmc_info mmc[] = { ...@@ -117,15 +189,6 @@ static struct omap2_hsmmc_info mmc[] = {
{} /* Terminator */ {} /* Terminator */
}; };
static struct platform_device omap3_beagle_lcd_device = {
.name = "omap3beagle_lcd",
.id = -1,
};
static struct omap_lcd_config omap3_beagle_lcd_config __initdata = {
.ctrl_name = "internal",
};
static struct regulator_consumer_supply beagle_vmmc1_supply = { static struct regulator_consumer_supply beagle_vmmc1_supply = {
.supply = "vmmc", .supply = "vmmc",
}; };
...@@ -181,16 +244,6 @@ static struct twl4030_gpio_platform_data beagle_gpio_data = { ...@@ -181,16 +244,6 @@ static struct twl4030_gpio_platform_data beagle_gpio_data = {
.setup = beagle_twl_gpio_setup, .setup = beagle_twl_gpio_setup,
}; };
static struct regulator_consumer_supply beagle_vdac_supply = {
.supply = "vdac",
.dev = &omap3_beagle_lcd_device.dev,
};
static struct regulator_consumer_supply beagle_vdvi_supply = {
.supply = "vdvi",
.dev = &omap3_beagle_lcd_device.dev,
};
/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
static struct regulator_init_data beagle_vmmc1 = { static struct regulator_init_data beagle_vmmc1 = {
.constraints = { .constraints = {
...@@ -349,14 +402,8 @@ static struct platform_device keys_gpio = { ...@@ -349,14 +402,8 @@ static struct platform_device keys_gpio = {
}, },
}; };
static struct omap_board_config_kernel omap3_beagle_config[] __initdata = {
{ OMAP_TAG_LCD, &omap3_beagle_lcd_config },
};
static void __init omap3_beagle_init_irq(void) static void __init omap3_beagle_init_irq(void)
{ {
omap_board_config = omap3_beagle_config;
omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params); mt46h32m32lf6_sdrc_params);
omap_init_irq(); omap_init_irq();
...@@ -367,9 +414,9 @@ static void __init omap3_beagle_init_irq(void) ...@@ -367,9 +414,9 @@ static void __init omap3_beagle_init_irq(void)
} }
static struct platform_device *omap3_beagle_devices[] __initdata = { static struct platform_device *omap3_beagle_devices[] __initdata = {
&omap3_beagle_lcd_device,
&leds_gpio, &leds_gpio,
&keys_gpio, &keys_gpio,
&beagle_dss_device,
}; };
static void __init omap3beagle_flash_init(void) static void __init omap3beagle_flash_init(void)
...@@ -456,6 +503,8 @@ static void __init omap3_beagle_init(void) ...@@ -456,6 +503,8 @@ static void __init omap3_beagle_init(void)
/* Ensure SDRC pins are mux'd for self-refresh */ /* Ensure SDRC pins are mux'd for self-refresh */
omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
beagle_display_init();
} }
static void __init omap3_beagle_map_io(void) static void __init omap3_beagle_map_io(void)
......
...@@ -45,6 +45,8 @@ ...@@ -45,6 +45,8 @@
/* list all spi devices here */ /* list all spi devices here */
enum { enum {
RX51_SPI_WL1251, RX51_SPI_WL1251,
RX51_SPI_MIPID, /* LCD panel */
RX51_SPI_TSC2005, /* Touch Controller */
}; };
static struct wl12xx_platform_data wl1251_pdata; static struct wl12xx_platform_data wl1251_pdata;
...@@ -54,6 +56,16 @@ static struct omap2_mcspi_device_config wl1251_mcspi_config = { ...@@ -54,6 +56,16 @@ static struct omap2_mcspi_device_config wl1251_mcspi_config = {
.single_channel = 1, .single_channel = 1,
}; };
static struct omap2_mcspi_device_config mipid_mcspi_config = {
.turbo_mode = 0,
.single_channel = 1,
};
static struct omap2_mcspi_device_config tsc2005_mcspi_config = {
.turbo_mode = 0,
.single_channel = 1,
};
static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = { static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = {
[RX51_SPI_WL1251] = { [RX51_SPI_WL1251] = {
.modalias = "wl1251", .modalias = "wl1251",
...@@ -64,6 +76,22 @@ static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = { ...@@ -64,6 +76,22 @@ static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = {
.controller_data = &wl1251_mcspi_config, .controller_data = &wl1251_mcspi_config,
.platform_data = &wl1251_pdata, .platform_data = &wl1251_pdata,
}, },
[RX51_SPI_MIPID] = {
.modalias = "acx565akm",
.bus_num = 1,
.chip_select = 2,
.max_speed_hz = 6000000,
.controller_data = &mipid_mcspi_config,
},
[RX51_SPI_TSC2005] = {
.modalias = "tsc2005",
.bus_num = 1,
.chip_select = 0,
/* .irq = OMAP_GPIO_IRQ(RX51_TSC2005_IRQ_GPIO),*/
.max_speed_hz = 6000000,
.controller_data = &tsc2005_mcspi_config,
/* .platform_data = &tsc2005_config,*/
},
}; };
#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
......
/*
* linux/arch/arm/mach-omap2/board-rx51-video.c
*
* Copyright (C) 2010 Nokia
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <linux/spi/spi.h>
#include <linux/mm.h>
#include <asm/mach-types.h>
#include <plat/mux.h>
#include <plat/display.h>
#include <plat/vram.h>
#include <plat/mcspi.h>
#include "mux.h"
#define RX51_LCD_RESET_GPIO 90
#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
static int rx51_lcd_enable(struct omap_dss_device *dssdev)
{
gpio_set_value(dssdev->reset_gpio, 1);
return 0;
}
static void rx51_lcd_disable(struct omap_dss_device *dssdev)
{
gpio_set_value(dssdev->reset_gpio, 0);
}
static struct omap_dss_device rx51_lcd_device = {
.name = "lcd",
.driver_name = "panel-acx565akm",
.type = OMAP_DISPLAY_TYPE_SDI,
.phy.sdi.datapairs = 2,
.reset_gpio = RX51_LCD_RESET_GPIO,
.platform_enable = rx51_lcd_enable,
.platform_disable = rx51_lcd_disable,
};
static struct omap_dss_device *rx51_dss_devices[] = {
&rx51_lcd_device,
};
static struct omap_dss_board_info rx51_dss_board_info = {
.num_devices = ARRAY_SIZE(rx51_dss_devices),
.devices = rx51_dss_devices,
.default_device = &rx51_lcd_device,
};
struct platform_device rx51_display_device = {
.name = "omapdss",
.id = -1,
.dev = {
.platform_data = &rx51_dss_board_info,
},
};
static struct platform_device *rx51_video_devices[] __initdata = {
&rx51_display_device,
};
static int __init rx51_video_init(void)
{
if (!machine_is_nokia_rx51())
return 0;
if (omap_mux_init_gpio(RX51_LCD_RESET_GPIO, OMAP_PIN_OUTPUT)) {
pr_err("%s cannot configure MUX for LCD RESET\n", __func__);
return 0;
}
if (gpio_request(RX51_LCD_RESET_GPIO, "LCD ACX565AKM reset")) {
pr_err("%s failed to get LCD Reset GPIO\n", __func__);
return 0;
}
gpio_direction_output(RX51_LCD_RESET_GPIO, 1);
platform_add_devices(rx51_video_devices,
ARRAY_SIZE(rx51_video_devices));
return 0;
}
subsys_initcall(rx51_video_init);
void __init rx51_video_mem_init(void)
{
/*
* GFX 864x480x32bpp
* VID1/2 1280x720x32bpp double buffered
*/
omap_vram_set_sdram_vram(PAGE_ALIGN(864 * 480 * 4) +
2 * PAGE_ALIGN(1280 * 720 * 4 * 2), 0);
}
#else
void __init rx51_video_mem_init(void) { }
#endif /* defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) */
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#define RX51_GPIO_SLEEP_IND 162 #define RX51_GPIO_SLEEP_IND 162
struct omap_sdrc_params *rx51_get_sdram_timings(void); struct omap_sdrc_params *rx51_get_sdram_timings(void);
extern void rx51_video_mem_init(void);
static struct gpio_led gpio_leds[] = { static struct gpio_led gpio_leds[] = {
{ {
...@@ -143,6 +144,7 @@ static void __init rx51_init(void) ...@@ -143,6 +144,7 @@ static void __init rx51_init(void)
static void __init rx51_map_io(void) static void __init rx51_map_io(void)
{ {
omap2_set_globals_343x(); omap2_set_globals_343x();
rx51_video_mem_init();
omap34xx_map_common_io(); omap34xx_map_common_io();
} }
......
...@@ -10,6 +10,7 @@ config PANEL_GENERIC ...@@ -10,6 +10,7 @@ config PANEL_GENERIC
config PANEL_SHARP_LS037V7DW01 config PANEL_SHARP_LS037V7DW01
tristate "Sharp LS037V7DW01 LCD Panel" tristate "Sharp LS037V7DW01 LCD Panel"
depends on OMAP2_DSS depends on OMAP2_DSS
select BACKLIGHT_CLASS_DEVICE
help help
LCD Panel used in TI's SDP3430 and EVM boards LCD Panel used in TI's SDP3430 and EVM boards
...@@ -33,8 +34,14 @@ config PANEL_TOPPOLY_TDO35S ...@@ -33,8 +34,14 @@ config PANEL_TOPPOLY_TDO35S
config PANEL_TPO_TD043MTEA1 config PANEL_TPO_TD043MTEA1
tristate "TPO TD043MTEA1 LCD Panel" tristate "TPO TD043MTEA1 LCD Panel"
depends on OMAP2_DSS && I2C depends on OMAP2_DSS && SPI
help help
LCD Panel used in OMAP3 Pandora LCD Panel used in OMAP3 Pandora
config PANEL_ACX565AKM
tristate "ACX565AKM Panel"
depends on OMAP2_DSS_SDI
select BACKLIGHT_CLASS_DEVICE
help
This is the LCD panel used on Nokia N900
endmenu endmenu
...@@ -5,3 +5,4 @@ obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o ...@@ -5,3 +5,4 @@ obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o
obj-$(CONFIG_PANEL_TAAL) += panel-taal.o obj-$(CONFIG_PANEL_TAAL) += panel-taal.o
obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o
obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o
This diff is collapsed.
...@@ -20,10 +20,17 @@ ...@@ -20,10 +20,17 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/backlight.h>
#include <linux/fb.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/slab.h>
#include <plat/display.h> #include <plat/display.h>
struct sharp_data {
struct backlight_device *bl;
};
static struct omap_video_timings sharp_ls_timings = { static struct omap_video_timings sharp_ls_timings = {
.x_res = 480, .x_res = 480,
.y_res = 640, .y_res = 640,
...@@ -39,18 +46,89 @@ static struct omap_video_timings sharp_ls_timings = { ...@@ -39,18 +46,89 @@ static struct omap_video_timings sharp_ls_timings = {
.vbp = 1, .vbp = 1,
}; };
static int sharp_ls_bl_update_status(struct backlight_device *bl)
{
struct omap_dss_device *dssdev = dev_get_drvdata(&bl->dev);
int level;
if (!dssdev->set_backlight)
return -EINVAL;
if (bl->props.fb_blank == FB_BLANK_UNBLANK &&
bl->props.power == FB_BLANK_UNBLANK)
level = bl->props.brightness;
else
level = 0;
return dssdev->set_backlight(dssdev, level);
}
static int sharp_ls_bl_get_brightness(struct backlight_device *bl)
{
if (bl->props.fb_blank == FB_BLANK_UNBLANK &&
bl->props.power == FB_BLANK_UNBLANK)
return bl->props.brightness;
return 0;
}
static const struct backlight_ops sharp_ls_bl_ops = {
.get_brightness = sharp_ls_bl_get_brightness,
.update_status = sharp_ls_bl_update_status,
};
static int sharp_ls_panel_probe(struct omap_dss_device *dssdev) static int sharp_ls_panel_probe(struct omap_dss_device *dssdev)
{ {
struct backlight_properties props;
struct backlight_device *bl;
struct sharp_data *sd;
int r;
dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS | dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
OMAP_DSS_LCD_IHS; OMAP_DSS_LCD_IHS;
dssdev->panel.acb = 0x28; dssdev->panel.acb = 0x28;
dssdev->panel.timings = sharp_ls_timings; dssdev->panel.timings = sharp_ls_timings;
sd = kzalloc(sizeof(*sd), GFP_KERNEL);
if (!sd)
return -ENOMEM;
dev_set_drvdata(&dssdev->dev, sd);
memset(&props, 0, sizeof(struct backlight_properties));
props.max_brightness = dssdev->max_backlight_level;
bl = backlight_device_register("sharp-ls", &dssdev->dev, dssdev,
&sharp_ls_bl_ops, &props);
if (IS_ERR(bl)) {
r = PTR_ERR(bl);
kfree(sd);
return r;
}
sd->bl = bl;
bl->props.fb_blank = FB_BLANK_UNBLANK;
bl->props.power = FB_BLANK_UNBLANK;
bl->props.brightness = dssdev->max_backlight_level;
r = sharp_ls_bl_update_status(bl);
if (r < 0)
dev_err(&dssdev->dev, "failed to set lcd brightness\n");
return 0; return 0;
} }
static void sharp_ls_panel_remove(struct omap_dss_device *dssdev) static void sharp_ls_panel_remove(struct omap_dss_device *dssdev)
{ {
struct sharp_data *sd = dev_get_drvdata(&dssdev->dev);
struct backlight_device *bl = sd->bl;
bl->props.power = FB_BLANK_POWERDOWN;
sharp_ls_bl_update_status(bl);
backlight_device_unregister(bl);
kfree(sd);
} }
static int sharp_ls_power_on(struct omap_dss_device *dssdev) static int sharp_ls_power_on(struct omap_dss_device *dssdev)
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/mutex.h>
#include <plat/display.h> #include <plat/display.h>
...@@ -67,6 +68,8 @@ ...@@ -67,6 +68,8 @@
static int _taal_enable_te(struct omap_dss_device *dssdev, bool enable); static int _taal_enable_te(struct omap_dss_device *dssdev, bool enable);
struct taal_data { struct taal_data {
struct mutex lock;
struct backlight_device *bldev; struct backlight_device *bldev;
unsigned long hw_guard_end; /* next value of jiffies when we can unsigned long hw_guard_end; /* next value of jiffies when we can
...@@ -510,6 +513,8 @@ static int taal_probe(struct omap_dss_device *dssdev) ...@@ -510,6 +513,8 @@ static int taal_probe(struct omap_dss_device *dssdev)
} }
td->dssdev = dssdev; td->dssdev = dssdev;
mutex_init(&td->lock);
td->esd_wq = create_singlethread_workqueue("taal_esd"); td->esd_wq = create_singlethread_workqueue("taal_esd");
if (td->esd_wq == NULL) { if (td->esd_wq == NULL) {
dev_err(&dssdev->dev, "can't create ESD workqueue\n"); dev_err(&dssdev->dev, "can't create ESD workqueue\n");
...@@ -697,10 +702,9 @@ static int taal_power_on(struct omap_dss_device *dssdev) ...@@ -697,10 +702,9 @@ static int taal_power_on(struct omap_dss_device *dssdev)
return 0; return 0;
err: err:
dsi_bus_unlock();
omapdss_dsi_display_disable(dssdev); omapdss_dsi_display_disable(dssdev);
err0: err0:
dsi_bus_unlock();
if (dssdev->platform_disable) if (dssdev->platform_disable)
dssdev->platform_disable(dssdev); dssdev->platform_disable(dssdev);
...@@ -733,54 +737,96 @@ static void taal_power_off(struct omap_dss_device *dssdev) ...@@ -733,54 +737,96 @@ static void taal_power_off(struct omap_dss_device *dssdev)
static int taal_enable(struct omap_dss_device *dssdev) static int taal_enable(struct omap_dss_device *dssdev)
{ {
struct taal_data *td = dev_get_drvdata(&dssdev->dev);
int r; int r;
dev_dbg(&dssdev->dev, "enable\n"); dev_dbg(&dssdev->dev, "enable\n");
if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) mutex_lock(&td->lock);
return -EINVAL;
if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) {
r = -EINVAL;
goto err;
}
r = taal_power_on(dssdev); r = taal_power_on(dssdev);
if (r) if (r)
return r; goto err;
dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
mutex_unlock(&td->lock);
return 0;
err:
dev_dbg(&dssdev->dev, "enable failed\n");
mutex_unlock(&td->lock);
return r; return r;
} }
static void taal_disable(struct omap_dss_device *dssdev) static void taal_disable(struct omap_dss_device *dssdev)
{ {
struct taal_data *td = dev_get_drvdata(&dssdev->dev);
dev_dbg(&dssdev->dev, "disable\n"); dev_dbg(&dssdev->dev, "disable\n");
mutex_lock(&td->lock);
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
taal_power_off(dssdev); taal_power_off(dssdev);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
mutex_unlock(&td->lock);
} }
static int taal_suspend(struct omap_dss_device *dssdev) static int taal_suspend(struct omap_dss_device *dssdev)
{ {
struct taal_data *td = dev_get_drvdata(&dssdev->dev);
int r;
dev_dbg(&dssdev->dev, "suspend\n"); dev_dbg(&dssdev->dev, "suspend\n");
if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) mutex_lock(&td->lock);
return -EINVAL;
if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) {
r = -EINVAL;
goto err;
}
taal_power_off(dssdev); taal_power_off(dssdev);
dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
mutex_unlock(&td->lock);
return 0; return 0;
err:
mutex_unlock(&td->lock);
return r;
} }
static int taal_resume(struct omap_dss_device *dssdev) static int taal_resume(struct omap_dss_device *dssdev)
{ {
struct taal_data *td = dev_get_drvdata(&dssdev->dev);
int r; int r;
dev_dbg(&dssdev->dev, "resume\n"); dev_dbg(&dssdev->dev, "resume\n");
if (dssdev->state != OMAP_DSS_DISPLAY_SUSPENDED) mutex_lock(&td->lock);
return -EINVAL;
if (dssdev->state != OMAP_DSS_DISPLAY_SUSPENDED) {
r = -EINVAL;
goto err;
}
r = taal_power_on(dssdev); r = taal_power_on(dssdev);
dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
mutex_unlock(&td->lock);
return r;
err:
mutex_unlock(&td->lock);
return r; return r;
} }
...@@ -799,6 +845,7 @@ static int taal_update(struct omap_dss_device *dssdev, ...@@ -799,6 +845,7 @@ static int taal_update(struct omap_dss_device *dssdev,
dev_dbg(&dssdev->dev, "update %d, %d, %d x %d\n", x, y, w, h); dev_dbg(&dssdev->dev, "update %d, %d, %d x %d\n", x, y, w, h);
mutex_lock(&td->lock);
dsi_bus_lock(); dsi_bus_lock();
if (!td->enabled) { if (!td->enabled) {
...@@ -820,18 +867,24 @@ static int taal_update(struct omap_dss_device *dssdev, ...@@ -820,18 +867,24 @@ static int taal_update(struct omap_dss_device *dssdev,
goto err; goto err;
/* note: no bus_unlock here. unlock is in framedone_cb */ /* note: no bus_unlock here. unlock is in framedone_cb */
mutex_unlock(&td->lock);
return 0; return 0;
err: err:
dsi_bus_unlock(); dsi_bus_unlock();
mutex_unlock(&td->lock);
return r; return r;
} }
static int taal_sync(struct omap_dss_device *dssdev) static int taal_sync(struct omap_dss_device *dssdev)
{ {
struct taal_data *td = dev_get_drvdata(&dssdev->dev);
dev_dbg(&dssdev->dev, "sync\n"); dev_dbg(&dssdev->dev, "sync\n");
mutex_lock(&td->lock);
dsi_bus_lock(); dsi_bus_lock();
dsi_bus_unlock(); dsi_bus_unlock();
mutex_unlock(&td->lock);
dev_dbg(&dssdev->dev, "sync done\n"); dev_dbg(&dssdev->dev, "sync done\n");
...@@ -861,13 +914,16 @@ static int _taal_enable_te(struct omap_dss_device *dssdev, bool enable) ...@@ -861,13 +914,16 @@ static int _taal_enable_te(struct omap_dss_device *dssdev, bool enable)
static int taal_enable_te(struct omap_dss_device *dssdev, bool enable) static int taal_enable_te(struct omap_dss_device *dssdev, bool enable)
{ {
struct taal_data *td = dev_get_drvdata(&dssdev->dev);
int r; int r;
mutex_lock(&td->lock);
dsi_bus_lock(); dsi_bus_lock();
r = _taal_enable_te(dssdev, enable); r = _taal_enable_te(dssdev, enable);
dsi_bus_unlock(); dsi_bus_unlock();
mutex_unlock(&td->lock);
return r; return r;
} }
...@@ -875,7 +931,13 @@ static int taal_enable_te(struct omap_dss_device *dssdev, bool enable) ...@@ -875,7 +931,13 @@ static int taal_enable_te(struct omap_dss_device *dssdev, bool enable)
static int taal_get_te(struct omap_dss_device *dssdev) static int taal_get_te(struct omap_dss_device *dssdev)
{ {
struct taal_data *td = dev_get_drvdata(&dssdev->dev); struct taal_data *td = dev_get_drvdata(&dssdev->dev);
return td->te_enabled; int r;
mutex_lock(&td->lock);
r = td->te_enabled;
mutex_unlock(&td->lock);
return r;
} }
static int taal_rotate(struct omap_dss_device *dssdev, u8 rotate) static int taal_rotate(struct omap_dss_device *dssdev, u8 rotate)
...@@ -885,6 +947,7 @@ static int taal_rotate(struct omap_dss_device *dssdev, u8 rotate) ...@@ -885,6 +947,7 @@ static int taal_rotate(struct omap_dss_device *dssdev, u8 rotate)
dev_dbg(&dssdev->dev, "rotate %d\n", rotate); dev_dbg(&dssdev->dev, "rotate %d\n", rotate);
mutex_lock(&td->lock);
dsi_bus_lock(); dsi_bus_lock();
if (td->enabled) { if (td->enabled) {
...@@ -896,16 +959,24 @@ static int taal_rotate(struct omap_dss_device *dssdev, u8 rotate) ...@@ -896,16 +959,24 @@ static int taal_rotate(struct omap_dss_device *dssdev, u8 rotate)
td->rotate = rotate; td->rotate = rotate;
dsi_bus_unlock(); dsi_bus_unlock();
mutex_unlock(&td->lock);
return 0; return 0;
err: err:
dsi_bus_unlock(); dsi_bus_unlock();
mutex_unlock(&td->lock);
return r; return r;
} }
static u8 taal_get_rotate(struct omap_dss_device *dssdev) static u8 taal_get_rotate(struct omap_dss_device *dssdev)
{ {
struct taal_data *td = dev_get_drvdata(&dssdev->dev); struct taal_data *td = dev_get_drvdata(&dssdev->dev);
return td->rotate; int r;
mutex_lock(&td->lock);
r = td->rotate;
mutex_unlock(&td->lock);
return r;
} }
static int taal_mirror(struct omap_dss_device *dssdev, bool enable) static int taal_mirror(struct omap_dss_device *dssdev, bool enable)
...@@ -915,6 +986,7 @@ static int taal_mirror(struct omap_dss_device *dssdev, bool enable) ...@@ -915,6 +986,7 @@ static int taal_mirror(struct omap_dss_device *dssdev, bool enable)
dev_dbg(&dssdev->dev, "mirror %d\n", enable); dev_dbg(&dssdev->dev, "mirror %d\n", enable);
mutex_lock(&td->lock);
dsi_bus_lock(); dsi_bus_lock();
if (td->enabled) { if (td->enabled) {
r = taal_set_addr_mode(td->rotate, enable); r = taal_set_addr_mode(td->rotate, enable);
...@@ -925,23 +997,33 @@ static int taal_mirror(struct omap_dss_device *dssdev, bool enable) ...@@ -925,23 +997,33 @@ static int taal_mirror(struct omap_dss_device *dssdev, bool enable)
td->mirror = enable; td->mirror = enable;
dsi_bus_unlock(); dsi_bus_unlock();
mutex_unlock(&td->lock);
return 0; return 0;
err: err:
dsi_bus_unlock(); dsi_bus_unlock();
mutex_unlock(&td->lock);
return r; return r;
} }
static bool taal_get_mirror(struct omap_dss_device *dssdev) static bool taal_get_mirror(struct omap_dss_device *dssdev)
{ {
struct taal_data *td = dev_get_drvdata(&dssdev->dev); struct taal_data *td = dev_get_drvdata(&dssdev->dev);
return td->mirror; int r;
mutex_lock(&td->lock);
r = td->mirror;
mutex_unlock(&td->lock);
return r;
} }
static int taal_run_test(struct omap_dss_device *dssdev, int test_num) static int taal_run_test(struct omap_dss_device *dssdev, int test_num)
{ {
struct taal_data *td = dev_get_drvdata(&dssdev->dev);
u8 id1, id2, id3; u8 id1, id2, id3;
int r; int r;
mutex_lock(&td->lock);
dsi_bus_lock(); dsi_bus_lock();
r = taal_dcs_read_1(DCS_GET_ID1, &id1); r = taal_dcs_read_1(DCS_GET_ID1, &id1);
...@@ -955,9 +1037,11 @@ static int taal_run_test(struct omap_dss_device *dssdev, int test_num) ...@@ -955,9 +1037,11 @@ static int taal_run_test(struct omap_dss_device *dssdev, int test_num)
goto err; goto err;
dsi_bus_unlock(); dsi_bus_unlock();
mutex_unlock(&td->lock);
return 0; return 0;
err: err:
dsi_bus_unlock(); dsi_bus_unlock();
mutex_unlock(&td->lock);
return r; return r;
} }
...@@ -971,12 +1055,16 @@ static int taal_memory_read(struct omap_dss_device *dssdev, ...@@ -971,12 +1055,16 @@ static int taal_memory_read(struct omap_dss_device *dssdev,
unsigned buf_used = 0; unsigned buf_used = 0;
struct taal_data *td = dev_get_drvdata(&dssdev->dev); struct taal_data *td = dev_get_drvdata(&dssdev->dev);
if (!td->enabled)
return -ENODEV;
if (size < w * h * 3) if (size < w * h * 3)
return -ENOMEM; return -ENOMEM;
mutex_lock(&td->lock);
if (!td->enabled) {
r = -ENODEV;
goto err1;
}
size = min(w * h * 3, size = min(w * h * 3,
dssdev->panel.timings.x_res * dssdev->panel.timings.x_res *
dssdev->panel.timings.y_res * 3); dssdev->panel.timings.y_res * 3);
...@@ -995,7 +1083,7 @@ static int taal_memory_read(struct omap_dss_device *dssdev, ...@@ -995,7 +1083,7 @@ static int taal_memory_read(struct omap_dss_device *dssdev,
r = dsi_vc_set_max_rx_packet_size(TCH, plen); r = dsi_vc_set_max_rx_packet_size(TCH, plen);
if (r) if (r)
goto err0; goto err2;
while (buf_used < size) { while (buf_used < size) {
u8 dcs_cmd = first ? 0x2e : 0x3e; u8 dcs_cmd = first ? 0x2e : 0x3e;
...@@ -1006,7 +1094,7 @@ static int taal_memory_read(struct omap_dss_device *dssdev, ...@@ -1006,7 +1094,7 @@ static int taal_memory_read(struct omap_dss_device *dssdev,
if (r < 0) { if (r < 0) {
dev_err(&dssdev->dev, "read error\n"); dev_err(&dssdev->dev, "read error\n");
goto err; goto err3;
} }
buf_used += r; buf_used += r;
...@@ -1020,16 +1108,18 @@ static int taal_memory_read(struct omap_dss_device *dssdev, ...@@ -1020,16 +1108,18 @@ static int taal_memory_read(struct omap_dss_device *dssdev,
dev_err(&dssdev->dev, "signal pending, " dev_err(&dssdev->dev, "signal pending, "
"aborting memory read\n"); "aborting memory read\n");
r = -ERESTARTSYS; r = -ERESTARTSYS;
goto err; goto err3;
} }
} }
r = buf_used; r = buf_used;
err: err3:
dsi_vc_set_max_rx_packet_size(TCH, 1); dsi_vc_set_max_rx_packet_size(TCH, 1);
err0: err2:
dsi_bus_unlock(); dsi_bus_unlock();
err1:
mutex_unlock(&td->lock);
return r; return r;
} }
...@@ -1041,8 +1131,12 @@ static void taal_esd_work(struct work_struct *work) ...@@ -1041,8 +1131,12 @@ static void taal_esd_work(struct work_struct *work)
u8 state1, state2; u8 state1, state2;
int r; int r;
if (!td->enabled) mutex_lock(&td->lock);
if (!td->enabled) {
mutex_unlock(&td->lock);
return; return;
}
dsi_bus_lock(); dsi_bus_lock();
...@@ -1084,16 +1178,19 @@ static void taal_esd_work(struct work_struct *work) ...@@ -1084,16 +1178,19 @@ static void taal_esd_work(struct work_struct *work)
queue_delayed_work(td->esd_wq, &td->esd_work, TAAL_ESD_CHECK_PERIOD); queue_delayed_work(td->esd_wq, &td->esd_work, TAAL_ESD_CHECK_PERIOD);
mutex_unlock(&td->lock);
return; return;
err: err:
dev_err(&dssdev->dev, "performing LCD reset\n"); dev_err(&dssdev->dev, "performing LCD reset\n");
taal_disable(dssdev); taal_power_off(dssdev);
taal_enable(dssdev); taal_power_on(dssdev);
dsi_bus_unlock(); dsi_bus_unlock();
queue_delayed_work(td->esd_wq, &td->esd_work, TAAL_ESD_CHECK_PERIOD); queue_delayed_work(td->esd_wq, &td->esd_work, TAAL_ESD_CHECK_PERIOD);
mutex_unlock(&td->lock);
} }
static int taal_set_update_mode(struct omap_dss_device *dssdev, static int taal_set_update_mode(struct omap_dss_device *dssdev,
......
...@@ -36,6 +36,12 @@ config OMAP2_DSS_COLLECT_IRQ_STATS ...@@ -36,6 +36,12 @@ config OMAP2_DSS_COLLECT_IRQ_STATS
<debugfs>/omapdss/dispc_irq for DISPC interrupts, and <debugfs>/omapdss/dispc_irq for DISPC interrupts, and
<debugfs>/omapdss/dsi_irq for DSI interrupts. <debugfs>/omapdss/dsi_irq for DSI interrupts.
config OMAP2_DSS_DPI
bool "DPI support"
default y
help
DPI Interface. This is the Parallel Display Interface.
config OMAP2_DSS_RFBI config OMAP2_DSS_RFBI
bool "RFBI support" bool "RFBI support"
default n default n
......
obj-$(CONFIG_OMAP2_DSS) += omapdss.o obj-$(CONFIG_OMAP2_DSS) += omapdss.o
omapdss-y := core.o dss.o dispc.o dpi.o display.o manager.o overlay.o omapdss-y := core.o dss.o dispc.o display.o manager.o overlay.o
omapdss-$(CONFIG_OMAP2_DSS_DPI) += dpi.o
omapdss-$(CONFIG_OMAP2_DSS_RFBI) += rfbi.o omapdss-$(CONFIG_OMAP2_DSS_RFBI) += rfbi.o
omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o
omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o
......
...@@ -482,6 +482,14 @@ static void dss_uninitialize_debugfs(void) ...@@ -482,6 +482,14 @@ static void dss_uninitialize_debugfs(void)
if (dss_debugfs_dir) if (dss_debugfs_dir)
debugfs_remove_recursive(dss_debugfs_dir); debugfs_remove_recursive(dss_debugfs_dir);
} }
#else /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */
static inline int dss_initialize_debugfs(void)
{
return 0;
}
static inline void dss_uninitialize_debugfs(void)
{
}
#endif /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */ #endif /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */
/* PLATFORM DEVICE */ /* PLATFORM DEVICE */
...@@ -499,7 +507,7 @@ static int omap_dss_probe(struct platform_device *pdev) ...@@ -499,7 +507,7 @@ static int omap_dss_probe(struct platform_device *pdev)
r = dss_get_clocks(); r = dss_get_clocks();
if (r) if (r)
goto fail0; goto err_clocks;
dss_clk_enable_all_no_ctx(); dss_clk_enable_all_no_ctx();
...@@ -515,64 +523,64 @@ static int omap_dss_probe(struct platform_device *pdev) ...@@ -515,64 +523,64 @@ static int omap_dss_probe(struct platform_device *pdev)
r = dss_init(skip_init); r = dss_init(skip_init);
if (r) { if (r) {
DSSERR("Failed to initialize DSS\n"); DSSERR("Failed to initialize DSS\n");
goto fail0; goto err_dss;
} }
#ifdef CONFIG_OMAP2_DSS_RFBI
r = rfbi_init(); r = rfbi_init();
if (r) { if (r) {
DSSERR("Failed to initialize rfbi\n"); DSSERR("Failed to initialize rfbi\n");
goto fail0; goto err_rfbi;
} }
#endif
r = dpi_init(pdev); r = dpi_init(pdev);
if (r) { if (r) {
DSSERR("Failed to initialize dpi\n"); DSSERR("Failed to initialize dpi\n");
goto fail0; goto err_dpi;
} }
r = dispc_init(); r = dispc_init();
if (r) { if (r) {
DSSERR("Failed to initialize dispc\n"); DSSERR("Failed to initialize dispc\n");
goto fail0; goto err_dispc;
} }
#ifdef CONFIG_OMAP2_DSS_VENC
r = venc_init(pdev); r = venc_init(pdev);
if (r) { if (r) {
DSSERR("Failed to initialize venc\n"); DSSERR("Failed to initialize venc\n");
goto fail0; goto err_venc;
} }
#endif
if (cpu_is_omap34xx()) { if (cpu_is_omap34xx()) {
#ifdef CONFIG_OMAP2_DSS_SDI
r = sdi_init(skip_init); r = sdi_init(skip_init);
if (r) { if (r) {
DSSERR("Failed to initialize SDI\n"); DSSERR("Failed to initialize SDI\n");
goto fail0; goto err_sdi;
} }
#endif
#ifdef CONFIG_OMAP2_DSS_DSI
r = dsi_init(pdev); r = dsi_init(pdev);
if (r) { if (r) {
DSSERR("Failed to initialize DSI\n"); DSSERR("Failed to initialize DSI\n");
goto fail0; goto err_dsi;
} }
#endif
} }
#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
r = dss_initialize_debugfs(); r = dss_initialize_debugfs();
if (r) if (r)
goto fail0; goto err_debugfs;
#endif
for (i = 0; i < pdata->num_devices; ++i) { for (i = 0; i < pdata->num_devices; ++i) {
struct omap_dss_device *dssdev = pdata->devices[i]; struct omap_dss_device *dssdev = pdata->devices[i];
r = omap_dss_register_device(dssdev); r = omap_dss_register_device(dssdev);
if (r) if (r) {
DSSERR("device reg failed %d\n", i); DSSERR("device %d %s register failed %d\n", i,
dssdev->name ?: "unnamed", r);
while (--i >= 0)
omap_dss_unregister_device(pdata->devices[i]);
goto err_register;
}
if (def_disp_name && strcmp(def_disp_name, dssdev->name) == 0) if (def_disp_name && strcmp(def_disp_name, dssdev->name) == 0)
pdata->default_device = dssdev; pdata->default_device = dssdev;
...@@ -582,8 +590,29 @@ static int omap_dss_probe(struct platform_device *pdev) ...@@ -582,8 +590,29 @@ static int omap_dss_probe(struct platform_device *pdev)
return 0; return 0;
/* XXX fail correctly */ err_register:
fail0: dss_uninitialize_debugfs();
err_debugfs:
if (cpu_is_omap34xx())
dsi_exit();
err_dsi:
if (cpu_is_omap34xx())
sdi_exit();
err_sdi:
venc_exit();
err_venc:
dispc_exit();
err_dispc:
dpi_exit();
err_dpi:
rfbi_exit();
err_rfbi:
dss_exit();
err_dss:
dss_clk_disable_all_no_ctx();
dss_put_clocks();
err_clocks:
return r; return r;
} }
...@@ -593,25 +622,15 @@ static int omap_dss_remove(struct platform_device *pdev) ...@@ -593,25 +622,15 @@ static int omap_dss_remove(struct platform_device *pdev)
int i; int i;
int c; int c;
#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
dss_uninitialize_debugfs(); dss_uninitialize_debugfs();
#endif
#ifdef CONFIG_OMAP2_DSS_VENC
venc_exit(); venc_exit();
#endif
dispc_exit(); dispc_exit();
dpi_exit(); dpi_exit();
#ifdef CONFIG_OMAP2_DSS_RFBI
rfbi_exit(); rfbi_exit();
#endif
if (cpu_is_omap34xx()) { if (cpu_is_omap34xx()) {
#ifdef CONFIG_OMAP2_DSS_DSI
dsi_exit(); dsi_exit();
#endif
#ifdef CONFIG_OMAP2_DSS_SDI
sdi_exit(); sdi_exit();
#endif
} }
dss_exit(); dss_exit();
......
...@@ -392,7 +392,9 @@ void dss_init_device(struct platform_device *pdev, ...@@ -392,7 +392,9 @@ void dss_init_device(struct platform_device *pdev,
int r; int r;
switch (dssdev->type) { switch (dssdev->type) {
#ifdef CONFIG_OMAP2_DSS_DPI
case OMAP_DISPLAY_TYPE_DPI: case OMAP_DISPLAY_TYPE_DPI:
#endif
#ifdef CONFIG_OMAP2_DSS_RFBI #ifdef CONFIG_OMAP2_DSS_RFBI
case OMAP_DISPLAY_TYPE_DBI: case OMAP_DISPLAY_TYPE_DBI:
#endif #endif
...@@ -413,9 +415,11 @@ void dss_init_device(struct platform_device *pdev, ...@@ -413,9 +415,11 @@ void dss_init_device(struct platform_device *pdev,
} }
switch (dssdev->type) { switch (dssdev->type) {
#ifdef CONFIG_OMAP2_DSS_DPI
case OMAP_DISPLAY_TYPE_DPI: case OMAP_DISPLAY_TYPE_DPI:
r = dpi_init_display(dssdev); r = dpi_init_display(dssdev);
break; break;
#endif
#ifdef CONFIG_OMAP2_DSS_RFBI #ifdef CONFIG_OMAP2_DSS_RFBI
case OMAP_DISPLAY_TYPE_DBI: case OMAP_DISPLAY_TYPE_DBI:
r = rfbi_init_display(dssdev); r = rfbi_init_display(dssdev);
...@@ -541,7 +545,10 @@ int dss_resume_all_devices(void) ...@@ -541,7 +545,10 @@ int dss_resume_all_devices(void)
static int dss_disable_device(struct device *dev, void *data) static int dss_disable_device(struct device *dev, void *data)
{ {
struct omap_dss_device *dssdev = to_dss_device(dev); struct omap_dss_device *dssdev = to_dss_device(dev);
dssdev->driver->disable(dssdev);
if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED)
dssdev->driver->disable(dssdev);
return 0; return 0;
} }
......
...@@ -223,7 +223,13 @@ void dss_dump_clocks(struct seq_file *s) ...@@ -223,7 +223,13 @@ void dss_dump_clocks(struct seq_file *s)
seq_printf(s, "dpll4_ck %lu\n", dpll4_ck_rate); seq_printf(s, "dpll4_ck %lu\n", dpll4_ck_rate);
seq_printf(s, "dss1_alwon_fclk = %lu / %lu * 2 = %lu\n", if (cpu_is_omap3630())
seq_printf(s, "dss1_alwon_fclk = %lu / %lu = %lu\n",
dpll4_ck_rate,
dpll4_ck_rate / dpll4_m4_ck_rate,
dss_clk_get_rate(DSS_CLK_FCK1));
else
seq_printf(s, "dss1_alwon_fclk = %lu / %lu * 2 = %lu\n",
dpll4_ck_rate, dpll4_ck_rate,
dpll4_ck_rate / dpll4_m4_ck_rate, dpll4_ck_rate / dpll4_m4_ck_rate,
dss_clk_get_rate(DSS_CLK_FCK1)); dss_clk_get_rate(DSS_CLK_FCK1));
...@@ -293,7 +299,8 @@ int dss_calc_clock_rates(struct dss_clock_info *cinfo) ...@@ -293,7 +299,8 @@ int dss_calc_clock_rates(struct dss_clock_info *cinfo)
{ {
unsigned long prate; unsigned long prate;
if (cinfo->fck_div > 16 || cinfo->fck_div == 0) if (cinfo->fck_div > (cpu_is_omap3630() ? 32 : 16) ||
cinfo->fck_div == 0)
return -EINVAL; return -EINVAL;
prate = clk_get_rate(clk_get_parent(dss.dpll4_m4_ck)); prate = clk_get_rate(clk_get_parent(dss.dpll4_m4_ck));
...@@ -329,7 +336,10 @@ int dss_get_clock_div(struct dss_clock_info *cinfo) ...@@ -329,7 +336,10 @@ int dss_get_clock_div(struct dss_clock_info *cinfo)
if (cpu_is_omap34xx()) { if (cpu_is_omap34xx()) {
unsigned long prate; unsigned long prate;
prate = clk_get_rate(clk_get_parent(dss.dpll4_m4_ck)); prate = clk_get_rate(clk_get_parent(dss.dpll4_m4_ck));
cinfo->fck_div = prate / (cinfo->fck / 2); if (cpu_is_omap3630())
cinfo->fck_div = prate / (cinfo->fck);
else
cinfo->fck_div = prate / (cinfo->fck / 2);
} else { } else {
cinfo->fck_div = 0; cinfo->fck_div = 0;
} }
...@@ -402,10 +412,14 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck, ...@@ -402,10 +412,14 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck,
goto found; goto found;
} else if (cpu_is_omap34xx()) { } else if (cpu_is_omap34xx()) {
for (fck_div = 16; fck_div > 0; --fck_div) { for (fck_div = (cpu_is_omap3630() ? 32 : 16);
fck_div > 0; --fck_div) {
struct dispc_clock_info cur_dispc; struct dispc_clock_info cur_dispc;
fck = prate / fck_div * 2; if (cpu_is_omap3630())
fck = prate / fck_div;
else
fck = prate / fck_div * 2;
if (fck > DISPC_MAX_FCK) if (fck > DISPC_MAX_FCK)
continue; continue;
......
...@@ -242,11 +242,22 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck, ...@@ -242,11 +242,22 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck,
struct dispc_clock_info *dispc_cinfo); struct dispc_clock_info *dispc_cinfo);
/* SDI */ /* SDI */
#ifdef CONFIG_OMAP2_DSS_SDI
int sdi_init(bool skip_init); int sdi_init(bool skip_init);
void sdi_exit(void); void sdi_exit(void);
int sdi_init_display(struct omap_dss_device *display); int sdi_init_display(struct omap_dss_device *display);
#else
static inline int sdi_init(bool skip_init)
{
return 0;
}
static inline void sdi_exit(void)
{
}
#endif
/* DSI */ /* DSI */
#ifdef CONFIG_OMAP2_DSS_DSI
int dsi_init(struct platform_device *pdev); int dsi_init(struct platform_device *pdev);
void dsi_exit(void); void dsi_exit(void);
...@@ -270,11 +281,30 @@ void dsi_pll_uninit(void); ...@@ -270,11 +281,30 @@ void dsi_pll_uninit(void);
void dsi_get_overlay_fifo_thresholds(enum omap_plane plane, void dsi_get_overlay_fifo_thresholds(enum omap_plane plane,
u32 fifo_size, enum omap_burst_size *burst_size, u32 fifo_size, enum omap_burst_size *burst_size,
u32 *fifo_low, u32 *fifo_high); u32 *fifo_low, u32 *fifo_high);
#else
static inline int dsi_init(struct platform_device *pdev)
{
return 0;
}
static inline void dsi_exit(void)
{
}
#endif
/* DPI */ /* DPI */
#ifdef CONFIG_OMAP2_DSS_DPI
int dpi_init(struct platform_device *pdev); int dpi_init(struct platform_device *pdev);
void dpi_exit(void); void dpi_exit(void);
int dpi_init_display(struct omap_dss_device *dssdev); int dpi_init_display(struct omap_dss_device *dssdev);
#else
static inline int dpi_init(struct platform_device *pdev)
{
return 0;
}
static inline void dpi_exit(void)
{
}
#endif
/* DISPC */ /* DISPC */
int dispc_init(void); int dispc_init(void);
...@@ -362,12 +392,23 @@ int dispc_get_clock_div(struct dispc_clock_info *cinfo); ...@@ -362,12 +392,23 @@ int dispc_get_clock_div(struct dispc_clock_info *cinfo);
/* VENC */ /* VENC */
#ifdef CONFIG_OMAP2_DSS_VENC
int venc_init(struct platform_device *pdev); int venc_init(struct platform_device *pdev);
void venc_exit(void); void venc_exit(void);
void venc_dump_regs(struct seq_file *s); void venc_dump_regs(struct seq_file *s);
int venc_init_display(struct omap_dss_device *display); int venc_init_display(struct omap_dss_device *display);
#else
static inline int venc_init(struct platform_device *pdev)
{
return 0;
}
static inline void venc_exit(void)
{
}
#endif
/* RFBI */ /* RFBI */
#ifdef CONFIG_OMAP2_DSS_RFBI
int rfbi_init(void); int rfbi_init(void);
void rfbi_exit(void); void rfbi_exit(void);
void rfbi_dump_regs(struct seq_file *s); void rfbi_dump_regs(struct seq_file *s);
...@@ -379,6 +420,15 @@ void rfbi_transfer_area(u16 width, u16 height, ...@@ -379,6 +420,15 @@ void rfbi_transfer_area(u16 width, u16 height,
void rfbi_set_timings(int rfbi_module, struct rfbi_timings *t); void rfbi_set_timings(int rfbi_module, struct rfbi_timings *t);
unsigned long rfbi_get_max_tx_rate(void); unsigned long rfbi_get_max_tx_rate(void);
int rfbi_init_display(struct omap_dss_device *display); int rfbi_init_display(struct omap_dss_device *display);
#else
static inline int rfbi_init(void)
{
return 0;
}
static inline void rfbi_exit(void)
{
}
#endif
#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
......
...@@ -843,6 +843,7 @@ static void configure_manager(enum omap_channel channel) ...@@ -843,6 +843,7 @@ static void configure_manager(enum omap_channel channel)
c = &dss_cache.manager_cache[channel]; c = &dss_cache.manager_cache[channel];
dispc_set_default_color(channel, c->default_color);
dispc_set_trans_key(channel, c->trans_key_type, c->trans_key); dispc_set_trans_key(channel, c->trans_key_type, c->trans_key);
dispc_enable_trans_key(channel, c->trans_enabled); dispc_enable_trans_key(channel, c->trans_enabled);
dispc_enable_alpha_blending(channel, c->alpha_enabled); dispc_enable_alpha_blending(channel, c->alpha_enabled);
...@@ -940,6 +941,22 @@ static int configure_dispc(void) ...@@ -940,6 +941,22 @@ static int configure_dispc(void)
return r; return r;
} }
/* Make the coordinates even. There are some strange problems with OMAP and
* partial DSI update when the update widths are odd. */
static void make_even(u16 *x, u16 *w)
{
u16 x1, x2;
x1 = *x;
x2 = *x + *w;
x1 &= ~1;
x2 = ALIGN(x2, 2);
*x = x1;
*w = x2 - x1;
}
/* Configure dispc for partial update. Return possibly modified update /* Configure dispc for partial update. Return possibly modified update
* area */ * area */
void dss_setup_partial_planes(struct omap_dss_device *dssdev, void dss_setup_partial_planes(struct omap_dss_device *dssdev,
...@@ -968,6 +985,8 @@ void dss_setup_partial_planes(struct omap_dss_device *dssdev, ...@@ -968,6 +985,8 @@ void dss_setup_partial_planes(struct omap_dss_device *dssdev,
return; return;
} }
make_even(&x, &w);
spin_lock_irqsave(&dss_cache.lock, flags); spin_lock_irqsave(&dss_cache.lock, flags);
/* We need to show the whole overlay if it is scaled. So look for /* We need to show the whole overlay if it is scaled. So look for
...@@ -1029,6 +1048,8 @@ void dss_setup_partial_planes(struct omap_dss_device *dssdev, ...@@ -1029,6 +1048,8 @@ void dss_setup_partial_planes(struct omap_dss_device *dssdev,
w = x2 - x1; w = x2 - x1;
h = y2 - y1; h = y2 - y1;
make_even(&x, &w);
DSSDBG("changing upd area due to ovl(%d) scaling %d,%d %dx%d\n", DSSDBG("changing upd area due to ovl(%d) scaling %d,%d %dx%d\n",
i, x, y, w, h); i, x, y, w, h);
} }
......
...@@ -23,13 +23,16 @@ ...@@ -23,13 +23,16 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/regulator/consumer.h>
#include <plat/display.h> #include <plat/display.h>
#include <plat/cpu.h>
#include "dss.h" #include "dss.h"
static struct { static struct {
bool skip_init; bool skip_init;
bool update_enabled; bool update_enabled;
struct regulator *vdds_sdi_reg;
} sdi; } sdi;
static void sdi_basic_init(void) static void sdi_basic_init(void)
...@@ -57,6 +60,10 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) ...@@ -57,6 +60,10 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
goto err0; goto err0;
} }
r = regulator_enable(sdi.vdds_sdi_reg);
if (r)
goto err1;
/* In case of skip_init sdi_init has already enabled the clocks */ /* In case of skip_init sdi_init has already enabled the clocks */
if (!sdi.skip_init) if (!sdi.skip_init)
dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1); dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
...@@ -115,19 +122,12 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) ...@@ -115,19 +122,12 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
dssdev->manager->enable(dssdev->manager); dssdev->manager->enable(dssdev->manager);
if (dssdev->driver->enable) {
r = dssdev->driver->enable(dssdev);
if (r)
goto err3;
}
sdi.skip_init = 0; sdi.skip_init = 0;
return 0; return 0;
err3:
dssdev->manager->disable(dssdev->manager);
err2: err2:
dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
regulator_disable(sdi.vdds_sdi_reg);
err1: err1:
omap_dss_stop_device(dssdev); omap_dss_stop_device(dssdev);
err0: err0:
...@@ -137,15 +137,14 @@ EXPORT_SYMBOL(omapdss_sdi_display_enable); ...@@ -137,15 +137,14 @@ EXPORT_SYMBOL(omapdss_sdi_display_enable);
void omapdss_sdi_display_disable(struct omap_dss_device *dssdev) void omapdss_sdi_display_disable(struct omap_dss_device *dssdev)
{ {
if (dssdev->driver->disable)
dssdev->driver->disable(dssdev);
dssdev->manager->disable(dssdev->manager); dssdev->manager->disable(dssdev->manager);
dss_sdi_disable(); dss_sdi_disable();
dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
regulator_disable(sdi.vdds_sdi_reg);
omap_dss_stop_device(dssdev); omap_dss_stop_device(dssdev);
} }
EXPORT_SYMBOL(omapdss_sdi_display_disable); EXPORT_SYMBOL(omapdss_sdi_display_disable);
...@@ -162,6 +161,11 @@ int sdi_init(bool skip_init) ...@@ -162,6 +161,11 @@ int sdi_init(bool skip_init)
/* we store this for first display enable, then clear it */ /* we store this for first display enable, then clear it */
sdi.skip_init = skip_init; sdi.skip_init = skip_init;
sdi.vdds_sdi_reg = dss_get_vdds_sdi();
if (IS_ERR(sdi.vdds_sdi_reg)) {
DSSERR("can't get VDDS_SDI regulator\n");
return PTR_ERR(sdi.vdds_sdi_reg);
}
/* /*
* Enable clocks already here, otherwise there would be a toggle * Enable clocks already here, otherwise there would be a toggle
* of them until sdi_display_enable is called. * of them until sdi_display_enable is called.
......
...@@ -479,12 +479,6 @@ static int venc_panel_enable(struct omap_dss_device *dssdev) ...@@ -479,12 +479,6 @@ static int venc_panel_enable(struct omap_dss_device *dssdev)
goto err1; goto err1;
} }
if (dssdev->platform_enable) {
r = dssdev->platform_enable(dssdev);
if (r)
goto err2;
}
venc_power_on(dssdev); venc_power_on(dssdev);
venc.wss_data = 0; venc.wss_data = 0;
...@@ -494,13 +488,9 @@ static int venc_panel_enable(struct omap_dss_device *dssdev) ...@@ -494,13 +488,9 @@ static int venc_panel_enable(struct omap_dss_device *dssdev)
/* wait couple of vsyncs until enabling the LCD */ /* wait couple of vsyncs until enabling the LCD */
msleep(50); msleep(50);
mutex_unlock(&venc.venc_lock);
return r;
err2:
venc_power_off(dssdev);
err1: err1:
mutex_unlock(&venc.venc_lock); mutex_unlock(&venc.venc_lock);
return r; return r;
} }
...@@ -524,9 +514,6 @@ static void venc_panel_disable(struct omap_dss_device *dssdev) ...@@ -524,9 +514,6 @@ static void venc_panel_disable(struct omap_dss_device *dssdev)
/* wait at least 5 vsyncs after disabling the LCD */ /* wait at least 5 vsyncs after disabling the LCD */
msleep(100); msleep(100);
if (dssdev->platform_disable)
dssdev->platform_disable(dssdev);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
end: end:
mutex_unlock(&venc.venc_lock); mutex_unlock(&venc.venc_lock);
......
...@@ -183,13 +183,14 @@ int omapfb_update_window(struct fb_info *fbi, ...@@ -183,13 +183,14 @@ int omapfb_update_window(struct fb_info *fbi,
struct omapfb2_device *fbdev = ofbi->fbdev; struct omapfb2_device *fbdev = ofbi->fbdev;
int r; int r;
if (!lock_fb_info(fbi))
return -ENODEV;
omapfb_lock(fbdev); omapfb_lock(fbdev);
lock_fb_info(fbi);
r = omapfb_update_window_nolock(fbi, x, y, w, h); r = omapfb_update_window_nolock(fbi, x, y, w, h);
unlock_fb_info(fbi);
omapfb_unlock(fbdev); omapfb_unlock(fbdev);
unlock_fb_info(fbi);
return r; return r;
} }
......
...@@ -57,7 +57,8 @@ static ssize_t store_rotate_type(struct device *dev, ...@@ -57,7 +57,8 @@ static ssize_t store_rotate_type(struct device *dev,
if (rot_type != OMAP_DSS_ROT_DMA && rot_type != OMAP_DSS_ROT_VRFB) if (rot_type != OMAP_DSS_ROT_DMA && rot_type != OMAP_DSS_ROT_VRFB)
return -EINVAL; return -EINVAL;
lock_fb_info(fbi); if (!lock_fb_info(fbi))
return -ENODEV;
r = 0; r = 0;
if (rot_type == ofbi->rotation_type) if (rot_type == ofbi->rotation_type)
...@@ -105,7 +106,8 @@ static ssize_t store_mirror(struct device *dev, ...@@ -105,7 +106,8 @@ static ssize_t store_mirror(struct device *dev,
if (mirror != 0 && mirror != 1) if (mirror != 0 && mirror != 1)
return -EINVAL; return -EINVAL;
lock_fb_info(fbi); if (!lock_fb_info(fbi))
return -ENODEV;
ofbi->mirror = mirror; ofbi->mirror = mirror;
...@@ -137,8 +139,9 @@ static ssize_t show_overlays(struct device *dev, ...@@ -137,8 +139,9 @@ static ssize_t show_overlays(struct device *dev,
ssize_t l = 0; ssize_t l = 0;
int t; int t;
if (!lock_fb_info(fbi))
return -ENODEV;
omapfb_lock(fbdev); omapfb_lock(fbdev);
lock_fb_info(fbi);
for (t = 0; t < ofbi->num_overlays; t++) { for (t = 0; t < ofbi->num_overlays; t++) {
struct omap_overlay *ovl = ofbi->overlays[t]; struct omap_overlay *ovl = ofbi->overlays[t];
...@@ -154,8 +157,8 @@ static ssize_t show_overlays(struct device *dev, ...@@ -154,8 +157,8 @@ static ssize_t show_overlays(struct device *dev,
l += snprintf(buf + l, PAGE_SIZE - l, "\n"); l += snprintf(buf + l, PAGE_SIZE - l, "\n");
unlock_fb_info(fbi);
omapfb_unlock(fbdev); omapfb_unlock(fbdev);
unlock_fb_info(fbi);
return l; return l;
} }
...@@ -195,8 +198,9 @@ static ssize_t store_overlays(struct device *dev, struct device_attribute *attr, ...@@ -195,8 +198,9 @@ static ssize_t store_overlays(struct device *dev, struct device_attribute *attr,
if (buf[len - 1] == '\n') if (buf[len - 1] == '\n')
len = len - 1; len = len - 1;
if (!lock_fb_info(fbi))
return -ENODEV;
omapfb_lock(fbdev); omapfb_lock(fbdev);
lock_fb_info(fbi);
if (len > 0) { if (len > 0) {
char *p = (char *)buf; char *p = (char *)buf;
...@@ -303,8 +307,8 @@ static ssize_t store_overlays(struct device *dev, struct device_attribute *attr, ...@@ -303,8 +307,8 @@ static ssize_t store_overlays(struct device *dev, struct device_attribute *attr,
r = count; r = count;
out: out:
unlock_fb_info(fbi);
omapfb_unlock(fbdev); omapfb_unlock(fbdev);
unlock_fb_info(fbi);
return r; return r;
} }
...@@ -317,7 +321,8 @@ static ssize_t show_overlays_rotate(struct device *dev, ...@@ -317,7 +321,8 @@ static ssize_t show_overlays_rotate(struct device *dev,
ssize_t l = 0; ssize_t l = 0;
int t; int t;
lock_fb_info(fbi); if (!lock_fb_info(fbi))
return -ENODEV;
for (t = 0; t < ofbi->num_overlays; t++) { for (t = 0; t < ofbi->num_overlays; t++) {
l += snprintf(buf + l, PAGE_SIZE - l, "%s%d", l += snprintf(buf + l, PAGE_SIZE - l, "%s%d",
...@@ -345,7 +350,8 @@ static ssize_t store_overlays_rotate(struct device *dev, ...@@ -345,7 +350,8 @@ static ssize_t store_overlays_rotate(struct device *dev,
if (buf[len - 1] == '\n') if (buf[len - 1] == '\n')
len = len - 1; len = len - 1;
lock_fb_info(fbi); if (!lock_fb_info(fbi))
return -ENODEV;
if (len > 0) { if (len > 0) {
char *p = (char *)buf; char *p = (char *)buf;
...@@ -416,7 +422,8 @@ static ssize_t store_size(struct device *dev, struct device_attribute *attr, ...@@ -416,7 +422,8 @@ static ssize_t store_size(struct device *dev, struct device_attribute *attr,
size = PAGE_ALIGN(simple_strtoul(buf, NULL, 0)); size = PAGE_ALIGN(simple_strtoul(buf, NULL, 0));
lock_fb_info(fbi); if (!lock_fb_info(fbi))
return -ENODEV;
for (i = 0; i < ofbi->num_overlays; i++) { for (i = 0; i < ofbi->num_overlays; i++) {
if (ofbi->overlays[i]->info.enabled) { if (ofbi->overlays[i]->info.enabled) {
......
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