If you have tried to use a Bluetooth keyboard like the iGo Stowaway with CyanogenMod 10.1, you have likely been disappointed that it didn't work. The exact manifestation of the problem is that the keyboard pairs fine with the phone, but fails to connect to it afterwards. On inspection, the logs show error messages related to the userspace HID driver obviously missing.
Someone more knowledgeable might explain exactly why the UHID driver is missing from the current kernel(s), but I noticed that the driver has been backported for the ZTE's MSM7x27 kernel on GitHub by plaguedbypenguins for use in KonstaT's CM 10.1 port for the ZTE Blade. So, I decided to give it a try and, with a couple of cosmetic adaptations, the patch applied cleanly to the Sony MSM8x60 source code. It also builds without error and, most importantly, does what's it supposed to do: at least the iGo Stowaway keyboard that I have now works flawlessly with CyanogenMod 10.1.
To make it simpler for anyone interested, I've forked and patched the kernel source code here. And this in particular is the commited patch in question. Let me emphasize once more that my own input into the patch is effectively null, so all credit and thanks should go to the original developers!
Since I'm more a wannabe developer, I'd be very grateful if people who have good experience, especially with the kernel, take a look and see if there isn't something wrong under the surface, despite the fact that the patch applies and builds cleanly and seems to do the job. I guess @tilal6991 might be especially interested. I suppose that if all is OK, the patch might as well be merged in the CM 10.1 code in time for the last CM 10.1.3 release. Speaking of that, I am still having problems building the CM 10.2 code, so haven't even blindly tried the patch on it yet.
Code:
E/bt-btif ( 3151): bta_hh_co_open: Error: failed to open uhid, err:No such file or directory
W/bt-btif ( 3151): BTA_HH_OPEN_EVT: Error, failed to find the uhid driver...
E/bt-btif ( 3151): uhid_write: Cannot write to uhid:Bad file number
Someone more knowledgeable might explain exactly why the UHID driver is missing from the current kernel(s), but I noticed that the driver has been backported for the ZTE's MSM7x27 kernel on GitHub by plaguedbypenguins for use in KonstaT's CM 10.1 port for the ZTE Blade. So, I decided to give it a try and, with a couple of cosmetic adaptations, the patch applied cleanly to the Sony MSM8x60 source code. It also builds without error and, most importantly, does what's it supposed to do: at least the iGo Stowaway keyboard that I have now works flawlessly with CyanogenMod 10.1.
To make it simpler for anyone interested, I've forked and patched the kernel source code here. And this in particular is the commited patch in question. Let me emphasize once more that my own input into the patch is effectively null, so all credit and thanks should go to the original developers!
Since I'm more a wannabe developer, I'd be very grateful if people who have good experience, especially with the kernel, take a look and see if there isn't something wrong under the surface, despite the fact that the patch applies and builds cleanly and seems to do the job. I guess @tilal6991 might be especially interested. I suppose that if all is OK, the patch might as well be merged in the CM 10.1 code in time for the last CM 10.1.3 release. Speaking of that, I am still having problems building the CM 10.2 code, so haven't even blindly tried the patch on it yet.