msm: mdss: move MDSS revision macros to /linux/msm_mdp.h

Currently kernel driver and user mode libraries keep their own
copies of HW revision numbers. This strategy is prone to errors
and usually frowned upon. Fix this by moving revision information
to sanitized header which is shared by kernel drivers and user mode
libraries.

Change-Id: I59d1256ffd98e07f4ef9ae2b534f04b67abd2119
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
msm: mdss: MDP clock optimization for single layer video playback

MDP core clock bumping is not required for single layer video
playback in 8x26 targets. Hence add revision check to avoid fudge
factor.

Change-Id: I1b0ccb4ef50514f705845b0218fa6ca0d28c1779
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
msm: mdss: Fix mdp clock rate assignment when apply fudge is false

When apply fudge is false, currently mdp clock rate can take
garbage values, hence assign the calculated clock rate without
applying any fudge factors.

Change-Id: I7c9d34024ab94b05160b50560ab136c0c8b7781d
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
wcnss: Configure WLAN MAC addr through user control interface

wcnss userspace service will use user control interface to configure
certain parameters required by wcnss driver. This interface is required
to configure the WLAN MAC address. These parameter was earlier written
thru module parameters from wcnss service, however that required the
wcnss userspace daemon to have the root permission.

Change-Id: I6e928a44c7f1f9ba7ab193c882bad102d8c2bd5a
CRs-fixed: 636953
Signed-off-by: Hardik Kantilal Patel <hkpatel@codeaurora.org>
msm: thermal: Handle zone ID and tsens ID to fetch temperature

Add a function, which can handle zone and tsens ID and get
current temperature.

Change-Id: I685852e8571c0609a32b0ce982ae70d0b59443fd
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
msm: camera2: cpp: Remove the reinstallation of cpp_timer

when msm_cpp_do_timeout_work is running, it's possible that the
cpp_timer is pending again. So if we setup this timer in the work
again, it will initialize the timer list entry without any
synchronization. If other context is accessing the global timer
list, it will found one of the node being corrupted. And finally
system crashes. Actually we don't need to reinstall the timer
because the callback function and private data don't change at all.

Change-Id: I51ba8a0a4e575af6b9f2816245e4c5f4a1d99fd1
CRs-Fixed: 637802
Signed-off-by: Figo Wang <figow@codeaurora.org>
input: sensors: fix accelerometer output data rate issue

Accelerometer data output rate is limited by device ODR register,
no need to configure this register in polling mode.

CRs-Fixed: 641705
Change-Id: If59900b244b31f813dd17e72b19c7fd2ca4b4ba1
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Slim_ngd: Don't create the device node per SSR

Observe the device crash due to the device node
gets created per ADSP SSR when the logical address
query succeeds at the first attempt.
This patch makes sure that the device node creation
happened only once  by declaring another variable to
track the logical address retry.

CRs-Fixed: 640381
Change-Id: I3d947fcbc575af7cb431255772aa9cb64d2df6b6
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
qseecom: Validate pointer offset in qseecom_send_modfd_cmd

Validate cmd_req_buf pointer offset in qseecom_send_modfy_cmd, and
make sure cmd buffer address to be within shared bufffer.

Change-Id: I431511a92ab2cccbc2daebc0cf76cc3872689a97
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
ARM: dts: msm: Add num fabrics to the msm8226 target

Add the number of fabrics present to the msm8226 device tree file. Use
this propoerty instead of APIs in code to determine the target type to
arrive at the number of bus fabrics present.

CRs-Fixed: 642345
Change-Id: I299d735b3c37c583b29a5cdb13367af42ccf8cea
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
Revert "msm: kgsl: Flush TLB when mapping to IOMMU pagetable".

This reverts commit c97c1550893922a442e771c769df3c78b079874a

Change-Id: I40680faddf751a276cacfbfd551cf371b9909bf1
Signed-off-by: Abhishek Ranjan <aranja@codeaurora.org>
Revert "msm: kgsl: Add new API's to track device mutex owner".

This reverts commit 62d17154dcb2ce1d417a80cea24b6a3875cbf935

Change-Id: Ia8f5f97ac851ec65dfbafe674e520d7bf69d8e83
Signed-off-by: Abhishek Ranjan <aranja@codeaurora.org>
msm: kgsl: Add new API's to track device mutex owner.

Add new API's kgsl_mutex_lock/unlock to track device mutex owner.
Mutex owner is an atomic variable and all operations set/clear on
it are also atomic to avoid any race conditions.

If a thread tries to acquire the mutex using new API, try to acquire
the mutex only if mutex owner is not same as current thread. This is
to prevent deadlocks which can happen if a thread tries to acquire
mutex with mutex held.

Change-Id: I743c95e1b86e7994a5a4d87727a8eb122fc05677
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Abhishek Ranjan <aranja@codeaurora.org>
msm: kgsl: Flush TLB when mapping to IOMMU pagetable.

Flush TLB when mapping to IOMMU pagetable, this is a requirement
for current IOMMU hardware.

Change-Id: I0fa5e108fedb3828b9b70eb82ab354f1a21db76c
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Abhishek Ranjan <aranja@codeaurora.org>
Merge "net: flow_dissector: fail on evil iph->ihl"
Merge "ARM: dts: msm: Add num fabrics to the msm8226 target"
Merge "qseecom: Validate pointer offset in qseecom_send_modfd_cmd"
Merge "Merge "qseecom: Validate pointer offset in qseecom_send_modfd_cmd""
power: core: add set_voltage_limit API

Add the power_supply_set_voltage_limit API which
allows the POWER_SUPPLY_PROP_VOLTAGE_MAX property
to be configured for a given power supply.

CRs-Fixed: 637169
Change-Id: Ib525366ff742ad31d81ffee75920c19a6f9e8de8
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
power: qpnp-charger: take into account charge path priority

On the SMBB peripheral there is a possibility of having
both the USB and DC input being connected at the same time.
In this situation there is a requirement to be able to communicate
to userspace services that the higher priority input was
inserted so appropriate action can be taken.

This is achieved as follows:

1. If DC has the higher priority, the USB input
current limit will be reduced to 100 mA to avoid
charging from the USB path.

2. If USB has priority the DC input current
limit will be reduced to 100 mA to avoid charging
from the DC path.

3. Upon the removal of the priority charge path
the secondary charge path input current limit
will be restored to allow charging.

CRs-Fixed: 637169
Change-Id: Id5b61103b9f1d8f32ffd707d2512972c1a310108
Signed-off-by: David Keitel <dkeitel@codeaurora.org>