예제 #1
0
파일: debug.c 프로젝트: wufuyue/TCL_S820
static void process_dbg_opt(const char *opt)
{
	if (0 == strncmp(opt, "on", 2))
    {
		hdmi_power_on();
    }
    else if (0 == strncmp(opt, "off", 3))
    {
		hdmi_power_off();
    }
    else if (0 == strncmp(opt, "enable", 6))
    {
		test_hdmi_enable(true);
    }
    else if (0 == strncmp(opt, "disable", 7))
    {
		test_hdmi_enable(false);
    }
	else if(0 == strncmp(opt, "suspend", 7))
	{
		hdmi_suspend();
	}
	else if(0 == strncmp(opt, "resume", 6))
	{
		hdmi_resume();
	}
       else if(0 == strncmp(opt, "colorbar", 8))
        {
            
       }
       else if(0 == strncmp(opt, "ldooff", 6))
        {
            
       }
       else if (0 == strncmp(opt, "log:", 4))
    {
        if (0 == strncmp(opt + 4, "on", 2)) {
            hdmi_log_enable(true);
        } else if (0 == strncmp(opt + 4, "off", 3)) {
            hdmi_log_enable(false);
        } else {
            goto Error;
        }
    }
    else if(0 == strncmp(opt, "fakecablein:", 12))
    {
        if (0 == strncmp(opt + 12, "enable", 6))
        {
            hdmi_cable_fake_plug_in( );
        }
        else if (0 == strncmp(opt + 12, "disable", 7))
        {
            hdmi_cable_fake_plug_out( );
        }
        else
        {
            goto Error;
        }
    }
	else
	{
		goto Error;
	}

    return;

Error:
    printk("[hdmitx] parse command error!\n\n%s", STR_HELP);
}
예제 #2
0
// TODO: this is a temp debug solution
static void process_dbg_opt(const char *opt)
{
    if (0)
    {

    }
    else if (0 == strncmp(opt, "on", 2))
    {
        hdmi_power_on();
    }
    else if (0 == strncmp(opt, "off", 3))
    {
        hdmi_power_off();
    }
    else if (0 == strncmp(opt, "suspend", 7))
    {
        hdmi_suspend();
    }
    else if (0 == strncmp(opt, "resume", 6))
    {
        hdmi_resume();
    }
    else if (0 == strncmp(opt, "colorbar", 8))
    {

    }
    else if (0 == strncmp(opt, "ldooff", 6))
    {

    }
    else if (0 == strncmp(opt, "log:", 4))
    {
        if (0 == strncmp(opt + 4, "on", 2))
        {
            hdmi_log_enable(true);
        }
        else if (0 == strncmp(opt + 4, "off", 3))
        {
            hdmi_log_enable(false);
        }
        else
        {
            goto Error;
        }
    }
    else if (0 == strncmp(opt, "fakecablein:", 12))
    {
        if (0 == strncmp(opt + 12, "enable", 6))
        {
            hdmi_cable_fake_plug_in();
        }
        else if (0 == strncmp(opt + 12, "disable", 7))
        {
            hdmi_cable_fake_plug_out();
        }
        else
        {
            goto Error;
        }
    }
    else if (0 == strncmp(opt, "hdmimmp:", 8))
    {
        if (0 == strncmp(opt + 8, "on", 2))
        {
            hdmi_mmp_enable(1);
        }
        else if (0 == strncmp(opt + 8, "off", 3))
        {
            hdmi_mmp_enable(0);
        }
        else if (0 == strncmp(opt + 8, "img", 3))
        {
            hdmi_mmp_enable(7);
        }
        else
        {
            goto Error;
        }
    }
    else if (0 == strncmp(opt, "hdmireg", 7))
    {
        ext_disp_diagnose();
    }
    else if (0 == strncmp(opt, "enablehwc:", 10))
    {
        if (0 == strncmp(opt + 10, "on", 2))
        {
            hdmi_hwc_enable(1);
        }
        else if (0 == strncmp(opt + 10, "off", 3))
        {
            hdmi_hwc_enable(0);
        }
    }
    else if (0 == strncmp(opt, "I2S1:", 5))
    {
#ifdef GPIO_MHL_I2S_OUT_WS_PIN
        if (0 == strncmp(opt + 5, "on", 2))
        {
            printk("[hdmi][Debug] Enable I2S1 \n");
            mt_set_gpio_mode(GPIO_MHL_I2S_OUT_WS_PIN, GPIO_MODE_01);
            mt_set_gpio_mode(GPIO_MHL_I2S_OUT_CK_PIN, GPIO_MODE_01);
            mt_set_gpio_mode(GPIO_MHL_I2S_OUT_DAT_PIN, GPIO_MODE_01);
        }
        else if (0 == strncmp(opt + 5, "off", 3))
        {
            printk("[hdmi][Debug] Disable I2S1 \n");
            mt_set_gpio_mode(GPIO_MHL_I2S_OUT_WS_PIN, GPIO_MODE_02);
            mt_set_gpio_mode(GPIO_MHL_I2S_OUT_CK_PIN, GPIO_MODE_01);
            mt_set_gpio_mode(GPIO_MHL_I2S_OUT_DAT_PIN, GPIO_MODE_02);
        }
#endif
    }
    else if (0 == strncmp(opt, "I2SEnable:", 10))
    {
        if (0 == strncmp(opt + 10, "1", 1))
        {
            I2S_Enable = 1;
        }
        else if (0 == strncmp(opt + 10, "0", 1))
        {
            I2S_Enable = 0;
        }
    }
    else if (0 == strncmp(opt, "DPI_IO_DRIVING:", 15))
    {
        if (0 == strncmp(opt + 15, "4", 1))
        {
            MASKREG32(DISPSYS_IO_DRIVING, 0x3C00, 0x0000);
        }
        else if (0 == strncmp(opt + 15, "8", 1))
        {
            MASKREG32(DISPSYS_IO_DRIVING, 0x3C00, 0x1400);
        }
        else if (0 == strncmp(opt + 15, "12", 2))
        {
            MASKREG32(DISPSYS_IO_DRIVING, 0x3C00, 0x2800);
        }
        else if (0 == strncmp(opt + 15, "16", 2))
        {
            MASKREG32(DISPSYS_IO_DRIVING, 0x3C00, 0x3C00);
        }
    }
    else if (0 == strncmp(opt, "DPI_DUMP:", 9))
    {
        if (ddp_modules_driver[DISP_MODULE_DPI]->dump_info != NULL)
        {
            ddp_modules_driver[DISP_MODULE_DPI]->dump_info(DISP_MODULE_DPI, 1);
        }
    }
    else if (0 == strncmp(opt, "forceon", 7))
    {
        hdmi_force_on(false);
    }
    else
    {
        goto Error;
    }

    return;

Error:
    printk("[hdmitx] parse command error!\n\n%s", STR_HELP);
}
static long mtk_ext_disp_mgr_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
    void __user *argp = (void __user *)arg;
    int r = 0;

    printk("[EXTD]ioctl= %s(%d), arg = %lu\n", _hdmi_ioctl_spy(cmd), cmd & 0xff, arg);

    switch (cmd)
    {
    case MTK_HDMI_AUDIO_VIDEO_ENABLE:
    {
        /* 0xXY
                   * the low 16 bits(Y) are for disable and enable, and the high 16 bits(X) are for device id
                   * the device id:
                   * X = 0 - mhl
                   * X = 1 - wifi display
                */
        external_display_enable(arg);
        break;
    }

    case MTK_HDMI_POWER_ENABLE:
    {
        /* 0xXY
                   * the low 16 bits(Y) are for disable and enable, and the high 16 bits(X) are for device id
                   * the device id:
                   * X = 0 - mhl
                   * X = 1 - wifi display
                */
        external_display_power_enable(arg);
        break;
    }

    case MTK_HDMI_VIDEO_CONFIG:
    {
        /* 0xXY
                   * the low 16 bits(Y) are for disable and enable, and the high 16 bits(X) are for device id
                   * the device id:
                   * X = 0 - mhl
                   * X = 1 - wifi display
                   */
        external_display_set_resolution(arg);
        break;
    }

    case MTK_HDMI_FORCE_FULLSCREEN_ON:
        //case MTK_HDMI_FORCE_CLOSE:
    {
        /* 0xXY
                   * the low 16 bits(Y) are for disable and enable, and the high 16 bits(X) are for device id
                   * the device id:
                   * X = 0 - mhl
                   * X = 1 - wifi display
                   */
        arg = arg | 0x1;
        external_display_power_enable(arg);
        break;
    }

    case MTK_HDMI_FORCE_FULLSCREEN_OFF:
        //case MTK_HDMI_FORCE_OPEN:
    {
        /* 0xXY
                   * the low 16 bits(Y) are for disable and enable, and the high 16 bits(X) are for device id
                   * the device id:
                   * X = 0 - mhl
                   * X = 1 - wifi display
                 */
        arg = arg & 0x0FF0000;
        external_display_power_enable(arg);
        break;
    }

    case MTK_HDMI_GET_DEV_INFO:
    {
        /* 0xXY
                   * the low 16 bits(Y) are for disable and enable, and the high 16 bits(X) are for device id
                   * the device id:
                   * X = 0 - mhl
                   * X = 1 - wifi display
                 */
        r = external_display_get_dev_info(*((unsigned long *)argp), argp);
        break;
    }

    case MTK_HDMI_USBOTG_STATUS:
    {
        //hdmi_set_USBOTG_status(arg);
        break;
    }

    case MTK_HDMI_AUDIO_ENABLE:
    {
        printk("[EXTD]hdmi_set_audio_enable, arg = %lu\n", arg);
        hdmi_set_audio_enable(arg);
        break;
    }

    case MTK_HDMI_VIDEO_ENABLE:
    {
        break;
    }

    case MTK_HDMI_AUDIO_CONFIG:
    {
        r = hdmi_audio_config(arg);
        break;
    }

    case MTK_HDMI_IS_FORCE_AWAKE:
    {
        r = hdmi_is_force_awake(argp);
        break;
    }

    case MTK_HDMI_GET_EDID:
    {
        hdmi_get_edid(argp);
        break;
    }

    case MTK_HDMI_SCREEN_CAPTURE:
    {
        r = hdmi_screen_capture(argp);
        break;
    }

    case MTK_HDMI_FACTORY_CHIP_INIT:
    {
        r = hdmi_factory_mode_test(STEP1_CHIP_INIT, NULL);
        break;
    }

    case MTK_HDMI_FACTORY_JUDGE_CALLBACK:
    {
        r = hdmi_factory_mode_test(STEP2_JUDGE_CALLBACK, argp);
        break;
    }

    case MTK_HDMI_FACTORY_START_DPI_AND_CONFIG:
    {
        r = hdmi_factory_mode_test(STEP3_START_DPI_AND_CONFIG, arg);
        //hdmi_factory_mode_test(STEP1_CHIP_INIT, NULL);
        //hdmi_factory_mode_test(STEP3_START_DPI_AND_CONFIG, arg);
        break;
    }
    case MTK_HDMI_FACTORY_DPI_STOP_AND_POWER_OFF:
    {
        ///r = hdmi_factory_mode_test(STEP4_DPI_STOP_AND_POWER_OFF, NULL);
        break;
    }
    case MTK_HDMI_FAKE_PLUG_IN:
    {
        if(arg)
        {
            hdmi_cable_fake_plug_in();
        }
        else
        {
            hdmi_cable_fake_plug_out();
        }
        break;
    }
    default:
    {
        printk("[EXTD]ioctl(%d) arguments is not support\n",  cmd & 0x0ff);
        r = -EFAULT;
        break;
    }
    }

    printk("[EXTD]ioctl = %s(%d) done\n",  _hdmi_ioctl_spy(cmd), cmd & 0x0ff);
    return r;
}
// TODO: this is a temp debug solution
//extern void hdmi_cable_fake_plug_in(void);
//extern int hdmi_drv_init(void);
static void process_dbg_opt(const char *opt)
{
    if (0)
    {

    }

#if defined(CONFIG_MTK_HDMI_SUPPORT)
    else if (0 == strncmp(opt, "on", 2))
    {
        hdmi_power_on();
    }
    else if (0 == strncmp(opt, "off", 3))
    {
        hdmi_power_off();
    }
    else if (0 == strncmp(opt, "suspend", 7))
    {
        hdmi_suspend();
    }
    else if (0 == strncmp(opt, "resume", 6))
    {
        hdmi_resume();
    }
    else if (0 == strncmp(opt, "colorbar", 8))
    {

    }
    else if (0 == strncmp(opt, "ldooff", 6))
    {

    }
    else if (0 == strncmp(opt, "log:", 4))
    {
        if (0 == strncmp(opt + 4, "on", 2))
        {
            hdmi_log_enable(true);
        }
        else if (0 == strncmp(opt + 4, "off", 3))
        {
            hdmi_log_enable(false);
        }
        else
        {
            goto Error;
        }
    }
    else if (0 == strncmp(opt, "fakecablein:", 12))
    {
        if (0 == strncmp(opt + 12, "enable", 6))
        {
            hdmi_cable_fake_plug_in();
        }
        else if (0 == strncmp(opt + 12, "disable", 7))
        {
            hdmi_cable_fake_plug_out();
        }
        else
        {
            goto Error;
        }
    }
    else if (0 == strncmp(opt, "force_res:", 10))
    {
        char *p = (char *)opt + 10;
        unsigned int res = (unsigned int) simple_strtoul(p, &p, 16);
        hdmi_force_resolution(res);
    }

#endif
    else if (0 == strncmp(opt, "hdmimmp:", 8))
    {
        if (0 == strncmp(opt + 8, "on", 2))
        {
            hdmi_mmp_enable(1);
        }
        else if (0 == strncmp(opt + 8, "off", 3))
        {
            hdmi_mmp_enable(0);
        }
        else if (0 == strncmp(opt + 8, "img", 3))
        {
            hdmi_mmp_enable(7);
        }
        else
        {
            goto Error;
        }
    }
    else if (0 == strncmp(opt, "hdmireg", 7))
    {
        ext_disp_diagnose();
    }
    else if (0 == strncmp(opt, "enablehwc:", 10))
    {
        if (0 == strncmp(opt + 10, "on", 2))
        {
            hdmi_hwc_enable(1);
        }
        else if (0 == strncmp(opt + 10, "off", 3))
        {
            hdmi_hwc_enable(0);
        }
    }
    else
    {
        goto Error;
    }

    return;

Error:
    printk("[hdmitx] parse command error!\n\n%s", STR_HELP);
}
예제 #5
0
// TODO: this is a temp debug solution
//extern void hdmi_cable_fake_plug_in(void);
//extern int hdmi_drv_init(void);
static void process_dbg_opt(const char *opt)
{
    if (0)
    {

    }
#if defined(MTK_HDMI_SUPPORT)
    else if (0 == strncmp(opt, "on", 2))
    {
        hdmi_power_on();
    }
    else if (0 == strncmp(opt, "off", 3))
    {
        hdmi_power_off();
    }
    else if (0 == strncmp(opt, "suspend", 7))
    {
        hdmi_suspend();
    }
    else if (0 == strncmp(opt, "resume", 6))
    {
        hdmi_resume();
    }
    else if (0 == strncmp(opt, "colorbar", 8))
    {

    }
    else if (0 == strncmp(opt, "ldooff", 6))
    {

    }
    else if (0 == strncmp(opt, "log:", 4))
    {
        if (0 == strncmp(opt + 4, "on", 2))
        {
            hdmi_log_enable(true);
        }
        else if (0 == strncmp(opt + 4, "off", 3))
        {
            hdmi_log_enable(false);
        }
        else
        {
            goto Error;
        }
    }
    else if (0 == strncmp(opt, "fakecablein:", 12))
    {
        if (0 == strncmp(opt + 12, "enable", 6))
        {
            hdmi_cable_fake_plug_in();
        }
        else if (0 == strncmp(opt + 12, "disable", 7))
        {
            hdmi_cable_fake_plug_out();
        }
        else
        {
            goto Error;
        }
    }

#endif
    else if (0 == strncmp(opt, "hdmimmp:", 8))
    {
        if (0 == strncmp(opt + 8, "on", 2))
        {
            hdmi_mmp_enable(1);
        }
        else if (0 == strncmp(opt + 8, "off", 3))
        {
            hdmi_mmp_enable(0);
        }
        else if (0 == strncmp(opt + 8, "img", 3))
        {
            hdmi_mmp_enable(7);
        }
        else if (0 == strncmp(opt + 8, "init", 4))
        {
            init_hdmi_mmp_events();
        }
        else
        {
            goto Error;
        }
    }
    else if (0 == strncmp(opt, "imgscale:", 9))
    {
        char *p = (char *)opt + 9;
        unsigned int level = (unsigned int) simple_strtoul(p, &p, 3);

        if (level)
        {
            if (level > 10)
            {
                level = 10;
            }
            if (level < 1)
            {
                level = 1;
            }
            mmp_image_scale = level;
            printk("[hdmitx] imgscale set to %d\n", mmp_image_scale);
        }
        else
        {
            goto Error;
        }
    }
    else
    {
        goto Error;
    }

    return;

Error:
    printk("[hdmitx] parse command error!\n\n%s", STR_HELP);
}