Adds new event type to convey about the resources
requirement.
Change-Id: I7ea67231c247dc983463a02b828c10adc486b60d
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
Proprietary chargers pull D+/- to specific voltages between 2.0-3.3V
(VLGC) for identification. The DM voltage may not exceed VLGC due
to pull-down resistor. Hence a proprietary charger is detected as
a Standard downstream port (SDP). Read line state to distinguish
between SDP and proprietary charger. The DP voltage would exceed
VLGC for proprietary chargers.
D- can be greater than VLGC when a low speed device is attached via
Accessory charger adapter (ACA-A). Hence mark the charger as ACA-A
if ID resistance is RID_A and D- > VLGC
CRs-Fixed: 368688
Change-Id: I3497efbe025abf150078a19d69254f75f5df5b2a
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Halt the system when HSIC system error happens and dump HSIC
link registres. Also, save the address of msm_hsic_hcd
structure to a global pointer.
CRs-Fixed: 375536
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Change-Id: Ia346778911f610338f38492bc1ff0e8a9c7a87c7
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>
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>
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>
Currently, qseecom user-space library does not have a way to
verify if a particular secure application is loaded in the
qsee or not. This new ioctl solves this issue.
Change-Id: Ia96459f3b8aadee2f6a3af564bb1cc83695759b5
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
Adding new usb_core_id property which is used to match an instance
of struct usb_gadget to an instance of struct usb_gadget_driver.
This will allow constructing more then one usb periheral stack.
This new property is optional and if not specified in both the gadget
and gadget driver then it will have the default value of zero.
Change-Id: Idbab46ed76267ab4827319f2f9efe67c91b50dbd
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
Currently the code does not have a mechanism to remember the soc
reported just before shutting down and upon restarting the new
soc reported is off from the previous soc value reported.
This change introduces
- a method to save soc in an unused coincell back register: ssbi address
0x107 is not used on 8921 and serves the purpose of storing the soc.
The driver reads this value and uses it to scale the reported soc.
- a method to detect that a battery was removed and perhaps replaced by a
different one. If the battery is found replaced the driver is notified
of the change and it disregards the soc value it read from the backup
register. The charger driver has a battery backed bit (force vref
therm) which it sets in its initialization sequence. Once set the
value remains between restarts, unless the battery is removed. The
default value of this bit is 0. Hence if a zero is detected before
writing to it, battery was removed between restarts - this mechanism
is used to notify the BMS to disregard the soc read from the backup
register.
Note that for this to work correctly the bootloader needs to be updated to
not overwrite register 0x107 upon restart.
CRs-Fixed: 370287
Change-Id: If7d098552d36eb27a396ee7d37f78d3629861f6e
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
The MIGRATE_CMA migration type has two main characteristics:
(i) only movable pages can be allocated from MIGRATE_CMA
pageblocks and (ii) page allocator will never change migration
type of MIGRATE_CMA pageblocks.
This guarantees (to some degree) that page in a MIGRATE_CMA page
block can always be migrated somewhere else (unless there's no
memory left in the system).
It is designed to be used for allocating big chunks (eg. 10MiB)
of physically contiguous memory. Once driver requests
contiguous memory, pages from MIGRATE_CMA pageblocks may be
migrated away to create a contiguous block.
To minimise number of migrations, MIGRATE_CMA migration type
is the last type tried when page allocator falls back to other
migration types when requested.
Change-Id: I2bb0954de8be4f212b03dea0e5a508048684bda2
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.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>
This commit adds the alloc_contig_range() function which tries
to allocate given range of pages. It tries to migrate all
already allocated pages that fall in the range thus freeing them.
Once all pages in the range are freed they are removed from the
buddy system thus allocated for the caller to use.
Change-Id: I659b133b1c9991568bfb6bd09c7792e15f2a2bfb
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.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>
Problem Description:
Open and close the same set of slimbus ports after
certain iterations will fail port open, as that port
was not disconnected successfully.
Fix Description:
Handle sequence of closing slimbus ports. Store
the channel masks associated with each codec dai
and reset them after they are closed from slimbus
Then, release the close slimbus port event, after
all the channels are closed completely
Change-Id: Ie14b9f0920b37f905151b48f18df181503acc21d
CRs-fixed: 370761
Signed-off-by: Swaminathan Sathappan <Swami@codeaurora.org>
Modem header files added new SSID. We need same changes on Linux side.
Change-Id: Ia383fd1f8ab889369b2577ae2df13894a1a62f7a
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
Complete the rename by changing cs to coresight for variables,
functions and constants.
Change-Id: I506d5872e5c09f201c4f3674d7722d36eca26921
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Since cs is not a well known acronym for CoreSight, rename
directory and files from cs to coresight.
Change-Id: I5f9b12794b80b1c01c9ce0621d53ee6be408a361
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Each device driver manages its own clk by using the clk apis that
now support CoreSight clock. Remove qdss clock wrapper functions
and their usage.
Change-Id: If73198f273f69e5525a6444e7a7c277c20c96111
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Support for CoreSight core layer apis that will be used by other
CoreSight drivers.
Change-Id: Ieddc3dd362ee8e641abc557153d0a3e38aa9beab
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
To support generic coresight driver, move stm header file from
mach-msm to include/linux
Change-Id: I6f83d28156fac72a2c35637b7f9b9b58d10d964d
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Create new jtag header file and move jtag related definitions to
it. This will decouple jtag code and help make coresight code
generic.
Change-Id: I722de9945800a4d0ba5b792c1b6dda5fc0b3cc40
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Move common shared data to external coresight header file.
Change-Id: I546ba939ef7d3d746cd171802498da5be872c234
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
As part of creating generic coresight driver code, rename qdss
to coresight.
Change-Id: I18f32ca96bb5c2e7ca540f592871e9942f2188e4
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
All clients are now migrated from the pmem_kalloc APIs. Remove
references to these APIs so no one can call them.
Change-Id: I8cc388c347d48a20525efbb2f42e1065cbbc44e6
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
The scope property indicates the operating mode of the system. This
property could be used to switch to and from usb host mode.
Add a helper api to update this property.
CRs-Fixed: 373365
Change-Id: I5fb57f7b1075276ba90b0f7e0a44626e07ee196f
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
The test scheduler allows testing a block device by dispatching
specific requests according to the test case and declare PASS/FAIL
according to the requests completion error code
Change-Id: Ief91f9fed6e3c3c75627d27264d5252ea14f10ad
Signed-off-by: Maya Erez <merez@codeaurora.org>
Add mpp support to the qpnp-pin driver. MPP support allows for
additional devices to be specified in the Device Tree topology.
This support is implemented in the same driver as the GPIO
support since the address map is very close between them.
The addition of this support does not change the existing gpio
support.
Default MPP configuration can be specified in the Device Tree
using the three new bindings for mpp. Any attribute not specified
in the Device Tree will assume its default configuration.
It's also possible to configure an MPP at runtime using the
existing qpnp_pin_config() API. If a given configuration feature
is not supported by the underlying hardware pin, then that
particular request is silently dropped with no error. This allows
for gpio users to continue specifying only a subset of the full
qpnp_pin_cfg structure.
Change-Id: I2b72768647de2a371edfa05c52fc1ed776c215c0
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
qpnp-gpio manages gpio_chip queries based on the slave
ID. This has a limitation in that it restricts the number of
gpio_chips per slave ID to one. However, some PMICs have both MPP
and GPIO on the same slave, and thus the slave ID is not a
meaningful unit to search for.
Instead, make use of the 'label' binding to give the
primary dev-container node a name. This name will serve as the
gpio_chip label, which can be used in lookups.
Change-Id: Ic20caeb4622d73449a983992275446c733ddd89a
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
The devnode array is currently being used for non
spmi-dev-container devices as a special case where the number of
devnodes is 1. This obfuscates the code and also removes the
ability to store the dev-container's device resource information,
since in that special case the devnode array is dedicated for the
child devices.
Add a new spmi_resource entry used for typical spmi_devices, and
treat the devnode array as the special case for
spmi-dev-container.
Also add a new API spmi_get_primary_dev_name() to return the name
of the device assigned with the 'label' binding if it exists.
Change-Id: Ibe7b12285e37bb0529024558550a96d71393bc10
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
Since QPNP PMICs also include support for MPP, and since we
intend to support MPPs in the same code base, it's not
appropriate to limit this the scope of this driver to 'gpio'.
Change the driver name to 'pin' since it more accurately
describes the potential for this driver.
Also update the Device Tree include files for the name changes.
Remove a superflous 'gpio-pin' definition in the msmcopper
specific include file, since such configuration shall never
change. This binding should be defined in the PMIC specific
include only.
Change-Id: Id1d6407039908e3cf44dfc19af71f0cdc7aff8e6
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
Since we support multiple device_nodes per spmi_device when used
with the spmi-dev-container flag, it's often unclear how a driver
should make reference to a particular device. Therefore,
introduce the spmi specific binding spmi-dev-name that specifies
the device name for the device_node.
Also introduce an API that can be used from
the driver to lookup the specific device node associated with a
particular device name.
Note that it may seem at first glance that the binding 'label' is
redundant with device_node->name. However, per the ePAPR,
device_node->name is intended to be as generic as possible,
representing the function of the device and not the precise
programming model. 'label' is used to give a platform
specific name that can be queried from device drivers.
Change-Id: I28eca35d0b625372c26a6d8ad81e7679f200d14b
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
reg-names and interrupt-names are standard bindings to map device
tree reg and interrupt indices to particular names. This way the
driver does not need to be concerned with hard coded assignments.
Therefore, add spmi support for these bindings.
Explicit support for reg-names is required since the
implementation does not make use of of_address_to_resource(),
which happens to already support this.
This is because of_address_to_resource() mandates address
translation, which is not relevant to spmi.
interrupt-names is already implicitly handled by
of_irq_to_resource(), which is used in the spmi implementation.
Add additional documentation to state clearly that this binding
is also supported.
Also add supporting routines to easily lookup a resource by name
for both registers and interrupts.
Change-Id: I94faf950da5106ecd4ff36f47e5b46102d9bd426
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
Pointers are more flexible than index numbers, since index
numbers depend upon an additional reference to the array in
question. In particular, we'd like to add a new API to lookup a
devnode based on a predefined name in the Device Tree. This API
will return a spmi_resource, and so it's natural to want to use
this pointer directly with the other existing APIs.
Also introduce a new API spmi_for_each_devnode that can be used
to iterate each spmi_resource in the dev_node array. This
abstracts the traversal of the array, which was previously done
within the existing APIs.
Change-Id: I18f9397e5d78770e840a9f95dd8061201931df6e
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
It turns out that the only use cases for the qpnp library use
the existing spmi data structures. As such, there's really
no justification for having the library not be called 'spmi'.
There is nothing Qualcomm specific about this code.
Also cleanup some inconsistencies in the Kernel Doc comments
while we're here.
Change-Id: I1c73c88be740b6f5d38ba2de62de1737981b30fa
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
The following merge commit chose the irq_domain implementation
from AU_LINUX_ANDROID_ICS.04.00.04.00.126 instead of the version
in v3.4.
commit f132c6cf77251e011e1dad0ec88c0b1fda16d5aa
Merge: 23016de 3f6240f
Author: Steve Muckle <smuckle@codeaurora.org>
Date: Wed Jun 6 18:30:57 2012 -0700
Merge commit 'AU_LINUX_ANDROID_ICS.04.00.04.00.126' into
msm-3.4
Since this version is inconsistent with the upstream,
port the irq_domain framework to the version in v3.4 and
makes all necessary changes to clients that are out of spec.
Details of client ports are below.
-Update the qpnp-int driver for revmap irq_domain API. The revmap
irq_domain implementation introduces a reverse lookup scheme using
a radix tree. This scheme is useful for controllers like qpnp-int
that require a large range of hwirqs.
-Bring the ARM GIC driver up to v3.4, being careful
to port existing CAF changes.
-Partially port the gpio-msm-common driver to the new irq_domain API.
Enable the gpio-msm-common driver to work with the new irq_domain
API using a linear revmap. It is not a full port since irq_domain
is still only registered for Device Tree configurations. It should
be registered even for legacy configurations.
In addition, the irq_domains .map function should be setting all
the fields currently done in msm_gpio_probe(). That's not
currently possible since msm_gpio_probe is invoked
unconditionally - even from Device Tree configurations.
Finally, gpio-msm-common should be converted into a real
platform_device so that probe() is invoked due to driver and
device matching.
Change-Id: I19fa50171bd244759fb6076e3cddc70896d8727b
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
There could be race condition between h/w initiating sof
(start of frames) and finishing port reset. This can
cause hsic phy lockup, which results in enumeration failure.
Avoid this race condition by:
1. Moving to the old enumeration sequence where set_address is
initiated before get_device descriptor. This results in one
port reset instead of two port resets.
2. Halt usb controller before initiating port reset and start it after
port reset is complete. This is tricky because PORT_RESET bit
automatically clears when h/w completes the reset and failure to
start the controller within 3ms causes the peripheral device to
suspend resulting in enumeration failure. Hence, after setting
port reset bit forcefully drive strobe/data lines to reset using
ulpi interface and once port reset is complete, disable forceful
reset and start the controller in atomic context.
CRs-fixed: 364458, 359930
Change-Id: I49a2eac8043eb3001956c7ee9ead2c3a901524db
Signed-off-by: Vamsi Krishna <vskrishn@codeaurora.org>
MMC_CAP2_POWER_OFF_VCCQ_DURING_SUSPEND and MMC_CAP2_PACKED_RD are defined
to the same value. Needs to give each one of them a unique number.
Change-Id: I5f55396075fbffdae305122cd8fbb9f4b056c751
Signed-off-by: Maya Erez <merez@codeaurora.org>
Add flag for handling secure session to rotator data passed during
start ioctl call.
Change-Id: Iaf22b7584a15d4678cd44483c0118bf1fb4c7c9b
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Add rotator session management support with overlay interface using MDP
flag MDSS_MDP_ROT_ONLY. Overlay interface can only support overlay
surface or rotator (written back to memory) but not both.
Change-Id: Ib2f494683b2e6c2fd8c67818df2b57afb82a3df3
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Using CPUFreq policy objects and setting the max frequency limit by
overriding the policy->max node, leads to race/overwrite conditions with
an user trying to use the scaling_max_frequency node.
The thermal limits are directly communicated to the 'msm' cpufreq driver
and use the cpufreq_update_policy() to ensure that the frequency is
limited as per the thermal safeguard requirements.
CRs-fixed: 370343
Change-Id: Iab5a15e0f0d25da4b9f6a9417dbfc01bf5d6f8f6
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
Some of USB clocks have to be enabled in order for A2 to
be able to wake up USB.
Since USB now enters LPM upon USB bus suspend, this fix keeps
USB pclk & core_clk enabled, to allow waking up from A2.
A similar fix was already introduced for HSIC driver. This
change adds similar fix for USB.
Change-Id: Icd434132bc3dc3466dc7a55bb40603a3de3b4b2f
CRs-Fixed: 369189
Signed-off-by: Amit Blay <ablay@codeaurora.org>
During the migration from kernel 3.0 to 3.4, V4L2 framework changed.
This requires changes from video driver. This change makes video
driver code compatible with kernel 3.4.
Change-Id: I12fb28e4b7c261c9755fbb62bb6bb8ea299d5272
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
Add support to allow ion_cp_heap.c to secure according to new
requirements. This includes adding versioning to the secure
calls to allow other types of securing to take place.
Change-Id: I65e07ebaeefa1d0572b6531753a707a28284aa0d
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Add pm8xxx-tm subdevice into pm8038-core. The pm8xxx-tm device
can be used to access the real-time PMIC die temperature. It
can also be used to trigger an interrupt when critical
temperature thresholds are reached.
Change-Id: I4b8bda1d51cafaa6b77408da4c183bdb2dc4327a
Signed-off-by: David Collins <collinsd@codeaurora.org>
The next generation of content protection has separate SCM
calls into TZ. Add these functions in a dedicated file so they
can be used by any Ion heap.
Change-Id: I197130f6a5fc33efcd6871b0f7c362fa99f18d20
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>