ASoC: msm: qdsp6v2: Ignore unexpected events from dsp

If dsp responds with an unexpected event, audio driver
should ignore the response and continue. Change removes
the BUG_ON and handles error gracefully.

Change-Id: Ie7bbf1ea9b47630dae38e89887e53883f8f1dc12
CRs-fixed: 512784
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
ARM: dts: msm: set the pm8941 charging resume SoC to 99%

Add the charging resume property and set it to 99%. This makes the
charger driver resume charging when state of charge is 99% or below.

Change-Id: I9228990be5207aef4d97463756a86e3024f4dfb1
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
msm: smcmod: Added ioctl to decrypt PIL segment images

The new proposed ioctl will be used to decrypt images during
Google OTA update from recovery mode. It makes a request to
secure world and receives a response with status. The
decryption is executed by secure world code.

Change-Id: I667ec5f7918f271f82c1942c21f09bf3e932e874
Signed-off-by: Stanimir Varbanov <svarba@codeaurora.org>
msm: smcmod: Remove the driver dependancy to FSM9xxx

The smcmod driver will be used on MSM targets to communicate with
secure world. To make possible building of the driver on MSM targets
remove the depends on FSM9xxx from Kconfig.

Change-Id: I721d791f64d1dd48bc7264b9af545afb8818ef56
Signed-off-by: Stanimir Varbanov <svarba@codeaurora.org>
cache_erp: Use seq_printf and modernize procfs code

In future kernels create_proc_entry() is going to be removed.
Let's modernize this code and use regular file operations and
seq_printf() to avoid experiencing compilation problems in future
kernels.

Change-Id: Ifc11287a8aefa8b2af3fb7d68fd96c1db8f2f098
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
ARM: vfpmodule: Move bounce stats file to seq_file and friends

In future kernels create_proc_entry() is going to be removed.
Let's modernize this code and use regular file operations and
seq_printf() to avoid experiencing compilation problems in future
kernels.

Change-Id: Ie53663e099ff72a3eec84df7c3f77e15c0e539be
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: clock: Fix list rate to handle rate > LONG_MAX

While at it, also convert the list_rate return type from int to long to be
consistent with the rest of the ops.

Change-Id: Ib5bc230d82472d17ddcc99956cb6f10ff21df5ff
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
msm: clock-rpm: Remove the factor field from struct rpm_clk

The factor field was introduced for QDSS clocks to set a rate of
0, 1, 2. The rate for other RPM clocks is set in Hz. The factor
would determine the divisor applied to a rate before sending it
over to the RPM. In order to remove this extra complexity (factor
field), the QDSS driver is made to set rates of 0, 1000, 2000.

Change-Id: I722c32e7c66e16b62d4cf31eb865a80b4a7f3922
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
mdss: hdmi: Dynamic Audio re-configuration

This change allows audio driver to change the audio configuration
dynamically without bother HDCP link and video configurations.

Change-Id: I34af3a9070d29a3ea3ebad7196ca24765fcf6152
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>

Conflicts:
	sound/soc/codecs/msm_hdmi_codec_rx.c
msm: mpm-of: Remove explicit freeing managed resources

The platform model takes care of free'ing managed resources when probe
fails. Remove explicit calls to free managed resources. This will ensure
that all mananged resources are handled correclty by the platform
device framework.

Change-Id: I6062b1dab55c468ee224f0ca7c8e47631a1ff3c7
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
msm: cpufreq: Ensure cpufreq change happens on corresponding CPU

Checking the cpus_allowed mask of the current thread before changing the
frequency doesn't guarantee that the rest of the execution will continue on
the same CPU. The only way to guarantee this is to schedule a work on the
specific CPU and also prevent hotplug  of that CPU (already done by
existing code).

Change-Id: I51a02fcc777a47d3c16f2d83c47e96f2c59f7ae6
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
msm: Add support for multiple memory holes

If a target supports multiple memory holes, the base address and
size of the memory holes are represented as an array of tuples.
The device tree is scanned in order to extract these values and
remove the memory.

Change-Id: Id253112a384b7f64be067636e5bffc69e3950fb5
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
msm: clock-debug: Update fmax_rates to print uV/uA values for each level

Example output after change:
/sys/kernel/debug/clk/a7sspll $ cat fmax_rates
                  reg 0     reg 1
         freq        uV        uV
            0         0         1
   1000000000   1800000         4
 [ 1900000000   1800000         5]
            0   1800000         7

