Stephen Warren wrote at Friday, February 11, 2011 9:06 AM:
Mark Brown wrote at Friday, February 11, 2011 4:12 AM:
... As well as being detected via the main interrupt of the WM8903 the detection signals can also be brought out to the WM8903 GPIOs directly, allowing detection to operate without any I2C I/O. That mode can be configured via platform data only and the WM8903 microphone detection functions will never be called so the user needs to be able to enable detection via platform data.
Probably the best thing is to disable, then immediately re-enable the relevant fields (micdet_ena) in the register during wm8903_mic_detect. That will turn off the HW mic detection module, then start detection afresh, hence causing the "initial" interrupt to fire when desired.
Strangely, modifying wm8903_mic_detect() to:
* Unconditionally clear MICDET_ENA * Update the IRQ mask like it does today * Re-enable MICDET_ENA if det||shrt
Doesn't actually solve the problem. I guess disabling MICDET_ENA doesn't actually reset the mic detection state machine.
Anyway, as you said, perhaps just documenting how to set up micdet_cfg in the platform_data header is indeed the best way, since everything works without any code changes if I simply don't set MICDET_ENA in micdet_cfg.