power: max17040: do a sanity check in the fuel alert handler

Some max1704x devices have been seen to issue a bogus fuel alert.
When this happens, we sanity check the capacity value to make sure
that it is not a transient condition.

Added some more verbose logging when this condition occurs.

Change-Id: I537fb81ab2521469f53ee1ce6b4c16e255128dbe
Signed-off-by: Dima Zavin <dima@android.com>
net: wireless: bcmdhd: Fix scan crash in ibss mode

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

Conflicts:

	drivers/net/wireless/bcmdhd/wl_cfg80211.c
net: wireless: bcmdhd: Fix proper scan command even if request is NULL

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

Conflicts:

	drivers/net/wireless/bcmdhd/wl_cfg80211.c
usb: musb: Add a BUG_ON if trying to suspend musb in B_IDLE state

Musb sometimes failes to be suspended because it is active and in the
B_IDLE state. When this happens, USBPHY is left on and we don't hit OFF
mode. Add a BUG_ON to reboot in that case as it is better than emptying
the battery and so that we can see how often this happens.

Change-Id: Ic8d8c6918f3b9a8f0671f484d5d72fae63d7a61d
Signed-off-by: Benoit Goby <benoit@android.com>
usb: musb: Change BUG_ON to BUG to catch the issue as soon as it happens

Bug: 5696789

Change-Id: I660025d8632076cc6bf81cc7026677e7c1bca6d3
Signed-off-by: Benoit Goby <benoit@android.com>
misc: modem_if: link_mipi: Reset mipi phy when receive wrong packet

1. use mipi sw reset after get wrong packet for recovery.

Bug: 5852314
Change-Id: I8cd0ba82d913777d82a59284a657b42e318635ae
Signed-off-by: wonhee <wonhee48.seo@samsung.com>
ASoC: dsp - BE disconnection after pending flag is clear

Currently we can disconnect a BE and have its update flag incorrectly
set after reparenting. Fix this so we always clear the update flag
before any disconnections and reparenting.

dsp_run_update_startup() also called disconnect but this was always
called anyway by its caller soc_dsp_runtime_update() before the update
flag was cleared.

Change-Id: If0cde4c9df845a7189188bb49e6fb4fd496a925d
Signed-off-by: Liam Girdwood <lrg@ti.com>

Conflicts:

	sound/soc/soc-dsp.c
ASoC: DSP: Split runtime startup/shutdown updates

A FE->BE-1 link can transition to FE->BE-2 in a single widget/kcontrol
change (e.g. Muxes). Currently, DSP framework searches for new and old
paths of the FE, and then perform the startup/shutdown runtime updates.
The single-step FE->BE-1 to FE->BE-2 transition has both: new and old
paths to be updated, hence BE-1 and BE-2 will be marked for runtime
update. However, startup and shutdown updates will both be performed
on BE-1 and BE-2, which is incorect as it would be expected to run
startup update on BE-2 and shutdown update on BE-1.

In order to handle these scenarios, the path search (new and old) is
performed along with its runtime update (startup and shutdown).

Change-Id: I5a687d6fcc51a968d9b0ae52d749935a92f00ef7
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Liam Girdwood <lrg@ti.com>
misc: fsa9480: don't enable FSA IRQ when VBUS IRQ is enabled

We should never enable two detection IRQs inside the FSA9480
driver, otherwise we can get into a situation where we enable
the FSA IRQ multiple times. One way this can happen is if the
FSA IRQ fires when the VBUS IRQ is enabled and we end up
redetecting the same state (i.e. AV_365K_CHARGER).

Change-Id: Iefcf71c88451056b2be318284b0eadc16997e6d9
Signed-off-by: Simon Wilson <simonwilson@google.com>
omap4: tuna: Drop soft lockup detector timeout to 10 secs

To trigger prior to watchdog timer.

Change-Id: Ia9197b57ef0a288b554f2879f180d71334c65565
Signed-off-by: Todd Poynor <toddpoynor@google.com>

Conflicts:

	arch/arm/configs/tuna_defconfig
Revert "mmc: Set suspend/resume bus operations if CONFIG_PM_RUNTIME is used"

