1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2005 by Linus Nielsen Feltzing
11 * Copyright (C) 2007 by Christian Gmeiner
13 * All files in this archive are subject to the GNU General Public License.
14 * See the file COPYING in the source tree root for full license agreement.
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
19 ****************************************************************************/
28 #if CONFIG_CPU == PNX0101
33 #if CONFIG_CODEC == SWCODEC
38 #if CONFIG_CODEC == MAS3507D /* volume/balance/treble/bass interdependency */
39 #define VOLUME_MIN -780
40 #define VOLUME_MAX 180
41 #elif !defined(VOLUME_MIN) && !defined(VOLUME_MAX)
42 #define VOLUME_MIN -400
43 #define VOLUME_MAX 600
46 /* volume/balance/treble/bass interdependency main part */
47 #define VOLUME_RANGE (VOLUME_MAX - VOLUME_MIN)
50 extern bool audio_is_initialized
;
52 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
53 extern unsigned long shadow_io_control_main
;
54 extern unsigned shadow_codec_reg0
;
56 #endif /* SIMULATOR */
60 const struct sound_settings_info audiohw_settings
[] = {
61 [SOUND_VOLUME
] = {"dB", 0, 1, VOLUME_MIN
/ 10, VOLUME_MAX
/ 10, -25},
62 [SOUND_BASS
] = {"dB", 0, 1, -24, 24, 0},
63 [SOUND_TREBLE
] = {"dB", 0, 1, -24, 24, 0},
64 [SOUND_BALANCE
] = {"%", 0, 1,-100, 100, 0},
65 [SOUND_CHANNELS
] = {"", 0, 1, 0, 5, 0},
66 [SOUND_STEREO_WIDTH
] = {"%", 0, 5, 0, 250, 100},
67 #if CONFIG_CODEC == MAS3587F || defined(HAVE_UDA1380) || defined(HAVE_TLV320)\
68 || defined(HAVE_WM8975) || defined(HAVE_WM8758) || defined(HAVE_WM8731)
69 [SOUND_LEFT_GAIN
] = {"dB", 1, 1,-128, 96, 0},
70 [SOUND_RIGHT_GAIN
] = {"dB", 1, 1,-128, 96, 0},
71 [SOUND_MIC_GAIN
] = {"dB", 1, 1,-128, 108, 16},
73 #if defined(HAVE_WM8758)
74 [SOUND_BASS_CUTOFF
] = {"", 0, 1, 1, 4, 1},
75 [SOUND_TREBLE_CUTOFF
] = {"", 0, 1, 1, 4, 1},
77 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
78 [SOUND_LOUDNESS
] = {"dB", 0, 1, 0, 17, 0},
79 [SOUND_AVC
] = {"", 0, 1, -1, 4, 0},
80 [SOUND_MDB_STRENGTH
] = {"dB", 0, 1, 0, 127, 48},
81 [SOUND_MDB_HARMONICS
] = {"%", 0, 1, 0, 100, 50},
82 [SOUND_MDB_CENTER
] = {"Hz", 0, 10, 20, 300, 60},
83 [SOUND_MDB_SHAPE
] = {"Hz", 0, 10, 50, 300, 90},
84 [SOUND_MDB_ENABLE
] = {"", 0, 1, 0, 1, 0},
85 [SOUND_SUPERBASS
] = {"", 0, 1, 0, 1, 0},
90 const char *sound_unit(int setting
)
92 return audiohw_settings
[setting
].unit
;
95 int sound_numdecimals(int setting
)
97 return audiohw_settings
[setting
].numdecimals
;
100 int sound_steps(int setting
)
102 return audiohw_settings
[setting
].steps
;
105 int sound_min(int setting
)
107 return audiohw_settings
[setting
].minval
;
110 int sound_max(int setting
)
112 return audiohw_settings
[setting
].maxval
;
115 int sound_default(int setting
)
117 return audiohw_settings
[setting
].defaultval
;
120 sound_set_type
* sound_get_fn(int setting
)
122 sound_set_type
* result
= NULL
;
126 result
= sound_set_volume
;
130 result
= sound_set_bass
;
134 result
= sound_set_treble
;
138 result
= sound_set_balance
;
142 result
= sound_set_channels
;
145 case SOUND_STEREO_WIDTH
:
146 result
= sound_set_stereo_width
;
150 case SOUND_BASS_CUTOFF
:
151 result
= sound_set_bass_cutoff
;
154 case SOUND_TREBLE_CUTOFF
:
155 result
= sound_set_treble_cutoff
;
159 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
161 result
= sound_set_loudness
;
165 result
= sound_set_avc
;
168 case SOUND_MDB_STRENGTH
:
169 result
= sound_set_mdb_strength
;
172 case SOUND_MDB_HARMONICS
:
173 result
= sound_set_mdb_harmonics
;
176 case SOUND_MDB_CENTER
:
177 result
= sound_set_mdb_center
;
180 case SOUND_MDB_SHAPE
:
181 result
= sound_set_mdb_shape
;
184 case SOUND_MDB_ENABLE
:
185 result
= sound_set_mdb_enable
;
188 case SOUND_SUPERBASS
:
189 result
= sound_set_superbass
;
197 #if CONFIG_CODEC == SWCODEC
198 /* Copied from dsp.h, nasty nasty, but we don't want to include dsp.h */
200 DSP_CALLBACK_SET_PRESCALE
= 0,
201 DSP_CALLBACK_SET_BASS
,
202 DSP_CALLBACK_SET_TREBLE
,
203 DSP_CALLBACK_SET_CHANNEL_CONFIG
,
204 DSP_CALLBACK_SET_STEREO_WIDTH
207 static int (*dsp_callback
)(int, intptr_t) = NULL
;
209 void sound_set_dsp_callback(int (*func
)(int, intptr_t))
216 #if CONFIG_CODEC == MAS3507D
217 /* convert tenth of dB volume (-780..+180) to dac3550 register value */
218 static int tenthdb2reg(int db
)
220 if (db
< -540) /* 3 dB steps */
221 return (db
+ 780) / 30;
222 else /* 1.5 dB steps */
223 return (db
+ 660) / 15;
227 #if (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 \
228 || defined HAVE_WM8975 || defined HAVE_WM8758 || defined(HAVE_WM8731) \
229 || defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) \
230 || defined(HAVE_AS3514) || defined(HAVE_WM8985)
232 /* all values in tenth of dB MAS3507D UDA1380 */
233 int current_volume
= 0; /* -780..+180 -840.. 0 */
234 int current_balance
= 0; /* -960..+960 -840..+840 */
235 int current_treble
= 0; /* -150..+150 0.. +60 */
236 int current_bass
= 0; /* -150..+150 0..+240 */
238 static void set_prescaled_volume(void)
243 /* The WM codecs listed don't have suitable prescaler functionality, so we let
244 * the prescaler stay at 0 for these unless SW tone controls are in use */
245 #if defined(HAVE_SW_TONE_CONTROLS) || !(defined(HAVE_WM8975) \
246 || defined(HAVE_WM8731) || defined(HAVE_WM8721) || defined(HAVE_WM8751) \
247 || defined(HAVE_WM8758) || defined(HAVE_WM8985))
249 prescale
= MAX(current_bass
, current_treble
);
251 prescale
= 0; /* no need to prescale if we don't boost
254 /* Gain up the analog volume to compensate the prescale gain reduction,
255 * but if this would push the volume over the top, reduce prescaling
256 * instead (might cause clipping). */
257 if (current_volume
+ prescale
> VOLUME_MAX
)
258 prescale
= VOLUME_MAX
- current_volume
;
261 #if defined(HAVE_SW_TONE_CONTROLS)
262 dsp_callback(DSP_CALLBACK_SET_PRESCALE
, prescale
);
263 #elif CONFIG_CODEC == MAS3507D
264 mas_writereg(MAS_REG_KPRESCALE
, prescale_table
[prescale
/10]);
265 #elif defined(HAVE_UDA1380)
266 audiohw_set_mixer_vol(tenthdb2mixer(-prescale
), tenthdb2mixer(-prescale
));
269 if (current_volume
== VOLUME_MIN
)
270 prescale
= 0; /* Make sure the chip gets muted at VOLUME_MIN */
272 l
= r
= current_volume
+ prescale
;
274 if (current_balance
> 0)
276 l
-= current_balance
;
280 if (current_balance
< 0)
282 r
+= current_balance
;
287 #if CONFIG_CODEC == MAS3507D
288 dac_volume(tenthdb2reg(l
), tenthdb2reg(r
), false);
289 #elif defined(HAVE_UDA1380) || defined(HAVE_WM8975) || defined(HAVE_WM8758) \
290 || defined(HAVE_WM8731) || defined(HAVE_WM8721) || defined(HAVE_WM8751) \
291 || defined(HAVE_AS3514)
292 audiohw_set_master_vol(tenthdb2master(l
), tenthdb2master(r
));
293 #if defined(HAVE_WM8975) || defined(HAVE_WM8758) \
294 || (defined(HAVE_WM8751) && !defined(MROBE_100))
295 audiohw_set_lineout_vol(tenthdb2master(0), tenthdb2master(0));
298 #elif defined(HAVE_TLV320)
299 audiohw_set_headphone_vol(tenthdb2master(l
), tenthdb2master(r
));
302 #endif /* (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 */
303 #endif /* !SIMULATOR */
305 #if CONFIG_CODEC != SWCODEC
306 int channel_configuration
= SOUND_CHAN_STEREO
;
307 int stereo_width
= 100;
312 #if CONFIG_CODEC != SWCODEC
313 static void set_channel_config(void)
315 /* default values: stereo */
316 unsigned long val_ll
= 0x80000;
317 unsigned long val_lr
= 0;
318 unsigned long val_rl
= 0;
319 unsigned long val_rr
= 0x80000;
321 switch(channel_configuration
)
323 /* case SOUND_CHAN_STEREO unnecessary */
325 case SOUND_CHAN_MONO
:
332 case SOUND_CHAN_CUSTOM
:
334 /* fixed point variables (matching MAS internal format)
335 integer part: upper 13 bits (inlcuding sign)
336 fractional part: lower 19 bits */
337 long fp_width
, fp_straight
, fp_cross
;
339 fp_width
= (stereo_width
<< 19) / 100;
340 if (stereo_width
<= 100)
342 fp_straight
= - ((1<<19) + fp_width
) / 2;
343 fp_cross
= fp_straight
+ fp_width
;
347 /* straight = - (1 + width) / (2 * width) */
348 fp_straight
= - ((((1<<19) + fp_width
) / (fp_width
>> 9)) << 9);
349 fp_cross
= (1<<19) + fp_straight
;
351 val_ll
= val_rr
= fp_straight
& 0xfffff;
352 val_lr
= val_rl
= fp_cross
& 0xfffff;
356 case SOUND_CHAN_MONO_LEFT
:
363 case SOUND_CHAN_MONO_RIGHT
:
370 case SOUND_CHAN_KARAOKE
:
378 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
379 mas_writemem(MAS_BANK_D0
, MAS_D0_OUT_LL
, &val_ll
, 1); /* LL */
380 mas_writemem(MAS_BANK_D0
, MAS_D0_OUT_LR
, &val_lr
, 1); /* LR */
381 mas_writemem(MAS_BANK_D0
, MAS_D0_OUT_RL
, &val_rl
, 1); /* RL */
382 mas_writemem(MAS_BANK_D0
, MAS_D0_OUT_RR
, &val_rr
, 1); /* RR */
383 #elif CONFIG_CODEC == MAS3507D
384 mas_writemem(MAS_BANK_D1
, 0x7f8, &val_ll
, 1); /* LL */
385 mas_writemem(MAS_BANK_D1
, 0x7f9, &val_lr
, 1); /* LR */
386 mas_writemem(MAS_BANK_D1
, 0x7fa, &val_rl
, 1); /* RL */
387 mas_writemem(MAS_BANK_D1
, 0x7fb, &val_rr
, 1); /* RR */
391 #endif /* CONFIG_CODEC != SWCODEC */
393 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
394 unsigned long mdb_shape_shadow
= 0;
395 unsigned long loudness_shadow
= 0;
398 void sound_set_volume(int value
)
400 if(!audio_is_initialized
)
402 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
403 unsigned tmp
= ((unsigned)(value
+ 115) & 0xff) << 8;
404 mas_codec_writereg(0x10, tmp
);
405 #elif (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 \
406 || defined HAVE_WM8975 || defined HAVE_WM8758 || defined HAVE_WM8731 \
407 || defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) \
408 || defined(HAVE_AS3514) || defined(HAVE_WM8985)
409 current_volume
= value
* 10; /* tenth of dB */
410 set_prescaled_volume();
411 #elif CONFIG_CPU == PNX0101
412 int tmp
= (60 - value
* 4) & 0xff;
413 CODECVOL
= tmp
| (tmp
<< 8);
418 void sound_set_balance(int value
)
420 if(!audio_is_initialized
)
422 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
423 unsigned tmp
= ((unsigned)(value
* 127 / 100) & 0xff) << 8;
424 mas_codec_writereg(0x11, tmp
);
425 #elif CONFIG_CODEC == MAS3507D || defined HAVE_UDA1380 \
426 || defined HAVE_WM8975 || defined HAVE_WM8758 || defined HAVE_WM8731 \
427 || defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) \
428 || defined(HAVE_AS3514) || defined(HAVE_WM8985)
429 current_balance
= value
* VOLUME_RANGE
/ 100; /* tenth of dB */
430 set_prescaled_volume();
431 #elif CONFIG_CPU == PNX0101
432 /* TODO: implement for iFP */
437 void sound_set_bass(int value
)
439 if(!audio_is_initialized
)
441 #if defined(HAVE_SW_TONE_CONTROLS)
442 current_bass
= value
* 10;
443 dsp_callback(DSP_CALLBACK_SET_BASS
, current_bass
);
444 set_prescaled_volume();
445 #elif (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
446 unsigned tmp
= ((unsigned)(value
* 8) & 0xff) << 8;
447 mas_codec_writereg(0x14, tmp
);
448 #elif CONFIG_CODEC == MAS3507D
449 mas_writereg(MAS_REG_KBASS
, bass_table
[value
+15]);
450 current_bass
= value
* 10;
451 set_prescaled_volume();
452 #elif defined(HAVE_WM8751)
453 current_bass
= value
;
454 audiohw_set_bass(value
);
455 set_prescaled_volume();
456 #elif defined HAVE_WM8975 || defined HAVE_WM8758 || defined(HAVE_UDA1380) \
457 || defined HAVE_WM8731 || defined(HAVE_WM8721) || defined(HAVE_WM8985)
458 current_bass
= value
* 10;
459 audiohw_set_bass(value
);
460 set_prescaled_volume();
461 #elif CONFIG_CPU == PNX0101
462 /* TODO: implement for iFP */
467 void sound_set_treble(int value
)
469 if(!audio_is_initialized
)
471 #if defined(HAVE_SW_TONE_CONTROLS)
472 current_treble
= value
* 10;
473 dsp_callback(DSP_CALLBACK_SET_TREBLE
, current_treble
);
474 set_prescaled_volume();
475 #elif (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
476 unsigned tmp
= ((unsigned)(value
* 8) & 0xff) << 8;
477 mas_codec_writereg(0x15, tmp
);
478 #elif CONFIG_CODEC == MAS3507D
479 mas_writereg(MAS_REG_KTREBLE
, treble_table
[value
+15]);
480 current_treble
= value
* 10;
481 set_prescaled_volume();
482 #elif defined(HAVE_WM8751)
483 audiohw_set_treble(value
);
484 current_treble
= value
;
485 set_prescaled_volume();
486 #elif defined(HAVE_WM8975) || defined(HAVE_WM8758) || defined(HAVE_UDA1380) \
487 || defined(HAVE_WM8731) || defined(HAVE_WM8721) || defined(HAVE_WM8985)
488 audiohw_set_treble(value
);
489 current_treble
= value
* 10;
490 set_prescaled_volume();
491 #elif CONFIG_CPU == PNX0101
492 /* TODO: implement for iFP */
497 void sound_set_channels(int value
)
499 #if CONFIG_CODEC == SWCODEC
500 dsp_callback(DSP_CALLBACK_SET_CHANNEL_CONFIG
, value
);
502 if(!audio_is_initialized
)
504 channel_configuration
= value
;
505 set_channel_config();
509 void sound_set_stereo_width(int value
)
511 #if CONFIG_CODEC == SWCODEC
512 dsp_callback(DSP_CALLBACK_SET_STEREO_WIDTH
, value
);
514 if(!audio_is_initialized
)
516 stereo_width
= value
;
517 if (channel_configuration
== SOUND_CHAN_CUSTOM
)
518 set_channel_config();
522 #if defined(HAVE_WM8758) || defined(HAVE_WM8985)
523 void sound_set_bass_cutoff(int value
)
525 if(!audio_is_initialized
)
528 audiohw_set_bass_cutoff(value
);
531 void sound_set_treble_cutoff(int value
)
533 if(!audio_is_initialized
)
536 audiohw_set_treble_cutoff(value
);
540 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
541 void sound_set_loudness(int value
)
543 if(!audio_is_initialized
)
545 loudness_shadow
= (loudness_shadow
& 0x04) |
546 (MAX(MIN(value
* 4, 0x44), 0) << 8);
547 mas_codec_writereg(MAS_REG_KLOUDNESS
, loudness_shadow
);
550 void sound_set_avc(int value
)
552 if(!audio_is_initialized
)
557 tmp
= (0x1 << 8) | (0x8 << 12);
560 tmp
= (0x2 << 8) | (0x8 << 12);
563 tmp
= (0x4 << 8) | (0x8 << 12);
566 tmp
= (0x8 << 8) | (0x8 << 12);
568 case -1: /* turn off and then turn on again to decay quickly */
569 tmp
= mas_codec_readreg(MAS_REG_KAVC
);
570 mas_codec_writereg(MAS_REG_KAVC
, 0);
576 mas_codec_writereg(MAS_REG_KAVC
, tmp
);
579 void sound_set_mdb_strength(int value
)
581 if(!audio_is_initialized
)
583 mas_codec_writereg(MAS_REG_KMDB_STR
, (value
& 0x7f) << 8);
586 void sound_set_mdb_harmonics(int value
)
588 if(!audio_is_initialized
)
590 int tmp
= value
* 127 / 100;
591 mas_codec_writereg(MAS_REG_KMDB_HAR
, (tmp
& 0x7f) << 8);
594 void sound_set_mdb_center(int value
)
596 if(!audio_is_initialized
)
598 mas_codec_writereg(MAS_REG_KMDB_FC
, (value
/10) << 8);
601 void sound_set_mdb_shape(int value
)
603 if(!audio_is_initialized
)
605 mdb_shape_shadow
= (mdb_shape_shadow
& 0x02) | ((value
/10) << 8);
606 mas_codec_writereg(MAS_REG_KMDB_SWITCH
, mdb_shape_shadow
);
609 void sound_set_mdb_enable(int value
)
611 if(!audio_is_initialized
)
613 mdb_shape_shadow
= (mdb_shape_shadow
& ~0x02) | (value
?2:0);
614 mas_codec_writereg(MAS_REG_KMDB_SWITCH
, mdb_shape_shadow
);
617 void sound_set_superbass(int value
)
619 if(!audio_is_initialized
)
621 loudness_shadow
= (loudness_shadow
& ~0x04) | (value
?4:0);
622 mas_codec_writereg(MAS_REG_KLOUDNESS
, loudness_shadow
);
624 #endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
626 #else /* SIMULATOR */
628 void sound_set_volume(int value
)
630 /* 128 is SDL_MIX_MAXVOLUME */
631 sim_volume
= 128 * (value
- VOLUME_MIN
/ 10) / (VOLUME_RANGE
/ 10);
634 void sound_set_balance(int value
)
639 void sound_set_bass(int value
)
644 void sound_set_treble(int value
)
649 void sound_set_channels(int value
)
654 void sound_set_stereo_width(int value
)
659 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
660 void sound_set_loudness(int value
)
665 void sound_set_avc(int value
)
670 void sound_set_mdb_strength(int value
)
675 void sound_set_mdb_harmonics(int value
)
680 void sound_set_mdb_center(int value
)
685 void sound_set_mdb_shape(int value
)
690 void sound_set_mdb_enable(int value
)
695 void sound_set_superbass(int value
)
699 #endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
701 #if defined(HAVE_WM8758) || defined(HAVE_WM8985)
702 void sound_set_bass_cutoff(int value
)
707 void sound_set_treble_cutoff(int value
)
711 #endif /* HAVE_WM8758 */
713 #endif /* SIMULATOR */
715 void sound_set(int setting
, int value
)
717 sound_set_type
* sound_set_val
= sound_get_fn(setting
);
719 sound_set_val(value
);
722 #if (!defined(HAVE_AS3514) && !defined (HAVE_WM8731)) || defined(SIMULATOR)
723 int sound_val2phys(int setting
, int value
)
725 #if CONFIG_CODEC == MAS3587F
730 case SOUND_LEFT_GAIN
:
731 case SOUND_RIGHT_GAIN
:
732 result
= (value
- 2) * 15;
736 result
= value
* 15 + 210;
744 #elif defined(HAVE_UDA1380)
749 case SOUND_LEFT_GAIN
:
750 case SOUND_RIGHT_GAIN
:
752 result
= value
* 5; /* (1/2) * 10 */
760 #elif defined(HAVE_TLV320) || defined(HAVE_WM8731)
765 case SOUND_LEFT_GAIN
:
766 case SOUND_RIGHT_GAIN
:
767 result
= (value
- 23) * 15; /* (x - 23)/1.5 *10 */
771 result
= value
* 200; /* 0 or 20 dB */
779 #elif defined(HAVE_AS3514)
780 /* This is here for the sim only and the audio driver has its own */
785 case SOUND_LEFT_GAIN
:
786 case SOUND_RIGHT_GAIN
:
788 result
= (value
- 23) * 15;
802 #endif /* !defined(HAVE_AS3514) || defined(SIMULATOR) */
804 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
806 /* This function works by telling the decoder that we have another
807 crystal frequency than we actually have. It will adjust its internal
808 parameters and the result is that the audio is played at another pitch.
810 The pitch value is in tenths of percent.
812 static int last_pitch
= 1000;
814 void sound_set_pitch(int pitch
)
818 if (pitch
!= last_pitch
)
820 /* Calculate the new (bogus) frequency */
821 val
= 18432 * 1000 / pitch
;
823 mas_writemem(MAS_BANK_D0
, MAS_D0_OFREQ_CONTROL
, &val
, 1);
825 /* We must tell the MAS that the frequency has changed.
826 * This will unfortunately cause a short silence. */
827 mas_writemem(MAS_BANK_D0
, MAS_D0_IO_CONTROL_MAIN
, &shadow_io_control_main
, 1);
833 int sound_get_pitch(void)
837 #else /* SIMULATOR */
838 void sound_set_pitch(int pitch
)
843 int sound_get_pitch(void)
847 #endif /* SIMULATOR */
848 #endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */