Commit graph

574573 commits

Author SHA1 Message Date
Bhalchandra Gajare
6ed085d498 ASoC: wcd934x: Add support for voltage scaling
WCD934X audio codec supports static voltage scaling (SVS) mode, which
puts the codec into lowest power state. The codec has different power
states (SVS2, SVS and Nominal). Add support in codec driver to vote
for SVS when audio usecases are enabled and remove vote for SVS when
audio usecases are disabled. The codec driver only votes for SVS or
no SVS and the hardware internally manages to go into Nominal mode.

CRs-Fixed: 1049012
Change-Id: I6f66d3136e3c49da54f5919184bc113267105463
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2016-08-26 11:58:15 -07:00
Meng Wang
cacf1949cd ASoC: wcd934x: add MAD support for wcd934x codec
MAD (Microphone Activity Detection) hardware block in wcd934x audio
codec samples the microphone at configured intervals to sense
presence of valid audio signal. This is used for voice activation
use cases. Change adds widgets and routes to enable the MAD block.

CRs-Fixed: 1049012
Change-Id: I1ce4f3f215850fada6c25192a4351f3a9c76a370
Signed-off-by: Meng Wang <mwang@codeaurora.org>
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2016-08-26 11:57:57 -07:00
Tatenda Chipeperekwa
fb5a1b1276 ARM: dts: msm: add audio codec as child of MSM External display
Add the audio codec as a child node of the MSM External display
node. The audio codec probe will happen after the External
display probe, and will allow the audio codec to register with
the External display independently of the display interface(s)
that will the added after a hotplug event.

Change-Id: I481e475ceff2ea0a07a0dfc4083526982674954c
CRs-Fixed: 1009284
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
2016-08-26 11:41:47 -07:00
Tatenda Chipeperekwa
d54ab561f0 msm: mdss: remove unused APIs from external display header
Remove unused APIs from the external display header while
retaining the hdmi audio codec registration API for backward
compatibility.

Change-Id: I62e8d8810280fd42e1db1769ab95be877dc536ed
CRs-Fixed: 1009284
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
2016-08-26 11:38:58 -07:00
Zhen Kong
431c2111d8 qseecom: improve listener resp processing if app is blocked
When qseecom send listener A's resp to app A, if app A needs to
request listener B but B is used by another app, TZ will return
BLOCKED status to qseecom. Instead of returning an error to
client directly, qseecom need to wait listener B become available
and then notify TZ to continue blocked request for listener B.

Change-Id: I5f7a19718b3b81a1e27d128bc69554cbaabf03f9
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2016-08-26 09:51:40 -07:00
Arun Kumar Neelakantam
eb1c2c4105 net: ipc_router: Fix remote port conn_info memory leak
conn_info is used to connect the local port with destination port
address and is freed only for remote server cleanup in SSR case
which leads memory leak for other remote ports which valid conn_info.

Free the conn_info structure for all remote ports during the SSR and
while handling remove client message.

CRs-Fixed: 1057219
Change-Id: I164a9eb308f5779d545766b18bb41184c49bbb3d
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
2016-08-26 19:33:03 +05:30
Riley Andrews
dbc6f463a6 mutex: Add a delay into the SPIN_ON_OWNER wait loop.
On arm systems the spin on owner optimization can intermittently cause a
lockup that's usually as long as the waiting thread's cpu timeslice. The
repeated mutex aquisitions + atomics in a single spinning thread can
completely lock out the owner from releasing the kernel mutex. The
owner needs to acquire a spinlock on the relase path and this spinlock
can share a monitor with the other locks and atomics on the waiter path.
Rate limit the waiter so that the thread releasing the mutex never
is starved.

Bug 23036902

Change-Id: Ie1b64275a0c6141f94faaf3e63fcbf9b5438140c
Signed-off-by: Riley Andrews <riandrews@google.com>
Git-commit: 84d8ce7e0025cac60a8a379a7ee3e59d640fbc03
Git-repo: https://android.googlesource.com/kernel/msm.git
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
2016-08-25 23:54:08 -07:00
Meng Wang
1c2c0e84de ASoC: wcd934x: Adjust DMIC clock based on sample rate
Currently DMIC clock is set at 4.8MHz for all sampling rates.
For optimal power, sampling rates <=48KHz and dmic clock <=2.4MHz,
it should be set to the value read from device tree and others
should be set to 2.4MHz.

