diff options
author | Vikas Sajjan <vikas.sajjan@linaro.org> | 2013-01-15 16:48:49 +0530 |
---|---|---|
committer | Vikas Sajjan <vikas.sajjan@linaro.org> | 2013-02-14 14:34:13 +0530 |
commit | f9c626e4cca5cf92851f1aa9580a6575dddb279f (patch) | |
tree | fabef4e374f98e41760c30df956dc1aa3e8daf4e | |
parent | 11d809eabdffa2ac98562898dc2c7fb67baac874 (diff) |
exynos: mipi: adds platfrom data to s6e8aa0 panel driver
Adds necessary platform support to s6e8aa0 panel driver and init
sequence to get the display up on smdk 5250.
Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
-rw-r--r-- | arch/arm/boot/dts/exynos5250-smdk5250.dts | 4 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mach-exynos5-dt.c | 121 | ||||
-rw-r--r-- | drivers/video/exynos/Makefile | 2 | ||||
-rw-r--r-- | drivers/video/exynos/exynos_mipi_dsi.c | 8 | ||||
-rw-r--r-- | drivers/video/exynos/s6e8ax0.c | 35 |
5 files changed, 112 insertions, 58 deletions
diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts index e4833689355..0ca395778e9 100644 --- a/arch/arm/boot/dts/exynos5250-smdk5250.dts +++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts @@ -207,8 +207,8 @@ }; lcd_fimd0: lcd_panel0 { - lcd-htiming = <4 4 4 1280>; - lcd-vtiming = <4 4 4 800>; + lcd-htiming = <11 11 2 800>; + lcd-vtiming = <3 3 2 1280>; }; fimd { diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c index 17eda14c90b..fdfe8c6c561 100644 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c @@ -10,8 +10,8 @@ */ #define EXYNOS_MIPI_DRIVER -#define TC358764_DRIVER 1 -#define SE68ax0_DRIVER !TC358764_DRIVER +#define TC358764_PANEL 0 +#define SE68AA0_PANEL !TC358764_PANEL #include <linux/of_platform.h> #include <linux/of_fdt.h> @@ -47,6 +47,7 @@ #include "common.h" +#if TC358764_PANEL static struct mipi_dsim_config dsim_info = { .e_interface = DSIM_VIDEO, .e_pixel_format = DSIM_24BPP_888, @@ -83,8 +84,47 @@ static struct mipi_dsim_config dsim_info = { .dsim_ddi_pd = &tc358764_mipi_lcd_driver, #endif }; +#else +static struct mipi_dsim_config dsim_info = { + .e_interface = DSIM_VIDEO, + .e_pixel_format = DSIM_24BPP_888, + /* main frame fifo auto flush at VSYNC pulse */ + .auto_flush = false, + .eot_disable = false, + .auto_vertical_cnt = true, + .hse = false, + .hfp = false, + .hbp = false, + .hsa = false, + + .e_no_data_lane = DSIM_DATA_LANE_4, + .e_byte_clk = DSIM_PLL_OUT_DIV8, + .e_burst_mode = DSIM_BURST, + + .p = 3, + .m = 115, + .s = 1, + + /* D-PHY PLL stable time spec :min = 200usec ~ max 400usec */ + .pll_stable_time = 500, + + .esc_clk = 7 * 1000000, /* escape clk : 10MHz */ + + /* stop state holding counter after bta change count 0 ~ 0xfff */ + .stop_holding_cnt = 0x0fff, + .bta_timeout = 0xff, /* bta timeout 0 ~ 0xff */ + .rx_timeout = 0xffff, /* lp rx timeout 0 ~ 0xffff */ +#ifdef EXYNOS_MIPI_DRIVER + .e_virtual_ch = DSIM_VIRTUAL_CH_0, /* :SAB */ + .cmd_allow = 0xf, /* :SAB */ +#else + .dsim_ddi_pd = &tc358764_mipi_lcd_driver, +#endif +}; -#if TC358764_DRIVER +#endif + +#if TC358764_PANEL static struct fb_videomode tc358764_lcd_panel_info = { .left_margin = 0x4, .right_margin = 0x4, @@ -95,47 +135,42 @@ static struct fb_videomode tc358764_lcd_panel_info = { .xres = 1280, .yres = 800, }; -#else -static struct fb_videomode se68ax0_lcd_panel_info = { - .left_margin = 0x4, - .right_margin = 0x4, - .upper_margin = 0x4, - .lower_margin = 0x4, - .hsync_len = 0x4, - .vsync_len = 0x4, - .xres = 1280, - .yres = 800, +#elif SE68AA0_PANEL +static struct fb_videomode s6e8ax0_lcd_panel_info = { + .left_margin = 11, + .right_margin = 11, + .upper_margin = 3, + .lower_margin = 3, + .hsync_len = 2, + .vsync_len = 2, + .xres = 800, + .yres = 1280, }; #endif -static int s5p_dsim_enable_d_phy(struct platform_device *pdev, bool enable) +static int exynos_dsim_enable_d_phy(struct platform_device *pdev, bool enable) { unsigned int reg; #if defined(CONFIG_ARCH_EXYNOS5) - pr_err("mipi: func: %s, line: %d\n", __func__, __LINE__); reg = readl(S5P_MIPI_DPHY_CONTROL(1)) & ~(1 << 0); reg |= (enable << 0); writel(reg, S5P_MIPI_DPHY_CONTROL(1)); #else - pr_err("mipi: func: %s, line: %d\n", __func__, __LINE__); reg = readl(S5P_MIPI_DPHY_CONTROL(0)) & ~(1 << 0); reg |= (enable << 0); writel(reg, S5P_MIPI_DPHY_CONTROL(0)); #endif - pr_err("mipi: func: %s, line: %d\n", __func__, __LINE__); return 0; } -static int s5p_dsim_enable_dsi_master(struct platform_device *pdev, bool enable) +static int exynos_dsim_enable_dsi_master(struct platform_device *pdev, bool enable) { unsigned int reg; #if defined(CONFIG_ARCH_EXYNOS5) reg = readl(S5P_MIPI_DPHY_CONTROL(1)) & ~(1 << 2); - pr_err("mipi: func: %s, line: %d\n", __func__, __LINE__); reg |= (enable << 2); writel(reg, S5P_MIPI_DPHY_CONTROL(1)); #else - pr_err("mipi: func: %s, line: %d\n", __func__, __LINE__); reg = readl(S5P_MIPI_DPHY_CONTROL(0)) & ~(1 << 2); reg |= (enable << 2); writel(reg, S5P_MIPI_DPHY_CONTROL(0)); @@ -143,34 +178,30 @@ static int s5p_dsim_enable_dsi_master(struct platform_device *pdev, bool enable) return 0; } -int s5p_dsim_init_d_phy(struct platform_device *pdev, bool enable) +int exynos_dsim_init_d_phy(struct platform_device *pdev, bool enable) { /** * DPHY and aster block must be enabled at the system initialization * step before data access from/to DPHY begins. */ - pr_err("mipi: func: %s, line: %d\n", __func__, __LINE__); - s5p_dsim_enable_d_phy(pdev, enable); - s5p_dsim_enable_dsi_master(pdev, enable); + exynos_dsim_enable_d_phy(pdev, enable); + exynos_dsim_enable_dsi_master(pdev, enable); return 0; } #ifdef EXYNOS_MIPI_DRIVER -static int __lcd_set_power(struct lcd_device *ld, int power) +static int panel_set_power(struct lcd_device *ld, int power) #else -static void __lcd_set_power(struct plat_lcd_data *pd, +static void panel_set_power(struct plat_lcd_data *pd, unsigned int power) #endif { static int bPowerOn; - pr_err("mipi: func: %s, line: %d\n", __func__, __LINE__); - if (power == bPowerOn) return 0; - pr_err("mipi: func: %s, line: %d\n", __func__, __LINE__); bPowerOn = power; /* reset */ @@ -186,7 +217,7 @@ static void __lcd_set_power(struct plat_lcd_data *pd, return 0; } - +#if TC358764_PANEL static struct mipi_dsim_platform_data tc358764_mipi_dsim_platform_data = { .lcd_panel_name = "tc358764", .dsim_config = &dsim_info, @@ -194,17 +225,25 @@ static struct mipi_dsim_platform_data tc358764_mipi_dsim_platform_data = { .lcd_panel_info = &tc358764_lcd_panel_info, .phy_enable = s5p_dsim_init_d_phy, }; - -static int tc358764_lcd_reset(struct lcd_device *ld) +#elif SE68AA0_PANEL +static struct mipi_dsim_platform_data tc358764_mipi_dsim_platform_data = { + .lcd_panel_name = "s6e8ax0", + .dsim_config = &dsim_info, + .enabled = 0, + .lcd_panel_info = &s6e8ax0_lcd_panel_info, + .phy_enable = exynos_dsim_init_d_phy, +}; +#endif +static int dummy_lcd_reset(struct lcd_device *ld) { return 1; } /* toshiba LVDS-MIPI */ -#if TC358764_DRIVER +#if TC358764_PANEL static struct lcd_platform_data tc358764_lcd_platform_data = { - .reset = tc358764_lcd_reset, - .power_on = __lcd_set_power, + .reset = dummy_lcd_reset, + .power_on = panel_set_power, .lcd_enabled = 1, .reset_delay = 120, /* 120ms */ .power_on_delay = 25, /* 25ms */ @@ -218,11 +257,10 @@ static struct mipi_dsim_lcd_device tc358764_mipi_dsim_lcd_device = { .platform_data = (void *)&tc358764_lcd_platform_data, }; -#else -static void mipi_lcd_set_power(struct lcd_device *ld, - unsigned int power) +#elif SE68AA0_PANEL +static void mipi_lcd_set_power(struct lcd_device *ld, unsigned int power) { - if (samsung_rev() >= EXYNOS5250_REV_1_0) { + if (0/*samsung_rev() >= EXYNOS5250_REV_1_0*/) { if (!gpio_request(EXYNOS5_GPD1(5), "GPD1")) { s3c_gpio_cfgpin(EXYNOS5_GPD1(5), S3C_GPIO_SFN(1)); gpio_direction_output(EXYNOS5_GPD1(5), 0); @@ -278,7 +316,7 @@ static void mipi_lcd_set_power(struct lcd_device *ld, } static struct lcd_platform_data s6e8ax0_lcd_platform_data = { - .reset = tc358764_lcd_reset, + .reset = dummy_lcd_reset, .power_on = mipi_lcd_set_power, .lcd_enabled = 1, .reset_delay = 120, /* 120ms */ @@ -522,7 +560,6 @@ static void __init exynos5_dt_machine_init(void) } if (of_machine_is_compatible("samsung,exynos5250")) { - pr_err("mipi: func: %s, line: %d\n", __func__, __LINE__); gpio_request_one(EXYNOS5_GPX3(0), GPIOF_OUT_INIT_HIGH, "lcd_bl_en"); samsung_bl_set(&smdk5250_bl_gpio_info, &smdk5250_bl_data); @@ -536,7 +573,7 @@ static void __init exynos5_dt_machine_init(void) #ifdef EXYNOS_MIPI_DRIVER -#if TC358764_DRIVER +#if TC358764_PANEL pr_err("v MIPI:SAB exynos_mipi_dsi_register_lcd_device from exynos5_dt.c file "); pr_err("v MIPI:SAB register_ldc_device_name: %s", tc358764_mipi_dsim_lcd_device.name); exynos_mipi_dsi_register_lcd_device(&tc358764_mipi_dsim_lcd_device); diff --git a/drivers/video/exynos/Makefile b/drivers/video/exynos/Makefile index 8ac31ca8dce..ed18636825f 100644 --- a/drivers/video/exynos/Makefile +++ b/drivers/video/exynos/Makefile @@ -2,7 +2,7 @@ # Makefile for the exynos video drivers. # obj-$(CONFIG_EXYNOS_LCD_TC358764) += tc358764.o +obj-$(CONFIG_EXYNOS_LCD_S6E8AX0) += s6e8ax0.o obj-$(CONFIG_EXYNOS_MIPI_DSI) += exynos_mipi_dsi.o exynos_mipi_dsi_common.o \ exynos_mipi_dsi_lowlevel.o -obj-$(CONFIG_EXYNOS_LCD_S6E8AX0) += s6e8ax0.o obj-$(CONFIG_EXYNOS_DP) += exynos_dp_core.o exynos_dp_reg.o diff --git a/drivers/video/exynos/exynos_mipi_dsi.c b/drivers/video/exynos/exynos_mipi_dsi.c index d34d59592c6..32dde4490ab 100644 --- a/drivers/video/exynos/exynos_mipi_dsi.c +++ b/drivers/video/exynos/exynos_mipi_dsi.c @@ -277,13 +277,10 @@ static struct mipi_dsim_ddi *exynos_mipi_dsi_bind_lcd_ddi( mutex_lock(&dsim->lock); - pr_err("\n $$$$$ PANEL : %s\n", name); - list_for_each_entry_safe(dsim_ddi, next, &dsim_ddi_list, list) { lcd_drv = dsim_ddi->dsim_lcd_drv; lcd_dev = dsim_ddi->dsim_lcd_dev; - pr_err("mipi: func: %s, line: %d\n", __func__, __LINE__); #if 0 if (!lcd_drv || !lcd_dev || (dsim->id != dsim_ddi->bus_id)) @@ -293,7 +290,6 @@ static struct mipi_dsim_ddi *exynos_mipi_dsi_bind_lcd_ddi( continue; #endif - pr_err("mipi: func: %s, line: %d\n", __func__, __LINE__); dev_dbg(dsim->dev, "lcd_drv->id = %d, lcd_dev->id = %d\n", lcd_drv->id, lcd_dev->id); dev_dbg(dsim->dev, "lcd_dev->bus_id = %d, dsim->id = %d\n", @@ -348,8 +344,6 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev) struct mipi_dsim_ddi *dsim_ddi; int ret = -EINVAL; - pr_err("\n <<<<<< %s >>>>>> \n", __func__); - dsim = kzalloc(sizeof(struct mipi_dsim_device), GFP_KERNEL); if (!dsim) { dev_err(&pdev->dev, "failed to allocate dsim object.\n"); @@ -417,8 +411,6 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev) mutex_init(&dsim->lock); - pr_err("\n $$$$$ PANEL : %s\n", dsim_pd->lcd_panel_name); - /* bind lcd ddi matched with panel name. */ dsim_ddi = exynos_mipi_dsi_bind_lcd_ddi(dsim, dsim_pd->lcd_panel_name); if (!dsim_ddi) { diff --git a/drivers/video/exynos/s6e8ax0.c b/drivers/video/exynos/s6e8ax0.c index 05d080b63bc..7f7b25f9b85 100644 --- a/drivers/video/exynos/s6e8ax0.c +++ b/drivers/video/exynos/s6e8ax0.c @@ -470,6 +470,34 @@ static void s6e8ax0_sleep_out(struct s6e8ax0 *lcd) data_to_send, ARRAY_SIZE(data_to_send)); } +void init_lcd(struct s6e8ax0 *lcd) +{ + static const unsigned char data_to_send1[] = { + 0x0, 0x0 + }; + static const unsigned char data_to_send2[] = { + 0x11, 0x00 + }; + static const unsigned char data_to_send3[] = { + 0x0, 0x0 + }; + + struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); + + ops->cmd_write(lcd_to_master(lcd), MIPI_DSI_DCS_SHORT_WRITE, + data_to_send1, ARRAY_SIZE(data_to_send1)); + msleep(60); + + /* Exit sleep */ + ops->cmd_write(lcd_to_master(lcd), MIPI_DSI_DCS_SHORT_WRITE, + data_to_send2, ARRAY_SIZE(data_to_send2)); + + msleep(600); + + ops->cmd_write(lcd_to_master(lcd), MIPI_DSI_TURN_ON_PERIPHERAL, + data_to_send3, ARRAY_SIZE(data_to_send3)); +} + static void s6e8ax0_display_on(struct s6e8ax0 *lcd) { struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); @@ -754,10 +782,7 @@ static void s6e8ax0_power_on(struct mipi_dsim_lcd_device *dsim_dev, int power) msleep(lcd->ddi_pd->reset_delay); - /* lcd reset */ - if (lcd->ddi_pd->reset) - lcd->ddi_pd->reset(lcd->ld); - msleep(5); + lcd->ddi_pd->power_on(NULL, 1); } static void s6e8ax0_set_sequence(struct mipi_dsim_lcd_device *dsim_dev) @@ -766,7 +791,7 @@ static void s6e8ax0_set_sequence(struct mipi_dsim_lcd_device *dsim_dev) s6e8ax0_panel_init(lcd); s6e8ax0_display_on(lcd); - + init_lcd(lcd); lcd->power = FB_BLANK_UNBLANK; } |