Index: firmware/sound.c =================================================================== --- firmware/sound.c (Revision 16291) +++ firmware/sound.c (Arbeitskopie) @@ -290,11 +290,6 @@ || defined(HAVE_WM8731) || defined(HAVE_WM8721) || defined(HAVE_WM8751) \ || defined(HAVE_AS3514) audiohw_set_master_vol(tenthdb2master(l), tenthdb2master(r)); -#if defined(HAVE_WM8975) || defined(HAVE_WM8758) \ - || (defined(HAVE_WM8751) && !defined(MROBE_100)) - audiohw_set_lineout_vol(tenthdb2master(0), tenthdb2master(0)); -#endif - #elif defined(HAVE_TLV320) audiohw_set_headphone_vol(tenthdb2master(l), tenthdb2master(r)); #endif Index: firmware/target/arm/wmcodec-pp.c =================================================================== --- firmware/target/arm/wmcodec-pp.c (Revision 16291) +++ firmware/target/arm/wmcodec-pp.c (Arbeitskopie) @@ -102,12 +102,6 @@ } -#if !defined(HAVE_WM8731) && !defined(HAVE_WM8751) -void audiohw_postinit(void) -{ -} -#endif - void wmcodec_write(int reg, int data) { pp_i2c_send(I2C_AUDIO_ADDRESS, (reg<<1) | ((data&0x100)>>8),data&0xff); Index: firmware/drivers/audio/wm8758.c =================================================================== --- firmware/drivers/audio/wm8758.c (Revision 16291) +++ firmware/drivers/audio/wm8758.c (Arbeitskopie) @@ -85,6 +85,12 @@ //#define BASSCTRL 0x //#define TREBCTRL 0x0b +void audiohw_postinit(void) +{ + /* set line out volume */ + audiohw_set_lineout_vol(tenthdb2master(0), tenthdb2master(0)); +} + /* Silently enable / disable audio output */ void audiohw_enable_output(bool enable) { @@ -96,7 +102,7 @@ /* TODO: Review the power-up sequence to prevent pops */ wmcodec_write(RESET, 0x1ff); /*Reset*/ - + wmcodec_write(PWRMGMT1, 0x2b); wmcodec_write(PWRMGMT2, 0x180); wmcodec_write(PWRMGMT3, 0x6f); @@ -109,7 +115,7 @@ /* The iPod can handle multiple frequencies, but fix at 44.1KHz for now */ audiohw_set_sample_rate(WM8758_44100HZ); - + wmcodec_write(LOUTMIX,0x1); /* Enable mixer */ wmcodec_write(ROUTMIX,0x1); /* Enable mixer */ audiohw_mute(0); Index: firmware/drivers/audio/wm8975.c =================================================================== --- firmware/drivers/audio/wm8975.c (Revision 16291) +++ firmware/drivers/audio/wm8975.c (Arbeitskopie) @@ -65,6 +65,11 @@ #define IPOD_PCM_LEVEL 0x65 /* -6dB */ +void audiohw_postinit(void) +{ + /* set line out volume */ + audiohw_set_lineout_vol(tenthdb2master(0), tenthdb2master(0)); +} /* Silently enable / disable audio output */ void audiohw_enable_output(bool enable) @@ -83,36 +88,36 @@ */ wmcodec_write(RESET, 0x1ff); /*Reset*/ wmcodec_write(RESET, 0x0); - + /* 2. Enable Vmid and VREF. */ wmcodec_write(PWRMGMT1, 0xc0); /*Pwr Mgmt(1)*/ /* From app notes: allow Vref to stabilize to reduce clicks */ sleep(HZ/4); - + /* 3. Enable DACs as required. */ wmcodec_write(PWRMGMT2, 0x180); /*Pwr Mgmt(2)*/ - + /* 4. Enable line and / or headphone output buffers as required. */ wmcodec_write(PWRMGMT2, 0x1f8); /*Pwr Mgmt(2)*/ - + /* BCLKINV=0(Dont invert BCLK) MS=1(Enable Master) LRSWAP=0 LRP=0 */ /* IWL=00(16 bit) FORMAT=10(I2S format) */ wmcodec_write(AINTFCE, 0x42); - + /* The iPod can handle multiple frequencies, but fix at 44.1KHz for now */ audiohw_set_sample_rate(WM8975_44100HZ); - + /* set the volume to -6dB */ wmcodec_write(LOUT1VOL, VOLUME_ZC_WAIT | IPOD_PCM_LEVEL); wmcodec_write(ROUT1VOL, VOLUME_ZC_WAIT | 0x100 | IPOD_PCM_LEVEL); wmcodec_write(LOUTMIX1, 0x150); /* Left out Mix(def) */ wmcodec_write(LOUTMIX2, 0x50); - + wmcodec_write(ROUTMIX1, 0x50); /* Right out Mix(def) */ wmcodec_write(ROUTMIX2, 0x150); - + wmcodec_write(MOUTMIX1, 0x0); /* Mono out Mix */ wmcodec_write(MOUTMIX2, 0x0); @@ -122,8 +127,6 @@ } } - - int audiohw_set_master_vol(int vol_l, int vol_r) { /* +6 to -73dB 1dB steps (plus mute == 80levels) 7bits */ Index: firmware/drivers/audio/wm8985.c =================================================================== --- firmware/drivers/audio/wm8985.c (Revision 16291) +++ firmware/drivers/audio/wm8985.c (Arbeitskopie) @@ -47,6 +47,10 @@ return 0; } +void audiohw_postinit(void) +{ +} + /* Silently enable / disable audio output */ void audiohw_enable_output(bool enable) { Index: firmware/drivers/audio/wm8721.c =================================================================== --- firmware/drivers/audio/wm8721.c (Revision 16291) +++ firmware/drivers/audio/wm8721.c (Arbeitskopie) @@ -77,6 +77,10 @@ return -db * 2 / 5; } +void audiohw_postinit(void) +{ +} + void audiohw_mute(bool mute) { if (mute) Index: firmware/drivers/audio/wm8751.c =================================================================== --- firmware/drivers/audio/wm8751.c (Revision 16291) +++ firmware/drivers/audio/wm8751.c (Arbeitskopie) @@ -157,6 +157,10 @@ audiohw_mute(false); +#ifndef MROBE_100 + audiohw_set_lineout_vol(tenthdb2master(0), tenthdb2master(0)); +#endif + #ifdef MROBE_100 /* enable headphone output */ GPIOL_OUTPUT_VAL &= ~0x10;