Change-Id: If68fea97d2f0b27432e61d73d6841a2b194bb63b
Signed-off-by: Meng Wang <mwang@codeaurora.org>
2016-08-26 13:22:21 +08:00
Mahesh Sivasubramanian
505878dcf7 soc: qcom: rpm-smd: Account for NOACK messages with system sleep
When a system is entering RPM assisted sleep, the NOACK messages are
not accounted in preventing such sleep modes as no driver is waiting
on it. In such scenarios, some active messages could still be in the
Apps RX buffer which reduces the number of outstanding sleep messages.

Fix by accounting for NOACK messages while flushing sleep set requests
and ensuring that they are read before sending any sleep set requests.

The original changes were reverted to address issues with SMD transport.
This change includes fixes from earlier squashed into a single commit.

Change-Id: I5570d7694424d0a602c446c0af098a64ffa681e4
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
2016-08-26 10:21:51 +05:30
Chris Lew
f064471536 diag: Add error handler to free buffers when fwd fails
Forwarding the data from the MHI layer can fail if USB
or MD is not connected. This change adds an error case
to free the buffers if forwarding the data fails.

CRs-Fixed: 1054875
Change-Id: I49ef2a32ffd731ab2875c941c9d11155f2aba9e2
Signed-off-by: Chris Lew <clew@codeaurora.org>
2016-08-25 18:21:42 -07:00
Abhijeet Dharmapurikar
52bf80303d qcom_charger: smb-lib: support faking battery capacity
On debug setups where the battery is not present, we need a way
to fake battery capacity instead of reporting some incorrect
/non-existent value. Provide means for the userspace to setup
a fake battery capacity.

Change-Id: Iff3ee1009d9c3215433cc267f016ef9cf2a9bff2
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-08-25 15:55:39 -07:00
Abhijeet Dharmapurikar
2f25819b0c mfd: qcom-i2c-pmic: prepare for shared interrupt
The interrupt coming to smb1381 and other i2c pmic's could be shared
with direct charge chip. Update the code to reflect that.

CRs-Fixed: 1059549
Change-Id: I4d12ff4d1d87aa984f601760b26b3413484f501a
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-08-25 15:27:08 -07:00
Rajesh Bondugula
5c1051a589 msm: camera: sensor: Add state validation for flash
Validate current flash state before turning on the flash.
Multiple calls to same state is a valid request in case of
dual camera. So the request is ignored is already present
in desired state.

Crs-Fixed: 1051259
Change-Id: Ifa2c4721a156c34c6d917ff950d648bea6cee50e
Signed-off-by: Rajesh Bondugula <rajeshb@codeaurora.org>
2016-08-25 14:42:31 -07:00
Abhijeet Dharmapurikar
79c88a3bdb qpnp-fg-gen3: export the battery float voltage
Implement VOLTAGE_MAX_DESIGN to expose the battery float voltage. This
property will reflect the values read from battery profile and will
will be used for setting the max voltage on charging chips.

Change-Id: I4b9028f8930ac2f3de6c043fa145494f37322160
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-08-25 14:23:37 -07:00
Abhijeet Dharmapurikar
67d71eb938 qcom-charger: smb-lib: correct the usb suspend votable name
Currently the name of the votable that suspends usb is INPUT_SUSPEND.
However, the PMI has two inputs - USB and DC. The dc suspending votable
is correctly named DC_SUSPEND. So rename the INPUT_SUSPEND to an
appropriate name - USB_SUSPEND.

Change-Id: Ia5ea1b139f5e9d560dc6492aa9fc13ffeeda83ca
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-08-25 14:22:52 -07:00
Skylar Chang
ebc2a18351 msm: ipa: WA to get PA of sgt_tbl from wlan
with SMMU enable, the API page_to_phys() is
failed to get PA of the sg_page tbl. The WA
is to have wlan-driver directly send the PA
to ipa-driver.

Change-Id: I7750102222d519969da0d597a6591aa728abb27a
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2016-08-25 14:02:19 -07:00
Archana Sathyakumar
27672f152d ARM: dts: msm: Update power attributes for msmcobalt
Update power attributes for cpu and cluster's low power modes based on
the measurements on the device.