This reverts commit e00d9bd8bba52a3cf4a4b52b21eb368f9509e7e8.
We are reverting this change to see if it clears up some filesystem
corruption we are seeing.

Change-Id: Ie42adda2128e8c73f83af2f17dea90c32c21f564
Signed-off-by: Ken Sumrall <ksumrall@android.com>
Revert "proc: enable writing to /proc/pid/mem"

This reverts commit 198214a7ee50375fa71a65e518341980cfd4b2f0.

Conflicts:

	fs/proc/base.c
usb: musb: Disable SESSREQ and VBUSERROR interrupts

Disable the SESSREQ and VBUSERROR interrupts since we don't use them.
if we receive them, the otg state machine will enter a state where it
prevents suspend.

Bug: 5696789
Change-Id: I8cb4824056230c33fee9e810c19f5557fa2840c9
Signed-off-by: Benoit Goby <benoit@android.com>
Revert "usb: musb: Add a BUG_ON if trying to suspend musb in B_IDLE state"

This reverts commit 8ebb62bd38adcbef29a457a064f61c1d9bb5526c.
TWL6030: Add extra debugging around rtc and waking

This adds during:
 - setting/reading the RTC Alarm (once or twice a minute)
 - wake IRQ checking during suspend (each time the device suspends).

Even in case of an RTC alarm failure it will not spam the logs.

Change-Id: Ic3a19f6828777edbc3cd330fc8e874fe95c4e7d5
Signed-off-by: JP Abgrall <jpa@google.com>
ASoC: Tuna: Reduce S/PDIF power down time

Reduce S/PDIF pmdown_time in order to prevent S/PDIF's power-down
to affect audio paths that ignore suspend during voice call.

Change-Id: I5fe32ed315e3bdbffb995a400646871fb4bcdf1c
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Revert "Revert "mmc: Set suspend/resume bus operations if CONFIG_PM_RUNTIME is used""

This reverts commit 3ace7831ab80ee38d3d387337ed4e20f98cd53a0.

Change-Id: I1afd0e0c09812619b2f4e1c472ccc65c58e712e3
Signed-off-by: Todd Poynor <toddpoynor@google.com>
ARM: omap4: tuna: Add panel configration for SM2A2 Line support.

change list.
 -. SM2A2 Panel Id value is '0xA2'.
 -. Add factory info for SM2A2 line panel.
 -. Add panel data for SM2A2.

Change-Id: I82addbf29bab4533845caf632676592d11d9950d
Signed-off-by: swin.kim <swin.kim@samsung.com>
DEBUG: rtc: twl: add register dump if RTC did not fire on time

If on waking up from suspend, we can expect an ALARM event. However,
in such a scenario, if RTC current time is greater than alarm time +
60 seconds, it could indicate an missed event notification to
users of twl rtc, so dump registers to provide better debug
information.

Change-Id: If89a92b147857ef23726d1eabfe36939e8371779
Signed-off-by: Nishanth Menon <nm@ti.com>
OMAP4: HSI: Fix for back to back CAWAKE interrupts

If a CAWAKE interrupt occurs while previous CAWAKE is still being
processed, the end of first CAWAKE processing will clear interrupt
status bit for 1st CAWAKE interrupt, but also for second interrupt.
So 2nd CAWAKE interrupt is missed.

Added a backup CAWAKE interrupt (HSI_Pp_M_IRQrU_STATUS.HSR_WAKE) to take over
the regular CAWAKE interrupt ((HSI_Pp_M_IRQr_STATUS.HSR_WAKE) while it is being
processed.
This CAWAKE backup interrupt will catch the second interrupt if it occurs.
It guaranty we don't miss a CAWAKE interrupt while clearing the previous
regular one.

Bug: 5956850
Change-Id: I915cb9ec555cf4bc6deab3d5ddfb592dce7bfa24
Signed-off-by: Djamil Elaidi <d-elaidi@ti.com>
Reported-by: Cedric Poignet <a0919860@ti.com>
Signed-off-by: wonhee <wonhee48.seo@samsung.com>

Conflicts:

	drivers/omap_hsi/hsi_driver_int.c