Commit graph

576143 commits

Author SHA1 Message Date
Jack Pham
18da08334e usb: pd: Handle PD_ALLOWED within state machine
Charger may be able to detect a legacy cable connection in which
PD is not supported however the state machine still needs to
run in order to send the EXTCON_USB notification to start the
USB controller in peripheral mode (assuming type is SDP or CDP).
Move checking of PD_ALLOWED to the state machine which can be used
to determine if moving beyond PE_SNK_STARTUP is allowed or not.

The psy_changed() callback should only queue the work when either
typec_mode or pd_allowed states have changed. Also move handling
of the in_pr_swap flag to this function by absorbing the
disconnect callback and clearing the flag when CC state indicates
it is reconnected.

Change-Id: I8879699531a49915e7286e4a166944709076fbd1
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-10-14 17:51:45 -07:00
Jack Pham
d1d42ada3d usb: pd: Support VCONN Swap
Support incoming VCONN Swap requests by accepting and turning
off/on VCONN.

Due to HW board limitations, if VCONN is being sourced from the
VBUS input we cannot support enabling VCONN while as a sink and
greater than 5V has been negotiated on VBUS. In that case, reject
the request. Add a device tree property that indicates whether
the board is configured for separate VCONN supply.

Change-Id: If3a9aa316ae08a80468631f3d536a1b345e21b18
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-10-14 17:51:45 -07:00
Jack Pham
b08f588476 usb: pd: Prevent sleep when state machine in progress
With PM autosleep enabled, the system may aggressively enter
and re-enter suspend in between calls to queue_work() and
when the state machine function gets executed, which may
at best result in numerous suspend/resume cycles and at
worse starve the PD state machine from even executing.

Fix this by calling pm_stay_awake() whenever the work is
queued and relinquish with pm_relax() when no further work
is to be done.

Change-Id: I71d8ea0c69a7b174c2280f92d1f5342e5e50d9b0
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-10-14 17:51:45 -07:00
Jack Pham
3bf9e38400 usb: pd: Simplify VDM tx handling
VDMs, especially structured ones, are almost always handled
as requests and responses. Hence it does not make sense to
allow more than one outgoing VDM at a time, so get rid of the
vdm_tx_queue list and simplify it to a single-issued packet.

Because port partners can only have one VDM request/response in
flight, also handle the case when a new structured request is
received before the previous response has been sent. In that
case we simply discard the queued message as it's now invalid.

Change-Id: I144f8158dbf8be0babf5516b01d084fd053413c3
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-10-14 17:51:45 -07:00
Jack Pham
7ce154ad5d usb: pd: Correctly handle invalid Structured VDMs
As UFP since the policy engine only responds to the Discover
Identity command, all other commands are unrecognized and
therefore should be NAKed. Fix the handling as follows:

 - Ensure the standard Discover Identity was sent using
   SID of 0xFF00, otherwise it is invalid
 - Don't NAK incoming Attention messages
 - When sending a NAK, respond with the same SVID of the
   initiating command, whether it was correct or not
 - Enter Mode is not supported in general, but the NAK
   should also be sent back with the same mode index
 - Re-issue Discover SVIDs when more than 12 SVIDs are returned
 - Clean up macro name prefixes from 'VDM' to 'SVDM' to
   emphasize they are accessing structured VDM specific bits

Change-Id: Id2590065a01e46f8da70733d55f3bfabff5b532d
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-10-14 17:51:45 -07:00
Jack Pham
beeb22f5e8 usb: pd: Miscellaneous compliance fixes
Fix several issues which help address PD compliance testing:
- Soft reset should be issued instead of hard reset in cases
  where an unexpected message is received.
- In source mode, send a Reject if the Request PDO object also
  exceeds the advertised current capability. Fix the incorrect
  bitmask in the PD_RDO_FIXED_CURR macro.
- Handle possibility of quick back-to-back RX messages by
  flushing the sm worker to ensure the last message was fully
  processed before overwriting the buffer.
- Discard PING messages as they are not applicable to Type-C.
- Respond to GET_SINK_CAP while in source mode, and vice
  versa, respond to GET_SOURCE_CAP when in sink mode.
- Move pd->hard_reset=false to PE_SRC/SNK_TRANSITION_TO_DEFAULT
  for consistency.
- Change default sink capabilities to advertise only 5V @ 900mA
  since the policy engine will not automatically request higher
  voltages. If userspace wants to request greater than 5V it should
  also update the sink capabilities.
- Reset the protocol counters at the beginning of PE_SNK_STARTUP.

Change-Id: I44598eb0b49efd763f86f303c70e8b018fca994b
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-10-14 17:51:45 -07:00
Phani Kumar Uppalapati
607f17ae85 ASoc: wcd9335: Ignore mbhc get impedance error
Avoid DAPM failure by ignoring the mbhc get impedance
errors as this is not a fatal and audio can still work
even if the class-H settings are not updated based on
impedance values.

