Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset f0241bda in mainline


Ignore:
Timestamp:
2012-08-17T16:57:29Z (9 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
82e4005
Parents:
2e01b3f
Message:

sb16: Implement capabilities query.

Location:
uspace/drv/audio/sb16
Files:
3 edited

Legend:

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

    r2e01b3f rf0241bda  
    227227}
    228228
     229unsigned sb_dsp_query_cap(sb_dsp_t *dsp, audio_cap_t cap)
     230{
     231        switch(cap) {
     232        case AUDIO_CAP_RECORD:
     233        case AUDIO_CAP_PLAYBACK:
     234        case AUDIO_CAP_INTERRUPT:
     235                return 1;
     236        case AUDIO_CAP_MAX_BUFFER:
     237                return MAX_BUFFER_SIZE;
     238        case AUDIO_CAP_INTERRUPT_MIN_FRAMES:
     239                return 1;
     240        case AUDIO_CAP_INTERRUPT_MAX_FRAMES:
     241                return 16535;
     242        case AUDIO_CAP_BUFFER_POS:
     243        default:
     244                return 0;
     245        }
     246}
     247
    229248int sb_dsp_test_format(sb_dsp_t *dsp, unsigned *channels, unsigned *rate,
    230249  pcm_sample_format_t *format)
  • uspace/drv/audio/sb16/dsp.h

    r2e01b3f rf0241bda  
    3939#include <errno.h>
    4040#include <pcm/sample_format.h>
     41#include <audio_pcm_iface.h>
    4142
    4243#include "registers.h"
     
    7273    int dma8, int dma16);
    7374void sb_dsp_interrupt(sb_dsp_t *dsp);
    74 
     75unsigned sb_dsp_query_cap(sb_dsp_t *dsp, audio_cap_t cap);
    7576int sb_dsp_test_format(sb_dsp_t *dsp, unsigned *channels, unsigned *rate,
    7677  pcm_sample_format_t *format);
  • uspace/drv/audio/sb16/pcm_iface.c

    r2e01b3f rf0241bda  
    4646        return EOK;
    4747}
     48
     49static unsigned sb_query_cap(ddf_fun_t *fun, audio_cap_t cap)
     50{
     51        assert(fun);
     52        assert(fun->driver_data);
     53        sb_dsp_t *dsp = fun->driver_data;
     54        return sb_dsp_query_cap(dsp, cap);
     55}
     56
    4857static int sb_test_format(ddf_fun_t *fun, unsigned *channels, unsigned *rate,
    4958    pcm_sample_format_t *format)
     
    116125        .get_info_str = sb_get_info_str,
    117126        .test_format = sb_test_format,
     127        .query_cap = sb_query_cap,
    118128
    119129        .get_buffer = sb_get_buffer,
Note: See TracChangeset for help on using the changeset viewer.