Android Open Accessory Protocol cannot be used in v3.18.x on most phone

55 views
Skip to first unread message

Min-Chieh Tsai

unread,
Oct 17, 2016, 8:10:20 PM10/17/16
to Android Linux Kernel Development
Hi all,

I found most phone vendor lost to apply the important patch as following i. It will cause the Android Open Accessory Protocol cannot register HID device anymore, because new HID driver will check raw_request function. But I found https://android.googlesource.com/kernel/common/+/android-3.18/drivers/usb/gadget/function/f_accessory.c have already patch this modification,  https://android.googlesource.com/kernel/msm/+/android-msm-gar-3.18-marshmallow-mr1-wear-release/drivers/usb/gadget/function/f_accessory.c is not.  We also check most phone vendor’s source code, they seems to follow Qualcomm MSM source tree to develop their platform. So, it didn’t include this patch in their developing source.
 
Because our company have already use the “Android Open Accessory Protocol” to create the android accessory product, it really confuse us now. Please give us some suggestion to change this situation.
 
 
Best regards,
Louis Tsai
 
=============================== patch ====================================================================

diff --git a/drivers/usb/gadget/function/f_accessory.c  
b/drivers/usb/gadget/function/f_accessory.c
index b5467ca..dec2242 100644
--- a/drivers/usb/gadget/function/f_accessory.c
+++ b/drivers/usb/gadget/function/f_accessory.c
@@ -404,12 +404,19 @@
  {
  }

+int acc_hid_raw_request(struct hid_device *hid, unsigned char reportnum,
+        __u8 *buf, size_t len, unsigned char rtype, int reqtype)
+{
+        return 0;
+}
+
  static struct hid_ll_driver acc_hid_ll_driver = {
          .parse = acc_hid_parse,
          .start = acc_hid_start,
          .stop = acc_hid_stop,
          .open = acc_hid_open,
          .close = acc_hid_close,
+        .raw_request = acc_hid_raw_request,
  };


Reply all
Reply to author
Forward
0 new messages