Changeset 485a496 in mainline
- Timestamp:
- 2011-11-25T23:25:13Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 80b9ab3
- Parents:
- deff6b4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/mixer.c
rdeff6b4 r485a496 138 138 sizeof(volume_ct1745) / sizeof(volume_item_t), volume_ct1745 }, 139 139 }; 140 141 static void sb_mixer_max_master_levels(sb_mixer_t *mixer)142 {143 assert(mixer);144 /* Set Master to maximum */145 if (!sb_mixer_get_control_item_count(mixer))146 return;147 const unsigned item = 0; /* 0 is Master. */148 unsigned channels = 0;149 const char *name = NULL;150 151 sb_mixer_get_control_item_info(mixer, item, &name, &channels);152 for (unsigned channel = 0; channel < channels; ++channel) {153 unsigned levels = 0;154 const int ret = sb_mixer_get_channel_info(mixer, item, channel,155 NULL, &levels);156 if (ret != EOK)157 continue;158 159 unsigned level =160 sb_mixer_get_volume_level(mixer, item, channel);161 ddf_log_note("Setting %s channel %d to %d (%d).\n",162 name, channel, levels - 1, level);163 164 sb_mixer_set_volume_level(mixer, item, channel, levels - 1);165 166 level = sb_mixer_get_volume_level(mixer, item, channel);167 ddf_log_note("%s channel %d set to %d.\n",168 name, channel, level);169 }170 }171 140 /*----------------------------------------------------------------------------*/ 172 141 const char * sb_mixer_type_str(sb_mixer_type_t type) … … 192 161 pio_write_8(®s->mixer_address, MIXER_RESET_ADDRESS); 193 162 pio_write_8(®s->mixer_data, 1); 194 sb_mixer_max_master_levels(mixer);195 163 } 196 164 pio_write_8(®s->mixer_address, MIXER_PNP_IRQ_ADDRESS); … … 268 236 value |= level << chan->shift; 269 237 pio_write_8(&mixer->regs->mixer_data, value); 238 ddf_log_note("Channel %s %s volume set to: %u.\n", 239 volume_table[mixer->type].table[index].description, 240 chan->name, level); 270 241 return EOK; 271 242 }
Note:
See TracChangeset
for help on using the changeset viewer.