On Wed, Dec 21, 2011 at 03:42:17PM +0100, Takashi Iwai wrote:
Mark Brown wrote:
I was rather expecting that the patches would be posted to the list for review at some point (though I may have missed them as not having generic support is really disappointing).
Err, sorry, I thought I have posted some in RFC, but wasn't there. The essential patch for the common helper is attached below.
Thanks. It'll be tomorrow at the earliest before I can read it properly.
We should at least verify that the userspace interface isn't going to cause problems for non-HDA systems.
Well, the kctl-jack part itself can't break anything right now since it's used only in HD-audio. If others will use, this will be a pure addition, so it won't break except for possibly different ctl numids.
I'm more worried about the userspace interface than the in kernel one, we can rewrite the kernel if it sucks but we're stuck with userspace.
The question toward the integration with the input-jack stuff is still open. In the HD-audio case, input-jack functions are merged into the kctl-jack helpers. But for others, it doesn't have to be so.
I really don't see any reason why you'd want to have to worry about the specific mechanisms in drivers (and there's also the extcon/switch stuff that's looking likely to hit soon). Indeed the extcon stuff might make this needless anyway.
One remaining obstacle for this integration is that the input-jack provides multiple key bits per jack entry while this doesn't exist in the kctl notification. With kctl, the notifier says just that the value was changed. Then the user-space can query the current value (not necessarily a boolean but can be an integer or else), but the value isn't passed in the notification itself. So, it's a different design.
The detail in the notification seems completely trivial to deal with - the input layer also provides similar readback support, it just happens to have a more verbose report (and it needs the cache for readback anyway as it also uses it to eliminate noop reports).