Slimbus: Inline a function to avoid multiple definition error

Compilation error(multiple definitons of function) happens
with slim_register_board_info function when CONFIG_SLIMBUS
flag is disabled.
In this patch slim_register_board_info function in slimbus.h
file is modified to static inline to resolve the issue.

CRs-fixed: 529039
Change-Id: I083062670139ae830dde9b0bc82c72febdf3271c
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
mmc: cd-gpio: Add sanity checks in mmc_cd_gpio_free()

Add necessary sanity checks in mmc_cd_gpio_free() to fix
below warning:

[    5.856209] WARNING: at
local/mnt/workspace/builds/jb2/kernel/kernel/irq/manage.c:1219
__free_irq+0x88/0x1a8()
[    5.856215] Trying to free already-free IRQ 0
[    5.856219] Modules linked in:
[    5.856239] [<c010be94>] (unwind_backtrace+0x0/0x11c) from [<c0190f38>]
(warn_slowpath_common+0x4c/0x64)

CRs-fixed: 564084
Change-Id: Ia9ea0e82453e645ce44046a762cd78aeb544e8b1
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
wcnss: Download NV during SSR

If CAL data is already available, then based on the intial design it is
belived that only CAL needs to be downloaded to WCNSS during SSR.
However that design was incorrect, FW always needs the NV after a
reset. So download NV (and CAL if available) during SSR.

Change-Id: I624d40ac3e195997c9638f62fcdb0e88f0cc749e
CRs-Fixed: 557561
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
radio: iris: Add NULL pointer check

Dereferencing a NULL pointer may cause kernel crash,
Check for NULL pointer before dereferencing.

Change-Id: I43b1aa8054646f29833f82b7203192aa3494d912
CRs-Fixed: 548404
Signed-off-by: Ayaz Ahmad <aahmad@codeaurora.org>
msm:Camera: Fix Power leak with sp1628 camera sensor

Instead of hard code to  GPIOF_OUT_INIT_LOW .
make use of power setting config value
for sensor power down.

Change-Id: Ib1037af550541b16be1f57c1145d83ea8bce4a27
Signed-off-by: Praveen Ac <praveenac@codeaurora.org>
ASoC: wcd9xxx: Do not use current source if micbias is already enabled

Some targets share the same micbias for handset mic and headset mic.
When any recording is in progress from handset mic and if headset
is inserted, we shouldn't be using current source for the detection
as the micbias is already enabled. Check if micbias is already enabled
or not and if it is already enabled, detect the headset insertion using
micbias not with current source.

Change-Id: I269c2320ed735fa07f6b77ebffe4d2a1a8163da9
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
msm: ADSPRPC: Use module specific class name

Update the class name passed during class creation to match the module
rather than use a generic one. If another driver uses this same generic
name then the class creation would fail.

Change-Id: I33d7527e27c56fd943c93f823d99d244e2348319
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
msm: ADSPRPC: Add checks for erroneous values

Check for invalid parameters passed in user invocation
and validate the return values using appropriate macros.

Change-Id: If529873d025ac0c13725efbedda5a58fae327722
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
power: qpnp-bms: fake a more accurate OCV at end of charge

When the bms is notified of end of charge, it fakes a high OCV in order
to report 100%. The high OCV used is the max voltage design for the
battery. However, that is not what should be used as the high OCV, since
the max voltage design corresponds to an over charged battery if used as
an OCV.

This can cause an issue with the correcting algorithm. When the BMS
driver finds that it needs to correct SOC downwards, it must do so by
lowering the OCV to correspond with a lower remaining charge. However,
since the battery profile does not start at max voltage design for 100%,
the BMS driver must correct about 25-30mV before it even starts
affecting SoC. This can create issues with meeting the cutoff voltage at
low SoCs.

Instead, look up the OCV for 100% charge and use that for the faked OCV.

Change-Id: I5ee3ab99098c3bf3354a4af792f2c5ff91aa60ed
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
power: qpnp-bms: increase the high soc adjust threshold to 98

