Ejemplo n.º 1
0
void create() {
  ::create();
  set_dance_name("beguiling step");
  set_auto(0);
  set_type("detrimental");
  set_target_required(1);
  set_max_rounds(3);
}
Ejemplo n.º 2
0
/*
 * Function called when the module is initialized
 */
static int __init dma_module_init(void) {
    int error;
    int i = 0;


    /* Request a chain */
    chain.chain_type = OMAP_DMA_STATIC_CHAIN;
    chain.device_id = OMAP_DMA_NO_DEVICE;
    chain.data_type = OMAP_DMA_DATA_TYPE_S8;
    chain.addressing_mode = OMAP_DMA_AMODE_POST_INC;
    chain.sync_mode = OMAP_DMA_SYNC_ELEMENT;
    chain.data_burst = OMAP_DMA_DATA_BURST_DIS;
    chain.channel_count = TRANSFER_COUNT;
    set_max_rounds(TRANSFER_ROUNDS);

    error = request_dma_chain(&chain);

    if(error) {
        set_test_passed_chain(0);
        return 1;
    }

    for(i = 0; i < chain.channel_count; i++) {

        /* Create the buffers for each transfer */
        transfers[i].buffers.buf_size = (1024 * 16);
        error = create_transfer_buffers_chain(&(transfers[i].buffers));
        if( error ) {
            set_test_passed_chain(0);
            return 1;
        }
        fill_source_buffer_chain(&(transfers[i].buffers));

        /* Chain a transfer to the chain */
        error = chain_transfer(&chain, &transfers[i]);
        if( error ) {
            set_test_passed_chain(0);
            return 1;
        }

    }

    /* Setup the global dma parameters */
    setup_dma_chain(&chain);

    /* Start the chain */
    start_dma_chain(&chain);

    /* Poll if the all the transfers have finished */
    for(i = 0; i < TRANSFER_POLL_COUNT; i++) {
        if(get_transfers_finished()) {
            mdelay(TRANSFER_POLL_TIME);
            check_test_passed();
            break;
        } else {
            mdelay(TRANSFER_POLL_TIME);
        }
    }

    /* This will happen if the poll retries have been reached*/
    if(i == TRANSFER_POLL_COUNT) {
        set_test_passed_chain(0);
        return 1;
    }

    return 0;
}