/****************************************************************************** * * cpia2_usb_stream_stop * *****************************************************************************/ int cpia2_usb_stream_stop(struct camera_data *cam) { int ret; ret = cpia2_usb_stream_pause(cam); cam->streaming = 0; configure_transfer_mode(cam, 0); return ret; }
/****************************************************************************** * * cpia2_usb_change_streaming_alternate * *****************************************************************************/ int cpia2_usb_change_streaming_alternate(struct camera_data *cam, unsigned int alt) { int ret = 0; if(alt < USBIF_ISO_1 || alt > USBIF_ISO_6) return -EINVAL; if(alt == cam->params.camera_state.stream_mode) return 0; cpia2_usb_stream_pause(cam); configure_transfer_mode(cam, alt); cam->params.camera_state.stream_mode = alt; /* Reset the camera to prevent image quality degradation */ cpia2_reset_camera(cam); cpia2_usb_stream_resume(cam); return ret; }
/** * @brief Initialize the UniPro core */ void unipro_init(void) { unsigned int i; int retval; struct cport *cport; /* * Compute and cache the number of CPorts that this bridge has, for use * by the functions in this source file. The value does not change. */ if (cport_count == 0) cport_count = unipro_cport_count(); cporttable = zalloc(sizeof(struct cport) * cport_count); if (!cporttable) { return; } retval = unipro_tx_init(); if (retval) { free(cporttable); cporttable = NULL; return; } for (i = 0; i < cport_count; i++) { cport = &cporttable[i]; cport->tx_buf = CPORT_TX_BUF(i); cport->cportid = i; cport->connected = 0; list_init(&cport->tx_fifo); } unipro_write(LUP_INT_EN, 0x1); /* * Set transfer mode 2 on all cports * Receiver choses address for received message * Header is delivered transparently to receiver (and used to carry the first eight * L4 payload bytes) */ DEBUGASSERT(TRANSFER_MODE == 2); configure_transfer_mode(TRANSFER_MODE); /* * Initialize cports. */ unipro_write(UNIPRO_INT_EN, 0x0); for (i = 0; i < cport_count; i++) { unipro_init_cport(i); } unipro_write(UNIPRO_INT_EN, 0x1); /* * Disable FCT transmission. See ENG-376. */ unipro_write(CPB_RX_E2EFC_EN_0, 0x0); if (tsb_get_product_id() == tsb_pid_apbridge) { unipro_write(CPB_RX_E2EFC_EN_1, 0x0); } irq_attach(TSB_IRQ_UNIPRO, irq_unipro); up_enable_irq(TSB_IRQ_UNIPRO); #ifdef UNIPRO_DEBUG unipro_info(); #endif lldbg("UniPro enabled\n"); }