Commit graph

572398 commits

Author SHA1 Message Date
Hemant Gupta
0ef7e894f7 Bluetooth: HID: Add support for building hid drivers
This patch adds support for enabling uhid driver in kernel which
provides interface for user space hid module to interact with
hid drivers of kernel. Without support for uhid driver, Bluetooth
HID functionality is broken completely. Also support for vendor
hid drivers is enabled so that HID profile can be connected with
these HID devices.

Change-Id: If56742a9c6b6c4ef774da6e83d57aee56bf28842
CRs-Fixed: 553571
Signed-off-by: Hemant Gupta <hemantg@codeaurora.org>
2016-07-21 03:46:48 -07:00
Susheel Khiani
36c23da759 iommu/iommu-debug: Make debug driver 32 bit compatible
Currently iommu-debug was enable only for 64 bit
targets as there were compilation issues coming
up while enabling it for 32 bit. Fix these issues
to ensure that we can use it on 32 bit targets
too.

Change-Id: If230af86f2fdd12fb5396f3b4736e57a123422bd
Signed-off-by: Susheel Khiani <skhiani@codeaurora.org>
2016-07-21 03:13:27 -07:00
Manish Poddar
80eb335deb msm: Camera buffer overflow fix
find_first_zero bit is considering addr parameter as unsigned
long and we are passing int variable.In the function it access
addr[i], so it tries to access 8 bytes , actual size of
open_idx and stream_id are 4 bytes.we change open_idx and
stream_id to long to fix it.

Change-Id: I510059cc8f495957bd2b5af9973b3495761edd06
Signed-off-by: Manish Poddar <mpoddar@codeaurora.org>
2016-07-20 22:50:49 -07:00
Krishna Chaitanya Devarakonda
25817c2873 msm: mdss: Fix mixer extension offset
The mixer extension offset for VIG3 is pointing to VIG2.
Correcting the offset value.

Change-Id: Ie54c2edc940495484f01e539cf42d5c83c4b0535
Signed-off-by: Krishna Chaitanya Devarakonda <kdevarak@codeaurora.org>
2016-07-20 18:54:42 -07:00
Satyajit Desai
8624f4eca5 coresight-etm4x: avoid reading trace-id from ETM hardware block
I/O read of trace-id when the CPU is in power collapse can result
in undefined behavior and system crash. Trace-id is set during
ETM init and not modified thereafter. So, there is no real need
to read the value from I/O.

Change-Id: I83029c721f7b90c65fcc8a958c7a82e65d005ed5
Signed-off-by: Satyajit Desai <sadesai@codeaurora.org>
2016-07-20 17:14:31 -07:00
Abhijeet Dharmapurikar
b4713c2ca1 smb-lib: account for Jeita while distributing FCC
The master charger has built in Jeita compensation where it reduces
FCC when the battery is in cool/warm Jeita threshold. This skews
the distribution of FCC between master and slave in parallel
configuration.

Fix this by checking if soft Jeita is active. If so reduce the requested
fcc so that master and slave get reduced share. However, since master
is reducing its FCC, add the reduction again to its share so the net
FCC on master is as per the distribution.

This also calls to handle the battery temperature change interrupt and
redistribute FCC.

Change-Id: I413cc0231a9125422efc71ed67717921af939959
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-07-20 16:54:55 -07:00
Abhijeet Dharmapurikar
6899c6bfff smb-lib: improve handling of usbin plugin interrupt
Currently the code disables the dpdm regulator if VBUS is present and
regulator is enabled.

It could happen that the charger oscillates its VBUS as it settles and
based on the delay's in responding to an interrupt, the software could
read vbus_present while the regulator was enabled earlier causing an
incorrect disable of the dpdm regulator.

It is required to ignore the interrupt in such cases.

Change-Id: I882780c1bcbc7713973eda5383291d891787f144
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-07-20 16:50:56 -07:00
Abhijeet Dharmapurikar
bc356bece8 qcom-charger: smb2: configure input from wipower
Wipower feeds to the DCIN input of the smb2 charger and relies on
input current configurations on six different voltage ranges for
optimal power draw.

Provide means to configure the current limits in them via a device
tree setting.

