How to detect audio plug type to distinguish microphone/headphones by pin configuration?
It seems the ADAU1671 does not include a device detection feature. You need an analog switch to switch the microphone connection between pin 4 and pin 1 anyway, if you want to support standalone microphones as well as headsets. You can toggle the microphone bias voltage on and off. As the bias is current limited, it can easily be pulled down by a short circuit or a low-impedance headphone coil. So I would try it this way:

Couple MICBIAS via R and/or L to a comparator or Schmitt trigger, and its output to a general purpose input. Switch microphone to pin 4, enable bias. If the bias is not pulled down (so you detect high on the GPI pin), it's a headset. If not, toggle microphone to pin 1 (and remove headphone out from it), and check again. If it is pulled down, it's a headphone, if it's not pulled down, it's a standalone mic or no device at all (e.g. just an extension cord).