wireless: add VHT (802.11ac) definitions

Add the VHT definitions to be used by drivers supporting it.

Change-Id: Ia301cf72940cef19767f4f485a09c9afc12ae514
CRs-fixed: 452921

Signed-off-by: Mahesh Palivela <maheshp@posedge.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
cfg80211: allow advertising VHT capabilities

Allow drivers to advertise their VHT capabilities
and export them to userspace via nl80211.

Change-Id: I2d2825a09dfddccca1bd3edacd7fc382d765bea5
CRs-fixed: 452921

Signed-off-by: Mahesh Palivela <maheshp@posedge.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
mac80211: include VHT capability IE in probe requests

Insert the VHT capability IE into probe requests.

Change-Id: I75620090969b46701f1c760baf9c6559a4a1ac2c
CRs-fixed: 452921

Signed-off-by: Mahesh Palivela <maheshp@posedge.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
power: pm8921-charger: don't reject all the chg current requests

The driver currently rejects any changes to the USB charge current if
no other source of power is present. This causes issues because if a
pc usb cable which supplies 500mA is connected while the PMIC was
drawing 1500mA, it will continue to draw 1500mA from it causing charger
collapse.

The reason why the rejects were put in place were because if we are
running from USB as the source, vbus_draw() could be called with 0mA.
This would cause brownouts.

So only reject setting the current to 0mA in case another source is not
present.

Change-Id: I55a829db369bf60de2ba86a522480dacddc02186
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
tspp: improve tspp_open_stream/tspp_close_stream behavior

The TSPP driver's kernel API supports opening and closing a TSPP stream
using the tspp_open_stream/tspp_close_stream API functions. This commit
fixes a few minor issues with the behavior and usage of this API.

tspp_open_stream and tspp_close_stream were fixed to connect/disconnect
the appropriate TSIF source based on the TSIF reference count.

The call to tspp_close_stream from within tspp_close_channel was removed,
since a kernel driver that uses the TSPP driver API is expected to call
tspp_close_stream explicitly, and not rely on the TSPP driver to close
the stream implicitly when the channel is closed.

An ioctl was added to allow user-space application to close the stream.

Change-Id: If49b440d9d83c8bba54aeabc18e8f06b3cc11b3e
Signed-off-by: Liron Kuch <lkuch@codeaurora.org>
board: 8960-pmic: Swap mapping of camera snapshot and focus keys

Functionality is swapped on 8960 devices.

Change-Id: I2a458c40b60be583dee982bb12927a9b018fb94f
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
tspp: Fix incorrect usage of clk_disable to support PM

The TSPP driver uses clk_prepare_enable() API to use the appropriate
clocks. When the device is not used, clk_disable_unprepare() should
be called. However, clk_disable() was used by mistake instead.

Change-Id: I70f8e9e8a7d2aef3a781be160b72096252e964de
Signed-off-by: Liron Kuch <lkuch@codeaurora.org>
msm: wfd: Correct logic to unmap mdp buffers

Currently unmapping of the mdp buffers from iommu is not
happening for non-secure mode. Initial value of the
flag that decides unmapping is changed to fix the issue.

Change-Id: I34201780f3b454f368e401792a050247e58eb185
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
Revert "USB: ensure parent device is resumed for child's system-resume"

This reverts commit de86e6482897db0006151ae9154f181e75f5ab2c.

Commit 7c8527ce ("PM: Prevent runtime suspend during system resume")
fixes the general issue of a parent device being prematurely
runtime suspended before a child device is resumed. It does so
by moving the pm_runtime_put_sync() call from the device_resume()
stage to device_complete(), which happens to act on the devices
in reverse (children before parent) order.

Thus when usb_resume() is called by device_resume(), we know its
parent will be runtime PM enabled and its usage counter is still
non-zero. This obviates the need to do an additional
pm_runtime_get_sync() before calling usb_resume_both() as the
device and its interfaces now have the opportunity to increment
the parent's power.child_count if necessary without fear of
having a runtime suspended parent.

(cherry picked from commit d48e904824ec38f9db01fcaccb527063b4c5d894)

Change-Id: I6d092c649889daf9483ed27aebe67df50d38ae91
CRs-fixed: 396041
Signed-off-by: Jack Pham <jackp@codeaurora.org>
slimbus: Callback to indicate device report present message

Clients can register a callback (just like probe) and that callback
will be called when the client's device reports present per slimbus
specification. The callback is hosted in a workqueue to avoid doing
it in same context from which probe is called (and/or in the context
receiving report present message). Callback is called when the device
reports present for the first time after the bus is initialized.

Change-Id: I8396b87121950f99a09764d497bf2d4b1535565d
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
(cherry picked from commit 0e7a1ef6292642d2c7c22fcaf8d5da1e7610f26d)
slimbus: Allow controller to override default scheduling algorithm

