From 423f1612eb62de58cfa07d05a316b0781fd5dff8 Mon Sep 17 00:00:00 2001 From: Vijayavardhan Vennapusa Date: Mon, 28 Sep 2015 13:10:19 +0530 Subject: [PATCH] USB: f_accessory: Set manufacturer and model string to default value Currently USB driver is resetting strings like manufacturer, model to zero as part of handling control request for protocol version. Some accessory docks may not send manufacturer and model strings before sending control request to enable audiosource USB composition. This results in userspace enabling audio source composition without accessory interface. If accessory dock is connected during bootup, accessory timeouts in configuring android device and results in detection failure. Userspace does have recovery mechanism if incase accessory dock timeouts to configure android device in accessory composition. Hence set manufacturer and model strings to default value so that userspace enables accessory + audiosource composition for userspace recovery to be working and detecting accessory dock successfully during bootup. Change-Id: Ibe4dd9d951a9615ae100e68dc15b3614e9834848 Signed-off-by: Vijayavardhan Vennapusa --- drivers/usb/gadget/function/f_accessory.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/function/f_accessory.c b/drivers/usb/gadget/function/f_accessory.c index d33229c35282..576ee04befe1 100644 --- a/drivers/usb/gadget/function/f_accessory.c +++ b/drivers/usb/gadget/function/f_accessory.c @@ -912,6 +912,8 @@ int acc_ctrlrequest(struct usb_composite_dev *cdev, memset(dev->serial, 0, sizeof(dev->serial)); dev->start_requested = 0; dev->audio_mode = 0; + strlcpy(dev->manufacturer, "Android", ACC_STRING_SIZE); + strlcpy(dev->model, "Android", ACC_STRING_SIZE); } }