Breakeven points for v1 hardware:

Power Cluster -

Min us  Max us  Mode selected
83      1810    c1
1810            c3

Note: C2d is disabled in v1

L2 - Power Cluster

Min us Max us Mode selected
99     975    d1
976    3398   d2d
3399   9182   d2e
9183          d4

Perf Cluster

Min us Max us Mode selected
86     1704   c1
1704          c3

Note: C2d is disabled in v1

L2 - Perf Cluster

Min us Max us Mode selected
99     905    d1
906    3380   d2d
3381   9418   d2e
9419          d4

CCI

Min us Max us Mode selected
16744         e3

Change-Id: Iaf9930c0589e193c8a366ff44808d75c6d6b360b
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
2016-08-25 14:16:15 -06:00
George Shen
4b478ca851 msm: kgsl: remove un-used GPU power states
DEEP-NAP and SLEEP states are not used in targets of previous
two generations. They are neither saving GPU power, nor saving
system power. Remove to reduce maintenance overhead.

CRs-Fixed: 1053516
Change-Id: If2fc2701548f90bb7ea9559a87752e13a7b0f736
Signed-off-by: George Shen <sqiao@codeaurora.org>
2016-08-25 11:58:29 -07:00
Prashanth Bhatta
cd48ca9c04 ARM: dts: Change minimum voltage for LDO25
For WLAN hardware to enter low power mode, LDO25 voltage needs to
be at 3.1V. Change the regulator node to add this change.
Also for icnss driver votes for LDO7, LDO17 and LDO25, use pin
control regulator votes.

CRs-fixed: 1059101
Change-Id: I894631f6085410bd9961a0e00ca5eb2cd7d0c5bd
Signed-off-by: Prashanth Bhatta <bhattap@codeaurora.org>
2016-08-25 11:56:42 -07:00
David Collins
b26949fe61 ARM: dts: msm: update VDD_GFX CPR target quotients for msmcobalt v2
Hardware characterization has shown that ROs 10 and 12 should be
used along with RO 13 on MSMCOBALT v2 for the highest VDD_GFX CPR
corner (Turbo L1).  Specify their target quotient values.

Change-Id: Id2084fd8913468372ad78ecf0d41427171f87bab
CRs-Fixed: 1054539
Signed-off-by: David Collins <collinsd@codeaurora.org>
2016-08-25 11:38:05 -07:00
Hemant Kumar
0e23404929 sound: usb: Add NULL check on return value of iommu_domain_alloc()
Upon allocation failure iommu_domain_alloc() returns NULL.
Driver is not checking for NULL value, which leads to NULL
pointer dereference later.

Change-Id: I9788412af3a34aca8fa8519e7ae6f3349f263a1e
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-08-25 10:01:21 -07:00
Jonathan Wicks
d1552b763a ARM: dts: msm: Update GPU SMMU settings for cobalt
Updating the GPU SMMU settings to match the settings
used during pre-sil testing.

Change-Id: I70e0b87c3575f5778726ae2855d68bf0e560206a
Signed-off-by: Jonathan Wicks <jwicks@codeaurora.org>
2016-08-25 09:27:46 -06:00
Sahitya Tummala
38610b88bf host: sdhci-msm: implement get_current_limit() host op
This is needed to get the current capabilities of vdd
regulator that is not managed by SDHCI driver.

Change-Id: Ib41f9892caca7f9d39675c6adf3b5eb8fdf88159
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
2016-08-25 07:13:06 -07:00
Sahitya Tummala
53688837e0 host: sdhci: fix current caps when there is no host->vmmc
When the regulators are not managed by SDHCI host driver (i.e.,
when host->vmmc and host->vmmcq are absent), get the regulator
current capabilities through a new host op get_current_limit().

Change-Id: I097349ad4d2e8ffbafbeb5fe65910894fe909bd6
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
2016-08-25 07:12:12 -07:00
Taniya Das
c6d8725f07 clk: qcom: Add support for clk_set_flags for branch and dummy clock
Add support to allow setting various flags on the branch clock
pertaining to PERIPH, RETAIN_PERIPH, RETAIN_MEM set and clear by clients
which require this support.

