Changeset 01282fc in mainline


Ignore:
Timestamp:
2011-09-25T12:10:59Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7a0a0f5
Parents:
cf083e8
Message:

sb16: Add mixer stubs. Add mixer initialization.

Location:
uspace/drv/audio/sb16
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/sb16/Makefile

    rcf083e8 r01282fc  
    3939SOURCES = \
    4040        main.c \
     41        mixer.c \
    4142        sb16.c
    4243
  • uspace/drv/audio/sb16/registers.h

    rcf083e8 r01282fc  
    3535#ifndef DRV_AUDIO_SB16_REGISTERS_H
    3636#define DRV_AUDIO_SB16_REGISTERS_H
     37
     38#include <ddi.h>
    3739
    3840typedef struct sb16_regs {
  • uspace/drv/audio/sb16/sb16.c

    rcf083e8 r01282fc  
    2828
    2929#include <errno.h>
     30#include <str_error.h>
    3031#include <libarch/ddi.h>
    3132
     
    4142    { .cmdcount = 1, .cmds = (irq_cmd_t*)irq_cmds };
    4243
     44static mixer_type_t mixer_type_by_dsp_version(unsigned major, unsigned minor)
     45{
     46        return SB_MIXER_UNKNOWN;
     47}
    4348/*----------------------------------------------------------------------------*/
    4449irq_code_t * sb16_irq_code(void)
     
    7984            drv->dsp_version.major, drv->dsp_version.minor);
    8085
     86        /* Initialize mixer */
     87        drv->mixer = mixer_type_by_dsp_version(
     88            drv->dsp_version.major, drv->dsp_version.minor);
    8189
    82         // TODO Initialize mixer
     90        ret = mixer_init(drv->regs, drv->mixer);
     91        if (ret != EOK) {
     92                ddf_log_error("Failed to initialize SB mixer: %s.\n",
     93                    str_error(ret));
     94                return ret;
     95        }
     96        ddf_log_note("Initialized mixer: %s.\n", mixer_type_to_str(drv->mixer));
     97
    8398        return EOK;
    8499}
  • uspace/drv/audio/sb16/sb16.h

    rcf083e8 r01282fc  
    3838#include <ddf/driver.h>
    3939#include <ddi.h>
     40
     41#include "mixer.h"
    4042#include "registers.h"
    4143
     
    4749                uint8_t minor;
    4850        } dsp_version;
     51        mixer_type_t mixer;
    4952} sb16_drv_t;
    5053
Note: See TracChangeset for help on using the changeset viewer.