Framework provides a slimbus scheduling algorithm and controller may
choose to override it. e.g. controller will override this if it
supports fixed set of channels at a fixed clock gear.
In that case, it is controller's responsibility to act on client
requests and update channel scheduling, subframe coding information.

Change-Id: I31fe72ef85f931900467b737652da7516d173dc5
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
(cherry picked from commit 4aec9230916f844d89b2565d09a7b874f181d5e0)
slimbus: Allow controller to specify logical addresses

It is possible that the controller has fixed addressing table for
enumeration devices. In that case, logical address will be set by
controller and not by framework. get_laddr allows a controller to
assign logical address. Make sure framework allows such addressing
by not assuming that index into address table will represent logical
address.

Change-Id: I0e3873980c2ee2ece01237f450ecefff4e99aedc
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
(cherry picked from commit f0b9c75110471242b8c832457ef7b8b9444e42f3)
slimbus: Populate slimbus device's logical address during assignment

Slimbus device is assigned logical address when it reports present.
Make sure to populate the device's logical address (laddr) during
this assignment.

CRs-Fixed: 412148
Change-Id: Icb8d74f6ea71aff8f6cb30523002f7839e2cb028
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
(cherry picked from commit 33c84e6255c03f15f6c6a46ec9e428e27fb35639)
SoC: msm: Set soft step values to 0 to avoid noise

The abrupt steps in the curve are causing the noise. To avoid noise
smaller step size are recommended.

CRs-fixed: 439933
Change-Id: I34681af412e4f7ba8a99ce0f08f5ee1fa69186ff
Signed-off-by: Fred Oh <fred@codeaurora.org>
ASoC:msm:Add support for Voice Features on SGLTE Call

- For every put command from userspace, flags related
to Voice Features (TTY,WV etc) are updated for both
Voice and SGLTE Sessions.
- Since either SGLTE or Voice Call will be active at any given
point of time, flags for both the sessions should be upated.

Change-Id: Iab9f3aa4938eabce7e81d59938a8ebd7a4119857
Signed-off-by: VidyaKumar Athota <vathota@codeaurora.org>
msm: display: Add DSI clock control for MDP GDHS power collapse

Enable DSI clock and regulator before enabling/disabling power collapse
for MDP GDHS.

(cherry picked from commit ad3200279e62eff01fd1bb9136cc9c0d11e10380)

(cherry picked from commit 58c5992c710df379e26bb210e00c74da501db9d2)

Change-Id: I76b91260c61abf214e688c0dea6989ed2cfa3801
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/board-8064-regulator.c

Signed-off-by: Dhivya Subramanian <dthiru@codeaurora.org>
power: pm8921-bms: implement BMS reset

Sometimes during testing it is convenient to force the BMS to take a new
OCV, essentially restarting the BMS soc calculation in order to test
short portions of the battery profile.

Implement a BMS_reset module parameter, which sets OCV to the
instantaneous VBAT and resets the coulomb counter whenever a 'Y' is
written to it.

Furthermore, in the bms reset mode, keep UUC constant at 3%, and do not
run adjusting algorithms until a 'N' is written to the module parameter.

Note that this feature should only be used with a fake battery, as it
maintains a constant voltage and gives us near true OCV estimates.
Also, the adjusting algorithm is disabled due to this reason. If
adjustments to the OCV were allowed, we will end up adjusting the SOC
higher, because the OCV est will never go low as the battery discharges.
It will fail the test cases for which this feature is designed.

Change-Id: Idfe7f0edf9c25f018f6e6d0a9df20a1a04d5277a
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
power: pm8921-bms: disable ocv updates for flat portion of the curve

An issue is observed when an OCV is updated while the device is
sleeping. When it wakes up the SOC calculations are run on the new OCV
which result in a drastically different SOC than previously reported.
The root cause of this issue is PON OCV likely was unsettled.

Provide a feature where OCV updates can be disabled between certain
SOC range.

Change-Id: I54a75a7e9d05ff2c8ccd484850f02a0190d6a3b7
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
power: pm8921-bms: fix override mode causes sleep current increase

The override mode is used to measure battery voltage and current
simultaneously. We observed that the XOADC and the AMUX
were left enabled even after the override mode is exited. This
causes the current consumption to increase by 500uA.

Execute a dummy XOADC read after override mode is exited. This will
ensure that the XOADC and the AMUX get turned off after the dummy
transaction is completed.

CRs-Fixed: 440864
Change-Id: I53b8b67d55bbab1de588a36b7d2eca26ba6e6bfd
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
power: pm8921-bms: Enable batt alarm

Set the batt alarm to wake up the system if the
battery voltage falls below a threshold. This is to
make sure that the device does not shutdown abruptly
without any notification.

Hold the low voltage wakelock to prevent the device
from going to sleep immediately after the low voltage
notification.

Change-Id: Ifaeeeb27bd85f9c95f026ac3565681432e247b02
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>