static void reset_ccmni_instance_buffer(struct ccmni_instance_t *ccmni_instance) { unsigned long flags; spin_lock_irqsave(&ccmni_instance->spinlock, flags); ccci_reset_buffers(ccmni_instance->shared_mem, CCCI1_CCMNI_BUF_SIZE); spin_unlock_irqrestore(&ccmni_instance->spinlock, flags); }
int ccmni_v1_ipo_h_restore(int md_id) { int i; struct ccmni_v1_ctl_block_t *ctlb; ctlb = ccmni_ctl_block[md_id]; for (i = 0; i < CCMNI_V1_PORT_NUM; i++) ccci_reset_buffers(ctlb->ccmni_instance[i]->shared_mem, CCCI1_CCMNI_BUF_SIZE); return 0; }
static void ccci_tty_close(struct tty_struct *tty, struct file *f) { tty_instance_t *tty_instance; if (tty == NULL) return; tty_instance = (tty_instance_t *) tty->driver_data; mutex_lock(&tty_instance->ccci_tty_mutex); tty_instance->count--; CCCI_MSG_INF("tty", "[tty_close]Port%d count %d \n", tty->index, tty_instance->count); if (tty_instance->count == 0) { wake_lock_destroy(&tty_instance->wake_lock); tty->driver_data = NULL; tty_instance->tty = NULL; tty_instance->ready = 0; ccci_reset_buffers(tty_instance->shared_mem ); if(tty_instance->need_reset) { if (tty_instance->reset_handle >= 0) { ccci_reset_request(tty_instance->reset_handle); } else { CCCI_MSG_INF("tty", "[tty_close]Invalid reset handle(port%d): %d \n", tty->index, tty_instance->reset_handle); } } } mutex_unlock(&tty_instance->ccci_tty_mutex); return; }