msm: Add a separate config option for RPC PMAPP and RPC USB

MSMs in which the APPS does not have a direct access to
PMIC (over SSBI) use RPC to communicate with the PMIC.
Create a new config option for this RPC based PMIC APP
driver and enable it only for the required MSMs (7x27a,
7x30, fsm9xxx).

Also, add a similar option for RPC based HS USB and FS USB
driver.

Change-Id: I6d32243eb271f72a9055b346198bb274749297c1
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
msm: audio: qdsp6v2: Support qdsp6 timestamp query

Tunnel mode decoder clients can query and use the accurate Qdsp6
timestamps.

Change-Id: I0a3251f305b428388f2096b5abe977520a5dc02b
Signed-off-by: Sidipotu Ashok <sashok@codeaurora.org>
msm_fb: Display: Enable NO_PIPE_CTRL flag for 7x30

Enable NO_PIPE_CTRL config flag for 7x30

Change-Id: Iefa2b753aae20c5ef8074cb4753cba9a8bd881c6
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
usb: gadget: adb: Force OUT(or RX) requests size to be MAX

Synopsys USB3 Controller (DWC3) has a restriction where size
of OUT requests (TRB) queued to the controller must be aligned
with the endpoint's max packet size.
Since, request buffer is already allocated with the size of
ADB_BULK_BUFFER_SIZE, hence, request this much data from the
controller.

Change-Id: Ibba1a627c9e34b92ddcb44ee2260a004a2b78dfc
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
mmc: support BKOPS feature for eMMC

Enable eMMC background operations (BKOPS) feature.

If URGENT_BKOPS is set after a response, note that BKOPS are required.
Immediately run BKOPS if required.  Read/write operations should be
requested during BKOPS(LEVEL-1), then issue HPI to interrupt the
ongoing BKOPS and service the foreground operation.
(This patch only controls the LEVEL2/3.)

When repeating the writing 1GB data, at a certain time, performance is
decreased.  At that time, card triggers the Level-3 or Level-2.  After
running bkops, performance is recovered.

Future considerations:
 * Check BKOPS_LEVEL=1 and start BKOPS in a preventive manner.
 * Interrupt ongoing BKOPS before powering off the card.
 * How do we get BKOPS_STATUS value (periodically send ext_csd command)?
 * If using periodic bkops, also consider runtime_pm control.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
Reviewed-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
(cherry picked from commit 6807769f7bf68984a5aeda4b9b521f1167cbaf00)

Change-Id: Ie01267b7aa7c5ee2e03bb3b1729e6ef47c552cc4
[merez@codeaurora.org: core.c: release_host when stopping BKOPs for
non SDIO cards in suspend]
Signed-off-by: Maya Erez <merez@codeaurora.org>
msm: kgsl: Do not check for hang when graphics core is idle

GPU hang detection logic checks register values every 2 seconds
and determines a hang if there is no change in the register values
after 2 seconds. When GPU core is idle the register values do not
change, hang detection logic should be disabled to prevent
false hangs being detected.

CRs-fixed: 402818
Change-Id: I6bd9085879fcafda9ca322221ba93e6a6ca5043c
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
coresight: move cp14.h to include/asm/hardware

Move cp14.h to include/asm/hardware so that it can be used by code
inside mach-msm as well as drivers/coresight.

Change-Id: I3f5cd6e1768378ec26abcd1e7328977836dce60f
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
msm: msm_bus: Correct BIMC QoS settings

Write way crossing registers were added to hardware due to which
the offsets of Priority and command override registers have
shifted. This patch corrects the offset values and the priority
settings for Apps processor ports.

Change-Id: I5527863a9de1dd57000d2375bc47c73e89e6498f
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
msm: modem-ssr-8974: Add support for phase 3 modem restart

Add support to restart just the modem when it encounters
a fatal error. This includes calling PIL to shutdown and
boot the modem up, as well as adding support to allow
userspace to collect the modem ramdump.

Change-Id: I0cd3a662e555a7a1c6104f714ae133b382414500
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
msm: clock: Allow registration of multiple MSM clock tables

If multiple clock drivers wish to use the framework in mach-msm/clock.c,
then it is necessary for additional clock tables to be registered after
msm_clock_init(). Add the msm_clock_register(table, size) API to
accomplish this. Unlike msm_clock_init(), msm_clock_register() can be
used multiple times and called after the kernel has finished booting.

