decoder_count = decoder_select + 1;
        } else {
                decoder = 0;
-               decoder_count = _num_decoders;
+               decoder_count = dev->_max_num_decoders;
        }
 
        switch (width) {
                break;
        }
 
-       _display_field_cnt[decoder] = duration;
-
        /* update hardware */
        fld_cnt = cx25821_i2c_read(&dev->i2c_bus[0], disp_cnt_reg, &tmp);
 
        int ret_val = 0;
        int i = 0;
 
-       _num_decoders = dev->_max_num_decoders;
-
        /* disable Auto source selection on all video decoders */
        value = cx25821_i2c_read(&dev->i2c_bus[0], MON_A_CTRL, &tmp);
        value &= 0xFFFFF0FF;
        if (ret_val < 0)
                goto error;
 
-       for (i = 0; i < _num_decoders; i++)
-               medusa_set_decoderduration(dev, i, _display_field_cnt[i]);
+       /*
+        * FIXME: due to a coding bug the duration was always 0. It's
+        * likely that it really should be something else, but due to the
+        * lack of documentation I have no idea what it should be. For
+        * now just fill in 0 as the duration.
+        */
+       for (i = 0; i < dev->_max_num_decoders; i++)
+               medusa_set_decoderduration(dev, i, 0);
 
        /* Select monitor as DENC A input, power up the DAC */
        value = cx25821_i2c_read(&dev->i2c_bus[0], DENC_AB_CTRL, &tmp);
        /* Turn on all of the data out and control output pins. */
        value = cx25821_i2c_read(&dev->i2c_bus[0], PIN_OE_CTRL, &tmp);
        value &= 0xFEF0FE00;
-       if (_num_decoders == MAX_DECODERS) {
+       if (dev->_max_num_decoders == MAX_DECODERS) {
                /*
                 * Note: The octal board does not support control pins(bit16-19)
                 * These bits are ignored in the octal board.
 
                 * For the upstream video channel, the risc engine will enable
                 * the FIFO. */
                if (fifo_enable && line == 3) {
-                       *(rp++) = RISC_WRITECR;
-                       *(rp++) = sram_ch->dma_ctl;
-                       *(rp++) = FLD_VID_FIFO_EN;
-                       *(rp++) = 0x00000001;
+                       *(rp++) = cpu_to_le32(RISC_WRITECR);
+                       *(rp++) = cpu_to_le32(sram_ch->dma_ctl);
+                       *(rp++) = cpu_to_le32(FLD_VID_FIFO_EN);
+                       *(rp++) = cpu_to_le32(0x00000001);
                }
        }