Changeset c7325dd6 in mainline


Ignore:
Timestamp:
2011-09-26T09:57:01Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
050d4fa
Parents:
b3f36d2
Message:

sb16: set Master channel to max on init.

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

Legend:

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

    rb3f36d2 rc7325dd6  
    114114void mixer_load_volume_levels(sb16_regs_t *regs, mixer_type_t type)
    115115{
    116         /* Default values are ok for now */
     116        /* Set Master to maximum */
     117        if (!mixer_get_control_item_count(type))
     118                return;
     119        unsigned levels = 0, channels = 0, current_level;
     120        const char *name = NULL;
     121        mixer_get_control_item_info(type, 0, &name, &channels, &levels);
     122        unsigned channel = 0;
     123        for (;channel < channels; ++channel) {
     124                current_level =
     125                    mixer_get_volume_level(regs, type, 0, channel);
     126                ddf_log_note("Setting %s channel %d to %d (%d).\n",
     127                    name, channel, levels - 1, current_level);
     128
     129                mixer_set_volume_level(regs, type, 0, channel, levels - 1);
     130
     131                current_level =
     132                    mixer_get_volume_level(regs, type, 0, channel);
     133                ddf_log_note("%s channel %d set to %d.\n",
     134                    name, channel, current_level);
     135        }
     136
    117137}
    118138/*----------------------------------------------------------------------------*/
    119139void mixer_store_volume_levels(sb16_regs_t *regs, mixer_type_t type)
    120140{
    121         /* Default values are ok for now */
     141        /* No place to store the values. */
    122142}
    123143/*----------------------------------------------------------------------------*/
  • uspace/drv/audio/sb16/sb16.c

    rb3f36d2 rc7325dd6  
    100100                return ret;
    101101        }
     102        mixer_load_volume_levels(drv->regs, drv->mixer);
    102103        ddf_log_note("Initialized mixer: %s.\n", mixer_type_to_str(drv->mixer));
    103104
Note: See TracChangeset for help on using the changeset viewer.