On Fri, Jan 29, 2010 at 10:13:08AM +0000, Mark Brown wrote:
On Thu, Jan 28, 2010 at 06:34:18PM +0800, Daniel Mack wrote:
Invalidate the cached hardware format on resume for PXA SSP ports. Otherwise hw_params() will bail out early at the next stream start, leaving the registers in a bogus state.
Would it not be better to write the cached state back to the hardware? Putting an invalid value in the cache seems like asking for trouble.
Hmm. I considered that, but the reason why the system failed to resume in my case was that the ssp port was not active at this time. Otherwise, the suspend/resume code would have already done the right thing.
And as the next client will indirectly call hw_params() again, the code there will do the right thing with the invalidated cache.
Restoring the register values from priv->dai_fmt would imply adding code to do everything what the other bit-fiddling functions do in a reverse manner. Which is something I'd like to avoid :)
Another idea is to unconditionally save and restore the register set, and deal with possible side-effects. Not sure what's really better.
Daniel