Changeset 3bacee1 in mainline for uspace/drv/audio/sb16/dsp.c


Ignore:
Timestamp:
2018-04-12T16:27:17Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3cf22f9
Parents:
76d0981d
git-author:
Jiri Svoboda <jiri@…> (2018-04-11 19:25:33)
git-committer:
Jiri Svoboda <jiri@…> (2018-04-12 16:27:17)
Message:

Make ccheck-fix again and commit more good files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/sb16/dsp.c

    r76d0981d r3bacee1  
    6363#define AUTO_DMA_MODE
    6464
    65 static inline const char * dsp_state_to_str(dsp_state_t state)
    66 {
    67         static const char* state_names[] = {
     65static inline const char *dsp_state_to_str(dsp_state_t state)
     66{
     67        static const char *state_names[] = {
    6868                [DSP_PLAYBACK_ACTIVE_EVENTS] = "PLAYBACK w/ EVENTS",
    6969                [DSP_CAPTURE_ACTIVE_EVENTS] = "CAPTURE w/ EVENTS",
     
    240240            dsp->active.samples / ((dsp->active.mode & DSP_MODE_STEREO) ? 2 : 1);
    241241
    242         switch (dsp->state)
    243         {
     242        switch (dsp->state) {
    244243        case DSP_PLAYBACK_ACTIVE_EVENTS:
    245244                dsp_report_event(dsp, PCM_EVENT_FRAMES_PLAYED);
     
    277276{
    278277        ddf_log_verbose("Querying cap %s", audio_pcm_cap_str(cap));
    279         switch(cap) {
     278        switch (cap) {
    280279        case AUDIO_CAP_CAPTURE:
    281280        case AUDIO_CAP_PLAYBACK:
     
    312311
    313312errno_t sb_dsp_test_format(sb_dsp_t *dsp, unsigned *channels, unsigned *rate,
    314   pcm_sample_format_t *format)
     313    pcm_sample_format_t *format)
    315314{
    316315        errno_t ret = EOK;
     
    346345}
    347346
    348 async_sess_t * sb_dsp_get_event_session(sb_dsp_t *dsp)
     347async_sess_t *sb_dsp_get_event_session(sb_dsp_t *dsp)
    349348{
    350349        assert(dsp);
     
    416415        }
    417416
    418         dsp->active.mode = 0
    419             | (pcm_sample_format_is_signed(format) ? DSP_MODE_SIGNED : 0)
    420             | (channels == 2 ? DSP_MODE_STEREO : 0);
     417        dsp->active.mode = 0 |
     418            (pcm_sample_format_is_signed(format) ? DSP_MODE_SIGNED : 0) |
     419            (channels == 2 ? DSP_MODE_STEREO : 0);
    421420        dsp->active.samples = frames * channels;
    422421        dsp->active.frame_count = 0;
     
    446445        if ((dsp->state == DSP_PLAYBACK_NOEVENTS ||
    447446            dsp->state == DSP_PLAYBACK_ACTIVE_EVENTS) &&
    448             immediate)
    449         {
     447            immediate) {
    450448                dsp_write(dsp, DMA_16B_PAUSE);
    451449                dsp_reset(dsp);
     
    459457                return EOK;
    460458        }
    461         if (dsp->state == DSP_PLAYBACK_ACTIVE_EVENTS)
    462         {
     459        if (dsp->state == DSP_PLAYBACK_ACTIVE_EVENTS) {
    463460                /* Stop after current fragment */
    464461                assert(!immediate);
     
    494491        }
    495492
    496         dsp->active.mode = 0
    497             | (pcm_sample_format_is_signed(format) ? DSP_MODE_SIGNED : 0)
    498             | (channels == 2 ? DSP_MODE_STEREO : 0);
     493        dsp->active.mode = 0 |
     494            (pcm_sample_format_is_signed(format) ? DSP_MODE_SIGNED : 0) |
     495            (channels == 2 ? DSP_MODE_STEREO : 0);
    499496        dsp->active.samples = frames * channels;
    500497        dsp->active.frame_count = 0;
     
    522519        if ((dsp->state == DSP_CAPTURE_NOEVENTS ||
    523520            dsp->state == DSP_CAPTURE_ACTIVE_EVENTS) &&
    524             immediate)
    525         {
     521            immediate) {
    526522                dsp_write(dsp, DMA_16B_PAUSE);
    527523                dsp_reset(dsp);
     
    535531                return EOK;
    536532        }
    537         if (dsp->state == DSP_CAPTURE_ACTIVE_EVENTS)
    538         {
     533        if (dsp->state == DSP_CAPTURE_ACTIVE_EVENTS) {
    539534                /* Stop after current fragment */
    540535                assert(!immediate);
Note: See TracChangeset for help on using the changeset viewer.