gpio: pm8xxx-gpio: remove unnecessary checks in static callbacks

Remove the parameter checks in pm_gpio_get and pm_gpio_set
callbacks because they are not necessary as callbacks of gpiolib.
This also removes an issue of NULL pointer check is after being
dereferenced.

Change-Id: Iaca83877fe93ba6335d40c9a36465f909aef2c97
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
power: pm8921-bms: fix the mismatch of container_of member type

Use the correct member type 'struct delayed_work *', instead of
'struct work *', for the container 'struct pm8921_bms_chip *'.

Change-Id: Ifcc03472626916076c1d9a24d8f2dc2d6b61b0d2
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
usb: ks_bridge: Add support for multiple instance of driver

ks bridver needs to get loaded for two mdm9x15 device enumeration
to support flashless boot and efs sync.

Change-Id: I4316fe74a311a26042e60787cb0b27fcd2df3cb9
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>

Conflicts:
	drivers/usb/misc/ks_bridge.c
event_timer: Add spinlock protection to event time update

Modify call flow to allow only one thread to make the smp cross call in
order to setup the event timer. Added more concurrency protections.
This helps fix a kernel data abort , where the stack looks like

Unable to handle kernel NULL pointer dereference at virtual address 0000008
pgd = d833c000
[00000008] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT SMP ARM
Modules linked in: mwlan_aarp(PO)
CPU: 0    Tainted: P        W  O  (3.4.0-perf-gf36610b-dirty #3)
PC is at __rb_rotate_left+0xc/0x70
LR is at rb_insert_color+0x100/0x12c
pc : <c02400e8>    lr : <c02402c0>    psr: 00000093
sp : d7b4db58  ip : 00000000  fp : 400bf518
r10: c0e957b8  r9 : 0000047c  r8 : 00000000
r7 : c0dcc1fc  r6 : d8ed9900  r5 : d8ed9900  r4 : d8f55ac0
r3 : 00000000  r2 : d8f55ac0  r1 : c0dcc1fc  r0 : d8ed9900
Flags: nzcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c5787d  Table: 98d3c06a  DAC: 00000015

(__rb_rotate_left+0xc/0x70) from (rb_insert_color+0x100/0x12c)
(rb_insert_color+0x100/0x12c) from (timerqueue_add+0x8c/0xbc)
(timerqueue_add+0x8c/0xbc) from (create_timer_smp+0x58/0xb8)
(create_timer_smp+0x58/0xb8) from (smp_call_function_single+0xc8/0x1c8)
(smp_call_function_single+0xc8/0x1c8) (mdp_update_pm+0xa4/0xb0)

The kernel data abort was likely due to a double add meaning adding the
same node twice, serializing the smp cross call should help this issue.

CRs-fixed: 442891
Change-Id: I572550b75ca18cdccc474103d863e8a924bccbba
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
gpio: pm8xxx-gpio: change the license header from CAF to LF

Use the new license header with The Linux Foundation instead of CAF.

Change-Id: I73afbaf73ba47a7adf2b45f7f2c02fde330d2344
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
Merge "msm: 8064: add platform configuration for two external 9k modems"
media: dvb: mpq: Extend TSPPv1 plugin PID filtering capabilities

Extend the capabilities of the demux driver's TSPPv1 plugin to support
more than 16 PID filters using SW filtering.

Change-Id: Ic0eff5e94fa4cd6ec852a38f785cc5129726bffe
Signed-off-by: Liron Kuch <lkuch@codeaurora.org>

Conflicts:
	drivers/media/dvb/mpq/demux/mpq_dmx_plugin_tspp_v1.c
media: dvb: mpq: Fix race-condition in mutex locking

mpq_dmx_decoder_fullness_wait was called either from
dvb-demux or internally by the plug-in. In the first case
mutex should be locked before checking the video buffer while
in the second case it was called while the mutex was already
locked. Due to this the function checked whether the mutex is
already locked or not.

This check it not atomic, if the function is called by dvb-demux
while the mutex is un-locked, after this check it is possible
to have a context-switch and the mutex gets locked by other API
functions of the plug-in, which could lead to dead-lock or
invalid states.

Change-Id: I32ce4aa3ee7a93c1a8a4fda1d0f916e65eab11ce
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>

Conflicts:
	drivers/media/dvb/mpq/demux/mpq_dmx_plugin_common.c
media: dvb: Fix PID removal from a filter

When removing a PID from a filter, the dmxdev_feed representing this PID
should be removed from the list of the filter's feeds, and its memory
should be freed.

Change-Id: I8e9f2d69e9c6a907eb6be2d07429e3448ad4e547
Signed-off-by: Liron Kuch <lkuch@codeaurora.org>
msm: adsprpc: RPC driver between apps and adsp

The driver implements an IPC (Inter-Processor) communication
mechanism that allows for clients to make remote method
invocations across processor boundary.

Change-Id: Ia9eb9bc69c64c785b040e24ee36a4f416ab49355
Acked-by: Sathish Ambley <sambley@qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm: adsprpc: include msm-specific ion header file

Due to a recent upgrade to the ion framework, all ion clients that are
using msm-specific ion features (such as ION_AUDIO_HEAP_ID) should be
using linux/msm_ion.h instead of linux/ion.h.

Change-Id: I90cd2cefa3a55c039f9cdd20c45503c47a0145eb
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm: adsprpc: Incorporate coding style comments

Remove goto statements to bail out from inside the macro
and unnecessary defines. Cleanup on module init failure.

Change-Id: I01885a9fa37283d77e1b6735decd2f639ae4d4b3
Acked-by: Sathish Ambley <sambley@qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm: Move adsprpc into drivers

Move RPC driver that allows for clients to make remote
invocation calls between apps and adsp into drivers.

Change-Id: I045da6163968066c954f448572c94a133181e1f4
Acked-by: Sathish Ambley <sambley@qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm: adsprpc: Update to retrieve the physical address for ION buffer

Use follow_pfn() to obtain the physical address of ION carve
out buffers instead of directly referencing them from vma
structure.

Change-Id: I4c144a25bc579c77fefebe43f8d4d0a9bb568bfe
Acked-by: Sathish Ambley <sambley@qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm: adsprpc: Allow zero length buffer

Initialize the arguments being passed to account for zero
length buffer being passed and not invoke flush routines
in these cases.

Change-Id: Ic6b3418f05ea3ca46e7ca758ebbd0a7bda987b51
Acked-by: Sathish Ambley <sambley@qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm_serial_hs: consider flush buffer request only when DMA is in progress

TTY Core uses flush_buffer to clear out any output data before closing
port, whereas UART application can always request to do flush output data
before starting data transfer using tty supported ioctl().
receive_tty_flush is used to make decision on completion of any DMA Tx
data transfer. Using same approach when there is no DMA Tx transfer is
happening, it is breaking next DMA Tx transfer functionality. Hence
update receive_tty_flush only when there is any DMA TX transfer active.

(cherry picked from commit 53069734628ebce341cf1ef778c91dbcbbcf67db)

Change-Id: I26f4ceece422674e1f7647e5dfadb476cec1ef92
CRs-Fixed: 438057
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
msm: subsystem_restart: Use a CPU intensive workqueue for SSR

Using the default workqueue settings can result in the SSR
work item blocking the watchdog petting function. To avoid
this, schedule the SSR work on a workqueue that has the
WQ_CPU_INTENSIVE flag set. This will prevent any work item
posted to the workqueue from blocking other work items
posted by other drivers in the system, including the watchdog
pet work item.

Change-Id: I159f8c5aba9ff3b40f61bdb101f266436bd2c9bc
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/subsystem_restart.c
msm: subsystem_restart: Remove customer specific code

Delete customer specific code in the subsystem restart
driver.

Change-Id: I6654e986dd67f0f578a71c88a142c565985f5183
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/subsystem_restart.c
Revert "mako: debug: disable lge_crash_handler"

This reverts commit 04e394381f9ec925d203c541d6dd02c55bae45a3.

Change-Id: I5711385d009b49504e23e592f8e8fdc68261d82c
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
msm: subsystem_restart: Panic on SSR errors

Don't just warn when SSR operations such as powerup
or shutdown fail. Panic the device so that failure-point
analysis is possible.

Change-Id: I09a5ca37d8a7cfaa8fd7ed7025711c6467c20e84
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>