Change-Id: I59ddc1b3b677bd0d7fa838afc9a6cbfc10f98409
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2016-08-25 12:39:12 +05:30
Taniya Das
f7e6b7a1bc clk: qcom: Add support for dummy reset controller
The consumers of the dummy clock provider would require support for dummy
resets, which would make a dummy assert/deassert reset signals. The dummy
reset controller registers for 0-100 reset signals.

The consumers node would have the reset phandle and reset specific pairs
and the reset signal names.

test_node {
	....
	resets = <&clock_gcc GCC_PHY_BCR>;
	reset-names = "phy_reset";
};

Change-Id: I242d2f36a6b4af53c658dbaa7a0f32e46cd3af33
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2016-08-25 12:35:34 +05:30
Vinayak Menon
47b41f43ee mm: zbud: fix the locking scenarios with zcache
With zcache using zbud, strange locking scenarios are
observed. The first problem seen is:

Core 2 waiting on mapping->tree_lock which is taken by core 6
do_raw_spin_lock

raw_spin_lock_irq
atomic_cmpxchg
page_freeze_refs
__remove_mapping
shrink_page_list

Core 6 after taking mapping->tree_lock is waiting on zbud pool lock
which is held by core 5
zbud_alloc
zcache_store_page
__cleancache_put_page
cleancache_put_page
__delete_from_page_cache
spin_unlock_irq
__remove_mapping
shrink_page_list
shrink_inactive_list

Core 5 after taking zbud pool lock from zbud_free received an IRQ, and
after IRQ exit, softirqs were scheduled and end_page_writeback tried to
lock on mapping->tree_lock which is already held by Core 6. Deadlock.
do_raw_spin_lock
raw_spin_lock_irqsave
test_clear_page_writeba
end_page_writeback
ext4_finish_bio
ext4_end_bio
bio_endio
blk_update_request
end_clone_bio
bio_endio
blk_update_request
blk_update_bidi_request
blk_end_bidi_request
blk_end_request
mmc_blk_cmdq_complete_r
mmc_cmdq_softirq_done
blk_done_softirq
static_key_count
static_key_false
trace_softirq_exit
__do_softirq()
tick_irq_exit
irq_exit()
set_irq_regs
__handle_domain_irq
gic_handle_irq
el1_irq
exception
__list_del_entry
list_del
zbud_free
zcache_load_page
__cleancache_get_page(?

This shows that allowing softirqs while holding zbud pool lock
can result in deadlocks. To fix this, 'commit 6a1fdaa36272
("mm: zbud: prevent softirq during zbud alloc, free and reclaim")'
decided to take spin_lock_bh during zbud_free, zbud_alloc and
zbud_reclaim. But this resulted in another deadlock.

spin_bug()
do_raw_spin_lock()
_raw_spin_lock_irqsave()
test_clear_page_writeback()
end_page_writeback()
ext4_finish_bio()
ext4_end_bio()
bio_endio()
blk_update_request()
end_clone_bio()
bio_endio()
blk_update_request()
blk_update_bidi_request()
blk_end_request()
mmc_blk_cmdq_complete_rq()
mmc_cmdq_softirq_done()
blk_done_softirq()
__do_softirq()
do_softirq()
__local_bh_enable_ip()
_raw_spin_unlock_bh()
zbud_alloc()
zcache_store_page()
__cleancache_put_page()
__delete_from_page_cache()
__remove_mapping()
shrink_page_list()

Here, the spin_unlock_bh resulted in explicit invocation of do_sofirq,
which resulted in the acquisition of mapping->tree_lock which was already
taken by __remove_mapping.

The new fix considers the following facts.
1) zcache_store_page is always be called from __delete_from_page_cache
with mapping->tree_lock held and interrupts disabled. Thus zbud_alloc
which is called only from zcache_store_page is always called with
interrupts disabled.
2) zbud_free and zbud_reclaim_page can be called from zcache with or
without interrupts disabled. So an interrupt while holding zbud pool
lock can result in do_softirq and acquisition of mapping->tree_lock.

(1) implies zbud_alloc need not explicitly disable bh. But disable
interrupts to make sure zbud_alloc is safe with zcache, irrespective
of future changes. This will fix the second scenario.
(2) implies zbud_free and zbud_reclaim_page should use spin_lock_irqsave,
so that interrupts will not be triggered and inturn softirqs.
spin_lock_bh can't be used because a spin_unlock_bh can triger a softirq
even in interrupt context. This will fix the first scenario.

