msm: msm_bus: export msm_bus_fabric_init_driver

I2c-qup driver is a client of msm_bus_fabric driver while drivers like
onsemi-ncp6335d and fan53555 are clients of i2c-qup driver. In some
targets, onsemi-ncp6335d and fan53555 drivers have to initialize and probe
early before the i2c-qup and msm_bus_fabric driver are ready. Hence export
msm_bus_fabric_init_driver to make sure msm_bus_fabric driver is ready when
its clients need to probe.

Change-Id: Ifa4f43d04f5261c49279ed9ff0e232e215066070
Signed-off-by: Ke Liu <keliu@codeaurora.org>
qup_i2c: export qup_i2c_init_driver

Drivers like onsemi-ncp6335d and fan53555 are clients of i2c-qup driver.
In some targets, these clients have to initialize and probe early before
the i2c-qup driver is ready. Hence export qup_i2c_init_driver to make sure
i2c-qup driver is ready when its clients need to probe.

Change-Id: I0f866d1c4239f9c72f6753674c2283e97f3a3691
Signed-off-by: Ke Liu <keliu@codeaurora.org>
msm: board-8226: initialize SPM, NCP6335D, FAN53555 and CPR drivers

SPM, NCP6335D and FAN53555 regulators needs to be initialized before CPR
regulator initialization. When cpr-regulator probes, it will try to get a
handle to each of the three regulators: the fan53555-regulator, the
ncp6335d-regulator and spm-regulator devices. CPR will use the first
available handle as its vdd_apc regulator. It is only possible to get a
handle to each of these regulator devices after the driver has probed.
NCP6335D and FAN53555 regulators are clients of QUP I2C, QUP_I2C is a
client of MSM_BUS_FABRIC driver, hence initialize MSM_BUS_FABRIC and
QUP I2C drivers before NCP6335D and FAN53555 regulators.

Change-Id: I57e358b55645c21b058e34a55f039850b71197d4
Signed-off-by: Ke Liu <keliu@codeaurora.org>
ARM: dts: msm: add optional cpr-regulator supplies for msm8926

CPR regulator needs to choose its vdd_apc supply from multiple optional
power regulators configured in its device tree. Only one of them
will be physically present and CPR will choose its regulator device.

Change-Id: I4365363c55a6d47b202df6e838c54eea1e5fac18
Signed-off-by: Ke Liu <keliu@codeaurora.org>
regulator: onsemi-ncp6335d: add list_voltage callback function

This callback function can help perform validation of the
regulator-min-microvolt and regulator-max-microvolt properties at runtime
automatically.

Change-Id: I63917e06c4fa881f67d938d0c53e7ad71ebda25f
Signed-off-by: Ke Liu <keliu@codeaurora.org>
ARM: dts: msm: Add support for msm8926 v2

Distinguish between msm8926 v1 and v2 based boards.
Add support for boards with external VDD_APC buck regulator.

CRs-fixed: 605364
Change-Id: I4287a0a55547f16c8b3977ca8745f053cb03b76a
Signed-off-by: Hanumant Singh <hanumant@codeaurora.org>
regulator: onsemi-ncp6335d: add support for tlmm spare register control

Certain Qualcomm chips mux the output of some GPIOs using the TLMM_SPARE
register. Add support for a device tree property which can be used to
specify a mask and value to write into this register so that the VSEL GPIO
can be toggled successfully on affected devices. When the appropriate bits
in the TLMM_SPARE register are written, the physical output of the GPIO can
be controlled normally via GPIO control registers.

Change-Id: Ic8a0886886a44687931ab5cb8150383cd84db2f6
Signed-off-by: Ke Liu <keliu@codeaurora.org>
ARM: dts: msm: enable TLMM spare register control on msm8926

Tlmm register controls some GPIOs output. In order to set GPIO output
successfully, we need to set the tlmm register as well.

Change-Id: I48df361386410a5b60e7f4bb5048016009545a65
Signed-off-by: Ke Liu <keliu@codeaurora.org>
ARM: dts: msm: Remove support for obsoleted speed bins for msm8226

Previously, there used to be a redundancy scheme where multiple speed
bins mapped to the same frequency. This reduancy scheme was never used
and is obsoleted to free resources.

Conflicts:
	arch/arm/boot/dts/qcom/msm8226-v2.dtsi
	arch/arm/boot/dts/qcom/msm8926.dtsi

Change-Id: I9ca3c4e0a809d1563a3d786521e3b54e54e06af5
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
arm: dts: 8926 : add gimli 2.0 external buck support