Change-Id: Icd6846d157af5a96d5ae49261e109cbd5ab8c266
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2016-10-14 16:35:09 -07:00
Phani Kumar Uppalapati
97ddf9fd0c ASoC: wcd934x: Create mixer control to select asrc output mode
Create mixer control to select asrc (asynchronous sample rate
converter) output mode to integer or fractional rate based on
the playback sample rate of the main path or DSD path.

CRs-Fixed: 1078253
Change-Id: I941a357d63f1024c5f7648de10af10df0148c6a7
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2016-10-14 15:26:08 -07:00
Chris Lew
68a6f50d3c soc: qcom: msm_smem: Pass device structure to ramdump driver
The ramdump driver uses the device pointer during ramdump read.
This change passes in the device pointer for smem during
ramdump create and moves the call to the probe function.

CRs-Fixed: 1075262
Change-Id: I6234e35d76440beb53c139ad0b02ec8b49c2a196
Signed-off-by: Chris Lew <clew@codeaurora.org>
2016-10-14 13:39:41 -07:00
Linux Build Service Account
e657410985 Merge "leds: qpnp-flash-v2: Add support for configuring hardware mitigation" 2016-10-14 03:40:38 -07:00
Linux Build Service Account
911b4fecbe Merge "usb: gadget: f_midi: Use 1024 bytes as MIDI buffer size" 2016-10-14 03:40:37 -07:00
Linux Build Service Account
32ed0e480d Merge "ASoC: msm: lock read/write when add/free audio ion memory" 2016-10-14 03:40:32 -07:00
Linux Build Service Account
a1c6e317af Merge "input: pat9125: add support of sending rotating switch events" 2016-10-14 03:40:31 -07:00
Linux Build Service Account
b2799f1e25 Merge "soc: qcom: glink: Fix ctx initialization with magic number" 2016-10-14 03:40:30 -07:00
Linux Build Service Account
65767b7f53 Merge "fbdev: use unsigned integers to prevent overflow" 2016-10-14 03:40:29 -07:00
Vevek Venkatesan
1e5dde5a4c input: misc: pat9125: add gpio configuration and pinctrl support
Pat9125 is a gpio driven i2c slave. This change adds the gpio
configuration and pinctrl support for pat9125 driver.

Change-Id: I2a9b379715622b5f010a5780ca481da7f9619400
Signed-off-by: Vevek Venkatesan <vevekv@codeaurora.org>
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
2016-10-14 14:37:26 +05:30
xiaonian
9b9f5b1124 ARM: dts: msm: Enable SD card for msmcobalt QRD VR1 board
Change polarity of corresponding GPIO to enable SD card
detection for msmcobalt QRD VR1 board.

CRs-Fixed: 1075999

Change-Id: I12bfceb01990873db3f4287f85deccb6b6b36495
Signed-off-by: xiaonian <xiaonian@codeaurora.org>
2016-10-14 02:04:38 -07:00
Taniya Das
d7c369c0b1 clk: qcom: clk-voter: Add support for voter clocks
Voter clocks nodes would require aggregation of all child node rates.
Certain clocks that are not rate-settable can still take
advantage of voter clock functionality.

Change-Id: Ibab7a5aa6aa89236974fcd0d65ffe0bd1a7acb12
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2016-10-14 10:58:17 +05:30
Linux Build Service Account
c116fa434f Merge "ARM: dts: msm: Fix clock for 720p@240fps usecase" 2016-10-13 19:11:39 -07:00
Linux Build Service Account
2e28fde065 Merge "msm: vidc: Update plane count in get-format" 2016-10-13 19:11:38 -07:00
Linux Build Service Account
3bc1baa947 Merge "defconfig: Enable USB MIDI Function driver for msmcobalt" 2016-10-13 19:11:37 -07:00
Linux Build Service Account
3d91f26e44 Merge "soc: qcom: smem: Update CDSP processor ID" 2016-10-13 19:11:36 -07:00
Linux Build Service Account
1bbcf2d2e4 Merge "msm: ipa3: fix benign prints on ipa3_usb_init" 2016-10-13 19:11:35 -07:00
Linux Build Service Account
7eda0b88c9 Merge "ARM: dts: msm: Add support for Lpass PIL on msmfalcon" 2016-10-13 19:11:34 -07:00
Linux Build Service Account
9336847785 Merge "usb: pd: Fix PR_SWAP handling" 2016-10-13 19:11:33 -07:00
Linux Build Service Account
580442d0a6 Merge "qpnp-fg-gen3: add support to configure ki coefficients during discharge" 2016-10-13 19:11:32 -07:00
Linux Build Service Account
4a10b1c33d Merge "qpnp-fg-gen3: Add support to hold soc at 100 when charge is full" 2016-10-13 19:11:31 -07:00
Linux Build Service Account
4b5f689e15 Merge "ASoC: wcd934x-dsp-cntl: Make sure memories can enter deep sleep" 2016-10-13 19:11:31 -07:00
Linux Build Service Account
0c4dd697ad Merge "ASoC: wcd934x-dsp-cntl: add support for codec restart" 2016-10-13 19:11:30 -07:00
Linux Build Service Account
c46c40d020 Merge "icnss: Remove msm_bus bandwidth vote" 2016-10-13 19:11:29 -07:00
Linux Build Service Account
cf584269c5 Merge "iommu/io-pgtable-arm: Use outer shareable for all configurations" 2016-10-13 19:11:28 -07:00
Linux Build Service Account
2a80956ae6 Merge "ASoC: codecs: Add teardown() call in shutdown" 2016-10-13 19:11:27 -07:00
Linux Build Service Account
511b8dcdfe Merge "msm: ipa: update wan pool size on napi enable" 2016-10-13 19:11:26 -07:00
Linux Build Service Account
4de07155f9 Merge "sched/cgroup: Fix/cleanup cgroup teardown/init" 2016-10-13 19:11:24 -07:00
Linux Build Service Account
cade0ea953 Merge "soc: qcom: glink: Fix uninitialzed return value" 2016-10-13 19:11:23 -07:00
Linux Build Service Account
3c9194d93b Merge "soc: qcom: qsee_ipc_irq_bridge: Fix null pointer dereferences" 2016-10-13 19:11:22 -07:00
Siena Richard
efb766e449 drivers: soc: add size checks and update log messages
Add size checks to validate minimum size is met. Update log messages
to include only relevant information to ensure logs are accurate and
useful.

