Changeset 6747b929 in mainline for uspace/drv/audio/hdaudio/stream.c


Ignore:
Timestamp:
2014-08-26T11:35:23Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c67195c
Parents:
159c722d
Message:

Playback stopping and restart.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/hdaudio/stream.c

    r159c722d r6747b929  
    177177
    178178        ctl = hda_reg8_read(&sdregs->ctl1);
    179         ctl = ctl | 2 /* XXX Run */;
     179        if (run)
     180                ctl = ctl | BIT_V(uint8_t, sdctl1_run);
     181        else
     182                ctl = ctl & ~BIT_V(uint8_t, sdctl1_run);
     183
    180184        hda_reg8_write(&sdregs->ctl1, ctl);
     185}
     186
     187static void hda_stream_reset_noinit(hda_stream_t *stream)
     188{
     189        uint32_t ctl;
     190        hda_sdesc_regs_t *sdregs;
     191
     192        sdregs = &stream->hda->regs->sdesc[stream->sdid];
     193
     194        ctl = hda_reg8_read(&sdregs->ctl1);
     195        ctl = ctl | BIT_V(uint8_t, sdctl1_srst);
     196        hda_reg8_write(&sdregs->ctl1, ctl);
     197
     198        async_usleep(100 * 1000);
     199
     200//      ctl = hda_reg8_read(&sdregs->ctl1);
     201//      ctl = ctl & ~BIT_V(uint8_t, sdctl1_srst);
     202//      hda_reg8_write(&sdregs->ctl1, ctl);
     203
     204//      async_usleep(100 * 1000);
    181205}
    182206
     
    214238{
    215239        ddf_msg(LVL_NOTE, "hda_stream_destroy()");
     240        hda_stream_reset_noinit(stream);
    216241        free(stream);
    217242}
     
    223248}
    224249
     250void hda_stream_stop(hda_stream_t *stream)
     251{
     252        ddf_msg(LVL_NOTE, "hda_stream_stop()");
     253        hda_stream_set_run(stream, false);
     254}
     255
     256void hda_stream_reset(hda_stream_t *stream)
     257{
     258        ddf_msg(LVL_NOTE, "hda_stream_reset()");
     259        hda_stream_reset_noinit(stream);
     260        hda_stream_desc_configure(stream);
     261}
     262
    225263/** @}
    226264 */
Note: See TracChangeset for help on using the changeset viewer.