irq: enable suspended EARLY_RESUME irqs forcefully if not resumed

When system enters into suspend, it disable all irqs in single
function call. This disables EARLY_RESUME irqs also along with
normal irqs.

The EARLY_RESUME irqs get enabled in sys_core_ops->resume and
non-EARLY_RESUME irqs get enabled in normal system resume path.

When suspend_noirq failed or suspend is aborted for any reason,
the EARLY_RESUME irqs do not get enabled as sys_core_ops->resume()
call did not happen. It only enables the non-EARLY_RESUME irqs in normal
system resume path. This makes the EARLY_RESUME irqs interrupt to be
disable for remaining life of system.

Add checks on normal irq_resume() whether EARLY_RESUME irqs have been
enabled or not and if not then enable it forcefully.

bug 1282448

Change-Id: I7ffffd725675ca635310eb4913a1f885d2e42e37
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/235000
Reviewed-by: Thomas Cherry <tcherry@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Mark Kuo <mkuo@nvidia.com>
rtc: max77663: fix alarm reading bug

When reading alarm of RTC-max77663, it didn't set alrm->enabled correctly,
if irq is masked, means disable alarm, alrm->enabled should be set to 0,
else it should be 1.

Change-Id: Id0b1ffd9a816643712f33624d7d52cbe7b66b3c3
Signed-off-by: Daniel Fu <danifu@nvidia.com>
Reviewed-on: http://git-master/r/129593
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
arm: tegra: fb: Update fix line_length

Update framebuffer's fix line_length parameter when changing
video mode dynamically.The new line_length should be according
to new x resolution. On addition, check the return value from
dc driver while setting a mode.

Bug 1163682
Bug 1056767
Bug 1056782
Signed-off-by: Shashank Sharma <shashanks@nvidia.com>
Change-Id: Ib0ab48474f0af3235556a7f7f0d8354af3b50994
Reviewed-on: http://git-master/r/147511
(cherry picked from commit 5856c4afde9459ba6afaf2cdcb07361d9fbf8c79)
Reviewed-on: http://git-master/r/160788
Tested-by: Matthew Pedro <mapedro@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User

Conflicts:
	drivers/video/tegra/fb.c
usb: otg: tegra: Do not free platform data twice

when platform device is unregistered, the call to platform_device_release()
will kfree the platform data. Hence do not free the platform data again.

Bug 1209618

Change-Id: Ied67f550223ec199da4bc8e38a12e7ee94c2d98a
Signed-off-by: Preetham Chandru R <pchandru@nvidia.com>
Reviewed-on: http://git-master/r/187806
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Kiran Adduri <kadduri@nvidia.com>
Reviewed-by: Rakesh Bodla <rbodla@nvidia.com>
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
cpufreq: refactor GPU overclocking
arm: tegra: remove unused function
video: tegra: host: add 3dfs user space control

Additional sysfs nodes user and freq_request may be used to control
gpu frequency. If user is set to non-zero, the value of freq_request
is used for setting the gpu frequency. freq_request is initialized to
the max gpu frequency.

Bug 1161410

Change-Id: I4065397450fd8774fbe7715145ab481698d41929
Signed-off-by: Ilan Aelion <iaelion@nvidia.com>
Reviewed-on: http://git-master/r/#change,165100
(cherry picked from commit 3668de9c7b71634a8f2afdada1b8c381c07a9bc4)
Reviewed-on: http://git-master/r/199922
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

Conflicts:
	drivers/video/tegra/host/gr3d/pod_scaling.c
video: tegra: host: always update 3dfs status

Always update 3dfs dev_status whether scaling is enabled or
disabled

Bug 1242049

Change-Id: Ifb2b9b3ee4134697aefbd99ff8234399770df0b4
Signed-off-by: Samuel Russell <samuelr@nvidia.com>
Reviewed-on: http://git-master/r/208953
(cherry picked from commit 4bfd0e76b36fdf3e88cedc5604af172695b5508b)
Reviewed-on: http://git-master/r/208981
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
video: tegra: host: reset enable flag before updating status

