Dynamic hardware clock gating is supported for most multimedia
ahb and axi clocks on 8930. This patch enables this feature for
these clocks.
Change-Id: I64ba96a7d14576e2fc7f0c0963deb00f2fc02cf7
Signed-off-by: Tianyi Gou <tgou@codeaurora.org>
inst_lock of pcam_inst needs to be initialized and destroyed
properly.
Change-Id: Ie041fc429cdf122c01b93393bb4a6c20a08e4267
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Featurizing card detection with CONFIG_MMC_MSM_CARD_HW_DETECTION
is not giving any benefit hence remove it.
Change-Id: I933de6c3979352d29b150cc061622c5b70075787
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Check that the ops pointer is valid before using it, otherwise we
may fault.
Change-Id: I7f1420638eca53f6d85b8c3ff114033ce77cb408
CRs-fixed: 360810
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Remove unneeded idle commands from the command stream when updating
pagetables and doing TLB flushes. Ths cuts down on the number of
commands in the ringbuffer during switches.
Change-Id: I8f1fa31db33c465ecdbd0ca897f4651f2670c4e4
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
In case of IOMMU memory needs to only be flushed when it is
unmapped and not mappped. Also, when an application is running
the number of unmaps would in most cases be less than number of
maps, so this way the number of flushes wil be fewer.
Change-Id: Id4107631c343045edbc744125035202844405910
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Check global GPU status registers in intervals of 2 seconds,
if the registers did not change after 2 seconds trigger a hang.
When there is an actual GPU hang and GPU is stalled, this reduces
the current hang detection time from 10 seconds to 2 seconds.
Faster GPU hang detection reduces the overall time to recover
from GPU hang.
Change-Id: If432ccacc1b77b4fc7f08b756886bd3ae5edf04f
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
A busy loop is executed when we allocate space from the ringbuffer.
If the GPU is hung then we can wait indefinitely in the busy loop.
Add a wait time to this busy loop, and if the wait time elapses then
report a GPU hang instead of waiting indefinitely.
Change-Id: I035c39063cbfa25380702720f929df5319e73e61
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Log power packets in addition to power state changes.
Change-Id: I46b8d86df881b328bb9124611bdbf1a0db2928f9
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
The wakeup worker and TX worker both run on the same single-threaded
workqueue, so the wakeup worker needs to reschedule after sending a
wakeup character to allow pending characters to get flushed.
Without this change, a burst of wakeup characters will be sent once the
exponential back-off delay is 32ms after which the wakeup worker
reschedules itself as a delayed work item.
Change-Id: I4260c7f5b2f1f90e87575eac4b407be2bc6adb1d
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
If the receive retry queue size gets too large, then automatically
enable flow control to prevent having to drop buffers.
Change-Id: If27599015b362ce013e177ee350e026933390d72
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Use temporary values to allow using arguments with side effects in the
unit test macros.
Change-Id: Iebe7586e1d3469fcf9729b77ddedc701c71a2bd3
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Clarify test messages for list-empty reporting to avoid confusing
the list-empty flag with an event count value.
Change-Id: I31aeb6feb89ada5f7d5b691432b5d8f4aba64cc8
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Add range checking of the channel ID for packet logging. This prevents
out-of-bounds array access when reading the channel state.
Change-Id: Ic91b29e89ef9997525f6283b8212408cccd646f8
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Hold mutex lock while flushing TTY to avoid race condition with
unloading the line discipline.
Change-Id: I2327be9bd39119d14c3e607e8ace201d51755e08
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Pull in Ion patches for 3.4 upgrade. Inclues the following
patches from google:
commit 7191e9ba25
Author: Rebecca Schultz Zavin <rebecca@android.com>
Date: Mon Jan 30 14:18:08 2012 -0800
ion: Switch map/unmap dma api to sg_tables
Switch these api's from scatterlists to sg_tables
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
commit 6f9e56945d
Author: Rebecca Schultz Zavin <rebecca@android.com>
Date: Tue Jan 31 09:40:30 2012 -0800
ion: Add reserve function to ion
Rather than requiring each platform call memblock_remove or reserve
from the board file, add this to ion
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
commit 9ae7e01de1
Author: KyongHo Cho <pullip.cho@samsung.com>
Date: Wed Sep 7 11:27:07 2011 +0900
gpu: ion: several bugfixes and enhancements of ION
1. Verifying if the size of memory allocation in ion_alloc() is aligned
by PAGE_SIZE at least. If it is not, this change makes the size to be
aligned by PAGE_SIZE.
2. Unmaps all mappings to the kernel and DMA address spaces when
destroying ion_buffer in ion_buffer_destroy(). This prevents leaks in
those virtual address spaces.
3. Makes the return value of ion_alloc() to be explicit Linux error code
when it fails to allocate a buffer.
4. Makes ion_alloc() implementation simpler. Removes 'goto' statement and
relavant call to ion_buffer_put().
5. Checks if the task is valid before calling put_task_struct() due
to failure on creating a ion client in ion_client_create().
6. Returns error when buffer allocation requested by userspace is failed.
Signed-off-by: KyongHo Cho <pullip.cho@samsung.com>
commit 043a61468f
Author: Rebecca Schultz Zavin <rebecca@android.com>
Date: Wed Feb 1 11:09:46 2012 -0800
ion: Switch ion to use dma-buf
Ion now uses dma-buf file descriptors to share
buffers with userspace. Ion becomes a dma-buf
exporter and any driver that can import dma-bufs
can now import ion file descriptors.
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
commit 0d1259b5f8
Author: Rebecca Schultz Zavin <rebecca@android.com>
Date: Mon Apr 30 16:45:38 2012 -0700
gpu: ion: Use alloc_pages instead of vmalloc from the system heap
With this change the ion_system_heap will only use kernel address
space when the memory is mapped into the kernel (rare case).
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
commit be4a1ee79a
Author: Rebecca Schultz Zavin <rebecca@android.com>
Date: Thu Apr 26 20:44:10 2012 -0700
gpu: ion: support begin/end and kmap/kunmap dma_buf ops
These ops were added in the 3.4 kernel. This patch adds support
for them to ion. Previous ion_map/unmap_kernel api is also
retained in addition to this new api.
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
commit 46d71337f9
Author: Rebecca Schultz Zavin <rebecca@android.com>
Date: Mon May 7 16:06:32 2012 -0700
gpu: ion: Allocate the sg_table at creation time rather than dynamically
Rather than calling map_dma on the allocations dynamically, this patch
switches to creating the sg_table at the time the buffer is created.
This is necessary because in future updates the sg_table will be used
for cache maintenance.
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
commit 903f6c716d
Author: Rebecca Schultz Zavin <rebecca@android.com>
Date: Wed May 23 12:55:55 2012 -0700
gpu: ion: Get an sg_table from an ion handle
This patch adds an interface to return and sg_table given a
valid ion handle.
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
The commit also includes fixups needed for MSM specific code.
Change-Id: Idbcfa9d6af0febf06f56daaa6beaa59cc08e4351
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
The auto_off feature loops through all clocks in lateinit and disables
them if their reference count is 0, so long as the SKIP_AUTO_OFF flag
is not set. This has a significant functional overlap with the more
intelligent handoff feature.
In addition to detecting initial clock rates, handoff (like auto_off)
disables clocks in lateinit, but only if the clock was detected to be
on when the handoff op was called during msm_clock_init.
Currently, handoff does not support a skip flag like SKIP_AUTO_OFF,
which was used aggressively by proc_comm targets. Experimentally,
however, this does not seem to cause problems, possibly because
clocks are now being more selectively disabled.
Because there is no up-to-date documentation of the reasons why many
of these flags were set, the flags are just dropped by this patch
until their questionable utility can be re-evaluated.
Change-Id: I6b3eeff9f8040d87be1a94cb28b28ab5774f23fb
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Add device tree support to sound soc audio drivers.
These drivers get registered to the alsa framework
and thus aid detection of soundcard.
Change the device tree entries to follow the new
design approach of having individual probe functions
for each audio interface.
Change-Id: Ie8f0bddd5ba6e2cfb66c6a23efdcb434c5082d7d
Signed-off-by: Phani Kumar Uppalapati <phanik@codeaurora.org>
The original intent of disallowing voltage set across cpus is to prevent
setting of voltages on a core when its idle thread. The cpufreq
framework ensures that the frequency changes and hence the voltage
changes happens on the respective cpus. By allowing setting of voltages
from others cpus, the secondary cores can be brought out of reset by the
non-primary CPUs after boot and thereby help mitigate any thermal issues
associated wth multicores.
The regulator framework that calls into msm_spm_set_vdd provides the
necessary access restrictions to prevent simultaneous calls into
msm_spm_set_vdd.And hence the spinlocks around the set_vdd calls have
been removed.
Change-Id: Ie60673d4b65953a0a8f9ec9bafb82399f692a7b5
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
In the case of SGLTE, the power down function for the external modem
will not get called after its ramdump collection is done.
Change-Id: Id71a549b775d83a7e09cd9daab913def09c1ef84
Signed-off-by: Ameya Thakur <ameyat@codeaurora.org>
Attach IOMMU call is currently done from DSI cmd mode DMA
update method. Move the attach call to kickoff which enables
it from restore and video paths
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Change-Id: I06d39e31b3ab1cf797fb655e7e558c1cabd98ebf
USB DP and DM lines are routed to USB PHY via MHL transmitter chip
if it is present on the board. MHL transmitter route USB DP and DM
lines to MSM based on the High Speed Switch position. The regulator
controlling this switch is different across targets. For example
this switch is powered up by 3.3V regulator on 8960 Liquid and it is
5V regulator on 8930 fluid. Hence rename existing "mhl_ext_3p3v"
supply name to a generic name "mhl_usb_hs_switch".
Change-Id: I35a6240fdbb01fa6b695a52968cd141d9418def7
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Remove static declaration of number of counters in the
L2CC PMU. Instead read from L2PMCR and adjust event id
allocation appropriately.
Change-Id: I1b3c7eec24fedc3a91ce6c3e93bbc58eb4d7ac91
Signed-off-by: Ashwin Chaugule <ashwinc@codeaurora.org>
Enabling pil vidc driver, which is used for loading secure firmware for
content protection feature.
Change-Id: I119331f95efd2f16b13221f9a26eb56b21108092
Signed-off-by: Riaz Ur Rahaman <riazr@codeaurora.org>
Add necessary match table so this driver can be used in
Device Tree configurations
Change-Id: I4e7fd0c1bb1d9f22296f70cf5710016b10046cd5
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
In the case of a crash on either one of the modems on SGLTE,
we need the other one to be restarted as well.
Change-Id: Iff300a6edc588bd75d218a9853cecaec33924841
Signed-off-by: Ameya Thakur <ameyat@codeaurora.org>
Currently, a segment's p_type value from program head is bitwise
AND with PT_LOAD type constant to determine if it's a loadable
segment. This might cause problem when the p_type value of a
non-LOAD segment has the PT_LOAD bit set. For example, the
GNU_STACK segment.
Fix this by comparing p_type value against PT_LOAD type constant.
Change-Id: Ie293dfd3ad744fc5dab3d9a6e7992f42d609b17c
Signed-off-by: Tianyi Gou <tgou@codeaurora.org>
Only SMUX_DATA_CTL_0 is currently used from userspace.
Change-Id: Iab9e4fa9b096d34a67fb6662418aec0be1381adb
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Disable debug logging that was only necessary for bring-up.
Change-Id: I5a31a982efdd1bb1915571158cc164a3856b097d
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
SMUX_CTL module currently does not handle removal of the driver
gracefully. If there are any pending blocked calls on wait_event,
and the line discipline is removed, this results in accessing
destroyed wake queues.
Add support for aborting wait in response to device removal.
Change-Id: I3213306f6ed401f3abe5770ce324d9329e4dbc3f
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Add a function which adds an event to disable the iommu clocks
based on a timestamp. If timestamp elapses then the event function
will disable the iommu clocks. Remove the disabling of iommu clocks
from the power control code.
Change-Id: Ic1263771f8c532131059283dde05425a73554974
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
MDP clock's overlay block is enabled during first update after panel
on currently. This is now moved to panel on to keep clock enabled
right from display on time.
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Change-Id: Ie201186c1471201874f2eff246486bc4a73b5872
Add GPIO regulator devices for both 7x27A and 8x25 QRD devices.
These are needed for shared GPIO functionality on QRD devices.
Change-Id: I15a02a2c1b5d2c5f272dbe69eccbfaef743e99ad
Signed-off-by: Aparna Mallavarapu <aparnam@codeaurora.org>
Make sure that the busy times are calculated at the end of the
current sample and before the next sample starts. This prevents
false alarms of busy timer events being triggered. Applies only
to devices with idlestats power policy.
Change-Id: I1e28fff4128b72c25e8073d845d519867d67a9ca
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
Till now mem-clocks were supported only in active context.
Due to that a potential out-of-bounds array access was
caught, which would result in a mem-clock access in sleep
context. Fix this by adding support for mem-clock in active
and sleep context.
Change-Id: I8772621cd20821cccf0d187fc1fb688fe8fda76e
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
The function to reset the external modem can be called from
atomic context so we need to use mdelay instead of usleep.
Change-Id: Ia161ced98764ed3772852f4252215452a1928ff7
Signed-off-by: Joel King <joelking@codeaurora.org>
The current code disables charging when the usb is operating in host
mode. This unnecessarily stops charging from the DC path. The board
layout (the ovp fet and otg path) is assumed to support host mode and
charging from dc path.
Also make the usb driver change the power supply framework's scope
property instead of calling 8921 charger apis directly.
CRs-Fixed: 373365
Change-Id: I2a9fb32de22cbe68e26078b97a7d83c40272a370
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
During slow insertion of headset, it may be possible that the
headset is wrongly detected as a headphone. This results in
the headset mic being non-functional.
Fix by polling the microphone voltage after a plug is detected
as a valid Headphone. In case the microphone voltage settles to
a valid headset voltage, correct the plug type from Headphone to
Headset.
CRs-fixed: 370332
Change-Id: I5280542e857940f8d228c5f0ded1d2fde301168f
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Decoder's output order was configured incorrectly, this
change fixes it.
Change-Id: I523260db33f1df5ffb7c30026683b272c9a05488
Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>
SDC controllers need two types of power supply:
- vdd (SD/eMMC flash core power supply)
- vdd_io (SD/eMMC I/O pad power supply)
Add support for enable, disable, low power mode setting
for these regulators.
Change-Id: Ifd0ef0d4dd9732893f49700fe86b1dad24497f71
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Class of device information is required to the bluez userspace
to write to persistant storage and also update upper layers on
request. So update the local CoD info to bluez once the hci write
is successful.
Change-Id: If45910d4b391616592b49d77d87ca0314be1f033
Signed-off-by: Srinivas Krovvidi <skrovvid@codeaurora.org>
This ccadc module is reused in multiple pmics. It is now unnecessary
to check for 8921 versions in the driver. As a result of this change
older 8921 versions are not supported.
CRs-Fixed: 372679
Change-Id: I2114f9428e2ba1a29c2bc9caaaa75106caf1dfc3
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
This patch adds support for CMA to dma-mapping subsystem for x86
architecture that uses common pci-dma/pci-nommu implementation. This
allows to test CMA on KVM/QEMU and a lot of common x86 boxes.
Change-Id: I8c826faaef1ae6c558db9deb9f693e551fc89ec4
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
The Contiguous Memory Allocator is a set of helper functions for DMA
mapping framework that improves allocations of contiguous memory chunks.
CMA grabs memory on system boot, marks it with MIGRATE_CMA migrate type
and gives back to the system. Kernel is allowed to allocate only movable
pages within CMA's managed memory so that it can be used for example for
page cache when DMA mapping do not use it. On
dma_alloc_from_contiguous() request such pages are migrated out of CMA
area to free required contiguous block and fulfill the request. This
allows to allocate large contiguous chunks of memory at any time
assuming that there is enough free memory available in the system.
This code is heavily based on earlier works by Michal Nazarewicz.
Change-Id: I8a04c58b0d39ee7343ac0b58b6dad9d57912c91d
[lauraa: fixed Kconfig conflict]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
alloc_contig_range() performs memory allocation so it also should keep
track on keeping the correct level of memory watermarks. This commit adds
a call to *_slowpath style reclaim to grab enough pages to make sure that
the final collection of contiguous pages from freelists will not starve
the system.
Change-Id: I2d68d9ac2cfcd32ca6f515fc7e44e8d9d850dff1
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Michal Nazarewicz <mina86@mina86.com>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
After regulator_get call for HDMI PLL footswitch purpose, set
output voltage to 1.8 V to ensure proper state while enabling and
disabling regulator.
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Change-Id: Ifdd0cdbf614524b53038074b943cca65b71bbd24
If due to timing issues out of our control, an outbound ATT Indicate
is delayed to the point that user space code does not receive
confirmation within it time-out period, both Client and Server
sockets must be torn down. We also must always respond to incoming
ATT Indicate pkt with a Confirmation, as the Error Response is an
illegal response for Indicate.
CRs-Fixed: 363355
Change-Id: I4003a59e1a731a08818f18d5b79db537e2aa2619
Signed-off-by: Brian Gix <bgix@codeaurora.org>