Changeset 6747b929 in mainline
- Timestamp:
- 2014-08-26T11:35:23Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c67195c
- Parents:
- 159c722d
- Location:
- uspace/drv/audio/hdaudio
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/hdaudio/pcm_iface.c
r159c722d r6747b929 228 228 static int hda_stop_playback(ddf_fun_t *fun, bool immediate) 229 229 { 230 hda_t *hda = fun_to_hda(fun); 231 230 232 ddf_msg(LVL_NOTE, "hda_stop_playback()"); 231 return ENOTSUP; 233 hda_stream_stop(hda->pcm_stream); 234 hda_stream_reset(hda->pcm_stream); 235 236 hda_pcm_event(hda, PCM_EVENT_PLAYBACK_TERMINATED); 237 return EOK; 232 238 } 233 239 -
uspace/drv/audio/hdaudio/spec/regs.h
r159c722d r6747b929 166 166 167 167 typedef enum { 168 /** Descriptor Error Interrupt Enable */ 169 sdctl1_deie = 4, 170 /** FIFO Error Interrupt Enable */ 171 sdctl1_feie = 3, 172 /** Interrupt on Completion Enable */ 173 sdctl1_ioce = 2, 174 /** Stream Run */ 175 sdctl1_run = 1, 176 /** Stream Reset */ 177 sdctl1_srst = 0 178 } hda_sdesc_ctl1_bits; 179 180 typedef enum { 168 181 /** Number of Output Streams Supported (H) */ 169 182 gcap_oss_h = 15, -
uspace/drv/audio/hdaudio/stream.c
r159c722d r6747b929 177 177 178 178 ctl = hda_reg8_read(&sdregs->ctl1); 179 ctl = ctl | 2 /* XXX Run */; 179 if (run) 180 ctl = ctl | BIT_V(uint8_t, sdctl1_run); 181 else 182 ctl = ctl & ~BIT_V(uint8_t, sdctl1_run); 183 180 184 hda_reg8_write(&sdregs->ctl1, ctl); 185 } 186 187 static void hda_stream_reset_noinit(hda_stream_t *stream) 188 { 189 uint32_t ctl; 190 hda_sdesc_regs_t *sdregs; 191 192 sdregs = &stream->hda->regs->sdesc[stream->sdid]; 193 194 ctl = hda_reg8_read(&sdregs->ctl1); 195 ctl = ctl | BIT_V(uint8_t, sdctl1_srst); 196 hda_reg8_write(&sdregs->ctl1, ctl); 197 198 async_usleep(100 * 1000); 199 200 // ctl = hda_reg8_read(&sdregs->ctl1); 201 // ctl = ctl & ~BIT_V(uint8_t, sdctl1_srst); 202 // hda_reg8_write(&sdregs->ctl1, ctl); 203 204 // async_usleep(100 * 1000); 181 205 } 182 206 … … 214 238 { 215 239 ddf_msg(LVL_NOTE, "hda_stream_destroy()"); 240 hda_stream_reset_noinit(stream); 216 241 free(stream); 217 242 } … … 223 248 } 224 249 250 void hda_stream_stop(hda_stream_t *stream) 251 { 252 ddf_msg(LVL_NOTE, "hda_stream_stop()"); 253 hda_stream_set_run(stream, false); 254 } 255 256 void hda_stream_reset(hda_stream_t *stream) 257 { 258 ddf_msg(LVL_NOTE, "hda_stream_reset()"); 259 hda_stream_reset_noinit(stream); 260 hda_stream_desc_configure(stream); 261 } 262 225 263 /** @} 226 264 */ -
uspace/drv/audio/hdaudio/stream.h
r159c722d r6747b929 73 73 74 74 extern hda_stream_t *hda_stream_create(hda_t *, hda_stream_dir_t, uint32_t); 75 extern void hda_stream_destroy(hda_stream_t *); 75 76 extern void hda_stream_start(hda_stream_t *); 76 extern void hda_stream_destroy(hda_stream_t *); 77 extern void hda_stream_stop(hda_stream_t *); 78 extern void hda_stream_reset(hda_stream_t *); 77 79 78 80 #endif
Note:
See TracChangeset
for help on using the changeset viewer.