aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArve Hjønnevåg2012-11-27 21:29:04 -0600
committerArve Hjønnevåg2013-02-22 17:27:51 -0600
commit8598af4630b00557b545e79097728ddee314dfd0 (patch)
treea2a72b5bc03e8fcddc367340356a94f1cb389239
parent684e7d5a80255c3d414f35ffb0230f646fc64f8a (diff)
downloadkernel-common-8598af4630b00557b545e79097728ddee314dfd0.tar.gz
kernel-common-8598af4630b00557b545e79097728ddee314dfd0.tar.xz
kernel-common-8598af4630b00557b545e79097728ddee314dfd0.zip
usb: gadget: android: Fixes and hacks to make android usb gadget compile on 3.8
Signed-off-by: Arve Hjønnevåg <arve@android.com>
-rw-r--r--drivers/usb/gadget/android.c16
-rw-r--r--drivers/usb/gadget/f_accessory.c2
-rw-r--r--drivers/usb/gadget/f_adb.c2
-rw-r--r--drivers/usb/gadget/f_audio_source.c2
-rw-r--r--drivers/usb/gadget/f_mtp.c4
5 files changed, 10 insertions, 16 deletions
diff --git a/drivers/usb/gadget/android.c b/drivers/usb/gadget/android.c
index 4e73bf1a0f3..23b5c46eadf 100644
--- a/drivers/usb/gadget/android.c
+++ b/drivers/usb/gadget/android.c
@@ -367,11 +367,14 @@ static void functionfs_closed_callback(struct ffs_data *ffs)
367 mutex_unlock(&dev->mutex); 367 mutex_unlock(&dev->mutex);
368} 368}
369 369
370static int functionfs_check_dev_callback(const char *dev_name) 370static void *functionfs_acquire_dev_callback(const char *dev_name)
371{ 371{
372 return 0; 372 return 0;
373} 373}
374 374
375static void functionfs_release_dev_callback(struct ffs_data *ffs_data)
376{
377}
375 378
376struct adb_data { 379struct adb_data {
377 bool opened; 380 bool opened;
@@ -1361,7 +1364,7 @@ static int android_bind(struct usb_composite_dev *cdev)
1361{ 1364{
1362 struct android_dev *dev = _android_dev; 1365 struct android_dev *dev = _android_dev;
1363 struct usb_gadget *gadget = cdev->gadget; 1366 struct usb_gadget *gadget = cdev->gadget;
1364 int gcnum, id, ret; 1367 int id, ret;
1365 1368
1366 /* 1369 /*
1367 * Start disconnected. Userspace will connect the gadget once 1370 * Start disconnected. Userspace will connect the gadget once
@@ -1399,15 +1402,6 @@ static int android_bind(struct usb_composite_dev *cdev)
1399 strings_dev[STRING_SERIAL_IDX].id = id; 1402 strings_dev[STRING_SERIAL_IDX].id = id;
1400 device_desc.iSerialNumber = id; 1403 device_desc.iSerialNumber = id;
1401 1404
1402 gcnum = usb_gadget_controller_number(gadget);
1403 if (gcnum >= 0)
1404 device_desc.bcdDevice = cpu_to_le16(0x0200 + gcnum);
1405 else {
1406 pr_warning("%s: controller '%s' not recognized\n",
1407 longname, gadget->name);
1408 device_desc.bcdDevice = __constant_cpu_to_le16(0x9999);
1409 }
1410
1411 usb_gadget_set_selfpowered(gadget); 1405 usb_gadget_set_selfpowered(gadget);
1412 dev->cdev = cdev; 1406 dev->cdev = cdev;
1413 1407
diff --git a/drivers/usb/gadget/f_accessory.c b/drivers/usb/gadget/f_accessory.c
index a244265c114..092964c2b50 100644
--- a/drivers/usb/gadget/f_accessory.c
+++ b/drivers/usb/gadget/f_accessory.c
@@ -1121,7 +1121,7 @@ static int acc_bind_config(struct usb_configuration *c)
1121 dev->cdev = c->cdev; 1121 dev->cdev = c->cdev;
1122 dev->function.name = "accessory"; 1122 dev->function.name = "accessory";
1123 dev->function.strings = acc_strings, 1123 dev->function.strings = acc_strings,
1124 dev->function.descriptors = fs_acc_descs; 1124 dev->function.fs_descriptors = fs_acc_descs;
1125 dev->function.hs_descriptors = hs_acc_descs; 1125 dev->function.hs_descriptors = hs_acc_descs;
1126 dev->function.bind = acc_function_bind; 1126 dev->function.bind = acc_function_bind;
1127 dev->function.unbind = acc_function_unbind; 1127 dev->function.unbind = acc_function_unbind;
diff --git a/drivers/usb/gadget/f_adb.c b/drivers/usb/gadget/f_adb.c
index 1629ffb5b97..a1d70d27695 100644
--- a/drivers/usb/gadget/f_adb.c
+++ b/drivers/usb/gadget/f_adb.c
@@ -566,7 +566,7 @@ static int adb_bind_config(struct usb_configuration *c)
566 566
567 dev->cdev = c->cdev; 567 dev->cdev = c->cdev;
568 dev->function.name = "adb"; 568 dev->function.name = "adb";
569 dev->function.descriptors = fs_adb_descs; 569 dev->function.fs_descriptors = fs_adb_descs;
570 dev->function.hs_descriptors = hs_adb_descs; 570 dev->function.hs_descriptors = hs_adb_descs;
571 dev->function.bind = adb_function_bind; 571 dev->function.bind = adb_function_bind;
572 dev->function.unbind = adb_function_unbind; 572 dev->function.unbind = adb_function_unbind;
diff --git a/drivers/usb/gadget/f_audio_source.c b/drivers/usb/gadget/f_audio_source.c
index c757409edf9..56dcf217cfe 100644
--- a/drivers/usb/gadget/f_audio_source.c
+++ b/drivers/usb/gadget/f_audio_source.c
@@ -599,7 +599,7 @@ audio_bind(struct usb_configuration *c, struct usb_function *f)
599 hs_as_in_ep_desc.bEndpointAddress = 599 hs_as_in_ep_desc.bEndpointAddress =
600 fs_as_in_ep_desc.bEndpointAddress; 600 fs_as_in_ep_desc.bEndpointAddress;
601 601
602 f->descriptors = fs_audio_desc; 602 f->fs_descriptors = fs_audio_desc;
603 f->hs_descriptors = hs_audio_desc; 603 f->hs_descriptors = hs_audio_desc;
604 604
605 for (i = 0, status = 0; i < IN_EP_REQ_COUNT && status == 0; i++) { 605 for (i = 0, status = 0; i < IN_EP_REQ_COUNT && status == 0; i++) {
diff --git a/drivers/usb/gadget/f_mtp.c b/drivers/usb/gadget/f_mtp.c
index 1638977a541..9ab94697c19 100644
--- a/drivers/usb/gadget/f_mtp.c
+++ b/drivers/usb/gadget/f_mtp.c
@@ -1212,10 +1212,10 @@ static int mtp_bind_config(struct usb_configuration *c, bool ptp_config)
1212 dev->function.name = "mtp"; 1212 dev->function.name = "mtp";
1213 dev->function.strings = mtp_strings; 1213 dev->function.strings = mtp_strings;
1214 if (ptp_config) { 1214 if (ptp_config) {
1215 dev->function.descriptors = fs_ptp_descs; 1215 dev->function.fs_descriptors = fs_ptp_descs;
1216 dev->function.hs_descriptors = hs_ptp_descs; 1216 dev->function.hs_descriptors = hs_ptp_descs;
1217 } else { 1217 } else {
1218 dev->function.descriptors = fs_mtp_descs; 1218 dev->function.fs_descriptors = fs_mtp_descs;
1219 dev->function.hs_descriptors = hs_mtp_descs; 1219 dev->function.hs_descriptors = hs_mtp_descs;
1220 } 1220 }
1221 dev->function.bind = mtp_function_bind; 1221 dev->function.bind = mtp_function_bind;