u32 vcd_init_device_context(struct vcd_drv_ctxt_type_t *p_drv_ctxt,
                            u32 n_ev_code)
{
    struct vcd_dev_ctxt_type *p_dev_ctxt = &p_drv_ctxt->dev_ctxt;
    struct sched_init_param_type sched_init;
    u32 rc;
    struct ddl_init_config_type ddl_init;

    VCD_MSG_LOW("vcd_init_device_context:");

    p_dev_ctxt->e_pending_cmd = VCD_CMD_NONE;

    rc = vcd_power_event(p_dev_ctxt, NULL, VCD_EVT_PWR_DEV_INIT_BEGIN);
    VCD_FAILED_RETURN(rc, "VCD_EVT_PWR_DEV_INIT_BEGIN failed");

    VCD_MSG_HIGH("Device powered ON and clocked");

    sched_init.n_perf_lvl = p_dev_ctxt->n_max_perf_lvl;
    rc = vcd_map_sched_status(sched_create
                              (&sched_init, &p_dev_ctxt->sched_hdl));

    if (VCD_FAILED(rc)) {
        VCD_MSG_ERROR("rc = 0x%x. Failed: sched_create", rc);

        (void)vcd_power_event(p_dev_ctxt, NULL,
                              VCD_EVT_PWR_DEV_INIT_FAIL);

        return rc;
    }

    VCD_MSG_HIGH("Created scheduler instance.");

    ddl_init.p_core_virtual_base_addr = p_dev_ctxt->p_device_base_addr;
    ddl_init.pf_interrupt_clr = p_dev_ctxt->config.pf_interrupt_clr;
    ddl_init.ddl_callback = vcd_ddl_callback;

    rc = ddl_device_init(&ddl_init, NULL);

    if (VCD_FAILED(rc)) {
        VCD_MSG_ERROR("rc = 0x%x. Failed: ddl_device_init", rc);

        (void)sched_destroy(p_dev_ctxt->sched_hdl);
        p_dev_ctxt->sched_hdl = NULL;

        (void)vcd_power_event(p_dev_ctxt, NULL,
                              VCD_EVT_PWR_DEV_INIT_FAIL);
    } else {
        vcd_device_timer_start(p_dev_ctxt);
        vcd_do_device_state_transition(p_drv_ctxt,
                                       VCD_DEVICE_STATE_INITING,
                                       n_ev_code);
    }

    return rc;
}
Ejemplo n.º 2
0
u32 vcd_init_device_context(struct vcd_drv_ctxt *drv_ctxt,
		u32 ev_code)
{
	struct vcd_dev_ctxt *dev_ctxt = &drv_ctxt->dev_ctxt;
	u32 rc;
	struct ddl_init_config ddl_init;

	VCD_MSG_LOW("vcd_init_device_context:");

	dev_ctxt->pending_cmd = VCD_CMD_NONE;

	rc = vcd_power_event(dev_ctxt, NULL, VCD_EVT_PWR_DEV_INIT_BEGIN);
	VCD_FAILED_RETURN(rc, "VCD_EVT_PWR_DEV_INIT_BEGIN failed");

	VCD_MSG_HIGH("Device powered ON and clocked");
	rc = vcd_sched_create(&dev_ctxt->sched_clnt_list);
	if (VCD_FAILED(rc)) {
		VCD_MSG_ERROR("rc = 0x%x. Failed: vcd_sched_create", rc);

		(void)vcd_power_event(dev_ctxt, NULL,
					  VCD_EVT_PWR_DEV_INIT_FAIL);

		return rc;
	}

	VCD_MSG_HIGH("Created scheduler instance.");

	ddl_init.core_virtual_base_addr = dev_ctxt->device_base_addr;
	ddl_init.interrupt_clr = dev_ctxt->config.interrupt_clr;
	ddl_init.ddl_callback = vcd_ddl_callback;

	rc = ddl_device_init(&ddl_init, NULL);

	if (VCD_FAILED(rc)) {
		VCD_MSG_ERROR("rc = 0x%x. Failed: ddl_device_init", rc);
		vcd_sched_destroy(&dev_ctxt->sched_clnt_list);
		(void)vcd_power_event(dev_ctxt, NULL,
					  VCD_EVT_PWR_DEV_INIT_FAIL);
	} else {
		vcd_device_timer_start(dev_ctxt);
		vcd_do_device_state_transition(drv_ctxt,
						   VCD_DEVICE_STATE_INITING,
						   ev_code);
	}


	#if 1//FEATURE_PANTECH_MMP_QCOM_CR , QC Case#00859255 for[WTR]Video lagging issue
	dev_ctxt->turbo_mode_set = 0;  
	#endif //QC Case#00859255 for[WTR]Video lagging issue

	return rc;
}