Changeset 018ab50 in mainline for uspace/drv/audio/sb16/dsp.c


Ignore:
Timestamp:
2012-08-20T11:28:46Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fb6c98f
Parents:
20840922
Message:

audio: Move event callback into separate API calls.

File:
1 edited

Legend:

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

    r20840922 r018ab50  
    5555
    5656#define DSP_RESET_RESPONSE 0xaa
    57 #define DSP_RATE_LIMIT 45000
     57
     58/* These are only for SB16 (DSP4.00+) */
     59#define DSP_RATE_UPPER_LIMIT 44100
     60#define DSP_RATE_LOWER_LIMIT 5000
    5861
    5962#define AUTO_DMA_MODE
     
    294297                ret = ELIMIT;
    295298        }
    296         if (*rate > DSP_RATE_LIMIT) {
    297                 *rate = DSP_RATE_LIMIT;
    298                 ret = ELIMIT;
    299         }
    300299        //TODO 8bit DMA supports 8bit formats
    301300        if (*format != PCM_SAMPLE_SINT16_LE && *format != PCM_SAMPLE_UINT16_LE) {
     
    304303                ret = ELIMIT;
    305304        }
     305        if (*rate > DSP_RATE_UPPER_LIMIT) {
     306                *rate = DSP_RATE_UPPER_LIMIT;
     307                ret = ELIMIT;
     308        }
     309        if (*rate < DSP_RATE_LOWER_LIMIT) {
     310                *rate = DSP_RATE_LOWER_LIMIT;
     311                ret = ELIMIT;
     312        }
    306313        return ret;
    307314}
     
    333340{
    334341        assert(dsp);
    335         assert(session);
    336342        if (dsp->event_session)
    337343                return EBUSY;
    338344        dsp->event_session = session;
    339         ddf_log_debug("Set event session.");
    340         return EOK;
     345        ddf_log_debug("Set event session to %p.", session);
     346        return EOK;
     347}
     348
     349async_sess_t * sb_dsp_get_event_session(sb_dsp_t *dsp)
     350{
     351        assert(dsp);
     352        ddf_log_debug("Get event session: %p.", dsp->event_session);
     353        return dsp->event_session;
    341354}
    342355
Note: See TracChangeset for help on using the changeset viewer.