Update copyright to The Linux Foundation

Change-Id: I9d9a06209e6bcc59495b21c42101420d48e97dfc
Signed-off-by: Duy Truong <dtruong@codeaurora.org>
Revert "USB: android: Avoid re-enabling the same configuration"

Commit d9b1897713 doesn't allow re-enumeration of USB default composition
on bus reset. if adb close and adb open has been called within 1 second
of duration. with adb usb command, it restarts the adb into USB mode after
closing the adb device and re-opening the same within 1 second. To the
user it looks as if command is stuck. Terminating adb usb based command
prompt, killing adb server and doing adb shell again gets the adb
functionality. Here user doesn't see any USB re-enumeration with it. Hence
revert commit d9b1897713 which doesn't block the adb usb command and
re-enumeration of USB.

(cherry picked from commit ff3e0492ee60c8594b3f48eed87e086f4b3d5b0b)

Change-Id: I9d503e0da9e6dfefb5628dceea37f7d2af2fcdff
CRs-Fixed: 385973
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
USB: android: Don't disable configuration for every adb close

Certain ADB commands like "adb usb" and "adb root" restart the
adb daemon running on the device.  These commands require USB
bus reset, otherwise adb commands on the host side would stuck
for ever.

USB bus reset can be forced from device side by re-enabling the
same composition.  Earlier, configuration is disabled when adb
daemon closes /dev/android_usb device file.  The configuration
is enabled again after adb daemon opens the device file. This
approach solves the "adb usb" problem with the below side effects.

1. When USB cable is disconnected, the Rx request is flushed and
an error code is returned to user space.  The adb daemon is simply
restarted in this case which cause an unnecessary rebinding of
all functions.
2. The above scenario can happen if host reset the bus when device
is in configured state.  If device disable pull-up during, bus
reset, USB CV CH9 test cases are failing.

The commit d9b1897 (USB: android: Avoid re-enabling the same
configuration) fixed the above side effects. But silently ignores the
original "adb usb" problem.

This commit is another attempt to solve all the above mentioned problems
by forcing re-enumeration only when device is in connected state.  That
means, "adb usb" and "adb root" commands force usb bus reset where as
plugging out a cable does not.

(cherry picked from commit 1aa235a6c0a3d67bff24609766baf5a7d5d8e3e4)

Change-Id: I91a0e0edf8d6c0a58b2b0e1273dfd781fafd7ed5
CRs-Fixed: 407882
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
USB: android: Fix adb device file closing bug

adb device file closing and config disabling can happen in
parallel during composition switch.  If adb device file
is closed prior to config disable, adb function driver request
android to disable configuration.  But this is not undone later
when adb device file is opened.  Due to this bug config remains
disabled after composition switch completion.  Fix this bug.

(cherry picked from commit c4d8e2ca7cfb2118bcc9f14a97568bfe42b76bcc)

Change-Id: Ia7cfd994334648467e9cd6b3c98698209e134fa4
CRs-Fixed: 414360
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
USB: android: Wakeup both reader and writer processes upon TX/RX error

The writer process is blocked on a wait queue if there are no free
TX requests.  It is unblocked from TX completion handler. When error
is encountered on RX path, wakeup the writer thread.  If the host
stops reading the data after RX errors, the writer process will never
be unblocked.  Similarly wakeup reader process when error is encountered
on TX path.

(cherry picked from commit e8757ca19d3f2230af507fc44262f9c92af37b59)

Change-Id: I4814efe6fac8c524be9087ef999f98a6cfe18e8f
CRs-Fixed: 449129
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Merge "Revert "USB: android: Avoid re-enabling the same configuration""
Merge "USB: android: Don't disable configuration for every adb close"
Merge "USB: android: Fix adb device file closing bug"
Merge "USB: android: Wakeup both reader and writer processes upon TX/RX error"
Revert "power: pm8921-charger: smbc uvlo lockup workaround"

This reverts commit 07be29dc33a7a782c347f43efe2a0febb7b4209c.

Change-Id: Ie85e8ae395fdada7c696fa76c02eddcdb3bd0b08
Signed-off-by: Sivasri Kumar Vanka <sivasri@codeaurora.org>
Revert "power: pm8921-charger: add pm_chg_write wrapper"

This reverts commit 833a465668f46dfeab3445699b1562c03301fa1a.

Change-Id: Ib12e404713ab2dab79c29673df9f5c8b1c4e0975
Signed-off-by: Sivasri Kumar Vanka <sivasri@codeaurora.org>
Revert "power: pm8921-charger: replace BTM with ADC algorithm"

This reverts commit 08c91f2b6058d9020b047700035e121e134f89bf.

Change-Id: Ie10a54265c9f695500611edbf9942b5716d5928e
Signed-off-by: Sivasri Kumar Vanka <sivasri@codeaurora.org>
Merge "Revert "power: pm8921-charger: smbc uvlo lockup workaround""
Merge "Revert "power: pm8921-charger: add pm_chg_write wrapper""
Merge "Revert "power: pm8921-charger: replace BTM with ADC algorithm""