Previously, the BMS driver does not allow OCV corrections when SoC
is above 90. This is because the BMS driver could accidentally pull
down a faked high OCV at end of charge and cause a bad user experience.
However, now that a check was added to make sure estimated SoC is below
15%, we do not need this check any more, since if estimated SoC is below
15%, we always want to correct anyways.

Raise the threshold from 90 to 98 to fix this issue and always correct
when SoC is below 98 and soc_est is below 15.

Change-Id: Ia26c040c6a5aec9a7245c3e13a0beb70309d34c3
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
msm: camera: Avoid uninitialized data copy to userspace

Add proper intialization to avoid invalid access in
userspace.

CRs-fixed: 552359
Change-Id: Iea1d6684fb4b061f7ab51945f15387b7f686ccf3
Signed-off-by: Deepak Cherian <dcheri@codeaurora.org>
msm: qdsp6v2: Deleting kernel driver from arch/arm/mach-msm

Drivers are registering under misc driver but exists under arch/arm/mach

Change-Id: I6210ed2ffbc38608914fb765b8e50ac6d97950ff
CRs-Fixed: 554492
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
msm: clock: Add parent fields to gcc_ce1_clk and gcc_ce2_clk

The votable CE core clocks should be linked up to their
parents. Add the parent fields to these clocks for
MSM8974, MSM8226, and MSM8610.

CRs-Fixed: 572028
Change-Id: Ia5567b2832cdb97f08052017d314f00dbdd41133
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
kernel: rng: Add IOCTL support to disable bus bandwidth

QRNG bus scale is set to high before qrng_read & set to
low after qrng_read, this impacts the performance during
boot-up, as there are various clients using qrng during
bootup. Inorder to fix this problem, a daemon is introduced
which calls into kernel module (that sets low bandwidth).
This change supports the IOCTL call to disable the bus bandwidth.

Change-Id: I386d1eb4c50c057ae2852e7f9d47c8db8e522ca5
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
msm: vidc: Support s3d framepacking payload information

This change exposes s3d framepacking payload information
to userspace which client can use for display purpose.

Change-Id: I87daaad41e08ef19be96a86fd21e70a320b8c1e4
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
kernel: rng: Change master id to 54 in rng vector

This fix prevents BKE Limiter from activating during boot due to
rng.

CRs-Fixed: 570296
Change-Id: Ie52f02a4af9cd824533e80ae3722496d09497529
Signed-off-by: Liam Fernandez <liam@codeaurora.org>
ASoC: wcd9xxx: Correct handling of RC Oscillator

RC oscillator is not disabled properly which is
effecting recording through handset.Correct handling
RC oscillator

Change-Id: I9df292ec8c34ec6a2f514e492adff8eb751ac7f3
Signed-off-by: Yeleswarapu, Nagaradhesh <nagaradh@codeaurora.org>
wcnss: Add support for WCNSS build version

WCNSS build version is now exchanged thru WCNSS control channel.

CRs-Fixed: 567573
Change-Id: I22bbf67b681fadc78bf8c4f256cdea8c9115ca61
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
Soc: msm: qdsp6v2: Fix invalid params handling

when ion_import_legacy api fails then we should not
call ion_free as the handle returned is not proper to
dereference so instead just destroy the ion client and
bail out.Sanity checks for all the input params is also
added.

Change-Id: I6c51986bf2ce334ff7405e38a12c1c1db50e2417
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
mmc: core: disable runtime-pm if MMC_CAP2_CORE_RUNTIME_PM is not defined

There is currently no mechanism to disable the runtime-pm
of eMMC/SD card. This patch adds the mechanism to disable
runtime-pm of eMMC/SD if MMC_CAP2_CORE_RUNTIME_PM is not
defined.

It sets the platform, class and card device as RPM_ACTIVE
irrespective of the capability but doesn't enable it.
The card is never runtime-suspended and hence the
corresponding mmc_host and platform device are not
runtime-suspended as well.

A capability MMC_CAP2_CORE_PM is used to select the use
of core power-management framework.

CRs-Fixed: 490021
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Change-Id: I394a81a889ab7d4f0f0e6fe4b932630e30fc16c9