Change-Id: Ibc810525dddf97614db41643642fec7472bd6a2c
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2016-08-25 11:49:45 +05:30
Abinaya P
546640e83f input: synaptics_dsx_2.6: correct sysfs permissions
Set correct permissions for sysfs nodes.
1. Show method of write only sysfs attributes is set to NULL
since the attributes are write-only.
2. Store method of read only sysfs attributes is set to NULL
since the attributes are read-only.

Change-Id: I93b14e22da57a8a47a02080a05a9b8c666970272
Signed-off-by: Abinaya P <abinayap@codeaurora.org>
2016-08-25 09:42:58 +05:30
Phani Kumar Uppalapati
b428b24214 drivers: mfd: Add 1.6MHz clk support for wcd934x codec
Add DMIC (Digital Microphone) 1.6MHz clock rate support
for wcd934x audio codec.

Change-Id: I601074304c7061a58e89a9e460e14225a6c1b335
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2016-08-24 18:10:19 -07:00
Riley Andrews
1943b682a3 cpuset: Make cpusets restore on hotplug
This deliberately changes the behavior of the per-cpuset
cpus file to not be effected by hotplug. When a cpu is offlined,
it will be removed from the cpuset/cpus file. When a cpu is onlined,
if the cpuset originally requested that that cpu was part of the cpuset, that
cpu will be restored to the cpuset. The cpus files still
have to be hierachical, but the ranges no longer have to be out of
the currently online cpus, just the physically present cpus.

Change-Id: I3efbae24a1f6384be1e603fb56f0d3baef61d924
[ohaugan@codeaurora.org: Port to 4.4]
Git-commit: f180bcac788464a0baf3d79d76dd86d6972ea413
Git-repo: https://android.googlesource.com/kernel/common/msm.git
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2016-08-24 16:03:23 -07:00
Nicholas Troast
ca38df6d39 qcom-charger: qpnp-fg-gen3: add v2 SRAM register map
The location of some fuel gauge SRAM registers have changed in
PMICOBALT v2. Add a new SRAM register map for v2 to handle these changes.

Change-Id: I1fcfce8e56b1d4e8b8f54457193cd547fb5e3de7
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2016-08-24 15:23:43 -07:00
Skylar Chang
f551e5cce9 msm: ipa3: remove wrong smmu clk vote
IPA-driver should request for
aggre2_noc_clk via bus driver.

Change-Id: I2f44b44a27ae93c6dd46cc6829d68ea1117ba237
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2016-08-24 15:07:12 -07:00
Skylar Chang
a4720ff813 msm: ipa: header change for SMMU wlan VA mapping
Wlan need to pass the VA to let the IPA-driver
decide when to suspend the WDI pipe in SMMU
enabled scenario.

Change-Id: I00ae7f088c7411c8a6420f5e7ab12276d65fd269
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2016-08-24 14:57:46 -07:00
Skylar Chang
c114fe5555 msm: ipa: fix potential race condition ioctls
There are potential race condition ioctls in
the IPA driver when it copies the actual
arguments from the user-space memory to the
IPA-driver. The fix is to add check on the
2nd copy to make sure the same payload size
is copied to the pre-allocated kernel memory
as in during the 1st copy.

Change-Id: I5a440f89153518507acdf5dad42625503732e59a
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2016-08-24 14:51:57 -07:00
Shashank Mittal
47dbefc263 defconfig: msm: enable common log for msmcobalt
Enable common log driver for msmcortex-perf_defconfig.
Common log driver is required to allocate memory for debugging.

Change-Id: I9a892ca7ffac903338c7f4f9ed5923b7b663a6a8
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
2016-08-24 11:12:02 -07:00
Oleg Perelet
3f44acf69e msm: kgsl: Change sequencing for GPU hardware clock gating
Disable GPU SP clock before programing hardware clock gating registers.

