diff options
Diffstat (limited to 'arch/arm/mach-exynos/mach-exynos5-dt.c')
-rw-r--r-- | arch/arm/mach-exynos/mach-exynos5-dt.c | 121 |
1 files changed, 79 insertions, 42 deletions
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); |