void __init xmd_ch_init(void) { int i; int size = ARRAY_SIZE(hsi_all_channels); #if MCM_DBG_LOG printk("\nmcm: xmd_ch_init++\n"); #endif if (0 != mipi_hsi_mem_init()) panic("\nmcm: memory initialization failed\n"); spin_lock_init(&mem_lock); for (i=0; i<size; i++) { hsi_channels[i].state = hsi_all_channels[i].state; hsi_channels[i].name = hsi_all_channels[i].name; hsi_channels[i].write_happening = HSI_FALSE; hsi_channels[i].write_queued = HSI_FALSE; hsi_channels[i].read_queued = HSI_FALSE; hsi_channels[i].read_happening = HSI_FALSE; spin_lock_init(&hsi_channels[i].lock); init_waitqueue_head(&hsi_channels[i].write_wait); init_waitqueue_head(&hsi_channels[i].read_wait); init_q(i); } hsi_ll_init(1, hsi_ch_cb); //Create and initialize work q hsi_read_wq = create_workqueue("hsi-read-wq"); hsi_write_wq = create_workqueue("hsi-write-wq"); }
void __init xmd_ch_init(void) { int i; int size = ARRAY_SIZE(hsi_all_channels); #if MCM_DBG_LOG printk("\nmcm: xmd_ch_init++\n"); #endif for (i=0; i<size; i++) { hsi_channels[i].state = hsi_all_channels[i].state; hsi_channels[i].name = hsi_all_channels[i].name; hsi_channels[i].write_happening = HSI_FALSE; hsi_channels[i].write_queued = HSI_FALSE; hsi_channels[i].read_queued = HSI_FALSE; hsi_channels[i].read_happening = HSI_FALSE; spin_lock_init(&hsi_channels[i].lock); init_waitqueue_head(&hsi_channels[i].write_wait); init_waitqueue_head(&hsi_channels[i].read_wait); init_q(i); } hsi_mem_init(); // /* TI HSI driver (from HSI_DRIVER_VERSION 0.4.2) can suppport port 1 and 2, but IMC XMD currently supports port 1 only */ hsi_ll_init(XMD_SUPPORT_PORT, hsi_ch_cb); // /* Create and initialize work q */ hsi_read_wq = create_workqueue("hsi-read-wq"); hsi_write_wq = create_workqueue("hsi-write-wq"); #if defined (HSI_LL_ENABLE_RX_BUF_RETRY_WQ) hsi_buf_retry_wq = create_workqueue("hsi_buf_retry_wq"); #endif INIT_WORK(&XMD_DLP_RECOVERY_wq, xmd_dlp_recovery_wq); /* */ #if 1 for (i=0; i<size; i++) { INIT_WORK(&hsi_channels[i].read_work, hsi_read_work); INIT_WORK(&hsi_channels[i].write_work, hsi_write_work); #if defined (HSI_LL_ENABLE_RX_BUF_RETRY_WQ) INIT_WORK(&hsi_channels[i].buf_retry_work, hsi_buf_retry_work); #endif } #endif /* */ // #if defined (ENABLE_RECOVERY_WAKE_LOCK) wake_lock_init(&xmd_recovery_wake_lock, WAKE_LOCK_SUSPEND, "xmd-recovery-wake"); #endif // hsi_mcm_state = HSI_MCM_STATE_INITIALIZED; }