CRs-Fixed: 1056488
Change-Id: I2c91e8ae6a30facefd5dd3d4a4e4c33ffc792fe1
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
2016-08-24 22:42:37 +05:30
Praneeth Paladugu
35a1866858 msm: vidc: Fix multistream issues
This change is to fix issues reported when OUTPUT and OUTPUT2
ports enabled in Venus. In this case following are the rules
    - s_fmt on OUTPUT port updates OUTPUT port dimensions.
    - s_fmt on CAPTURE port updates CAPTURE port dimensions.
    - reconfig dimensions are always updated on OUTPUT port.
    - All clocks scaling, bus scaling uses max of both ports.
    - DCVS is based on reconfig, CAPTURE and OUTPUT port dims.

CRs-Fixed: 1044772
Change-Id: Ib45424c70f995d856ad27107ae3ea24a59ca4e74
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
Signed-off-by: Abdulla Anam <abdullahanam@codeaurora.org>
2016-08-24 09:56:20 -07:00
Divya Ponnusamy
fc817b706c msm: kgsl: Change %p to %pK in debug messages
The format specifier %p can leak kernel addresses
while not valuing the kptr_restrict system settings.
Use %pK instead of %p, which evaluates whether
kptr_restrict is set.

Change-Id: I0778e43e0a03852ca2944377256a7b401586a747
Signed-off-by: Divya Ponnusamy <pdivya@codeaurora.org>
2016-08-24 20:44:10 +05:30
David Keitel
669c266b9c ARM: dts: msmcobalt: add status property for memlat-mon for msmcobalt
Set the status property of the qcom,memlat-mon-cpu4 device. This is
required for partial binned devices.

Change-Id: I246a5f5149e492aba4f7c3920296d4bd3d873de0
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
2016-08-24 07:40:46 -07:00
Dhoat Harpal
6111a89212 soc: qcom: glink: Validate ctx before using
Glink does not validate the received handle from client apis.
This leads to possibility of illegal memeory access.

Magic number is added along with rcu lock to validate handle
received from client.

CRs-Fixed: 1047743
Change-Id: I08c854d5885672cbe5410efe0736640b55de8bbb
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
2016-08-24 18:29:47 +05:30
Dhoat Harpal
4669c62339 soc: qcom: glink: Best Fit approach to find intent
Using first fit algorithm to select the remote rx intent from the
list is not optimal way.

Optimize the selection of intent from list using the best fit algorithm.

CRs-Fixed: 1058750
Change-Id: I7b2a70188975b75a0fbcd2a6cb26f28cc0258532
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
2016-08-24 17:47:16 +05:30
Komal Seelam
3136a40d03 cnss: Provide API to CLD Driver to control SPDT GPIO
Antenna Sharing GPIO need to be toggled between QCA PCIe and SDIO
devices based on the requirement. If SDIO device is to be operational,
this GPIO should be turned ON high.

Expose API to CLD Driver to control this GPIO for dual-wifi platforms.

CRs-Fixed: 1013494
Change-Id: I271ba273a4c70717f066d219ff02e8f0f56e2ac3
Signed-off-by: Komal Kumar <kseelam@codeaurora.org>
2016-08-24 04:42:47 -07:00
Komal Seelam
9e5835025b cnss: Expose Power Up/Down API to WLAN Functional Driver
Dynamic Mode Change Feature Request, needs to power ON
QCA Chip during system bootup to get Firmware Capabilities.
Today the implementation is only during driver load, platform driver
power up the chip and call the device driver probe and call device driver
remove and cut the chip power during driver unload.
As part of this feature request, driver needs API to power down and
power up chip after ifconfig down and before ifconfig up.

CRs-Fixed: 1009901
Change-Id: I8e964c6bb8d6d8fb6f4bfba17a6b24b97509953c
Signed-off-by: Komal Kumar <kseelam@codeaurora.org>
2016-08-24 04:41:43 -07:00
Komal Seelam
ec79695605 cnss: Disable wlan irq when PCIe link down is detected
Interrupt Storm is observed on the APPS side, when PCIe link down is
simulated, as FW keeps generating interrupts to host, as it's not aware
of the PCIe link down.

When PCIe link down is identified, wlan platform driver schedules work
to start recovery. During Recovery we cut down power to QCA6174, which
stops the interrupt storm. During the window where platform driver
schedule work and the work actually gets schedules, interrupt storm
happened and the APPS triggered watchdog.