Change-Id: I81d1dc3ed1d588d67525b15120e7d8b947536099
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-07-20 16:50:54 -07:00
Jordan Crouse
a5c4e52c5e msm: kgsl: Keep the active draw context until it is switched out
Instead of trying to make a decision to switch out the active
draw context for NULL at detach time leave the reference count
for it until the next context switch or until the next slumber
whichever comes first. This avoids races with the preemption
code and ensures a smooth transition.

A side effect is that we were depending heavily on the context
detach to reset the ringbuffer to the default at power down and
we didn't touch it on power up (though we did on soft reset and
wake from slumber. Curious).  Obviously if we are no longer
switching we will need to force the default pagetable during start
but it seems to me like this would be the right thing to do even
if we were still switching out.

CRs-Fixed: 1009124
Change-Id: Ic0dedbadff8df192096292b221130c8ef5b31e12
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2016-07-20 15:19:35 -06:00
Jordan Crouse
d8fa23c244 msm: kgsl: Force all command level context switches to the GPU
Force any command triggered context switch to the GPU - it should
be on the GPU anyway, but we were already passing a flags parameter
(unused) so this is a good chance to force the issue and make sure
that the cpu path decision isn't in play here.

CRs-Fixed: 1009124
Change-Id: Ic0dedbadb277a6498d0840b45c90e1265e2f354a
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2016-07-20 15:19:34 -06:00
Jordan Crouse
cdb650787d msm: kgsl: Record the ringbuffer start of pipeline timestamp
We are only writing the ringbuffer start of pipeline timestamp for
internal commands that do not have a draw context associated which
happen rarely (if ever).  We should be recording the timestamp for
*ALL* commands so when something goes wrong we can get a fuller
idea of the timestamp picture for each ringbuffer.

CRs-Fixed: 1009134
Change-Id: Ic0dedbad6d99130e31cd8a06dfe025610e9157a8
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2016-07-20 15:19:34 -06:00
Jordan Crouse
75437b98b1 msm: kgsl: Relax timestamp comparisons for processing events
When processing an event group we check the previously processed
timestamp to avoid going through the loop if we don't need to.
We use timestamp_cmp() to check the timestamp. In situations
where the retired timestamp has advanced by more than 0x80000000
since the last time we checked the timestamp, timestamp_cmp()
will return -1 as it thinks that the new timestamp is older than
the processed timestamp. This can happen with certain tests and
scheduling hiccups.

The event processor can be much less restrictive - all we really
care about is that the retired timestamp didn't slip backwards by
accident (highly unlikely). So just check that the last proccessed
timestamp is not equal to the retired timestamp and if the
retired timestamp has already rolled, that the delta is outside
of the 0x8000000 window.

CRs-Fixed: 1009149
Change-Id: Ic0dedbad641bfa3fd6cbc1c91a37fb0e37f72bae
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2016-07-20 15:19:34 -06:00
Jordan Crouse
858b8e0264 msm: kgsl: Remove unneeded error message in kgsl_iommu.c
iommu_attach_device() should return a log message for every
possible error and we don't need to double up the pain
especially for situations when we run out of available
domains and start getting a storm of ENOSPC errors back.

CRs-Fixed: 1009158
Change-Id: Ic0dedbad7416abb23c769a4d3be9ebd0ca04810c
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2016-07-20 15:19:34 -06:00
Jordan Crouse
dd9a770d23 msm: kgsl: Do INIT_WORK() just before queueing a deferred mem entry
gpuobj_free_on_fence() is used infrequently enough that it doesn't
make sense to do INIT_WORK() when the memory object is created,
especially if debug objects are enabled because INIT_WORK() will go
off and do a bunch of accounting that we don't need.  Do the
INIT_WORK() just before queueing in those rare cases that this
actually happens.

CRs-Fixed: 1009183
Change-Id: Ic0dedbad1015883788e12815806e3249a1e09b21
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2016-07-20 15:19:34 -06:00
Jordan Crouse
340d8516dc msm: kgsl: Remove idle wait in kgsl_iommu_set_pf_policy()
We don't need to wait for idle before changing the pagefault
policy on the IOMMU which is a good thing because on a busy
system we may never hit idle.

CRs-Fixed: 1009187
Change-Id: Ic0dedbadb8f6122e32a0a34a65c54a7bca2a523c
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2016-07-20 15:19:34 -06:00
Jordan Crouse
091839e4c3 msm: kgsl: Allow a draw context to skip snapshot
Some test applications intentionally generate a GPU fault for
various reasons. Because a GPU fault generates a snapshot and
snapshots are persistent until they are pulled, running the test
application may take up the snapshot slot and prevent a real fault
from being captured and debugged.