Change-Id: Idf76a7d964ec6989a0474d49895e54103f17938b
CRs-fixed: 1073129
Signed-off-by: Siena Richard <sienar@codeaurora.org>
2016-10-13 17:32:42 -07:00
Hemant Kumar
39f9f52879 usb: gadget: f_midi: Use 1024 bytes as MIDI buffer size
Some UDC driver doesn't allow or throw errors when USB request buffer
queued is unaligned i.e. buffer size is not equal to wMaxPacketSize or
multiple of wMaxPacketSize. Fix this issue by using 1024 bytes as MIDI
buffer size instead of 256 bytes.

Change-Id: I71d520a5a800a3e612dc4d57e7baffa93fad61b3
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-10-13 17:10:44 -07:00
Tatenda Chipeperekwa
c53f699c80 msm: mdss: dp: add support for logging event names
Add support for logging event names for debug purposes.

CRs-Fixed: 1076516
Change-Id: I85cc4d5ce92450d038d3a1f4fcc5ac51bdbb3bbf
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
2016-10-13 15:09:04 -07:00
Tatenda Chipeperekwa
cb0dd4bc98 msm: mdss: dp: update Clock Recovery phase of link training
Update TRAINING_PATTERN_SET then TRAINING_LANEx_SET in the
Clock Recovery phase of link training as this is the sequence
mandated in the display port specification.

CRs-Fixed: 1076516
Change-Id: I7aa157d9377799563180792fe5d31a22a7aff0e1
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
2016-10-13 15:08:40 -07:00
Runmin Wang
90c2d5300e soc: qcom: core_hang: Separate sysfs entry for silver and gold cluster
Silver and gold cluster use different PMU_EVENT and may need to have
different threshold values.

This patch creates different sysfs entries for silver and gold cluster.

CRs-Fixed: 1004392
Change-Id: I88cdf5110cadb44a81c0c700d5188bf639bb2129
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
2016-10-13 13:04:11 -07:00
Harshdeep Dhatt
fc078e8dee msm: kgsl: Remove DPM registers from snapshot
Remove the DPM registers from a5xx snapshot as they are
not needed for A540.

CRs-Fixed: 1074810
Change-Id: Ic4259821e1ee74e49068545208587ad66ac29679
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2016-10-13 14:00:28 -06:00
Gaurav Kohli
e1c41fb41b ARM: dts: msm: Add support for Lpass PIL on msmfalcon
Add support for Lpass PIL which facilitates the loading of Lpass
firmware, authentication and bringing it out of reset.

Change-Id: I587b39bc302449591cc0c71ff15b740374a8af4d
Signed-off-by: Gaurav Kohli <gkohli@codeaurora.org>
2016-10-13 12:47:33 -07:00
Linux Build Service Account
fac2c0da16 Merge "misc: qcom: qdsp6v2: Add missing initialization" 2016-10-13 12:29:08 -07:00
Linux Build Service Account
6f38194db1 Merge "clk: qcom: Add support for the turing vote clocks" 2016-10-13 12:29:07 -07:00
Linux Build Service Account
0ca3e09432 Merge "ARM: dts: msm: Add support for GDSCs for MSMFalcon/MSMtriton" 2016-10-13 12:29:06 -07:00
Linux Build Service Account
601676fcf3 Merge "ASoC: wcd9xxx: Disable external clock buffer when mclk is not in use" 2016-10-13 12:29:06 -07:00
Linux Build Service Account
858faf3e12 Merge "ASoC: wcd-spi: Initialize local variables before usage" 2016-10-13 12:29:05 -07:00
Linux Build Service Account
a6138ccde2 Merge "sched: bucketize CPU c-state levels" 2016-10-13 12:29:04 -07:00
Linux Build Service Account
daa54e82ab Merge "sched: use wakeup latency as c-state determinant" 2016-10-13 12:29:04 -07:00