Commit graph

576674 commits

Author SHA1 Message Date
Shubhraprakash Das
9103f8a346 msm: camera: isp: Configure stats framedrop period correctly
As per the hardware programming guide, a period of N needs to be
programmed as N-1.

Change-Id: I58c13a97dd35b3a439ea1af25bc93182e38e29f0
CRs-Fixed: 1066261
Signed-off-by: Venu Yeshala <vyeshala@codeaurora.org>
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2016-10-17 12:38:04 -07:00
Shubhraprakash Das
db1cd0b522 msm: camera: isp: Set the clock rate before ahb vote
Set the vfe clock rate before putting the ahb vote into
suspend otherwise the clock vote will bump up the ahb
vote and prevent shutdown.

CRs-Fixed: 1078215
Change-Id: I439ae8aea839af6d9b84fe1384feb18de3d9d276
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2016-10-17 12:34:57 -07:00
Puja Gupta
f90fbfe1c5 soc: qcom: Acquire mutex before checking for service
Acquire lock before you check if the service exist. This leads to
race condition where you end up adding same service multiple times
in service_list and make multiple registration request to servreg.

CRs-Fixed: 1078753
Change-Id: I8ae92ee1d26bd6687b6b2b4cbed1032485d7450e
Signed-off-by: Puja Gupta <pujag@codeaurora.org>
2016-10-17 12:04:27 -07:00
Harry Yang
c7e2ce5a8c smb138x-charger: supporting switching freq prop
Allow for changing the switching frequency via a power supply property.
The main charger will call this property to ensure optimal power
dissipation.

CRs-Fixed: 1048242
Change-Id: I17aeabe9c20388747dc1965bef22127bd054a828
Signed-off-by: Harry Yang <harryy@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-10-17 11:54:18 -07:00
Harry Yang
3570e9ed98 power_supply: add property to reflect switcher frequency
Modern battery chargers use a switching buck whose frequency
can be adjusted. Create a property to read/update it.

CRs-Fixed: 1048242
Change-Id: I7611e6b697222427303df47f837716005e013443
Signed-off-by: Harry Yang <harryy@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-10-17 11:54:17 -07:00
Abhijeet Dharmapurikar
04519c9566 smb-lib: fix type not updating to Unknown after removal
There is a possibility where the driver fails to change
the usb type to Unknown when the cable is removed - in particular
when pd is not allowed.

Use the debounce done event of the typec change interrupt to update
the usb type to Unknown.

Change-Id: I7f201209101e54461e3d08d677bd7b266f971420
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-10-17 11:54:16 -07:00
Abhijeet Dharmapurikar
2b9dbcf6f4 qpnp-smb2: print function names in debug statements
Currently the driver uses the dev_ variants to print debug information.
This is not useful.

Instead print the function name and use pr_ variants to print debug
information.

Change-Id: I0eeb61e847b07ac9b7622ac521bace24a417bb14
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-10-17 11:54:15 -07:00
Abhijeet Dharmapurikar
934fffc487 smb-lib: rerun apsd if not pd
If an HVDCP charger is detected and it does not support PD, that means
it is likely a legacy QC2 or QC3 charger. Rerun APSD when PD sets us to
be inactive.

For cases when pd is not allowed, PD won't set inactive status. For such
cases use the hvdcp_timeout interrupt to rerun APSD.

Change-Id: Ibe03e1dc88700b605e2f43ee4bca266ce3dee92b
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-10-17 11:54:14 -07:00
Abhijeet Dharmapurikar
139548f446 smb-lib: support separate current settings from usb and pd
Add support to set current limits from usb and pd.

Ensure that the limit from the pd is only enforced when pd is active
and that the limit from usb is enforced only when pd is inactive.

There is one situation when the input needs to be suspended as
per the usb driver's request when pd sets system_suspend_supported.
For that allow the usb voter to set that low current value to
suspend.

Also ensure that the pd and usb votes are nullified when source
is removed.

In addition, the return the individual valid votes from usb and pd
when their current_max are read.

Change-Id: I215e9e82f44061c4083a4df8cab400beadf6322d
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-10-17 11:54:13 -07:00
Abhijeet Dharmapurikar
2cdfc35e0b smb-lib: provide insertion removal functions
The current driver votes and unvotes for removal/insertion at
two interrupt handlers, debounce done and the type C detach.

The recommendation from hw teams is to use debounce done for both
insertion and removal. Update the code.

While at it, provide clean functions to vote and unvote for four
situations
a typec cable insertion
a typec cable removal
a source insertion
a source removal

