msm: camera: bugfix in actuator_init_focus func

bugfix in actuator_init_focus func added break
after write/poll case

Change-Id: I0362481fb7f4664da313670bf2187aa5e168ae6a
Signed-off-by: Vasko Kalanoski <vaskok@codeaurora.org>
spi_qsd: Add support for multiple BAM descriptors

Currently SPI driver is queuing a single BAM descriptor
at a time. The BAM engine supports queuing of multiple
transfer descriptors.

Add support to spi driver to queue multiple descriptors.

CRs-Fixed: 546346
Change-Id: Iaee9b3b362832262b75e46e19ad18552d037620b
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
clock: msm: Add clk support for second qcrypto device

Add clock entry for a second qcrypto instance for 8974.

Change-Id: I6e4c6e32e62c5cf26992c7d0dc8b27b188c2b15c
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
msm: camera: Avoid memory corruption by changing order of enum

SET_POSITION is added above MOVE_FOCUS which makes kernel prone to
memory corruption as MOVE_FOCUS enum is changed. when CFG_POSITION
is not present and userspace calls MOVE_FOCUS kernel misinterprets
MOVE_FOCUS as SET_POSITION and thus copies user structure to wrong
structure and makes memory to corrupt.

Change-Id: I335ee28d9af6ec25b00262d71701e503a06e21c5
Signed-off-by: Lokesh Kumar Aakulu <lkumar@codeaurora.org>
mdss: mdp3: swap colors when performing csc from yuv2rgb

When ppp hw is performing csc from yuv to rgb there is a color
swap. In order to account for this we need to swap the unpack
and packing order.

Change-Id: I55df9a87300f3ce2c9bf5352725f3ce1d2b1b8a4
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
mdss: mdp: Fix check to identify if dsi short read

The short response can be <=2 bytes.

Change-Id: Iad322bc892ea29b2acf220ef579d18dea1a91c32
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
crypto: msm: re-work qcrypto driver clk and bus management

This patch re-works bus scaling and clk management to respond to
the actual crypto engine usage. The driver suspend/resume are
integrated with overall driver clk and bus management.

Furthermore, two functions are added to the low level crypto driver. Low
level crypto driver is informed to save and restored hardware context if
necessary across PM suspend/resume.

Change-Id: Ic906e0c7e96dee847253d6ef57341d1a38e294cf
Acked-by: Chemin Hsieh <cheminh@qti.qualcomm.com>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
msm: vidc: Amend calculation of buffer sizes in VENUS_BUFFER_SIZE

Add 8KB worth of padding for extradata. This is required to accommodate
some of the larger extradata types that didn't fit into the residual
space between the actual buffer size and its aligned size.

CRs-Fixed: 647378
Change-Id: I550f806079dfbdece229f68ffdfc5c0e20b3c9e1
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
ASoC: wcd93xx: Remove delay for Slimbus during SSR recovery

When SLIMBUS data channel is to be torn down, CODEC driver
waits for channel removal interrupt from SLIMBUS slave device
with 1 second timeout as measure to prevent system from lock
down in case channel removal interrupt never arrive due to
known reason. When ADSP SSR happen, SLIMBUS would be reset
hence data channel will be gone inherently. Waiting for 1
second will only prolong SSR recovery latency. Update to
avoid the delay after SSR.

Change-Id: Ic6a94ddd1150ba143f4dd33aac1785d7d2ee7653
CRs-fixed: 653504
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
msm: vidc: Add support for different errors

When hardware is overloaded or when max number of clients are
reached in driver or firmware, hardware error is sent to video
client. This change is to replace hardware error with actual
errors.

CRs-fixed: 575852
Change-Id: I07e599f894a3716a3dc4fed5eb7c987311f5bdde
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
mmc: card: quirk: disable HPI for Kingston card

Certain Kingston eMMC 4.41 cards might get broken when HPI feature.
This quirk will disable the HPI feature for such buggy cards.

There are features depending on HPI, the change will disable them:
- BKOPS support
- stop transmission flow
- CACHE_CTRL

