Another headset plug-in detection from Texas Instruments. Link here (PDF)
The headset detect circuitry can differentiate between mono, stereo, mono with microphone, and stereo with microphone headsets. It can operate while the LM4935 is placed into low current standby mode, which promotes extended battery life. In standby mode, it consumes no extra current, if the headset has not been inserted into the headset jack.