Changeset 93c3163 in mainline
- Timestamp:
- 2014-08-25T22:11:12Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 99cb9bf
- Parents:
- 31ccd42a
- Location:
- uspace/drv/audio/hdaudio
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/hdaudio/Makefile
r31ccd42a r93c3163 29 29 USPACE_PREFIX = ../../.. 30 30 LIBS = $(LIBDRV_PREFIX)/libdrv.a 31 EXTRA_CFLAGS += -I$(LIBDRV_PREFIX)/include 31 EXTRA_CFLAGS += -I$(LIBDRV_PREFIX)/include -I$(LIBPCM_PREFIX)/include 32 32 BINARY = hdaudio 33 33 … … 37 37 hdactl.c \ 38 38 hdaudio.c \ 39 pcm_iface.c \ 39 40 stream.c 40 41 -
uspace/drv/audio/hdaudio/hdaudio.c
r31ccd42a r93c3163 46 46 #include "hdactl.h" 47 47 #include "hdaudio.h" 48 #include "pcm_iface.h" 48 49 #include "spec/regs.h" 49 50 … … 71 72 }; 72 73 74 ddf_dev_ops_t hda_pcm_ops = { 75 .interfaces[AUDIO_PCM_BUFFER_IFACE] = &hda_pcm_iface 76 }; 77 73 78 irq_pio_range_t hdaudio_irq_pio_ranges[] = { 74 79 { … … 144 149 static int hda_dev_add(ddf_dev_t *dev) 145 150 { 146 ddf_fun_t *fun_ a;151 ddf_fun_t *fun_pcm; 147 152 hda_t *hda = NULL; 148 153 hw_res_list_parsed_t res; … … 264 269 265 270 ddf_msg(LVL_NOTE, "create function"); 266 fun_ a = ddf_fun_create(dev, fun_exposed, "a");267 if (fun_ a== NULL) {268 ddf_msg(LVL_ERROR, "Failed creating function ' a'.");271 fun_pcm = ddf_fun_create(dev, fun_exposed, "pcm"); 272 if (fun_pcm == NULL) { 273 ddf_msg(LVL_ERROR, "Failed creating function 'pcm'."); 269 274 rc = ENOMEM; 270 275 goto error; 271 276 } 272 277 273 hda->fun_a = fun_a; 274 275 rc = ddf_fun_bind(fun_a); 278 hda->fun_pcm = fun_pcm; 279 280 ddf_fun_set_ops(fun_pcm, &hda_pcm_ops); 281 282 rc = ddf_fun_bind(fun_pcm); 276 283 if (rc != EOK) { 277 ddf_msg(LVL_ERROR, "Failed binding function ' a'.");278 ddf_fun_destroy(fun_ a);279 goto error; 280 } 281 282 ddf_fun_add_to_category(fun_ a, "virtual");284 ddf_msg(LVL_ERROR, "Failed binding function 'pcm'."); 285 ddf_fun_destroy(fun_pcm); 286 goto error; 287 } 288 289 ddf_fun_add_to_category(fun_pcm, "audio-pcm"); 283 290 return EOK; 284 291 error: … … 299 306 ddf_msg(LVL_DEBUG, "hda_dev_remove(%p)", dev); 300 307 301 if (hda->fun_ a!= NULL) {302 rc = ddf_fun_offline(hda->fun_ a);308 if (hda->fun_pcm != NULL) { 309 rc = ddf_fun_offline(hda->fun_pcm); 303 310 if (rc != EOK) 304 311 return rc; 305 312 306 rc = ddf_fun_unbind(hda->fun_ a);313 rc = ddf_fun_unbind(hda->fun_pcm); 307 314 if (rc != EOK) 308 315 return rc; … … 319 326 ddf_msg(LVL_DEBUG, "hda_dev_remove(%p)", dev); 320 327 321 if (hda->fun_ a!= NULL) {322 rc = ddf_fun_unbind(hda->fun_ a);328 if (hda->fun_pcm != NULL) { 329 rc = ddf_fun_unbind(hda->fun_pcm); 323 330 if (rc != EOK) 324 331 return rc; -
uspace/drv/audio/hdaudio/hdaudio.h
r31ccd42a r93c3163 45 45 typedef struct hda { 46 46 async_sess_t *parent_sess; 47 ddf_fun_t *fun_ a;47 ddf_fun_t *fun_pcm; 48 48 uint64_t rwbase; 49 49 size_t rwsize;
Note:
See TracChangeset
for help on using the changeset viewer.