Exemplo n.º 1
0
static int __init mddi_tpo_nv_init(void)
{
    int ret;
    struct msm_panel_info *pinfo;

#ifdef CONFIG_FB_MSM_MDDI_AUTO_DETECT
    mddi_wait(10); // wait to come completely out of reset
    plat_disp_type = mddi_get_client_id();

    printk("%s: client_id=0x%X, crc=0x%X, width=%d, height=%d\n",
           __FUNCTION__, plat_disp_type, mddi_client_capability_pkt.parameter_CRC,
           mddi_client_capability_pkt.Bitmap_Width,
           mddi_client_capability_pkt.Bitmap_Height);
    if (mddi_client_capability_pkt.Bitmap_Width == 0x00 ||
            mddi_client_capability_pkt.Bitmap_Height == 0x00)
    {
        printk("%s: panel appears to be missing. Exiting\n", __FUNCTION__);
        return 0;
    }
#endif

    ret = platform_driver_register(&mddi_tpo_nv_driver);
    if (!ret) {
        pinfo = &mddi_tpo_nv_panel_data.panel_info;
        pinfo->xres = LCD_WIDTH;
        pinfo->yres = LCD_HEIGHT;
        pinfo->type = MDDI_PANEL;
        pinfo->pdest = DISPLAY_1;
        pinfo->wait_cycle = 0;
        pinfo->bpp = 18;
        pinfo->fb_num = 2;
        pinfo->clk_min = TPO_NV_CLK_RATE;
        pinfo->clk_max = TPO_NV_CLK_RATE;
        pinfo->clk_rate = TPO_NV_CLK_RATE;
        pinfo->lcd.vsync_enable = TRUE;
        pinfo->lcd.refx100 =
            (mddi_tpo_nv_rows_per_second * 100) /
            mddi_tpo_nv_rows_per_refresh;
        pinfo->lcd.v_back_porch = V_BACK_PORCH;
        pinfo->lcd.v_front_porch = V_FRONT_PORCH;
        pinfo->lcd.v_pulse_width = V_SYNC_WIDTH;
        pinfo->lcd.hw_vsync_mode = TRUE;
        pinfo->lcd.vsync_notifier_period = (1 * HZ);
        pinfo->bl_max = 7;
        pinfo->bl_min = 1;

        ret = platform_device_register(&mddi_tpo_nv_device);
        if (ret)
        {
            platform_driver_unregister(&mddi_tpo_nv_driver);
        }
    }
    return ret;
}
Exemplo n.º 2
0
static int __init mddi_toshiba_wvga_pt_init(void)
{
	int ret;
#ifdef CONFIG_FB_MSM_MDDI_AUTO_DETECT
	uint id;

	ret = msm_fb_detect_client("mddi_toshiba_wvga_pt");
	if (ret == -ENODEV)
		return 0;

	if (ret) {
		id = mddi_get_client_id();
		if (id != 0xd2638722)
			return 0;
	}
#endif

	pinfo.xres = 480;
	pinfo.yres = 800;
	MSM_FB_SINGLE_MODE_PANEL(&pinfo);
	pinfo.type = MDDI_PANEL;
	pinfo.pdest = DISPLAY_1;
	pinfo.mddi.vdopkt = MDDI_DEFAULT_PRIM_PIX_ATTR;
	pinfo.wait_cycle = 0;
	pinfo.bpp = 18;
	pinfo.lcd.vsync_enable = TRUE;
	pinfo.lcd.refx100 = 6102; /* adjust refx100 to prevent tearing */
	pinfo.mddi.is_type1 = TRUE;
	pinfo.lcd.v_back_porch = 8;     /* vsw=10 + vbp = 8 */
	pinfo.lcd.v_front_porch = 2;
	pinfo.lcd.v_pulse_width = 10;
	pinfo.lcd.hw_vsync_mode = FALSE;
	pinfo.lcd.vsync_notifier_period = (1 * HZ);
	pinfo.bl_max = 15;
	pinfo.bl_min = 1;
	pinfo.clk_rate = 222750000;
	pinfo.clk_min =  200000000;
	pinfo.clk_max =  240000000;
	pinfo.fb_num = 2;

	ret = mddi_toshiba_device_register(&pinfo, TOSHIBA_VGA_PRIM,
						LCD_TOSHIBA_2P4_WVGA_PT);
	if (ret)
		printk(KERN_ERR "%s: failed to register device!\n", __func__);

	return ret;
}
Exemplo n.º 3
0
static int __init lcdc_auo_init(void)
{
	int ret;

#ifdef CONFIG_FB_MSM_TRY_MDDI_CATCH_LCDC_PRISM
	ret = msm_fb_detect_client("lcdc_auo_wvga");
	if (ret == -ENODEV)
		return 0;

	if (ret && (mddi_get_client_id() != 0))
		return 0;
#endif
	pinfo.xres = 480;
	pinfo.yres = 800;
	pinfo.type = LCDC_PANEL;
	pinfo.pdest = DISPLAY_1;
	pinfo.wait_cycle = 0;
	pinfo.bpp = 16;
	pinfo.fb_num = 2;
	pinfo.clk_rate = 24576000; /* 24.576MHz to match the SPEC. from AMSS */
	pinfo.width = 46; /* physical width in mm */
	pinfo.height = 77; /* physical height in mm */

	pinfo.lcdc.h_back_porch = 12;
	pinfo.lcdc.h_front_porch = 16;
	pinfo.lcdc.h_pulse_width = 4;
	pinfo.lcdc.v_back_porch = 3;
	pinfo.lcdc.v_front_porch = 3;
	pinfo.lcdc.v_pulse_width = 2;
	pinfo.lcdc.border_clr = 0;		/* blk */
	pinfo.lcdc.underflow_clr = 0xff;	/* blue */
	pinfo.lcdc.hsync_skew = 0;

	ret = lcdc_device_register(&pinfo, &lcdc_auo_panel_data);
	if (ret)
		printk(KERN_ERR "%s: failed to register device!\n", __func__);

	auo_gpio_init();

	return ret;
}
Exemplo n.º 4
0
static int __init lcdc_samsung_init(void)
{

	int ret;

#ifdef CONFIG_FB_MSM_TRY_MDDI_CATCH_LCDC_PRISM
	ret = msm_fb_detect_client("lcdc_samsung_wvga");
	if (ret == -ENODEV)
		return 0;

	if (ret && (mddi_get_client_id() != 0))
		return 0;
#endif
	pinfo.xres = FB_XRES;
	pinfo.yres = FB_YRES;
	pinfo.type = LCDC_PANEL;
	pinfo.pdest = DISPLAY_1;
	pinfo.wait_cycle = 0;
	pinfo.bpp = VINFO_BPP;
	pinfo.fb_num = 2;
	pinfo.clk_rate = 24576000; /* 33.3MHz is limited from SUMSUNG datasheet */
	pinfo.width = 48;          /* physical width 48.24 mm */
	pinfo.height = 81;         /* physical height 80.4 mm */

	pinfo.lcdc.h_back_porch =  8;
	pinfo.lcdc.h_front_porch = 8;
	pinfo.lcdc.h_pulse_width = 1;
	pinfo.lcdc.v_back_porch =  4;
	pinfo.lcdc.v_front_porch = 4;
	pinfo.lcdc.v_pulse_width = 4;
	pinfo.lcdc.border_clr = 0;        /* blk */
	pinfo.lcdc.underflow_clr = 0xff;  /* blue */
	pinfo.lcdc.hsync_skew = 0;

	ret = lcdc_device_register(&pinfo, &lcdc_samsung_panel_data);
	if (ret)
		printk(KERN_ERR "%s: failed to register device!\n", __func__);

	return ret;

}
Exemplo n.º 5
0
static int __init lcdc_prism_init(void)
{
	int ret;
	struct msm_panel_info pinfo;

#ifdef CONFIG_FB_MSM_TRY_MDDI_CATCH_LCDC_PRISM
	ret = msm_fb_detect_client("lcdc_prism_wvga");
	if (ret == -ENODEV)
		return 0;

	if (ret && (mddi_get_client_id() != 0))
		return 0;
#endif

	pinfo.xres = 800;
	pinfo.yres = 480;
	MSM_FB_SINGLE_MODE_PANEL(&pinfo);
	pinfo.type = LCDC_PANEL;
	pinfo.pdest = DISPLAY_1;
	pinfo.wait_cycle = 0;
	pinfo.bpp = 24;
	pinfo.fb_num = 2;
	pinfo.clk_rate = 38400000;

	pinfo.lcdc.h_back_porch = 21;
	pinfo.lcdc.h_front_porch = 81;
	pinfo.lcdc.h_pulse_width = 60;
	pinfo.lcdc.v_back_porch = 18;
	pinfo.lcdc.v_front_porch = 27;
	pinfo.lcdc.v_pulse_width = 2;
	pinfo.lcdc.border_clr = 0;	/* blk */
	pinfo.lcdc.underflow_clr = 0xff;	/* blue */
	pinfo.lcdc.hsync_skew = 0;

	ret = lcdc_device_register(&pinfo);
	if (ret)
		printk(KERN_ERR "%s: failed to register device!\n", __func__);

	return ret;
}
Exemplo n.º 6
0
static int __init mddi_toshiba_wvga_pt_init(void)
{
	int ret;
	struct msm_panel_info pinfo;
#ifdef CONFIG_FB_MSM_MDDI_AUTO_DETECT
	uint id;

	ret = msm_fb_detect_client("mddi_toshiba_wvga_pt");
	if (ret == -ENODEV)
		return 0;

	if (ret) {
		id = mddi_get_client_id();
		if (id != 0xd2638722)
			return 0;
	}
#endif

	pinfo.xres = 480;
	pinfo.yres = 800;
	pinfo.type = MDDI_PANEL;
	pinfo.pdest = DISPLAY_1;
	pinfo.mddi.vdopkt = MDDI_DEFAULT_PRIM_PIX_ATTR;
	pinfo.wait_cycle = 0;
	pinfo.bpp = 18;
	pinfo.lcd.vsync_enable = FALSE;
	pinfo.bl_max = 15;
	pinfo.bl_min = 1;
	pinfo.clk_rate = 192000000;
	pinfo.clk_min =  190000000;
	pinfo.clk_max =  200000000;
	pinfo.fb_num = 2;

	ret = mddi_toshiba_device_register(&pinfo, TOSHIBA_VGA_PRIM,
						LCD_TOSHIBA_2P4_WVGA_PT);
	if (ret)
		printk(KERN_ERR "%s: failed to register device!\n", __func__);

	return ret;
}
static int mddi_novatek_lcd_init(void)
{
	int ret;
	struct msm_panel_info *pinfo;

#ifdef CONFIG_FB_MSM_MDDI_AUTO_DETECT
	u32 id;
	id = mddi_get_client_id();

	/* TODO: Check client id */
#endif

#if defined(CONFIG_FB_MSM_MDDI_NOVATEK_HITACHI_HVGA)
	gpio_tlmm_config(GPIO_CFG(101, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_2MA), 
			  GPIO_ENABLE);
	gpio_configure(101, GPIOF_INPUT);
	if (gpio_get_value(101) != 1)
		return -ENODEV;
	g_mddi_lcd_probe = 1;
#endif

	ret = platform_driver_register(&this_driver);
	if (!ret) {
		pinfo = &novatek_panel_data0.panel_info;
		EPRINTK("%s: setting up panel info.\n", __func__);
		pinfo->xres = 320;
		pinfo->yres = 480;
		pinfo->type = MDDI_PANEL;
		pinfo->pdest = DISPLAY_1;
		pinfo->mddi.vdopkt = MDDI_DEFAULT_PRIM_PIX_ATTR;
		pinfo->wait_cycle = 0;
		pinfo->bpp = 16;
	
		// vsync config
		pinfo->lcd.vsync_enable = TRUE;
		pinfo->lcd.refx100 = (mddi_novatek_rows_per_second * 100) /
                        		mddi_novatek_rows_per_refresh;

		pinfo->lcd.v_back_porch = 200;
		pinfo->lcd.v_front_porch = 200;
		pinfo->lcd.v_pulse_width = 30;

		pinfo->lcd.hw_vsync_mode = TRUE;
		pinfo->lcd.vsync_notifier_period = (1 * HZ);

		pinfo->bl_max = 4;
		pinfo->bl_min = 1;

		pinfo->clk_rate = 122880000;
		pinfo->clk_min =   120000000;
		pinfo->clk_max =   130000000;
		pinfo->fb_num = 2;

		ret = platform_device_register(&this_device_0);
		if (ret) {
			EPRINTK("%s: this_device_0 register success\n", __func__);
			platform_driver_unregister(&this_driver);
		}
	}

	if(!ret) {
		mddi_lcd.vsync_detected = mddi_novatek_lcd_vsync_detected;
	}

	return ret;
}
Exemplo n.º 8
0
static int mddi_auo_lcd_init(void)
{
	int ret;
	struct msm_panel_info *pinfo;

#ifdef CONFIG_FB_MSM_MDDI_AUTO_DETECT
	u32 id;
	id = mddi_get_client_id();

	/* TODO: Check client id */

#endif

/* LGE_CHANGE [[email protected]] 2010-08-28, probe LCD */
#if defined(CONFIG_LGE_PCB_REV_A)
#if defined(CONFIG_FB_MSM_MDDI_NOVATEK_HITACHI_HVGA)
  gpio_tlmm_config(GPIO_CFG(101, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_2MA), GPIO_ENABLE);
	gpio_configure(101, GPIOF_INPUT);
  if (gpio_get_value(101) != 0)
		return -ENODEV;
	g_mddi_lcd_probe = 0;
#endif
#else
#if defined(CONFIG_FB_MSM_MDDI_NOVATEK_HITACHI_HVGA)
  gpio_tlmm_config(GPIO_CFG(93, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_2MA), GPIO_ENABLE);
	gpio_configure(93, GPIOF_INPUT);
  if (gpio_get_value(93) != 0)
		return -ENODEV;
	g_mddi_lcd_probe = 0;
#endif

#endif

	ret = platform_driver_register(&this_driver);
	if (!ret) {
		pinfo = &auo_panel_data0.panel_info;
		EPRINTK("%s: setting up panel info.\n", __func__);
		pinfo->xres = 320;
		pinfo->yres = 480;
		pinfo->type = MDDI_PANEL;
		pinfo->pdest = DISPLAY_1;
		pinfo->mddi.vdopkt = 0x23;//MDDI_DEFAULT_PRIM_PIX_ATTR;
		pinfo->wait_cycle = 0;
#if defined(CONFIG_FB_MSM_MDDI_24BIT)
		pinfo->bpp = 24;
#else
		pinfo->bpp = 16;
#endif
		// vsync config
		pinfo->lcd.vsync_enable = TRUE;
		pinfo->lcd.refx100 = (mddi_auo_rows_per_second * 100) /
                        		mddi_auo_rows_per_refresh;

/* LGE_CHANGE.
  * Change proch values to resolve LCD Tearing. Before BP:14, FP:6. After BP=FP=6.
  * The set values on LCD are both 8, but we use 6 for MDDI in order to secure timing margin.
  * 2010-08-21, [email protected]
  */
		pinfo->lcd.v_back_porch = 6 /*200*/;
		pinfo->lcd.v_front_porch = 6 /*200*/;
		pinfo->lcd.v_pulse_width = 4 /*30*/;

		pinfo->lcd.hw_vsync_mode = TRUE;
		pinfo->lcd.vsync_notifier_period = (1 * HZ);

		pinfo->bl_max = 4;
		pinfo->bl_min = 1;

		pinfo->clk_rate =10000000 /* 122880000*/;
		pinfo->clk_min = 9000000/*120000000*/;
		pinfo->clk_max =11000000 /* 130000000*/;
		pinfo->fb_num = 2;

		ret = platform_device_register(&this_device_0);
		if (ret) {
			EPRINTK("%s: this_device_0 register success\n", __func__);
			platform_driver_unregister(&this_driver);
		}
	}

	if(!ret) {
		mddi_lcd.vsync_detected = mddi_auo_lcd_vsync_detected;
	}

	return ret;
}
Exemplo n.º 9
0
static int mddi_hitachi_lcd_init(void)
{
	int ret;
	struct msm_panel_info *pinfo;

#ifdef CONFIG_FB_MSM_MDDI_AUTO_DETECT
	u32 id;
	id = mddi_get_client_id();

	/* TODO: Check client id */

#endif
	ret = platform_driver_register(&this_driver);
	if (!ret) {
		pinfo = &hitachi_panel_data0.panel_info;
		EPRINTK("%s: setting up panel info.\n", __func__);
		pinfo->xres = 320;
		pinfo->yres = 480;
		pinfo->type = MDDI_PANEL;
		pinfo->pdest = DISPLAY_1;
		pinfo->mddi.vdopkt = 0x23;//MDDI_DEFAULT_PRIM_PIX_ATTR;
		pinfo->wait_cycle = 0;
		pinfo->bpp = 16;
	
		// vsync config
		pinfo->lcd.vsync_enable = FALSE;
		pinfo->lcd.refx100 = (mddi_hitachi_rows_per_second * 100) /
                        		mddi_hitachi_rows_per_refresh;

/* LGE_CHANGE.
  * Change proch values to resolve LCD Tearing. Before BP:14, FP:6. After BP=FP=6.
  * The set values on LCD are both 8, but we use 6 for MDDI in order to secure timing margin.
  * 2010-08-21, [email protected]
  */
		pinfo->lcd.v_back_porch = 6;
		pinfo->lcd.v_front_porch = 6;
		pinfo->lcd.v_pulse_width = 4;

		pinfo->lcd.hw_vsync_mode = FALSE;
		pinfo->lcd.vsync_notifier_period = (1 * HZ);

		pinfo->bl_max = 4;
		pinfo->bl_min = 1;

		pinfo->clk_rate = 10000000;
		pinfo->clk_min =  9000000;
		pinfo->clk_max =  11000000;
		pinfo->fb_num = 2;

		ret = platform_device_register(&this_device_0);
		if (ret) {
			EPRINTK("%s: this_device_0 register success\n", __func__);
			platform_driver_unregister(&this_driver);
		}
	}
/*
	if(!ret) {
		mddi_lcd.vsync_detected = mddi_hitachi_lcd_vsync_detected;
	}
*/
	return ret;
}