Change-Id: I1563cd8f77d479e0c6c67ee3c93a66fbafb6d6f7
Signed-off-by: Xiaogang Cui <xiaogang@codeaurora.org>
arm: ftrace: ftrace_modify_code should make kernel text writable for update

STRICT_MEMORY_RWX write-protects the kernel text section, hence with
STRICT_MEMORY_RWX enabled ftrace need to make kernel text section
temporarily writable.

Change-Id: I67fef0ee1d81dd259bae623d7bf0ea2760ae7284
Signed-off-by: mohamed.khadri <mohamed.khadri@lge.com>
msm: mdss: Add support for disable load for hdmi vregs

Changes are to support additional disable load vreg
parameter for hdmi bindings

Change-Id: Ie3d9062f52e767cd97dae987053e9171c42a2808
Signed-off-by: Arpita Banerjee <cabane@codeaurora.org>
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
msm: Make CONFIG_STRICT_MEMORY_RWX even stricter

If CONFIG_STRICT_MEMORY_RWX was set, the first section (containing
the kernel page table and the initial code) and the section
containing the init code were both given RWX permission, which is
a potential security hole.

Pad the first section after the initial code (which will never
be executed when the MMU is on) to make the rest of the kernel
text start in the second section and make the first section RW.

Move some data which had ended up in the "init text"
section into the "init data" one, as this is RW, not RX.
Make the "init text" RX.

We will not free the section containing the "init text",
because if we do, the kernel will allocate memory for RW data there.

Change-Id: I6ca5f4e07342c374246f04a3fee18042fd47c33b
CRs-fixed: 513919
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
Signed-off-by: Patrick Tjin <pattjin@google.com>
msm: krait-regulator: switch mode on the same cpu

The driver currently runs LDO-BHS mode switches while possibly
running on a different CPU. The CPU for which the mode switch is
issued could be running its SPM sequence as a part of going in or
coming out of power collapse. The LDO-BHS switching executed from a
different CPU could race with the mode switches done in SPM sequence
leaving the CPU in a bad state.

Fix this by executing LDO-BHS mode switches on the target CPU. This
guarantees that the SPM sequence won't be running on that CPU while
changing modes.

CRs-Fixed: 523449
Change-Id: I863ce3bcd6dd9ba3155c4573071f01e7a020ef48
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Patrick Tjin <pattjin@google.com>
msm: krait-regulator: rename online to reg_en

The online variable is confusing, since it does not mean whether
the core is online or offline. It actually used to indicate whether
the regulator is enabled or disabled.
Change the variable name to indicate so.

Change-Id: I20c270162df57cf81c17e808d383880b5b2e4eef
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Patrick Tjin <pattjin@google.com>
msm: krait-regulator: fix race conditions in regulator enable/disable

The driver suffers from the following race conditions:
* when a core is being onlined and is in its PREPARE_UP stage regulator
enable for that core is called. This call may cause a switch between
ldo-bhs but since the core if not online yet and ldo-bhs calls are
strictly executed on the target cpu - this leads to smp function calls
to fail.
* before the core in onlined and after the PREPARE_UP stage there could
be another frequency change that causes a gang voltage change that in turn
causes this core to switch states. This too leads to failed smp function
calls since they are targeted towards offline core
* when a cpu is offlined but a DEAD notification is not sent a frequency
change on another core may cause a switch on this cpu. This also leads
to failed smp function calls on offline core.

Fix the above by forcing the core to BHS when it is in its transitory
phase and while it is offlined. In other words a core will switch to
bhs/ldo based on the voltage requests only between CPU_ONLINE and
CPU_DOWN_PREPARE notifications. A core can run on BHS if it
can run on LDO since LDO just acts as a voltage step down, the core
can run when fed higher voltage from BHS.

To do this add hooks to get cpu hotplug notifications in the driver and
appropriately force bhs or switch to ldo or bhs based on gang voltage.

CRs-Fixed: 529593
Change-Id: I7210f62072853ed6f807df2d78bc2144f67eaf31
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Patrick Tjin <pattjin@google.com>
msm: rpm_rbcpr_stats_v2: Support to query RBCPR stats

Support to query stats pertaining to RBCPR (Rapid Bridge Core Power
Reduction) from RPM data memory. The RBCPR module on the RPM modifies
voltage levels for certain chip level voltage rails based on feedback from
different sensors. This change allows querying for the RBCPR stats
maintained on RPM's data memory.

Change-Id: Ia3bdf1ef39c4064b2c3d7406b219e95c18ced21d
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>