I removed the two output capacitors from Lout2 and Rout2. I bridged them together and made that the common line for theadphones. That wire goes to the audio jack's ground/common connection.

I also removed the two big 220uF output caps from Lout1 and Rout1. I tapped the pads coming from the chip, and those go directly to the left/right connections on the audio jack. I also removed the HP_COM and LINE_COM caps.

I used "litz" wire from some older broken headphones. great way to do this mod as it's very soft and shapes well.
I measured for shorts and everything is ok.
Now, looking at the two versions for implementation in the datasheet:

I modified according to the DC Coupled Headphone output version.
Now I need to make the software modifications as well. I used the latest rockbox (3.14 - great build!)
I found 2 files in the rockbox sources, that are of interest.
wm8758.c at this location 'firmware/drivers/audio/'
wm8758.h at this location 'firmware/export/
Here's an example of what's in the .h file:
#define LOUT2VOL 0x36 /* default 039 */
#define LOUT2VOL_MASK 0x3f
#define LOUT2VOL_LOUT2MUTE (1 << 6)
#define LOUT2VOL_LOUT2ZC (1 << 7)
#define LOUT2VOL_OUT2VU (1 << 8)
#define ROUT2VOL 0x37 /* default 039 */
#define ROUT2VOL_MASK 0x3f
#define ROUT2VOL_ROUT2MUTE (1 << 6)
#define ROUT2VOL_ROUT2ZC (1 << 7)
#define ROUT2VOL_OUT2VU (1 << 8)
So I already have that defined, I just need to call it somehow in the .c file. I also attached both files to this post.
Here's the init sequence as recommended in the datasheet (from .c file):
void audiohw_preinit(void)
{
/* Set low bias mode */
wmcodec_write(BIASCTRL, BIASCTRL_BIASCUT);
/* Enable HPCOM, LINECOM */
wmcodec_write(OUTCTRL, OUTCTRL_HP_COM | OUTCTRL_LINE_COM
| OUTCTRL_TSOPCTRL | OUTCTRL_TSDEN | OUTCTRL_VROI);
/* Mute all Outputs and set PGAs minimum gain */
wmcodec_write(LOUT1VOL, 0x140);
wmcodec_write(ROUT1VOL, 0x140);
wmcodec_write(LOUT2VOL, 0x140);
wmcodec_write(ROUT2VOL, 0x140);
wmcodec_write(OUT3MIX, 0x40);
wmcodec_write(OUT4MIX, 0x40);
/* Enable L/ROUT1 */
wmcodec_write(PWRMGMT2, PWRMGMT2_ROUT1EN | PWRMGMT2_LOUT1EN);
/* Enable VMID independent current bias */
wmcodec_write(OUT4TOADC, OUT4TOADC_POBCTRL);
/* Enable required DACs and mixers */
wmcodec_write(PWRMGMT3, PWRMGMT3_RMIXEN | PWRMGMT3_LMIXEN
| PWRMGMT3_DACENR | PWRMGMT3_DACENL);
/* Enable VMIDSEL, BIASEN, BUFIOEN */
wmcodec_write(PWRMGMT1, PWRMGMT1_PLLEN | PWRMGMT1_BIASEN
| PWRMGMT1_BUFIOEN | PWRMGMT1_VMIDSEL_10K);
/* Setup digital interface, input amplifiers, PLL, ADCs and DACs */
wmcodec_write(AINTFCE, AINTFCE_IWL_16BIT | AINTFCE_FORMAT_I2S);
wmcodec_write(CLKCTRL, CLKCTRL_MS); /* WM8758 is clock master */
audiohw_set_frequency(HW_FREQ_44);
wmcodec_write(LOUTMIX, LOUTMIX_DACL2LMIX);
wmcodec_write(ROUTMIX, ROUTMIX_DACR2RMIX);
/* Disable VMID independent current bias */
wmcodec_write(OUT4TOADC, 0);
}
void audiohw_postinit(void)
{
wmcodec_write(PWRMGMT1, PWRMGMT1_PLLEN | PWRMGMT1_BIASEN
| PWRMGMT1_BUFIOEN | PWRMGMT1_VMIDSEL_500K);
/* lower the VMID power consumption */
wmcodec_write(BIASCTRL, 0);
audiohw_mute(false);
}
I think I can call it with something like:
wmcodec_write(LOUT2VOL, LOUT2VOL_LOUT2MUTE);
wmcodec_write(ROUT2VOL, ROUT2VOL_ROUT2MUTE);
I am not sure if this is enough. Here's the available volume control:

A normal volume change is called like this:
void audiohw_set_lineout_volume(int vol_l, int vol_r)
{
int dac_l, amp_l, dac_r, amp_r;
vol_l = vol_tenthdb2hw(vol_l);
vol_r = vol_tenthdb2hw(vol_r);
get_volume_params(vol_l, &dac_l, &_l);
get_volume_params(vol_r, &dac_r, &_r);
/* set lineout amp OUT2 */
wmcodec_write(LOUT2VOL, amp_l | LOUT2VOL_LOUT2ZC);
wmcodec_write(ROUT2VOL, amp_r | ROUT2VOL_ROUT2ZC | ROUT2VOL_OUT2VU);
}
And the datasheet says this:
LOUT2 and ROUT2 volumes do not
update until a 1 is written to SPKVU
(in reg 54 or 55)
I'm not sure if muting is considered volume change, and need to call zero-crossing with LOUT2VOL_LOUT2ZC/ROUT2VOL_ROUT2ZC and set the ROUT2VOL_OUT2VU for Output2 to go to VMID.
Right now it sounds like crap. I don't have any DC between common and each channel. But there's no Left/Right separation. and it makes sense as Lout2 and Rout2 are tied together. If they don't go to VMID, it sounds like crap.
Here's exactly what the LOUT2VOL_LOUT2MUTE and ROUT2VOL_ROUT2MUTE bits do with the outputs:
