summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Chen <b02280@freescale.com>2010-03-08 14:40:51 +0800
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-05-25 11:01:41 +0200
commit0d709bd022e60f4f6aa1d6e1960aa5ce8a20ccb3 (patch)
tree585fb797bd52e71ce13cf8b4410452f14d8c688a
parent515783433d4ba912411e7112cb627534194900fe (diff)
ENGR00121100 tve: fix issue of make tve as primary display
This patch make tve primary display work for both imx51_bbg and imx37_3stack. For imx51_bbg, add "hdtv=2" to cmdline, for imx37_3stack, add "tv" to cmdline. Signed-off-by: Jason Chen <b02280@freescale.com> Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
-rw-r--r--arch/arm/mach-mx37/mx37_3stack.c37
-rw-r--r--arch/arm/mach-mx5/mx51_babbage.c1
-rw-r--r--drivers/mxc/ipu3/ipu_disp.c14
3 files changed, 39 insertions, 13 deletions
diff --git a/arch/arm/mach-mx37/mx37_3stack.c b/arch/arm/mach-mx37/mx37_3stack.c
index 6b12be8f6859..2a5200031af5 100644
--- a/arch/arm/mach-mx37/mx37_3stack.c
+++ b/arch/arm/mach-mx37/mx37_3stack.c
@@ -29,6 +29,8 @@
#include <linux/pmic_external.h>
#include <linux/smsc911x.h>
#include <linux/i2c/tsc2007.h>
+#include <linux/ipu.h>
+#include <linux/mxcfb.h>
#if defined(CONFIG_MTD) || defined(CONFIG_MTD_MODULE)
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
@@ -370,6 +372,25 @@ static struct spi_board_info mxc_spi_board_info[] __initdata = {
};
#if defined(CONFIG_FB_MXC_SYNC_PANEL) || defined(CONFIG_FB_MXC_SYNC_PANEL_MODULE)
+static int __initdata enable_tv = { 0 };
+static int __init tv_setup(char *s)
+{
+ enable_tv = 1;
+ return 1;
+}
+__setup("tv", tv_setup);
+
+static struct fb_videomode tv_mode = {
+ /* NTSC TV output */
+ "TV-NTSC", 60, 720, 480, 74074,
+ 121, 16,
+ 17, 5,
+ 1, 1,
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT | FB_SYNC_EXT,
+ FB_VMODE_INTERLACED,
+ 0,
+};
+
static struct platform_device mxc_fb_device[] = {
{
.name = "mxc_sdc_fb",
@@ -397,12 +418,20 @@ static struct platform_device mxc_fb_device[] = {
},
};
-extern int g_di1_tvout;
+static struct mxc_fb_platform_data fb_data;
static void mxc_init_fb(void)
{
- g_di1_tvout = 1;
- (void)platform_device_register(&mxc_fb_device[0]);
- (void)platform_device_register(&mxc_fb_device[1]);
+ if (enable_tv) {
+ printk(KERN_INFO "TV is primary display\n");
+ fb_data.interface_pix_fmt = IPU_PIX_FMT_YUV444;
+ fb_data.mode = &tv_mode;
+ mxc_fb_device[1].dev.platform_data = &fb_data;
+ (void)platform_device_register(&mxc_fb_device[1]);
+ (void)platform_device_register(&mxc_fb_device[0]);
+ } else {
+ (void)platform_device_register(&mxc_fb_device[0]);
+ (void)platform_device_register(&mxc_fb_device[1]);
+ }
(void)platform_device_register(&mxc_fb_device[2]);
gpio_lcd_active();
}
diff --git a/arch/arm/mach-mx5/mx51_babbage.c b/arch/arm/mach-mx5/mx51_babbage.c
index c3f896a5900d..ab7dd288365f 100644
--- a/arch/arm/mach-mx5/mx51_babbage.c
+++ b/arch/arm/mach-mx5/mx51_babbage.c
@@ -429,7 +429,6 @@ static int __init mxc_init_fb(void)
printk(KERN_INFO "HDTV is specified as %d\n", enable_tv);
fb_data[1].interface_pix_fmt = IPU_PIX_FMT_YUV444;
fb_data[1].mode = &(video_modes[0]);
- mxc_register_device(&mxc_tve_device, &tve_data);
}
/* Once a customer knows the platform configuration,
diff --git a/drivers/mxc/ipu3/ipu_disp.c b/drivers/mxc/ipu3/ipu_disp.c
index 72ba7319e2cf..b432cb9df734 100644
--- a/drivers/mxc/ipu3/ipu_disp.c
+++ b/drivers/mxc/ipu3/ipu_disp.c
@@ -56,7 +56,6 @@ struct dp_csc_param_t {
int dmfc_type_setup;
static int dmfc_size_28, dmfc_size_29, dmfc_size_24, dmfc_size_27, dmfc_size_23;
-int g_di1_tvout;
void _ipu_dmfc_init(int dmfc_type, int first)
{
@@ -877,7 +876,7 @@ void _ipu_dp_set_csc_coefficients(ipu_channel_t channel, int32_t param[][3])
* This function is called to adapt synchronous LCD panel to IPU restriction.
*
*/
-void adapt_panel_to_ipu_restricitions(uint16_t *pixel_clk,
+void adapt_panel_to_ipu_restricitions(uint32_t *pixel_clk,
uint16_t width, uint16_t height,
uint16_t h_start_width,
uint16_t h_end_width,
@@ -931,7 +930,6 @@ void adapt_panel_to_ipu_restricitions(uint16_t *pixel_clk,
* @return This function returns 0 on success or negative error code on
* fail.
*/
-
int32_t ipu_init_sync_panel(int disp, uint32_t pixel_clk,
uint16_t width, uint16_t height,
uint32_t pixel_fmt,
@@ -966,11 +964,11 @@ int32_t ipu_init_sync_panel(int disp, uint32_t pixel_clk,
dev_dbg(g_ipu_dev, "pixel clk = %d\n", pixel_clk);
if (sig.ext_clk) {
- if (!(g_di1_tvout && (disp == 1))) { /* not round div for tvout*/
- /* Set the PLL to be an even multiple of the pixel clock. */
- if ((clk_get_usecount(g_pixel_clk[0]) == 0) &&
- (clk_get_usecount(g_pixel_clk[1]) == 0)) {
- di_parent = clk_get_parent(g_di_clk[disp]);
+ /* Set the PLL to be an even multiple of the pixel clock. not round div for tvout*/
+ if ((clk_get_usecount(g_pixel_clk[0]) == 0) &&
+ (clk_get_usecount(g_pixel_clk[1]) == 0)) {
+ di_parent = clk_get_parent(g_di_clk[disp]);
+ if (strcmp(di_parent->name, "tve_clk") != 0) {
rounded_pixel_clk =
clk_round_rate(g_pixel_clk[disp], pixel_clk);
div = clk_get_rate(di_parent) / rounded_pixel_clk;