This flag allows the draw context to intentionally avoid generating
a snapshot.

CRs-Fixed: 1009190
Change-Id: Ic0dedbad8476c308a13572d999540b243d97eabc
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2016-07-20 15:19:33 -06:00
Jordan Crouse
e6814f052b msm: kgsl: Program the secvid registers in the soft reset path
The secure buffer registers were not being programmed in the soft
reset path which was causing a failure for the critical packets
workaround and forcing a hard reset.

CRs-Fixed: 1009194
Change-Id: Ic0dedbad998767a1ffdfe265e52fae7baa18d203
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2016-07-20 15:19:33 -06:00
Jordan Crouse
46369030ee msm: kgsl: Implement fast preemption for 5XX
Allow 5XX targets to preempt quickly from an atomic context. In
particular this allows quicker transition from a high priority
ringbuffer to a lower one without having to wait for the worker
to schedule.

CRs-Fixed: 1009124
Change-Id: Ic0dedbad01a31a5da2954b097cb6fa937d45ef5c
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2016-07-20 15:19:33 -06:00
Jordan Crouse
0da2fbad58 msm: kgsl: Preemption cleanups
Remove some unused gpudev hooks and further segment the A4XX and
A5XX specific code into their respective areas.  Remove some bits
that are only applicable to 4XX from the 5XX side.

CRs-Fixed: 1009124
Change-Id: Ic0dedbadc324b979583d7a3998195bf15ac537f6
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2016-07-20 15:19:33 -06:00
Jordan Crouse
ea91f74673 msm: kgsl: Leave the MMU clocks on with the rest of the GPU
It is no longer power efficient to independently enable and disable
the MMU clocks. We can safely enable and disable them with the rest
of the GPU clocks and take back the infrastructure needed to handle
the clocks.

CRs-Fixed: 1009124
Change-Id: Ic0dedbadc48095eada9c5fce6004475a2cb0f0a9
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2016-07-20 15:19:33 -06:00
Carter Cooper
2e7b23f2af msm: kgsl: Use the GPU to write the RPTR
The memstore shared between the CPU and GPU is old but can not be
messed with. Rather than stealing values from it where available,
add a new block of shared memory that is exclusive to the driver
and GPU. This block can be used more freely than the old
memstore block.

Program the GPU to write the RPTR out to an address the CPU can read rather
than having the CPU read a GPU register directly. There are some very
small but very real conditions where different blocks on the GPU have
outdated values for the RPTR. When scheduling preemption the value read
from the register could not reflect the actual value of the RPTR in the CP.
This can cause the save/restore from preemption to give back incorrect RPTR
values causing much confusion between the GPU and CPU.

Remove the ringbuffers copy of the read pointer shadow.
Now that the GPU will update a shared memory address with the
value of the read pointer, there is no need to poll the register
to get the value and then keep a local copy of it.

CRs-Fixed: 987082
Change-Id: Ic44759d1a5c6e48b2f0f566ea8c153f01cf68279
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2016-07-20 15:19:32 -06:00
Rajesh Kemisetti
0ff59e6262 msm: kgsl: Stop fault_timer before reading fault registers
Currently adreno_ft_regs_val is getting updated at the time of
first submission or on the expiry of fault_timer.

If the fault_timer expires exactly at the time of inflight becomes 0
and there is an immediate submission for which GPU finishes the work
within short time. Then there is a chance to read the fault registers
in fault_detect_read() and fault_detect_read_compare() with less
time gap and declare it as a fault.

Stop the timer before reading fault registers and start it again.

CRs-Fixed: 1043478
Change-Id: Ib35104adf7b3618f94c6adf7fab531abffea3f76
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2016-07-20 15:19:32 -06:00
Shubhraprakash Das
6dee9ee63f msm: camera isp: Control camif interrupts on camif enable/disable
Turn off the camif interrupts when camif is disabled and turn them
on when camif is enabled. Also, improve the code to keep track of
interrupts that are enabled by updating them in the function that
sets interrupts instead of doing it in multiple places.