To support debugfs features for clocks registered with the new API,
changes are required to debugfs initialization, which is now done as
part of msm_clock_init() rather than clock_late_init(). A linked list
is used to chain together the tables of clocks so their state can be
printed by clock_debug_print_enabled().

Change-Id: I9b480cd5d342701baef7da864c5b4d66969ec8ec
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: clock: Fix hardware clock gating detection for mdp_axi_clk

clock-debug uses a clock flag (CLKFLAG_HWCG) to determine if a
clock is capable of hardware gating. Unfortunately, recent
changes to clock handoff cause this flag to not always be set.

Take mdp_axi_clk for example. It is a depends of mdp_clk, and so
if mdp_clk is on out of the bootloader, mdp_axi_clk is indirectly
enabled by the clk_prepare_enable() call in __handoff_clk() when
mdp_clk is enabled. We could add support for handing off depends
clocks, but we're planning on removing the depends code and there
isn't a real problem in failing to hand off branches that are
depends since they're hidden from consumers anyway.

The only problem with this scenario is that branch_handoff() is
not called and so mdp_axi_clk is not marked as supporting
hardware clock gating. The clock flag is only used to indicate
support for hardware clock gating, so let's just read the
hardware anytime a users wants to know if the clock has hardware
gating or not.

This changes the semantics of the has_hw_gating file because we
read the hardware instead of returning a cached value and the
state of the hardware changes at runtime (e.g. if the clock is
put into reset hardware gating is turned off). In practice these
clocks aren't switching in and out of hardware gating mode while
a clock test is in progress so the impact of this change is
minimal to zero.

Change-Id: I4f646b1b32b42e3ef00067b47ffb78df8fb761d5
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: clock-debug: Print clock name and rate on failure

Make this error message more informative about which clock failed
to have its rate changed, and what rate was attempted. Not all
users of debugfs are people and so the rate setting operation may
be buried layers deep in a script somewhere.

Change-Id: I6ae7f77f677b5077a294811d993df20aeadf1091
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: clock-debug.c: Display clock vdd fmax values

Display the voltage level a clock votes for debugging.
The currently selected level is shown in square brackets.

Change-Id: I5062c5ea05408c94b63a1eeb376c42da9b7e5908
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
msm: clock_debug: sync with MSM-3.4 as of 2012-09-24

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
msm: clock: Expose parts of "clock.h" through <mach/clk-provider.h>

Expose the features of "clock.h" outside of mach-msm so that new clock
drivers leveraging the framework in mach-msm/clock.c can be implemented
outside of the mach-msm sub-architecture directory.

Change-Id: I3d07017388b28d4e5b6e930e7eda4f48e840714b
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
ASoC: msm: Add support for voice over USB

Add routes to transfer voice packets to/from the
external modem to USB in APQ, and route the mixed
audio and voice streams to the extertal modem for
echo cancellation.

Change-Id: Ib5409ff1d8484fe0bdfb7205ad4f843b3dc818ac
Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>
board: 8960-pmic: Swap mapping of camera snapshot and focus keys

Functionality is swapped on 8960 devices.

Change-Id: I2a458c40b60be583dee982bb12927a9b018fb94f
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
usb: ks_bridge: Fix bug in partial read on data buffer

If driver copies only partial data buffer to user space
it does not update the buffer pointer. In this case
buffer pointer is still pointing to the already read
buffer and will be copied again in next read request
from user space. This corrupts the contents of the
efs file or ram dump files. Hence update data buffer
pointer with length of memory read completed by user
space.

CRs-Fixed: 403250
Change-Id: I48217aeeb2ee5ad05089922c6a7793195b95ce0c
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
v4l2: Add V4L2 control for getting seq_hdr in syncframe

Add v4l2 control V4L2_CID_QCOM_VIDEO_SYNC_FRAME_SEQ_HDR, this control
configures video hardware to enable/disable codecconfig data to be
packed with every syncframe. This has to be configured before
encoding starts.

CRs-fixed: 396716
Change-Id: I14bf83cb8583656a6a040be4f38ec0e5dea36a25
Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>
msm: vidc: Fix IOMMU pagefault for long clips

Shared command/message queues are circular, so if they get
full driver has to write/read into them from the beginning.
The address used to write/read from beginning was not the
kernel virtual address causing IOMMU page fault.

CRs-fixed: 400747
Change-Id: Ie414f75370c31c8a4fb1bf7c879d1d0f4d5c7ea0
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>