USB: gadget: f_accessory: New gadget driver for android USB accesories

Change-Id: Ibd8639edc782d22f195f923ca80fe1571feba1e9
Signed-off-by: Mike Lockwood <lockwood@android.com>
USB: gadget: f_accessory: Misc improvements and cleanup:

- Add URI string

- Replace type string with a description string

- Add a control call to retrieve accessory protocol version (currently 1)

- Driver read() and write() calls now fail after USB disconnect until
  driver file is closed and reopened.

- Misc cleanup work

Signed-off-by: Mike Lockwood <lockwood@android.com>
USB: gadget: f_accessory: Clear accessory strings when USB is disconnected

Signed-off-by: Mike Lockwood <lockwood@android.com>
USB: gadget: f_accessory: Clear previous strings on ACCESSORY_GET_PROTOCOL

Clearing strings on disconnect does not work since we may receive
a disconnect on some devices when transitioning into accessory mode.
We require an accessory to send ACCESSORY_GET_PROTOCOL before
sending any strings, so any strings from a previous session will be cleared.

Signed-off-by: Mike Lockwood <lockwood@android.com>
USB: gadget: f_accessory: Clear disconnected flag when driver file is opened

Fixes a race condition that can occur when entering accessory mode.

Signed-off-by: Mike Lockwood <lockwood@android.com>
USB: gadget: f_accessory: Add string for accessory's unique serial number

Signed-off-by: Mike Lockwood <lockwood@android.com>
USB: gadget: f_accessory: Set bNumEndpoints to correct value of 2

Signed-off-by: Mike Lockwood <lockwood@android.com>
Add platform data for USB accessory function in pecan board file

Change-Id: I509572d3f17e2081774eeec91dd9864ccb99b12d
Signed-off-by: RonGokhale <cips173@gmail.com>
[P350] Updated defconfig

Change-Id: Ibe642bf976eeb73f0e90e242e614e4fd4b1585bb
[P350] Fix board file

Change-Id: I885cc4fa23eae6ebd1de07258bb3949e22b4b6fd
Merge branch 'cm-10.1' of https://github.com/PecanCM/lge-kernel-pecan into cm-10.1
Merge branch 'cm-10.1' of https://github.com/PecanCM/lge-kernel-pecan into cm-10.1
derp in build script
Enabled CONFIG_FB_EARLYSUSPEND to make libsuspend work as expected. It should also bring some
improvements in battery life.

Change-Id: I3b14e86d6e8a4cdf37e4c39dceb7ccf8df02d9d8
USB:gadget: few Update from mainline

update it

Change-Id: I44930ac335f59a8cf5c01ddf71468981fb91a822
Signed-off-by: RonGokhale <cips173@gmail.com>
Merge branch 'cm-10.1' of github.com:PecanCM/lge-kernel-pecan into cm-10.1

Change-Id: Iece260726e43bfc62e394a3722642a6a3d249640
[P350] Move usb code from pecan-board file into there own file

Change-Id: I55a87f13c9bf2742a0e45c4813da46074b9ce111
Signed-off-by: RonGokhale <cips173@gmail.com>
[COMMON] Update build script for PecanCM

Change-Id: I0efae7d7a08a9ae432cecb435bee59ee8b940c85
[P350] include gpio.h in usb file

Change-Id: Ieb7940a9ef7c169e8dcdfb45418396faaab377b3
Signed-off-by: RonGokhale <cips173@gmail.com>
[P350] Few Updates in board-pecan-usb.c

Change-Id: I6bf582173cbd2bf6eada6f92c4391edfcefe68fd