
Mark Brown wrote at Tuesday, February 01, 2011 4:34 AM:
On Mon, Jan 31, 2011 at 04:03:58PM -0800, Stephen Warren wrote:
However, if I use the control to disable the headphones, then unplug/replug the headphones, the jack detect seems to override the control, and I hear audio from the headphones.
Using these two together makes no sense. Either you manually control the state of the output or you manage it automatically.
I was thinking that the jack detect would be used to enable/disable widgets for power purposes, but with a manual override to allow SW to set up use cases where only the internal speakers were used, and never headphones.
That said, if that isn't something that's ever typically done, I'm fine not supporting that.
Generally a PIN_SWITCH() should only be used to offer control if none is availabile within the CODEC - in the case of Harmony it wouldn't make much sense as there's plenty of control in the CODEC for what gets routed to the various outputs.
IIRC, the codec controls allow selecting only what gets routed, but there wasn't an overall "enable/disable speakers" switch (the mute switch does not disable the DAPM widgets). One would have to disable all the routing options to disable the speaker amplifiers, which would entail remembering what those routing options were to restore them once the speakers were desired again. A manual switch avoids this.