CRs-Fixed: 1037272
Change-Id: I1cc965696c06bd3901d86668aaf597abb3ef2d6d
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2016-07-20 11:48:57 -07:00
Shalini Krishnamoorthi
b13e28827a clk: qcom: Porting display clocks from msm folder to qcom folder
Porting msm8996 related display clocks/PLL from drivers/clk/msm
to drivers/clk/qcom (upstream version).

Change-Id: I7a4ab0be9e70f25817edadfc2eab4f7adf4435ee
Signed-off-by: Shalini Krishnamoorthi <shakri@codeaurora.org>
2016-07-20 11:46:58 -07:00
Mayank Rana
92a165748a ARM: dts: msm: Update QUSB PHY device node compatible property on msmcobalt
It is required to use phy-msm-qusb-v2.c driver with msmcobalt platform.
Hence use "qcom,qusb2phy-v2" instead of "qcom,qusb2phy" as compatiable
string with QUSB PHY related device node on msmcobalt.

Change-Id: I8d8ed29215f326801ba4e60794cc63e4eaeeb97e
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-07-20 11:34:49 -07:00
Devdutt Patnaik
e00fec135a usb: phy: qusb: Determine linestate for QUSB2 PHY
Controller driver passes current speed to QUSB2 PHY driver in
the flags parameter. Determine linestate using speed,
mode and cable connection status. This deprecates the older
mechanism where linestate was determined by reading the now
obsoleted QUSB2PHY_PORT_UTMI_STATUS register.

Change-Id: I682eb250964f32f93d7b31dae0291aca7fa44362
Signed-off-by: Devdutt Patnaik <dpatnaik@codeaurora.org>
2016-07-20 11:34:48 -07:00
Devdutt Patnaik
4d0a155ed7 usb: dwc3: Determine connection speed for HS PHY
DP/DM linestate is needed by the QUSB2 PHY driver to configure the
polarity of DP/DM transition triggers for exiting low power mode.
This was previously available via the  QUSB2PHY_PORT_UTMI_STATUS
PHY register which is now deprecated. In order to correctly determine
the interrupt polarity we need to pass the current operating speed
to the QUSB2 PHY driver. The PHY driver uses mode, speed and
cable connection status to determine the linestate and configure
interrupt polarities for wake up. Add logic to determine operating
speed for host and device mode cases.

Change-Id: Iaede1269f514a314bd9717a33100f748e7753b2a
Signed-off-by: Devdutt Patnaik <dpatnaik@codeaurora.org>
2016-07-20 11:34:47 -07:00
Devdutt Patnaik
54178f48e0 ARM: dts: msm: Update QUSB2 PHY device node for host mode on msmcobalt
Update the device node for QUSB2 PHY with the recommended
register initialization sequence for host mode.
This is needed to fix HS enumeration issues due to port
reset failure.