CRs-Fixed: 625480
Change-Id: Ie675f6cb0646c06458ac8eee9a38d12fbc485be5
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
ASoC: wcd9xxx: Synchronize button press with notifiers

Button press handler and event notification handler needs
to be syncronized so that they do not interfere in the
excution leading to incorrect register writes or threshold
updates.

CRs-Fixed: 637805
Change-Id: I51ebf1d546aa59e219ce71517970b35730589b6c
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
msm: vidc: Add AFD and CC metadata support to extradata

Add support and control for setting Active format
description and closed caption meta data in the
extradata. FW parses metadata and adds it to the
extradata. Client can use control to parse extradata
for the metadata information.

Change-Id: I79fb71e635927c95e0792862c9dea7d96f58e895
Signed-off-by: Jayasena Sangaraboina <jsanga@codeaurora.org>
msm: thermal: Automate KTM's switch to interrupt mode

Add support to Kernel Thermal Monitor (KTM) to stop polling
the temperatures and switch to interrupt mode when the KTM
module init is called. This avoids KTM's dependency on
thermal-engine to notify when to switch to interrupt mode.

After switching to interrupt mode, the KTM spawns a
thermal monitor thread and registers temperature
thresholds for monitoring the vdd restriction.

CRs-Fixed: 567187
Change-Id: Ib1536c9fc32d3fc0ef2737818c39ca80c5d636d8
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
msm: thermal: Update to speed up bootup time

Update KTM driver to remove flush_scheduled_work that
would introduce bootup delay. This patch replaces
cancel_delayed_work with cancel_delayed_work_sync
to cancel a delayed work.

CRs-Fixed: 647439
Change-Id: Ie81278ca3a7a58f8f46463f7149b512bd07cbcbc
Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
USB: ccid_bridge: Add module param for bulk message timeout

The bulk message timeout is 1 second by default. Some cards take
more time to respond to CCID commands. Provide a module param
to configure the bulk message timeout.

For example, the below command configures the timeout as 5 seconds.

echo -n 5000 > /sys/module/ccid_bridge/parameters/bulk_msg_timeout

CRs-Fixed: 652421
Change-Id: I5f8fc2a9586d3728fe1c43311a28c4084a333164
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
msm: mdss: Dynamically enabling ESD

Allow the check_status interval time to be
configurable via /sys interface.
Allow the dsi_check_status function to be
enabled or disabled via /sys interface
Combine MDP3 & MDP5 code and separate
the platform specific code.

Change-Id: I0a6be25b6974ff8dafa472febbdbde517d35cbbc
Signed-off-by: Raghavendra Ambadas <rambad@codeaurora.org>
ARM: dts: msm: add frequency to corner mappings for msm8226v2 and msm8926

Add frequency to corner mappings for turbo fuse corner frequencies in
1.2G and 1.4G speedbin tables which located at msm8226v2 and msm8926
clock-a7 device tree node.
1.2G/1.4G msm8226v2 and msm8926 parts can receive a dynamic quotient
adjustment to scale the CPR target quotient used for each corner, this
ensure these parts receive power saving when running at turbo
frequencies below the maximum possible turbo frequency.

CRs-Fixed: 597721
Change-Id: Ie5992361a79950614d9e2b04a6bfb373e26088a3
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Signed-off-by: Ke Liu <keliu@codeaurora.org>
msm: mdss: Clear the previous state of pipe during SOLID_FILL

Clear the previous state of pipe when it is being used in SOLID_FILL
operation to prevent wrong register configuration. For ex: Use case
when DMA pipe was used in BLOCK mode in previous frame, then it is
being used in LINE mode for SOLID_FILL operation in current frame.

CRs-Fixed: 655993
Change-Id: I0ed257276428b96c10a92457a16df4dfdc42c1f8
Signed-off-by: Sushil Chauhan <sushilchauhan@codeaurora.org>
ARM: dts: msm: set overlap fudge factor to 1.75 for msm8974

Set the fudge factor for the overlap bandwidth to 1.75.
This fixes underruns observed in some use cases with 8974 targets.

Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Change-Id: I05aea8047132dab158870d6e020943bf34548702