Change-Id: Ica3c32007bc9b8acce79c5bb2175790ff27180d0
CRs-Fixed: 967956
Signed-off-by: Komal Seelam <kseelam@codeaurora.org>
2016-08-24 04:40:49 -07:00
Komal Seelam
ae275bab72 cnss: Add optional property to control wlan_en gpio for Dual-Wifi platforms
The WIFI PCIe Clock is controlled by WLAN_EN gpio.
On Dual-WiFi Platforms, QCA WIFI SDIO chip clock sourced by PCIe Clock.

Turning off WLAN_EN gpio would result in SDIO WIFI Functional Failures.
Control the gpio, based on the platform.

CRs-Fixed: 990796
Change-Id: I1399cd8aa53d1c6fd6b8ff0c5cce66b978770dbd
Signed-off-by: Komal Seelam <kseelam@codeaurora.org>
Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
2016-08-24 17:07:23 +05:30
Shantanu Jain
29e0ce3c54 input: synaptics_dsx_2.6: fix issues raised by static analyzer
Fix issues raised by static analyzer:
1. initialize "retval" before being returned from the driver function.
2. Check return value of the function create_singlethread_workqueue()
   and return -ENOMEM if it failed. If creation of the workqueue
   failed, then both queue_work() and queue_delayed_work() calls will
   later crash, as they expect the workqueue pointer to be a non-NULL
   value. Also add clean-up code for this.
3. check return value of the snprintf() call as array 'buf' of size
   16 may use index value(s) 16...20.

CRs-Fixed: 995687
Change-Id: I89d9f7cacbcf23de43a7e96556d1ac65911126d6
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
2016-08-24 17:01:17 +05:30
Komal Seelam
639f0df4a0 cnss: Control vdd-wlan-xtal-aon-supply regulator in cnss platform driver
vdd-wlan-xtal-aon-supply(LD0-4) need to be voted by cnss platform
driver to keep wlan XO(LDO-5) ON during APPS suspend on mdmcalifornium
platforms when wlan is turned ON as per Power UP sequence. Currently
LDO-4 is only voted by USB driver when USB is connected. On removing USB,
LDO-4 is turned off resulting LDO-5 turned off.

When WLAN is turned on removing LDO-5 vote resulted in beaconing failures
on mdmcalifornium platforms. Hence add a dummy vote to LDO-4 when WLAN is
turned ON.

Change-Id: I0c6e7a6c2dc6a51fb19a9d31ceb6823fe9a05ae2
CRs-Fixed: 996537
Signed-off-by: Komal Seelam <kseelam@codeaurora.org>
2016-08-24 16:59:39 +05:30
Mao Li
11edf4f33c input: synaptics_dsx_2.6: fix CTP power issue for QRD8953
Synaptics touch controller does not go to sleep in suspend because
L6 is still enabled. Disable L6 in suspend to ensure CTP go into
sleep mode.

Change-Id: I40f3f380c1a85c292029d4e22e49bebf25bd198c
Signed-off-by: Mao Li <maol@codeaurora.org>
2016-08-24 16:56:28 +05:30
zhaoyuan
b378a2f8ba input: synaptics: defer touch resume to workqueue for v2.6 driver
During device resume, the touch resume function is called after
display resume. Touch resume function will take about >200ms.
Defer the touch resume function to a workqueue to reduce the total
device resume time. An optional DT property is added to enable this
on targets that need this feature.

This change has been merged. Now, touch driver was updated to V2.6,
so, merge this change to V2.6 driver.

Change-Id: Ica477f35bd4fda59eb49c9b4f5e88b460366c761
Signed-off-by: zhaoyuan <yzhao@codeaurora.org>
2016-08-24 16:50:27 +05:30
Shantanu Jain
a0732e6085 input: synaptics_dsx_2.6: Add support for clocks for secure touch
Because of a change in the underlying bus driver, the secure touch
layer in the input drivers is now required to control directly the
clocks which are needed during the touch sessions. The clocks which
are associated with the underlying I2C bus are clk_gcc_blsp1_ahb_clk
and clk_gcc_blsp1_qup3_i2c_apps_clk. These clocks are turned on/off
when the secure touch session is started/ended.

CRs-Fixed: 990820
Change-Id: Ie2f6f5b736b27792e6e4dc2c39064e0ebdc03d7b
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
Signed-off-by: Abinaya P <abinayap@codeaurora.org>
2016-08-24 16:39:41 +05:30