Apple's iPod Shuffle 2G did charging and USB syncing over its 3.5mm TRRS socket.
And for people concerned about accidentally shorting a power line when inserting the plug, hypothetically could use a socket with built in switches so power is only sent once the plug is fully inserted into the socket.
oh ok, I understand your concern now "how do i keep from burning out headphones if someone accidentally plugs them in".
I am hesitant to give advice because I don't know a great way, but a possible method of detecting what type of device (a headphone or USB device) is plugged in could work by doing an impedance measurement right after the device is inserted. USB standard specifies that the signal-to-ground impedance on the data lines is 30 ohms and between data lines is differential impedance of 90 ohms. The right and left channel of headphones meanwhile have an impedance to ground (from 4 ohms to 32 ohms or higher), but aren't set to a differential impedance between the left and right channel. So maybe there is a simple circuit that could measure the differential impedance that is triggered just after a device is inserted, and if it matches 90 ohms, then will treat the device as a USB device, but if a measurement matches a headphone, then treat the device as a headphone. But the specifics on how to do this, I'm not sure.
Also see figure 3 of https://www.onsemi.com/pub/collateral/and8074-d.pdf which gives a schematic of USB lines and says "if a 1.5 k pull up resistor is connected on either the D+ or D− line, the port is identified as upstream". Unfortunately downstream devices have pull-down to ground, so when not being driven would rest at low voltage, which I can't think of a great way to help to distinguish downstream USB from headphones.
woww, you have hit upon the solution: data on sleeve (with series resistance), 5 volts on tip, ground on ring. headphones will not provide a current path between tip and ring and so will not burn out. current limiting is still necessary to protect the power source from shorted output. the headphone plug sleeve is necessary for any circuit through the headphones and only ever contacts the sleeve of the jack
hmm, actually this doesn't help much. because the headphones do provide a current path between tip and ring: through one earspeaker to ground and then through the other one. this does provide more resistance than the alternative, but usually not enough to make a difference; if each earspeaker is 25Ω, 5 volts across it would give you 200mA, and 5 volts across both of them in series will give you 100mA, which is what I was planning to use for the current limit anyway
i think maybe i'll just go with trrs to avoid this problem
And for people concerned about accidentally shorting a power line when inserting the plug, hypothetically could use a socket with built in switches so power is only sent once the plug is fully inserted into the socket.