Note that this allows us to cleanly handle PD hard resets where
the typec connection remains intact but the source (or vbus) related
state needs to be reset.

This also helps us in cleanly handling power sole swaps where the source
plugged and removed functions handle vbus related states while typec
functions handle the typec related states.

Change-Id: I49fccb1fcf8eaea8fea1ae186906689a628c02f8
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-10-17 11:54:11 -07:00
Abhijeet Dharmapurikar
9cb924f2ed qpnp-smb2: handle shorted vbus and cc lines and legacy cables
There could be cables where vbus and cc lines are shorted or connected
using a small resistor. Raising VBUS to higher values could cause CC
line to get damaged. CC line cannot tolerate a voltage higher than 6V.

So if such a cable is seen, prevent pd stack from running so there is no
opportunity to increase vbus by selecting a higher voltage profile. Also
disable HVDP too.

Also, prevent PD_ALLOWED if a legacy cable is seen - the spec mentions
that if VBUS is seen along with CC, the adapter is not pd capable.

Change-Id: I7411bd541ffe704dda97dd869a3dbd4dbfc99518
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-10-17 11:54:10 -07:00
Abhijeet Dharmapurikar
ebdc699974 qpnp-smb2: update to USB_PD type when pd is active
Since the USB_PD type is no more set by the PD driver, it is
expected that the type be set based on pd_active property being
ACTIVE. So set the type and update the userspace when it changes.

Change-Id: I0f76f092d3e8de7a916e995e4d825fe0da79bf78
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-10-17 11:54:09 -07:00
Abhijeet Dharmapurikar
f080134002 qpnp-smb2: support exiting sink based on cc
While PD is under hard reset and the device is in sink mode, it
shouldn't leave sink mode because VBUS goes away. Instead it should
stay in sink mode while hard reset is being conducted and exit sink
mode only if CC gets detached.

Configure the exit state when hard reset is in progress. Also while
hard reset is in progress disable APSD else a APSD could run and
disturb SDP communication after VBUS recovers in hard reset procedure.

Change-Id: I7f5046d4822438e949658356e683e74acfa664f7
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-10-17 11:54:08 -07:00
Abhijeet Dharmapurikar
b9bcc03fb1 qcom-charger: Allow PD for hvdcp
Currently the code prevents pd if an hvdcp is detected. We want to
change that in that we want to prevent pd only while hvdcp detection
is in progress.  Once completed, we need to enable pd even if an  hvdcp
is detected. Enabling PD even for hvdcp allows us to detect a QC 4.0
which communicates over PD.

Currently we model the pd_allowed votable as an enable votable i.e.
if any one of the voters enable it, pd_allowed gets enabled.

Change that to a disable votable named pd_disallowed_votable,
which gets disabled when CC is detached, and hvdcp2.0 detection is not
yet completed.

Change-Id: I2ae261c71694695b41d8a31c4b40542d5e227c3a
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-10-17 11:54:07 -07:00
Abhijeet Dharmapurikar
665d020cda qpnp-smb2: Disable hvdcp based on user configuration
Some platforms do not support HVDCP charging. Provide means to
disable them.

Provide a votable for disabling HVDCP in preparation to handle
VBUS and CC line shorted situation.

Note that when hvdcp is disabled, we only disable voltage
negotiations i.e. qc 2.0 detection remains enabled since it
does not need voltage to change.

Change-Id: Id7eaa46f08ac451a918a550f7837efbef78ab6f6
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-10-17 11:54:06 -07:00
Nicholas Troast
9fde5f5830 qcom-charger: qpnp-smb2: configure float options from DT
When a float charger is detected by APSD there are configuration options
that change the behavior of the charger. These options should be
configurable from the device tree. Add a DT parameter "qcom,float-option"
and configure it as follows:
1 - Treat as a DCP
2 - Treat as a SDP
3 - Disable charging
4 - Suspend USB input

Change-Id: Ia9219bc232f2092569dfb1a14f628e788173c4ff
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2016-10-17 11:54:05 -07:00
Nicholas Troast
257eedaa90 qpnp-smb2: add debugfs entries to force power supply updates
It is useful when debugging to force power supply changed events. Add
debugfs entries for each power supply to allow forcing power supply
changed events.

Change-Id: I018eb018de2a8119acc09824c82cca8ff1b52faa
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2016-10-17 11:54:04 -07:00
Nicholas Troast
bb659da62a power_supply: add PARALLEL_PERCENT property
The PARALLEL_PERCENT property is used for the parallel distribution
percentage.

