power: smb347: notify board code of power changes

smb347_battery power supply will use the supplied_to
provided by the board file in pdata, if any, and pass
along a power_supply_changed() for itself if provided.
The board file can use its external_power_changed callback
to be notified of changes in state of the smb347 mains, usb,
or battery supplies.

Change-Id: Idd08b7cc49c5f8c639907371b686fca255825079
Signed-off-by: Todd Poynor <toddpoynor@google.com>
power: smb347: Add settable current max property for mains

Change-Id: I85ff9fc07b9a9eefad40b729e27887f5a6c1cb84
Signed-off-by: Todd Poynor <toddpoynor@google.com>
power_supply: Add custom property for USB High Current mode

For smb347.

Change-Id: I3323469072e1ee5085d61af8a89612b06b91f94a
Signed-off-by: Todd Poynor <toddpoynor@google.com>
power: smb347: Add USB High Current property

Change-Id: I83a9945fa9713b18de5c4f140f215f216b0bc87a
Signed-off-by: Todd Poynor <toddpoynor@google.com>
power: smb347: Use IRQF_ONESHOT for STAT interrupt

From code by HongMin Son <hongmin.son@samsung.com>

Change-Id: I87645392efceff9ea2d0edd5bb84a089ccbd4f86
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: HongMin Son <hongmin.son@samsung.com>
power: smb347 Handle charger source connect events

Undervoltage IRQs are signalled only on charger disconnect, not
connect.

* Update the comments to reflect this fact.
* Check for changed connected/disconnected status on any interrupt.

Change-Id: I4d542ae5fc94ce9386fdedc298dbc7d84a4e0d6b
Signed-off-by: Todd Poynor <toddpoynor@google.com>
power: smb347: update state if found changed on property get

If charger connect status is found changed while retreiving a
property, update the associated driver state and send a
power_supply_changed() for the supplies.  In case an interrupt
was not received for the connection status change.

Change-Id: I8b9fe09dd883bf6c9be6c95e89ea5b9281c8bc6d
Signed-off-by: Todd Poynor <toddpoynor@google.com>
power: smb347: Don't skip setting POWER_SUPPLY_PROP_USB_HC if offline

Avoids runtime errors.

Change-Id: I04e37ecf6b70d4ddccdc95084451becf0c074eb1
Signed-off-by: Todd Poynor <toddpoynor@google.com>
power: smb347: Make POWER_SUPPLY_PROP_USB_HC readable

Avoid runtime errors.

Change-Id: Ib48f179d97c3c5be33a8050423d6c6f549536eb4
Signed-off-by: Todd Poynor <toddpoynor@google.com>
net: wireless: bcmdhd: Update to version 1.28-5

- Fix static analysis error
- Fix UDP out of order issue (wlfc)
- Refactoring Packet filter and Vendor IE logic
- Change request information buffer size (MAC address, STA information)
- Fix kernel paic issue
- Fix Beacon update problem
- Fix Escan Result Parsing
- Fix Not able to associate with WEP Enable AP
- Fix deauth race condition
- Fix p2p issue of same channel concurrency

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
net: wireless: bcmdhd: Update wiphy bands on country and band change

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
usb: gadget: Fix usb string id allocation

Don't reset next_string_id every time the gadget is enabled, this makes
the next strings allocated overwrite strings allocated at probe time.
Instead, fix rndis not to allocate new string ids on every config bind.

Change-Id: Ied28ee416bb6f00c434c34176fe5b7f0dcb2b2d4
Signed-off-by: Benoit Goby <benoit@android.com>
sync: reorder sync_fence_release

Previously fence's pts were freed before the were the fence was removed from the
global fence list.  This led to a race with the debugfs support where it would
iterate over sync_pts that had been freed.

Change-Id: Ia3ddbf77de42ca593fc2dc353b5d04e42ddf3946
Signed-off-by: Erik Gilling <konkers@android.com>
sync: optimize fence merges

If the two fences being merged contain sync_pts from the same timeline,
those two pts will be collapsed into a single pt representing the latter
of the two.

Change-Id: Iced7ebb7e5a17a0c8b1a2969ba3388a4edb9ecaf
Signed-off-by: Erik Gilling <konkers@android.com>
net: wireless: bcmdhd: Add info_string param with driver/fw/chip info

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

Conflicts:

	drivers/net/wireless/bcmdhd/dhd_linux.c
power: smb347: Add platform data for reg vs. pin control of USB mode

USB5/1/HC or USB9/1.5/HC will be selected by pin if true, else
selected by register via POWER_SUPPLY_PROP_USB_HC.

Change-Id: Ib2aff319c0fbae36bc3f1bab1b2048a52741a579
Signed-off-by: Todd Poynor <toddpoynor@google.com>
power: power_supply: move POWER_SUPPLY_PROP_USB_HC to type 'int' order

Change-Id: I001af30ab5fe06dde5f368241f21b9e0864777a1
Signed-off-by: Todd Poynor <toddpoynor@google.com>
net: wireless: bcmdhd: Decrease chip recognition attempts to 3

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
power: power_supply: add POWER_SUPPLY_PROP_USB_OTG

Change-Id: Idfc6ef2e37d62aad6f26cc8eafa53db642cd352b
Signed-off-by: Todd Poynor <toddpoynor@google.com>
power: smb347: add POWER_SUPPLY_PROP_USB_OTG

Based on code from HongMin Son <hongmin.son@samsung.com>

Change-Id: I8b47ff41fb170aac60d1cbe5cf609fca72f8eb41
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: HongMin Son <hongmin.son@samsung.com>