mmc: core: fix the issue with clock scaling in HS400 mode

Clock scaling feature would scale up/down the MMC interface clock
frequency based on the load on storage. During clock scale up in HS400
bus speed mode, SW is unncesserily doing the tuning even after HS400
switch is done. This change fixes this bug.

CRs-Fixed: 660534
Change-Id: I4de06962a3fe6dba2e7ff8420d9a3e3997b33ba1
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
mmc: core: fix the issue with clock scaling in HS400 mode

Clock scaling feature would scale up/down the MMC interface clock
frequency based on the load on storage. During clock scale up in HS400
bus speed mode, SW is unncesserily doing the tuning even after HS400
switch is done. This change fixes this bug.

Change-Id: Ica39acc41b14095438a7ccf536c3c7e5792d9c41
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
ARM: dts: msm: Update bus bandwidth votes for sdhci on 8974

Some versions of 8974 supports eMMC HS400 mode providing maximum
throughput of 400MB/s. Update the list of bus bandwidth votes to
make sure appropriate vote is placed in this mode.

CRs-fixed: 656702
Change-Id: I5e3bed70d8c8c1c6423483f7469849823e3ebb2c
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
mdss: mdp: reset init phase and phase step to default

reset the init phase and phase step registers to default
when the pixel extension are not calculated in userspace.

Change-Id: I876f1628fb46901a07deb1b97a4ab55f924612b0
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
msm: mdss: synchronize recovery handler access

The recovery handler is used in the dsi event thread, and
the recovery handler variable was configured from a different
thread.  Earlier, there is no synchronization between the two
threads accessing the recovery handler, causing kernel panics.

Change-Id: Iee990276fdabd65e2e1f2e3c21ad574fc0d8a7bc
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
leds: leds-qpnp: provide pwm period when leds are set to LPG mode in DT

In the current design, if MPP-controlled leds or RGB leds are configured
to LPG mode in the device tree, the PWM period value is not provided.
This will result in "pwm_cfg->pwm_period_us" being assigned to zero
since no PWM period value will be read from device tree. As a result,
qpnp_pwm_init() returns error, which in turn results in failure of
qpnp_mpp_init() or qpnp_rgb_init() and finally resulting in failure of
qpnp_leds_probe().

So "qcom,pwm-us" property should be provided in DT for the above case and
the property parsing needs to be implemented in the leds-qpnp driver.

Change-Id: Ic32833ea4e685939148e38cdba078391936f8efb
CRs-Fixed: 667825
Signed-off-by: Abinaya P <abinayap@codeaurora.org>
msm: mdss: Move splash thread functionality

framebuffer and overlay drivers are tightly coupled with
splash thread functionality. This adds lots of code
related to continuous splash screen handling in
both drivers. Moving them to separate file cleans up
both drivers and allows to handle continuous splash screen
cases efficiently.

CRs-fixed: 605934
Change-Id: Id89bb281dbbf22e726cf5fd97e93f891e5c73f60
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
ASoC: msm-lsm-client: handle close gracefully

The listen pcm device could get closed abruptly due to userspace
application crash. In such cases, the device close will be invoked
abruptly. Handle this scenario gracefully by properly cleaning up the
driver before close.

Change-Id: Ie841f300400d547260da92383712a9aa0689d7a7
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
msm: vidc: Disable clock gating feature

Clock gating between inter frames when video hardware
is in IDLE state is not giving any power savings and
at the same time this feature is resulting in few
stability issues. So disabling clock gating feature.

Change-Id: I3d1d4521ec3ee2fbd25d80b33bd5c531a25d9034
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Signed-off-by: Balamurugan Alagarsamy <balaga@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>
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
media: dvb: increase SDMX shared buffer size

A shared buffer is used to encode the command and response when
sending a command to TZ via qseecom interface.
To allow increasing the number of linear buffers the shared buffer
size is increased to accommodate the command data.
In addition, add checks to detect overflow of the shared buffer.

