static u32 vcd_init_in_null (struct vcd_drv_ctxt *drv_ctxt, struct vcd_init_config *config, s32 *driver_handle) { u32 rc = VCD_S_SUCCESS; struct vcd_dev_ctxt *dev_ctxt = &drv_ctxt->dev_ctxt; u32 done_create_timer = false; VCD_MSG_LOW("vcd_init_in_dev_null:"); dev_ctxt->config = *config; dev_ctxt->device_base_addr = (u8 *)config->map_dev_base_addr( dev_ctxt->config.device_name); if (!dev_ctxt->device_base_addr) { VCD_MSG_ERROR("NULL Device_base_addr"); return VCD_ERR_FAIL; } if (config->register_isr) { config->register_isr(dev_ctxt->config. device_name); } if (config->timer_create) { if (config->timer_create(vcd_hw_timeout_handler, NULL, &dev_ctxt->hw_timer_handle)) done_create_timer = true; else { VCD_MSG_ERROR("timercreate failed"); return VCD_ERR_FAIL; } } rc = vcd_init_cmn(drv_ctxt, config, driver_handle); if (!VCD_FAILED(rc)) { vcd_do_device_state_transition(drv_ctxt, VCD_DEVICE_STATE_NOT_INIT, DEVICE_STATE_EVENT_NUMBER (init)); } else { if (dev_ctxt->config.un_map_dev_base_addr) dev_ctxt->config.un_map_dev_base_addr(); if (dev_ctxt->config.deregister_isr) dev_ctxt->config.deregister_isr(); if (done_create_timer && dev_ctxt->config.timer_release) dev_ctxt->config.timer_release(dev_ctxt-> hw_timer_handle); } return rc; }
static u32 vcd_init_in_null (struct vcd_drv_ctxt_type_t *p_drv_ctxt, struct vcd_init_config_type *p_config, s32 *p_driver_handle) { u32 rc = VCD_S_SUCCESS; struct vcd_dev_ctxt_type *p_dev_ctxt = &p_drv_ctxt->dev_ctxt; u32 b_done_create_timer = FALSE; VCD_MSG_LOW("vcd_init_in_dev_null:"); p_dev_ctxt->config = *p_config; p_dev_ctxt->p_device_base_addr = (u8 *)p_config->pf_map_dev_base_addr( p_dev_ctxt->config.p_device_name); if (!p_dev_ctxt->p_device_base_addr) { VCD_MSG_ERROR("NULL Device_base_addr"); return VCD_ERR_FAIL; } if (p_config->pf_register_isr) { p_config->pf_register_isr(p_dev_ctxt->config. p_device_name); } if (p_config->pf_timer_create) { if (p_config->pf_timer_create(vcd_hw_timeout_handler, NULL, &p_dev_ctxt->p_hw_timer_handle)) b_done_create_timer = TRUE; else { VCD_MSG_ERROR("timercreate failed"); return VCD_ERR_FAIL; } } rc = vcd_init_cmn(p_drv_ctxt, p_config, p_driver_handle); if (!VCD_FAILED(rc)) { vcd_do_device_state_transition(p_drv_ctxt, VCD_DEVICE_STATE_NOT_INIT, DEVICE_STATE_EVENT_NUMBER (pf_init)); } else { if (p_dev_ctxt->config.pf_un_map_dev_base_addr) p_dev_ctxt->config.pf_un_map_dev_base_addr(); if (p_dev_ctxt->config.pf_deregister_isr) p_dev_ctxt->config.pf_deregister_isr(); if (b_done_create_timer && p_dev_ctxt->config.pf_timer_release) p_dev_ctxt->config.pf_timer_release(p_dev_ctxt-> p_hw_timer_handle); } return rc; }
static u32 vcd_init_in_ready (struct vcd_drv_ctxt *drv_ctxt, struct vcd_init_config *config, s32 *driver_handle) { VCD_MSG_LOW("vcd_init_in_dev_ready:"); return vcd_init_cmn(drv_ctxt, config, driver_handle); }
static u32 vcd_init_in_ready (struct vcd_drv_ctxt_type_t *p_drv_ctxt, struct vcd_init_config_type *p_config, s32 *p_driver_handle) { VCD_MSG_LOW("vcd_init_in_dev_ready:"); return vcd_init_cmn(p_drv_ctxt, p_config, p_driver_handle); }