Add gimli 2.0 external bucksupport for 8926 platform.
External buck presence will be detected based on the
JTAG ID and based on that latency values and spm
commands are updated.

CRs-fixed: 568380
Change-Id: Iea30bdfac8c855a5d78250dbcaa340376714d13e
Signed-off-by: Anil kumar mamidala <amami@codeaurora.org>
msm:pm: add support for gimli-2.0 platform

Add support for gimli-2.0 platform with external buck.
If external buck id detected from the DT, send the sleep
votes for toqqling the GPIO to ON and OFF the external buck
when the system is going PC.

CRs-fixed: 568380
Change-Id: I173c52c4d24932b5c17af2ad2c9e19fc47b61ad9
Signed-off-by: Anil kumar mamidala <amami@codeaurora.org>
ARM: dt: msm8926v2: Match clockplan frequencies

GPU turbo frequency and BIMC frequencies have changed in v2.
Modify the dtsi file to match v2 and update the GPU clock plan
there..

Change-Id: I5ec79f4faac83d524c393765cec6950f71a1fbf4
CRs-fixed: 605171
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
Signed-off-by: Jing Zhou <jzhou70@codeaurora.org>
regulator: onsemi-ncp6335d: add device tree support for mode selection

Add support to the onsemi-ncp6335d driver to select which regulator
operating mode to utilize. There are two possible mode selections: PWM mode
and auto mode. If no mode property is specified in device tree, the
regulator will operate in the hardware default mode.

CRs-Fixed: 607899
Change-Id: I2e21c452a3ea3963146d9abbc7e89e811fd90388
Signed-off-by: Ke Liu <keliu@codeaurora.org>
ARM: dts: msm: disable CPR for msm8926-v2

Disable CPR for msm8926-v2 for stability issues.

CRs-fixed: 607899
Change-Id: Ifc9018f7a2f48d933be9cb87d6df51610f583cf8
Signed-off-by: Ke Liu <keliu@codeaurora.org>
ARM: dts: msm: move external power supply configuration for msm8926-v2

Move external power supply configurations from msm8926 to msm8926-v2-ext-buck
file as external power supply only exists for some msm8926-v2 chips.

CRs-fixed: 607899
Change-Id: I73d333b8b7d0489f06fa1f5e34a8cb9576a86062
Signed-off-by: Ke Liu <keliu@codeaurora.org>
ARM: dts: msm: Add panel dimension details for JDI 1080p panel

Explicitly setting the physical dimensions of the panel helps
in correctly computing the DPI (dots per inch) settings. Add
this information for the JDI 1080p panel based on the data
provided in the panel specification.

Change-Id: I2c4dde3c8c9a9ccef9325503cf8f9072bdfc0503
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
ARM: dt: msm8926v2: Match clockplan frequencies

GPU turbo frequency and BIMC frequencies have changed in v2.
Modify the dtsi file to match v2 and update the GPU clock plan
there..

Change-Id: I5ec79f4faac83d524c393765cec6950f71a1fbf4
CRs-fixed: 605171
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
Signed-off-by: Jing Zhou <jzhou70@codeaurora.org>
power: qpnp-charger: allow vinmin to be lowered to 4.0 V

Currently the minimum input voltage is limited to a minimum
value of 4.2 V. Some chargers in combination with cables
having high resistance may require the input voltage minum
to be lower than 4.2.

Fix this by allowing up to 4.0 V for the minimum input voltage
settings.

Change-Id: I6f1dfa2453c7b95ecc2ccdf2aac23981c0e4dd0a
CRs-Fixed: 584999
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
wlan: Use HDD context flag to check SSR status

WDOG thread's SSR in progress flag is only set once the message is
serialized and processed at WDOG thread context. However HDD context
flag is set even before WDOG thread process this message (soon after
the remote SMD close is handled). So checking the HDD context flag
for SSR status would avoid potential race conditions.

CRs-Fixed: 606188
Change-Id: I19fb2dc2168634cf0b07141635b55c206e8c43aa
wlan: HDD: Prevent several cfg80211 functions to continue during SSR

This fix handles the scenario that while a certain cfg80211 funtion is
waiting for a specific event to happen, SSR is coming in. If waiting
timeout happens and the funtion continues to run, it may lead to crash.
Hence add the code to handle this case only when timeout happens.

Change-Id: I371cd284d074514d12add2a7a7cf9106a2fc1adb
CRs-fixed: 605427