Changes in uspace/drv/audio/sb16/mixer_iface.c [9bd4615:1912b45] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/mixer_iface.c
r9bd4615 r1912b45 33 33 */ 34 34 35 #include <ddf/driver.h>36 35 #include <errno.h> 37 36 #include <audio_mixer_iface.h> 38 37 39 38 #include "mixer.h" 40 #include "sb16.h"41 42 static sb_mixer_t *fun_to_mixer(ddf_fun_t *fun)43 {44 sb16_t *sb = (sb16_t *)ddf_dev_data_get(ddf_fun_get_dev(fun));45 return &sb->mixer;46 }47 39 48 40 static int sb_get_info(ddf_fun_t *fun, const char** name, unsigned *items) 49 41 { 50 sb_mixer_t *mixer = fun_to_mixer(fun); 51 42 assert(fun); 43 const sb_mixer_t *mixer = ddf_fun_data_get(fun); 44 assert(mixer); 52 45 if (name) 53 46 *name = sb_mixer_type_str(mixer->type); … … 61 54 unsigned *max_level) 62 55 { 63 sb_mixer_t *mixer = fun_to_mixer(fun); 64 return sb_mixer_get_control_item_info(mixer, item, name, max_level); 56 assert(fun); 57 const sb_mixer_t *mixer = ddf_fun_data_get(fun); 58 assert(mixer); 59 return 60 sb_mixer_get_control_item_info(mixer, item, name, max_level); 65 61 } 66 62 67 63 static int sb_set_item_level(ddf_fun_t *fun, unsigned item, unsigned value) 68 64 { 69 sb_mixer_t *mixer = fun_to_mixer(fun); 65 assert(fun); 66 const sb_mixer_t *mixer = ddf_fun_data_get(fun); 67 assert(mixer); 70 68 return sb_mixer_set_control_item_value(mixer, item, value); 71 69 } … … 73 71 static int sb_get_item_level(ddf_fun_t *fun, unsigned item, unsigned *value) 74 72 { 75 sb_mixer_t *mixer = fun_to_mixer(fun); 73 assert(fun); 74 const sb_mixer_t *mixer = ddf_fun_data_get(fun); 75 assert(mixer); 76 76 return sb_mixer_get_control_item_value(mixer, item, value); 77 77 }
Note:
See TracChangeset
for help on using the changeset viewer.