Exemplo n.º 1
0
static int tvenc_on(struct platform_device *pdev)
{
	int ret = 0;

#ifndef CONFIG_MSM_BUS_SCALING
	struct msm_fb_data_type *mfd = platform_get_drvdata(pdev);
#endif

#ifdef CONFIG_MSM_BUS_SCALING
	if (tvenc_bus_scale_handle > 0)
		msm_bus_scale_client_update_request(tvenc_bus_scale_handle,
							1);
#else
	if (mfd->ebi1_clk)
		clk_enable(mfd->ebi1_clk);
#endif
	mdp4_extn_disp = 1;
	if (tvenc_pdata && tvenc_pdata->pm_vid_en)
		ret = tvenc_pdata->pm_vid_en(1);
	if (ret) {
		pr_err("%s: pm_vid_en(on) failed! %d\n",
		__func__, ret);
		return ret;
	}

	ret = tvenc_set_clock(CLOCK_ON);
	if (ret) {
		pr_err("%s: tvenc_set_clock(CLOCK_ON) failed! %d\n",
		__func__, ret);
		tvenc_pdata->pm_vid_en(0);
		goto error;
	}

	ret = panel_next_on(pdev);
	if (ret) {
		pr_err("%s: tvout_on failed! %d\n",
		__func__, ret);
		tvenc_set_clock(CLOCK_OFF);
		tvenc_pdata->pm_vid_en(0);
	}

error:
	return ret;

}
Exemplo n.º 2
0
static int tvenc_off(struct platform_device *pdev)
{
	int ret = 0;

	struct msm_fb_data_type *mfd;

	mfd = platform_get_drvdata(pdev);

	ret = panel_next_off(pdev);
	if (ret)
		pr_err("%s: tvout_off failed! %d\n",
		__func__, ret);

	tvenc_set_clock(CLOCK_OFF);

	if (tvenc_pdata && tvenc_pdata->pm_vid_en)
		ret = tvenc_pdata->pm_vid_en(0);
#ifdef CONFIG_MSM_BUS_SCALING
	if (tvenc_bus_scale_handle > 0)
		msm_bus_scale_client_update_request(tvenc_bus_scale_handle,
							0);
#else
	if (mfd->ebi1_clk)
		clk_disable(mfd->ebi1_clk);
#endif

	if (ret)
		pr_err("%s: pm_vid_en(off) failed! %d\n",
		__func__, ret);
	mdp4_extn_disp = 0;
#ifdef CONFIG_HUAWEI_KERNEL
    /* U8800-51 has no TV-OUT so remove it, GPIO33 of U8800-51 is used for HAC(Hearing Aid) */
	/* U8800 and U8800-51 have tv_out function only */
	if(machine_is_msm7x30_u8800() || machine_is_msm8255_u8800_pro()) 
	{
		/* if tvout cable plug in, don't change the switch */
		if (!tv_cable_connected)
		{
			gpio_tlmm_config(GPIO_CFG(33, 0, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA),GPIO_CFG_ENABLE);
			gpio_set_value(33, 0);    
		}
	}
	
#endif
	return ret;
}