Change-Id: I7d2a7a775437770075ddbd2d1a36ce5d9e44a631
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2016-10-17 11:54:03 -07:00
Nicholas Troast
3de357133d smb-lib: set ICL to 900mA when USB 3.0 has enumerated
900mA can be drawn from a USB 3.0 port that has been enumerated. Do it.

Change-Id: I94e5d36feb3cd54bcc46e8c56933340cad839c1f
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-10-17 11:54:02 -07:00
Nicholas Troast
69ea8b0c64 ARM: dts: msm: enable parallel battery current IIO for msmcobalt
The SMB138X TADC can provide the parallel charger with the
measured battery current. Enable it.

Change-Id: I32e5e5ed4ab3f09635f4fe512a1e9b75436ab88e
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2016-10-17 11:54:01 -07:00
Karthikeyan Periasamy
0dc00b42d2 msm: vidc: Check ion_handle for errors
When ion imports dma buf, it will return negative error number
in the case of failure like bad file number or invalid dma buf file.

check ion_handle for error numbers.

CRs-Fixed: 1071602
Change-Id: I1ea93161b85deb667cbb6f8515ff7c6943da6e3d
Signed-off-by: Karthikeyan Periasamy <kperiasa@codeaurora.org>
2016-10-17 11:17:37 -07:00
Ingrid Gallardo
35bfa1e56a msm: mdss: fix crash when wrong params are passed on the esd config
If wrong parameters are set on the dtsi to configure the
esd, a null pointer access can happen. Fix this to make
sure we check for valid pointers and otherwise just
throw an error, but not access an invalid pointer.

Change-Id: I3df0889c1225dcb613910cb90f050a2994f5834d
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2016-10-17 10:37:35 -07:00
Ingrid Gallardo
df94b216e1 ARM: dts: msm: enable esd for nt35597 panels in msmcobalt
Enable esd check with register read mode for nt35597 dsc
command and video mode panels and esd check with bta
mode for nt35597 dual-dsi command mode panel in msmcobalt.

Change-Id: I8121d45fedab6197f8466d25674d5b0decd45f1b
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2016-10-17 10:29:35 -07:00
Linux Build Service Account
827d048300 Merge "defconfig: msm: Add support for SMD-RPM clocks" 2016-10-17 06:08:08 -07:00
Linux Build Service Account
1ece543f8b Merge "msm: ipa: fix mutex_lock with task->state != RUNNING" 2016-10-17 06:08:07 -07:00
Linux Build Service Account
cd6936ba6a Merge "ASoC: wcd934x: Create mixer control to select asrc output mode" 2016-10-17 06:08:06 -07:00
Linux Build Service Account
16d292c2aa Merge "usb: pd: Use new power_supply properties for PD current" 2016-10-17 06:08:05 -07:00
Linux Build Service Account
5c4abbb23a Merge "ASoC: tavil: fix kctl_put and get function for SLIM RXX MUX" 2016-10-17 06:08:04 -07:00
Charan Teja Reddy
34f1955c4c ARM: dts: msm: add smmu impl-def registers for msmfalcon
Add the implementation defined registers for msmfalcon that ensures the
correct operation of SMMU.

Change-Id: Iaaa9661e0c078ea1e4bb6e110bf4fe672dd2a7e9
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
2016-10-17 03:51:13 -07:00
Charan Teja Reddy
7b2d18e8a6 ARM: dts: msm: add the smmu dt nodes for msmfalcon
Add the SMMU device tree nodes that are used by the SMMU masters to
translate the I/O virtual address to physical address.

Change-Id: Iae33a17ba43f624052ac6591dc56af26b7a605c6
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
2016-10-17 16:19:29 +05:30
Charan Teja Reddy
b31499e592 ARM: dts: msm: add the cma region for venus on msmtriton
Add the memory region for venus firmware that is used to allocate the
contiguous memory using CMA API.

Change-Id: Ibdec14a3e835df19876658d0ad7600da0200603b
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
2016-10-17 15:18:21 +05:30
Taniya Das
a4cd7d61cc defconfig: msm: Add support for SMD-RPM clocks
SMD-RPM clocks are required to be enabled for sending clocks requests to
RPM owned clocks.

Also cleanup the CONFIG_MSM_MDSS_PLL which no longer required as we select
CONFIG_COMMON_CLK.

