Changeset e941bf8 in mainline
- Timestamp:
- 2012-07-05T21:01:11Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4bbfb93
- Parents:
- 124f9bd
- Location:
- uspace/drv/audio/sb16
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/dma.h
r124f9bd re941bf8 59 59 return (result | ((uintptr_t)addr & 0xfff)); 60 60 } 61 /*----------------------------------------------------------------------------*/ 61 62 62 /** DMA mallocator simulator 63 63 * … … 72 72 return address; 73 73 } 74 /*----------------------------------------------------------------------------*/ 74 75 75 /** DMA mallocator simulator 76 76 * -
uspace/drv/audio/sb16/dsp.c
r124f9bd re941bf8 73 73 return EOK; 74 74 } 75 /*----------------------------------------------------------------------------*/ 75 76 76 static inline int sb_dsp_write(sb_dsp_t *dsp, uint8_t data) 77 77 { … … 89 89 return EOK; 90 90 } 91 /*----------------------------------------------------------------------------*/ 91 92 92 static inline void sb_dsp_reset(sb_dsp_t *dsp) 93 93 { … … 98 98 pio_write_8(&dsp->regs->dsp_reset, 0); 99 99 } 100 /*----------------------------------------------------------------------------*/ 100 101 101 static inline int sb_setup_dma(sb_dsp_t *dsp, uintptr_t pa, size_t size) 102 102 { … … 112 112 return ret; 113 113 } 114 /*----------------------------------------------------------------------------*/ 114 115 115 static inline int sb_setup_buffer(sb_dsp_t *dsp, size_t size) 116 116 { … … 139 139 return ret; 140 140 } 141 /*----------------------------------------------------------------------------*/ 141 142 142 static inline void sb_clear_buffer(sb_dsp_t *dsp) 143 143 { … … 146 146 dsp->buffer.size = 0; 147 147 } 148 /*----------------------------------------------------------------------------*/ 148 149 149 static inline size_t sample_count(unsigned sample_size, size_t byte_count) 150 150 { … … 154 154 return byte_count; 155 155 } 156 /*----------------------------------------------------------------------------*/ 156 157 157 int sb_dsp_init(sb_dsp_t *dsp, sb16_regs_t *regs, ddf_dev_t *dev, 158 158 int dma8, int dma16) … … 186 186 return ret; 187 187 } 188 /*----------------------------------------------------------------------------*/ 188 189 189 void sb_dsp_interrupt(sb_dsp_t *dsp) 190 190 { … … 203 203 #endif 204 204 } 205 /*----------------------------------------------------------------------------*/ 205 206 206 int sb_dsp_get_buffer(sb_dsp_t *dsp, void **buffer, size_t *size, unsigned *id) 207 207 { … … 241 241 return EOK; 242 242 } 243 /*----------------------------------------------------------------------------*/ 243 244 244 int sb_dsp_release_buffer(sb_dsp_t *dsp, unsigned id) 245 245 { … … 257 257 return EOK; 258 258 } 259 /*----------------------------------------------------------------------------*/ 259 260 260 int sb_dsp_start_playback(sb_dsp_t *dsp, unsigned id, unsigned parts, 261 261 unsigned sampling_rate, unsigned sample_size, unsigned channels, bool sign) … … 312 312 return EOK; 313 313 } 314 /*----------------------------------------------------------------------------*/ 314 315 315 int sb_dsp_stop_playback(sb_dsp_t *dsp, unsigned id) 316 316 { … … 322 322 return EOK; 323 323 } 324 /*----------------------------------------------------------------------------*/ 324 325 325 int sb_dsp_start_record(sb_dsp_t *dsp, unsigned id, unsigned sample_rate, 326 326 unsigned sample_size, unsigned channels, bool sign) … … 328 328 return ENOTSUP; 329 329 } 330 /*----------------------------------------------------------------------------*/ 330 331 331 int sb_dsp_stop_record(sb_dsp_t *dsp, unsigned id) 332 332 { -
uspace/drv/audio/sb16/dsp_commands.h
r124f9bd re941bf8 162 162 DMA_16B_EXIT = 0xd9, /* Ends DMA transfer and terminates I/O process */ 163 163 } dsp_command_t; 164 /*----------------------------------------------------------------------------*/ 164 165 165 #define DSP_MODE_SIGNED 0x10 166 166 #define DSP_MODE_STEREO 0x20 -
uspace/drv/audio/sb16/main.c
r124f9bd re941bf8 78 78 return ddf_driver_main(&sb_driver); 79 79 } 80 /*----------------------------------------------------------------------------*/ 80 81 81 static void irq_handler(ddf_dev_t *dev, ipc_callid_t iid, ipc_call_t *call) 82 82 { … … 85 85 sb16_interrupt(dev->driver_data); 86 86 } 87 /*----------------------------------------------------------------------------*/ 87 88 88 /** Initializes a new ddf driver instance of SB16. 89 89 * … … 165 165 return EOK; 166 166 } 167 /*----------------------------------------------------------------------------*/ 167 168 168 static int sb_get_res(const ddf_dev_t *device, uintptr_t *sb_regs, 169 169 size_t *sb_regs_size, uintptr_t *mpu_regs, size_t *mpu_regs_size, … … 242 242 return EOK; 243 243 } 244 /*----------------------------------------------------------------------------*/ 244 245 245 int sb_enable_interrupts(ddf_dev_t *device) 246 246 { -
uspace/drv/audio/sb16/mixer.c
r124f9bd re941bf8 140 140 sizeof(volume_ct1745) / sizeof(volume_item_t), volume_ct1745 }, 141 141 }; 142 /*----------------------------------------------------------------------------*/ 142 143 143 const char * sb_mixer_type_str(sb_mixer_type_t type) 144 144 { … … 151 151 return names[type]; 152 152 } 153 /*----------------------------------------------------------------------------*/ 153 154 154 int sb_mixer_init(sb_mixer_t *mixer, sb16_regs_t *regs, sb_mixer_type_t type) 155 155 { … … 171 171 return EOK; 172 172 } 173 /*----------------------------------------------------------------------------*/ 173 174 174 int sb_mixer_get_control_item_count(const sb_mixer_t *mixer) 175 175 { … … 177 177 return volume_table[mixer->type].count; 178 178 } 179 /*----------------------------------------------------------------------------*/ 179 180 180 int sb_mixer_get_control_item_info(const sb_mixer_t *mixer, unsigned index, 181 181 const char** name, unsigned *channels) … … 192 192 return EOK; 193 193 } 194 /*----------------------------------------------------------------------------*/ 194 195 195 int sb_mixer_get_channel_info(const sb_mixer_t *mixer, unsigned index, 196 196 unsigned channel, const char **name, unsigned *levels) … … 211 211 return EOK; 212 212 } 213 /*----------------------------------------------------------------------------*/ 213 214 214 int sb_mixer_set_volume_level(const sb_mixer_t *mixer, 215 215 unsigned index, unsigned channel, unsigned level) … … 243 243 return EOK; 244 244 } 245 /*----------------------------------------------------------------------------*/ 245 246 246 unsigned sb_mixer_get_volume_level(const sb_mixer_t *mixer, unsigned index, 247 247 unsigned channel) -
uspace/drv/audio/sb16/pcm_iface.c
r124f9bd re941bf8 45 45 return EOK; 46 46 } 47 /*----------------------------------------------------------------------------*/ 47 48 48 static int sb_get_buffer(ddf_fun_t *fun, 49 49 void **buffer, size_t *size, unsigned *id) … … 61 61 return sb_dsp_set_event_session(dsp, id, sess); 62 62 } 63 /*----------------------------------------------------------------------------*/ 63 64 64 static int sb_release_buffer(ddf_fun_t *fun, unsigned id) 65 65 { … … 69 69 return sb_dsp_release_buffer(dsp, id); 70 70 } 71 /*----------------------------------------------------------------------------*/ 71 72 72 static int sb_start_playback(ddf_fun_t *fun, unsigned id, unsigned parts, 73 73 unsigned sample_rate, unsigned sample_size, unsigned channels, bool sign) … … 79 79 dsp, id, parts, sample_rate, sample_size, channels, sign); 80 80 } 81 /*----------------------------------------------------------------------------*/ 81 82 82 static int sb_stop_playback(ddf_fun_t *fun, unsigned id) 83 83 { … … 87 87 return sb_dsp_stop_playback(dsp, id); 88 88 } 89 /*----------------------------------------------------------------------------*/ 89 90 90 static int sb_start_record(ddf_fun_t *fun, unsigned id, 91 91 unsigned sample_rate, unsigned sample_size, unsigned channels, bool sign) … … 97 97 dsp, id, sample_rate, sample_size, channels, sign); 98 98 } 99 /*----------------------------------------------------------------------------*/ 99 100 100 static int sb_stop_record(ddf_fun_t *fun, unsigned id) 101 101 { … … 105 105 return sb_dsp_stop_record(dsp, id); 106 106 } 107 /*----------------------------------------------------------------------------*/108 107 109 108 audio_pcm_buffer_iface_t sb_pcm_iface = { -
uspace/drv/audio/sb16/sb16.c
r124f9bd re941bf8 68 68 } 69 69 } 70 /*----------------------------------------------------------------------------*/ 70 71 71 size_t sb16_irq_code_size(void) 72 72 { 73 73 return sizeof(irq_cmds) / sizeof(irq_cmds[0]); 74 74 } 75 /*----------------------------------------------------------------------------*/ 75 76 76 void sb16_irq_code(void *regs, int dma8, int dma16, irq_cmd_t cmds[], irq_pio_range_t ranges[]) 77 77 { … … 90 90 } 91 91 } 92 /*----------------------------------------------------------------------------*/ 92 93 93 int sb16_init_sb16(sb16_t *sb, void *regs, size_t size, 94 94 ddf_dev_t *dev, int dma8, int dma16) … … 171 171 return EOK; 172 172 } 173 /*----------------------------------------------------------------------------*/ 173 174 174 int sb16_init_mpu(sb16_t *sb, void *regs, size_t size) 175 175 { … … 177 177 return ENOTSUP; 178 178 } 179 /*----------------------------------------------------------------------------*/ 179 180 180 void sb16_interrupt(sb16_t *sb) 181 181 {
Note:
See TracChangeset
for help on using the changeset viewer.