Changeset 159c722d in mainline for uspace/drv/audio/hdaudio/pcm_iface.c
- Timestamp:
- 2014-08-26T10:10:50Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6747b929
- Parents:
- 99cb9bf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/hdaudio/pcm_iface.c
r99cb9bf r159c722d 43 43 #include "hdactl.h" 44 44 #include "hdaudio.h" 45 #include "pcm_iface.h" 45 46 #include "spec/fmt.h" 46 47 #include "stream.h" … … 155 156 uint32_t fmt; 156 157 /* 48 kHz, 16-bits, 1 channel */ 157 fmt = fmt_bits_16 << fmt_bits_l;158 fmt = (fmt_base_44khz << fmt_base) | (fmt_bits_16 << fmt_bits_l); 158 159 159 160 ddf_msg(LVL_NOTE, "hda_get_buffer() - create stream"); … … 165 166 /* XXX This is only one buffer */ 166 167 *buffer = hda->pcm_stream->buf[0]; 167 *size = hda->pcm_stream->bufsize ;168 *size = hda->pcm_stream->bufsize * hda->pcm_stream->nbuffers; 168 169 169 170 ddf_msg(LVL_NOTE, "hda_get_buffer() retturing EOK, buffer=%p, size=%zu", … … 180 181 static int hda_set_event_session(ddf_fun_t *fun, async_sess_t *sess) 181 182 { 183 hda_t *hda = fun_to_hda(fun); 184 182 185 ddf_msg(LVL_NOTE, "hda_set_event_session()"); 183 return ENOTSUP; 186 hda->ev_sess = sess; 187 return EOK; 184 188 } 185 189 186 190 static async_sess_t *hda_get_event_session(ddf_fun_t *fun) 187 191 { 192 hda_t *hda = fun_to_hda(fun); 193 188 194 ddf_msg(LVL_NOTE, "hda_get_event_session()"); 189 return NULL;195 return hda->ev_sess; 190 196 } 191 197 … … 215 221 return rc; 216 222 223 async_usleep(1000*1000); 217 224 hda_stream_start(hda->pcm_stream); 218 225 return EOK; … … 238 245 } 239 246 247 void hda_pcm_event(hda_t *hda, pcm_event_t event) 248 { 249 async_exch_t *exchange; 250 251 if (hda->ev_sess == NULL) { 252 ddf_log_warning("No one listening for event %u", event); 253 return; 254 } 255 256 exchange = async_exchange_begin(hda->ev_sess); 257 async_msg_1(exchange, event, 0); 258 async_exchange_end(exchange); 259 } 260 240 261 /** @} 241 262 */
Note:
See TracChangeset
for help on using the changeset viewer.