On Sat, Apr 19, 2008 at 03:50:06PM +0100, Mark Brown wrote:
Ok, but why not let the codec driver expose all the functionality it can offer for setting up a certain GPIO and use this alsa control either from user space or from the asoc machine part? I think that's the most flexible way at all, no?
The CODEC driver can't safely give user space control of multi-function pins in general, including GPIOs, since their usage depends very strongly on how they have been connected to the system. At best much of the functionality won't be useful on a given board due to a lack of appropriate connections. At worst the consequences of misusing them can include things like causing one or more chips in the system to fall over, perhaps even the entire system. For example, if you've got two chips each trying to drive a signal to different voltages then it is possible that one or both of them will do something like attempt to consume too much power and cause supplies to collapse.
Ok, agreed to this point. I wanted to implement this feature as generic as possbile, but you're right, that might cause some trouble.
In the case of jack detect I'm actually currently working on a generalisation of that since it's such a common feature. I hope to have something in the next week or two but it depends on my other work.
I attached a patch for a proprietary interface - is that what you were talking about? Would that approach be mergeable with your generic jack detect code?
Thanks and best regards, Daniel