Change-Id: I8cfed672ff02cd61beb956116f9fcd365211cf11
Signed-off-by: Devdutt Patnaik <dpatnaik@codeaurora.org>
2016-07-20 11:33:56 -07:00
Jack Pham
f33cac01f3 usb: pd: Don't notify EXTCON_USB unless type is SDP or CDP
commit 77f6fd8044 ("usb: pd: Add support to notify plug
orientation via extcon") added an additional extcon notifier
to indicate orientation. But for the PE_SNK_STARTUP case
the change inadvertently notifies EXTCON_USB for all sink
states when it should just be for psy_type==USB|USB_CDP.
Add the missing curly braces to the if statement.

Change-Id: I19d424ff0d46cc0134210424a7d431b331cbf963
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-07-20 09:51:33 -07:00
Linux Build Service Account
9e4b3ba4af Merge "soc: qcom: code cleanup for service-locator" 2016-07-20 08:07:33 -07:00
Linux Build Service Account
b1210d3650 Merge "msm: vidc: Increase output port buffer size for VP9 decode" 2016-07-20 08:07:32 -07:00
Linux Build Service Account
135ada4b84 Merge "wcnss: Avoid user buffer overloading for write cal data" 2016-07-20 08:07:31 -07:00
Linux Build Service Account
043976c57f Merge "ARM: dts: msm: add gpio controller node for msmcobalt" 2016-07-20 08:07:28 -07:00
Linux Build Service Account
ee51bb2ba3 Merge "qcom-charger: smb138x-charger: change power supply type to usb parallel" 2016-07-20 08:07:27 -07:00
Linux Build Service Account
9d47bda2f3 Merge "ARM: dts: msm: update min voltage for pmcobalt s5 and s7" 2016-07-20 08:07:26 -07:00
Linux Build Service Account
7d113eb7d6 Merge "ARM: dts: msm: add ion heaps for msmfalcon" 2016-07-20 08:07:25 -07:00
Linux Build Service Account
8ac4813eb5 Merge "ARM: dts: msm: Add initial memory map for msmfalcon" 2016-07-20 08:07:24 -07:00
Dhoat Harpal
fd706908c9 ARM: dts: msm: Add ipc-spinlock entry for MSMFALCON
Add the ipc-spinlock entry to facilitate locking between apps and
non-apps processors.

CRs-Fixed: 1043377
Change-Id: I097e5464ec6ab80c12bcdb5f38d0599fa40da9ee
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
2016-07-20 20:00:20 +05:30
Raviteja Tamatam
c4469317c0 msm: mdss: fix mdss errors on 32-bit compilation
Changes made to fix mdss compilation errors on
32-bit mode

Change-Id: Ic28f6f36781154ff0c28f4636ade8523d753ab6a
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
2016-07-20 16:19:35 +05:30
Anand Kumar
f009a48f80 wcnss: Avoid user buffer overloading for write cal data
compare size of allocated cal data buffer from heap
and count bytes provided to write by user to avoid
heap overflow for write cal data.

Change-Id: Id70c3230f761385489e5e94c613f4519239dfb1f
CRs-Fixed: 1032174
Signed-off-by: Anand Kumar <anandkumar@codeaurora.org>
2016-07-20 00:35:18 -07:00
Yeleswarapu Nagaradhesh
5e351f3751 ARM: dts: msm: add gpio controller node for msmcobalt
WCD934X audio codec has GPIO controller and hence add
pinctrl node for WCD934X pinctrl driver. Change WSA GPIO's
to codec GPIO's.

CRs-Fixed: 1041199
Change-Id: I0f04c08587f080eb2df7341d41344ce2079de21b
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
2016-07-20 12:37:23 +05:30
Yeleswarapu Nagaradhesh
7f5b8235c1 ASoC: wcd9335: add all child devices of codec
New codec child nodes are added to handle wsa881x
enable pin. Add all the child devices of codec.

CRs-Fixed: 1041199
Change-Id: I889922a0c36ec80ee6ede95b2f19f80791323332
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
2016-07-20 00:01:03 -07:00
Yeleswarapu Nagaradhesh
1b289a8a23 ASoC: wcd: add wcd934x gpio controller device
Add wcd934x gpio controller as child to codec node
and add all child devices of codec.

CRs-Fixed: 1041199
Change-Id: I32ad5c5c8c9dd30a79818c873cfe1d121fd62d49
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
2016-07-19 23:31:09 -07:00
Laxminath Kasam
482c8b19a8 ASoC: Fix freed memory access of pcm stream kctl
Consider sound card instantiate fails due to
audrx init failure. In such case, all dais/ctls
are de-registered and freed. But as part of it,
access to unregistered ctls for pcm_chmap and similar
controls result in crash.  Ctls are freed at disconnection
but the disconnect is called only when it was registered.

CRs-Fixed: 1038054
Change-Id: Ief8817b4ec000c058d46aa021977b7c6003c0011
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2016-07-20 11:40:25 +05:30
Linux Build Service Account
7eb20e5733 Merge "msm: vidc: Add support for setting packed QP range" 2016-07-19 18:48:00 -07:00
Linux Build Service Account
25a5fb85c0 Merge "qcom: wcd934x: add pinctrl driver for wcd934x" 2016-07-19 18:47:59 -07:00
Linux Build Service Account
3225611f1d Merge "NFC: Fix crash due to invalid use of ese gpio" 2016-07-19 18:47:58 -07:00
Linux Build Service Account
88451207ce Merge "msm: vidc: check for venus_hfi_device state in resume" 2016-07-19 18:47:57 -07:00
Linux Build Service Account
c9176f0451 Merge "msm: camera: ispif: RDI Pack mode support" 2016-07-19 18:47:56 -07:00
Linux Build Service Account
b673198869 Merge "sched/core: Fix uninitialized variable used for tracepoint" 2016-07-19 18:47:55 -07:00