Change-Id: Ie006d20f3841aa7e8ea2e30bd6a5b211099936af
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
msm: mdss: add error check for iommu attach API

Iommu device attach api returns error code if it fails.
MDP driver will check this error code and fall back to
recovery path if device attach fails.

Change-Id: I4bc911a2341ef1a9773a6bd3e8aca35224885575
Signed-off-by: Anusha Koduru <kanusha@codeaurora.org>
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
msm: mdss: IOMMU ref count implementation

Currently MDP is attaching/detaching iommu based on
bus bandwidth requests. This can lead to performance
issues, so implement ref count on iommu such that
iommu is attached where needed.

Change-Id: Ic4d35e2dc7f83291d1ab93d3e0109a2d69c98844
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Signed-off-by: Vineet Bajaj <vbajaj@codeaurora.org>
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
msm: mdss: Cleanup iommu ref count implementation

With current iommu ref count implementation, iommu is
attached at points when only needed and detached once
finished. Iommu reference count in overlay pan display
path is currently missing hence add it. Also remove
code repetitions and unnecessary error checks while
decreasing iommu ref counts in overlay and writeback
path.

Change-Id: If1aed768e5d704dd6c9d4bfd17c1ec368c8d8711
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Signed-off-by: Vineet Bajaj <vbajaj@codeaurora.org>
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
msm: mdss: Cancel ESD workqueue whenever display off happens

Display can be turned off by using different ioctls. Make sure that
in all the cases ESD workqueue is cancelled.

CRs-Fixed: 626835
Change-Id: Id14992665e4a86941386a8269600d322c3500a70
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
msm: mdss: Prevent HDMI panels from doing AD checks

Assertive display is meant only for primary display, however the AD
checks are being done on the HDMI frame buffer and its mixers. Adding
a check for HDMI panel type will prevent edge case errors when doing
AD checks.

Change-Id: Iffdec9fcf479f24e9407d6508517fb4103b1e977
Signed-off-by: Benet Clark <benetc@codeaurora.org>
msm:mdss: Fix the issue with AD resume

AD is not configured correctly on dual DSI devices during
suspend/resume. The AD configuration data from user space are
only copied to the master AD configuration structure, and the AD
configuration structure attached to the right mixer (slave AD structure)
is never filled. So in the resume function, we cannot use the AD
configuration data from the slave AD configuration. Use the one
from the master structure instead.

Change-Id: I04cf3c467c2614420e01f9177f564eec7ce7bb23
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
(cherry picked from commit cc2176c176f99836d8040d268954f7575267f406)
msm: mdss: Prevent AD configuration on HDMI path

Currently there is no use case for enabling AD on HDMI path. This check
is already present in mdss_ad_init_checks(), but that does not prevent
mdss_mdp_ad_setup() from being called. So invoke mdss_mdp_ad_setup() only
if display panel is not of HDMI type.

CRs-fixed: 624298
Change-Id: I175fcdbb0cc4ccda31d3fc8074b1e0213e0af10a
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
msm: mdss: Prevent AD on WFD configuration

Assertive display is not allowed on HDMI and WFD configurations.
However, since WFD uses the writeback path, and AD uses the
writeback path for earlier hardware, then we must check which
hardware configuration is being used when checking writeback
panel configuration to prevent or allow AD.

CRs-fixed: 624298
Change-Id: I85f7380d0345cad7785ed41e22df559bc5c1618e
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Signed-off-by: Baldev Kumar Sahu <bsahu@codeaurora.org>
msm: mdss: Fix single pipe AD tile control

The tile control parameter is used by the Assertive Display
block to control merged mode or independent mode AD for
dual-pipe AD. However, in single pipe AD, the tile control
should always be set to zero.

Change-Id: I0dd3c3b716fd5156d9a0f9206911159d186fd9c7
Signed-off-by: Benet Clark <benetc@codeaurora.org>