- whenever userspace disables 3d scaling via
echo 0 > enable_3d_scaling, it results into calling
podgov_enable which calls update_devfreq to set the
max frequency for a SOC
- update_devfreq ends up calling gov->get_target_freq
whose implementation checks if scaling is enabled or not
- if it is NOT enabled then it returns the max frequency
for that SOC
- however, since enable flag was made = 0 after updating
the dev-freq, it might end up giving away < max freq value

bug 1242049

Change-Id: I1fe9498ca0c8403f76047442d8e8f478d22dbeb6
Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-on: http://git-master/r/215067
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
devfreq: fixups and back porting pod_scaling changes
cpufreq:GPU OC hack to alow it to scale properly after OC

After OC it will only scale to first highest freq >= 416
so we are setting freq before last one to be smaller then that
That is most probaly because podgov/defreq are creating tables at init
and are not updated after.
apds990x: setting near value to be 0

this should fix proximity problems acording to Rudjgaard research
So thanks to him for that
Revert "cpufreq: added proper interactive"

This reverts commit e6798282267aba4b6fee6e0aaafe4e10813758d6.
cpuquiet: Adding runnable thread knobs

Ported the knobs that select runnable thread profiles from autohotplug
into cpuquiet.

Change-Id: I6858731e238404d33c772767d066cd6d467267a8
Signed-off-by: Xiao Bo Zhao <xiaoboz@nvidia.com>
Reviewed-on: http://git-master/r/123852
Reviewed-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Tested-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>

Conflicts:
	drivers/cpuquiet/governors/balanced.c
net: wireless: bcmdhd: Update to version 1.61.46

Change-Id: If4a49dc98aea9b505aa00575b49b4df9491fa0d4
Signed-off-by: Kyunghoe Kim <kyunghoe.kim@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>

Conflicts:
	drivers/net/wireless/bcmdhd/src/bcmsdio/sys/bcmsdh_sdmmc_linux.c
	drivers/net/wireless/bcmdhd/src/dhd/sys/dhd_custom_gpio.c
	drivers/net/wireless/bcmdhd/src/dhd/sys/dhd_linux.c
	drivers/net/wireless/bcmdhd/src/wl/sys/wl_android.c
	drivers/net/wireless/bcmdhd/src/wl/sys/wl_cfg80211.c
	drivers/net/wireless/bcmdhd/src/wl/sys/wl_cfgp2p.c
net: wireless: bcmdhd: configurable for builtin driver

If you use the builtin driver for bcm4335, you should build
with 'ENABLE_INSMOD_NO_FW_LOAD'

Change-Id: I837ef0c8a01e16c32004fa3f351abf77a6a9f580
Signed-off-by: Devin Kim <dojip.kim@lge.com>
net: wireless: bcmdhd: Fix the panic when using tethering with builtin

This is a temprary workaround for panic when using tethering with builtin
driver. This fix is just avoding the panic. We need a proper fix for this
issue.

Change-Id: I0dc38379b45f02d747993ac30dacc7f4e4248e40
Signed-off-by: Devin Kim <dojip.kim@lge.com>
net: wireless: bcmdhd: enable custom MAC

- enable random MAC addr. and persist MAC addr.

Change-Id: I5ddedce7940fc4e59991994f4b6833fb29a933e2
Signed-off-by: Kyunghoe Kim <kyunghoe.kim@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
net: wireless: bcmdhd: Update to Version 1.88.10

Change-Id: I0e41b9af42120286b99d23acdf52fd19997a267e
Signed-off-by: Kyunghoe Kim <kyunghoe.kim@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>

Conflicts:
	drivers/net/wireless/bcmdhd/bcmsdh_sdmmc_linux.c
net: wireless: bcmdhd: Update to version 1.88.21

- Add BCM4339 support

Change-Id: I1ae05bc03ac8ef6f8babcdaa808b13cd0d31baea
Signed-off-by: kyunghoe.kim <kyunghoe.kim@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>