Changeset 25c98a8e in mainline
- Timestamp:
- 2011-11-25T22:11:00Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b67968c
- Parents:
- 53a7fda
- Location:
- uspace/drv/audio/sb16
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/Makefile
r53a7fda r25c98a8e 42 42 main.c \ 43 43 mixer.c \ 44 mixer_iface.c \ 44 45 sb16.c 45 46 -
uspace/drv/audio/sb16/main.c
r53a7fda r25c98a8e 120 120 121 121 122 ddf_fun_t *dsp_fun = NULL , *mixer_fun = NULL;122 ddf_fun_t *dsp_fun = NULL; 123 123 #define CHECK_RET_UNREG_DEST_RETURN(ret, msg...) \ 124 124 if (ret != EOK) { \ … … 126 126 if (dsp_fun) \ 127 127 ddf_fun_destroy(dsp_fun); \ 128 if (mixer_fun) \129 ddf_fun_destroy(mixer_fun); \130 128 unregister_interrupt_handler(device, irq); \ 131 129 return ret; \ … … 139 137 ret = dsp_fun ? EOK : ENOMEM; 140 138 CHECK_RET_UNREG_DEST_RETURN(ret, "Failed to create dsp function."); 141 142 143 mixer_fun = ddf_fun_create(device, fun_exposed, "mixer");144 ret = dsp_fun ? EOK : ENOMEM;145 CHECK_RET_UNREG_DEST_RETURN(ret, "Failed to create mixer function.");146 139 147 140 ret = sb16_init_sb16( … … 154 147 "Failed to bind dsp function: %s.\n", str_error(ret)); 155 148 156 ret = ddf_fun_bind(mixer_fun);157 CHECK_RET_UNREG_DEST_RETURN(ret,158 "Failed to bind mixer function: %s.\n", str_error(ret));159 160 149 /* Everything's OK assign driver_data. */ 161 mixer_fun->driver_data = soft_state;162 150 dsp_fun->driver_data = soft_state; 163 151 -
uspace/drv/audio/sb16/sb16.c
r53a7fda r25c98a8e 29 29 #include <errno.h> 30 30 #include <str_error.h> 31 #include <audio_mixer_iface.h> 31 32 32 33 #include "beep.h" … … 35 36 #include "dsp.h" 36 37 #include "sb16.h" 38 39 extern audio_mixer_iface_t sb_mixer_iface; 40 41 static ddf_dev_ops_t sb_mixer_ops = { 42 .interfaces[AUDIO_MIXER_IFACE] = &sb_mixer_iface, 43 }; 37 44 38 45 /* ISA interrupts should be edge-triggered so there should be no need for … … 85 92 sb->dsp.version.major, sb->dsp.version.minor); 86 93 94 ddf_fun_t *mixer_fun = ddf_fun_create(dev, fun_exposed, "mixer"); 95 if (!mixer_fun) { 96 ddf_log_error("Failed to create mixer function.\n"); 97 return ENOMEM; 98 } 87 99 ret = sb_mixer_init(&sb->mixer, sb->regs, mixer_type); 88 100 if (ret != EOK) { … … 91 103 return ret; 92 104 } 105 93 106 ddf_log_note("Initialized mixer: %s.\n", 94 107 sb_mixer_type_str(sb->mixer.type)); 108 mixer_fun->driver_data = &sb->mixer; 109 mixer_fun->ops = &sb_mixer_ops; 110 111 ret = ddf_fun_bind(mixer_fun); 112 if (ret != EOK) { 113 ddf_log_error( 114 "Failed to bind mixer function: %s.\n", str_error(ret)); 115 mixer_fun->driver_data = NULL; 116 ddf_fun_destroy(mixer_fun); 117 return ret; 118 } 95 119 96 120 ddf_log_note("Playing startup sound.\n");
Note:
See TracChangeset
for help on using the changeset viewer.