Change-Id: I805df626d85e8d19f3d9f44dd05011713bd22d1e
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2016-10-17 11:27:10 +05:30
Taniya Das
713867d88f clk: qcom: Add support for Voter and hardware clocks
MSMfalcon requires the voter & voter branch clocks to be able to
enabled/disabled & set rate on these clocks from the client. Also add
support for few hardware & dummy clocks to be able to perform clock ops
from the clients.

Change-Id: I54941fbcc0a4b4d24dcb01f4628aa4dc99fcbab9
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2016-10-17 11:26:56 +05:30
Taniya Das
55d4764dee clk: qcom: Support to add hardware clocks to of_clk_provider
Currently the hardware clocks are added from each clock controller
individually and are not added to the of_clk_provider. But there could be
clocks which are required by clients to be used. Add the hardware clocks to
the of_clk_provider list.

Change-Id: I9a36a52c77672fba13813656a58f7b8cc14a4c27
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2016-10-16 22:30:45 +05:30
Linux Build Service Account
4f983fd1aa Merge "clk: qcom: clk-voter: Add support for voter clocks" 2016-10-15 23:19:40 -07:00
Linux Build Service Account
1f47d424c4 Merge "input: misc: pat9125: add gpio configuration and pinctrl support" 2016-10-15 07:37:45 -07:00
Linux Build Service Account
e024b79852 Merge "usb: pd: Use new power_supply PD_IN_HARD_RESET property" 2016-10-15 01:19:59 -07:00
Linux Build Service Account
cb74f5d749 Merge "power_supply: Add additional USB PD properties" 2016-10-15 01:19:58 -07:00
Linux Build Service Account
c8c3a40219 Merge "drivers: soc: add size checks and update log messages" 2016-10-15 01:19:57 -07:00
Linux Build Service Account
b5602aede4 Merge "soc: qcom: core_hang: Separate sysfs entry for silver and gold cluster" 2016-10-15 01:19:55 -07:00
Linux Build Service Account
0f9ddd3093 Merge "leds: qpnp-flash-v2: Fix possible NULL pointer dereference" 2016-10-15 01:19:51 -07:00
Linux Build Service Account
f3fd158ba3 Merge "leds: qpnp-flash-v2: Add support for preemptive charger mitigation" 2016-10-15 01:19:50 -07:00
Hemant Kumar
1d0ede934b usb: gadget: f_midi: Fix use after free bug
Upon cable disconnect usb composition switches from midi
to default composition as a result midi function driver
frees the midi function. When cable is plugged back in
android_setup calls function setup call back for all the
function instances having non-null function pointer. This
results into access to already freed function pointer
stored in function instance. Fix this issue by setting
function instance's function pointer to NULL so that
android_setup will skip calling midi function setup upon
next cable connect.

Change-Id: Ia619650c94c35aea015a89841c59a1f9dbc521f9
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-10-14 19:25:33 -07:00
Linux Build Service Account
0a97d6bb23 Merge "ASoc: wcd9335: Ignore mbhc get impedance error" 2016-10-14 17:58:29 -07:00
Linux Build Service Account
9f00094706 Merge "scsi: ufs: gate ref_clk during aggressive clk gating" 2016-10-14 17:58:27 -07:00
Linux Build Service Account
7d6515f37b Merge "scsi: ufs: reduce auto hibern8 timeout to save power" 2016-10-14 17:58:27 -07:00
Linux Build Service Account
f1c69e2fdd Merge "soc: qcom: msm_smem: Pass device structure to ramdump driver" 2016-10-14 17:58:26 -07:00
Linux Build Service Account
78cd56d395 Merge "ASoC: wcd934x: Update DSD register sequence for v1.1" 2016-10-14 17:58:24 -07:00
Linux Build Service Account
d887e436d2 Merge "ASoC: wcd934x: update keeper enable for soundwire functionality" 2016-10-14 17:58:24 -07:00
Jack Pham
7f87a85c97 usb: pd: Use new power_supply properties for PD current
Switch to setting the POWER_SUPPLY_PROP_PD_CURRENT_MAX for
indicating the current limit to the charger driver when
an explicit contract is established. Also set the
POWER_SUPPLY_PROP_PD_USB_SUSPEND_SUPPORTED property whenever
encountering the "USB Suspend Supported" bit in the first
PDO of a Source Capabilities message. This is an indication
to the charger that when the USB bus enters suspend state that
it should follow suspend rules according to USB 2.0/3.1 spec.

Change-Id: I665ec788a770632b4849b9beff8444d00e956ce1
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-10-14 17:51:45 -07:00