@zonque it took me a bit longer than expected but I've just sent a series of patches upstream  for the support of the jack detection. So for now it's limited to the mechanical switch. I'm working on cleaning up headset buttons detection but I have inconsistent results with different headsets, and a variety of other issues that I need to address.
It should be fairly easy to backport this series to a 4.4 kernel, and some extra tweaking might be required in pm8916.dtsi for the interrupt name and perhaps the interrupt flag should be changed to IRQ_TYPE_EDGE_RISING (that's what I have locally but I am not sure this is necessary to make it work).
Let me know if you have any issue!
[edit: Srini replied to me that he has a more complete patchset coming up in a couple of days]