OSDN Git Service

sagit-ice-cold/kernel_xiaomi_msm8998.git
8 years agomsm: pcie: add device and vendor ID for PCIe on msmcobalt
Tony Truong [Wed, 11 May 2016 00:31:11 +0000 (17:31 -0700)]
msm: pcie: add device and vendor ID for PCIe on msmcobalt

Add device and vendor ID for PCIe on msmcobalt based on PCIe
core's configurations. This value is required to enable
PCIe low power management features.

Change-Id: I972c35c79327e3baa38573318ed0909d4daa9516
Signed-off-by: Tony Truong <truong@codeaurora.org>
8 years agomsm: pcie: retrieve PCIe SMMU SID base from DT
Tony Truong [Fri, 6 May 2016 02:06:08 +0000 (19:06 -0700)]
msm: pcie: retrieve PCIe SMMU SID base from DT

SMMU SIDs allocated for PCIe varies across chipsets.
Thus, add support to retrieve the base SID from
PCIe devicetree node so that PCIe bus driver can
use it to calculate and assign to each PCI device.

Change-Id: I7651f2cbc53587f5b48501855260c87af2a2db01
Signed-off-by: Tony Truong <truong@codeaurora.org>
8 years agomsm: pcie: update PCIe PHY registers and sequences for msmcobalt
Tony Truong [Mon, 9 May 2016 23:36:50 +0000 (16:36 -0700)]
msm: pcie: update PCIe PHY registers and sequences for msmcobalt

PCIe PHY on msmcobalt has different register offsets and does not
support the same PHY sequences as other platforms. Thus, update
the PHY register offsets and sequences for msmcobalt.

Change-Id: If87bd507228476fee9713f88c06a1cf04b13f163
Signed-off-by: Tony Truong <truong@codeaurora.org>
8 years agotrace: cpu_freq_switch: use tracefs instead of debugfs
David Keitel [Mon, 9 May 2016 21:27:48 +0000 (14:27 -0700)]
trace: cpu_freq_switch: use tracefs instead of debugfs

Rather than using debugfs, switch to tracefs which trace
moved to in kernel 4.4.

Signed-off-by: David Keitel <dkeitel@codeaurora.org>
Change-Id: I52ef7d45cabb20cc61fbd2fb3ef5016b041bc56c

8 years agomsm: pcie: add support to get PCIe PHY init sequence from DT
Tony Truong [Tue, 12 Apr 2016 18:58:22 +0000 (11:58 -0700)]
msm: pcie: add support to get PCIe PHY init sequence from DT

PCIe PHY varies between each chipset. Thus, the PHY init sequence on
each of these chipsets are also different. Therefore, add the support
to read PCIe PHY init sequence from devicetree.

Change-Id: I21c2ce2b7d3bf1541a5d3580db4bc40497701095
Signed-off-by: Tony Truong <truong@codeaurora.org>
8 years agomsm: sde: Add error code for unsupported rotator version
Alan Kwong [Fri, 13 May 2016 13:42:55 +0000 (09:42 -0400)]
msm: sde: Add error code for unsupported rotator version

Although rotator driver checks for hardware version, and rejects
unsupported version.  But it does not return error code to indicate
error condition, and causes driver crash.

This fix adds error code to unsupported version, so upper layer can
properly handling the condition.

CRs-Fixed: 1015335
Change-Id: If83199b5990a3623b1018058d2164862352902b7
Signed-off-by: Alan Kwong <akwong@codeaurora.org>
8 years agoARM: dts: msm: Disable OSM vred FSM for msmcobalt
Osvaldo Banuelos [Fri, 8 Apr 2016 21:28:55 +0000 (14:28 -0700)]
ARM: dts: msm: Disable OSM vred FSM for msmcobalt

Disable the OSM vred FSM until core-count adjustments are enabled
for the CPRh VDD_APC0 and VDD_APC1 devices.

Change-Id: I467f49edbc65449f29f761c6b873ca702d24fa72
CRs-Fixed: 1014894
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
8 years agoARM: dts: msm: Add rotator clocks MNOC AHB/AXI for msmcobalt
Alan Kwong [Tue, 3 May 2016 20:18:48 +0000 (16:18 -0400)]
ARM: dts: msm: Add rotator clocks MNOC AHB/AXI for msmcobalt

Add additional required clocks to mdss device tree to enable
mmss smmu and ahb access for rotator.

CRs-Fixed: 1008505
Change-Id: I5bfc16e3d6ac3c6052b8dca55b42b57480ec650e
Signed-off-by: Alan Kwong <akwong@codeaurora.org>
8 years agoAndroidKernel.mk: additional fixes for multi-kernel tree
Lior David [Tue, 10 May 2016 07:47:37 +0000 (10:47 +0300)]
AndroidKernel.mk: additional fixes for multi-kernel tree

Fixes 2 problems related to multi-kernel tree support:

1. Copying of modules to /system/lib/modules is broken when building
in a multi-kernel tree. This is because INSTALL_MOD_PATH is not
set correctly. When building a multi-kernel tree, the output
directory is one additional directory deep, so modules end up
under <out>/obj/system/lib/modules instead of
<out>/system/lib/modules. Fix this by using BUILD_ROOT_LOC
which is set appropriately for multi-kernel and standard trees.
2. When running "make kernelconfig" on a multi-kernel tree,
the generated defconfig is copied to the wrong location,
since it uses the old-style location under kernel, instead
of kernel/<kernel name>.

Change-Id: I90563104a5b6219472eaeae1964fc34b52586536
CRs-Fixed: 1014872
Signed-off-by: Lior David <liord@codeaurora.org>
8 years agoARM: dts: msm: restrict VDD_GFX voltage to Nom for CPR Rev 0 on msmcobalt
David Collins [Thu, 12 May 2016 00:00:28 +0000 (17:00 -0700)]
ARM: dts: msm: restrict VDD_GFX voltage to Nom for CPR Rev 0 on msmcobalt

Some MSMCOBALT parts with CPR revision 0 are unable to operate at
low voltage.  Therefore, raise the CPR floor voltage to be equal
to the Nominal ceiling voltage for all corners.  Also increase
the ceiling voltages for corners accordingly to ensure that the
ceiling >= floor voltage requirement is met.

Change-Id: I346a909984519c2522503f842d449c6f3217b746
CRs-Fixed: 1014407
Signed-off-by: David Collins <collinsd@codeaurora.org>
8 years agoARM: dts: msm: Enable super speed mode support on msmcobalt
Hemant Kumar [Wed, 11 May 2016 20:38:49 +0000 (13:38 -0700)]
ARM: dts: msm: Enable super speed mode support on msmcobalt

Enable ssphy and update the qmp phy initialization sequence
to enumerate in super speed mode. By default Lane A is
selected for super speed mode.

Change-Id: Ibd5fdd0a1f48ecd8a828d187ac86513e3f48ae6f
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
8 years agoARM: dts: msm: Add mnoc_ahb clock for msmcobalt
Abhijit Kulkarni [Wed, 4 May 2016 02:03:37 +0000 (19:03 -0700)]
ARM: dts: msm: Add mnoc_ahb clock for msmcobalt

Add mmss_mnoc_ahb clock to mdss device tree as this clock needs to be
turned on before turning on ahb_clk.

CRs-Fixed: 1008505
Change-Id: I43ccff9774d098d551c4ba25ad5678fee13aca1f
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
8 years agoASoC: msm: Add USB audio via ADSP support
Kuirong Wang [Mon, 9 May 2016 21:35:30 +0000 (14:35 -0700)]
ASoC: msm: Add USB audio via ADSP support

Add new USB rx and tx afe ports and routing to different
fe dais to enable USB audio via ADSP.

Change-Id: I4f82ba27becee1f3b62c410be0d00876961f9b18
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
8 years agoarm64: enable HAVE_IRQ_TIME_ACCOUNTING for arm64
Steve Muckle [Thu, 13 Nov 2014 23:51:49 +0000 (15:51 -0800)]
arm64: enable HAVE_IRQ_TIME_ACCOUNTING for arm64

The only dependency for irq time accounting is a sufficiently high
resolution timer. Plenty of arm64 platforms will have this, so enable
this feature.

CRs-Fixed: 1013947
Change-Id: Id675a541a6813a14ae0b7e1bb66670bf7467a97f
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
[satyap@codeaurora.org: trivial merge conflict resolution.]
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
8 years agodefconfig: Enable CPUSS dump driver
Runmin Wang [Tue, 3 May 2016 23:59:13 +0000 (16:59 -0700)]
defconfig: Enable CPUSS dump driver

Enable CPUSS dump driver to dump cpu subsystem during crash.

CRs-Fixed: 1011333
Change-Id: Id4a8bca3eb77db4f998c790f1927fe373684048a
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
8 years agosoc: qcom: Add snapshot of the cpuss driver
Runmin Wang [Tue, 3 May 2016 23:31:23 +0000 (16:31 -0700)]
soc: qcom: Add snapshot of the cpuss driver

This snapshot is taken as of msm-3.18 commit dacccc6.

CRs-Fixed: 1011333
Change-Id: I4ed06b5602220ed4e30bd37a0633ccb3454f7d43
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
8 years agodiag: Use correct index while accessing DCI channel
Sreelakshmi Gownipalli [Tue, 19 Apr 2016 20:16:15 +0000 (13:16 -0700)]
diag: Use correct index while accessing DCI channel

Use correct index value while accessing DCI channel status.

Change-Id: I97456326a40c6d24c208307a9e8e6a55fc5b9d59
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
8 years agoclk: msm: clock-gcc-cobalt: Add reset capability to PCIE pipe clock
Deepak Katragadda [Tue, 10 May 2016 23:29:54 +0000 (16:29 -0700)]
clk: msm: clock-gcc-cobalt: Add reset capability to PCIE pipe clock

Instead of having a separate reset clock for PCIE 0 reset, tag the
BCR register with the gcc_pcie_0_pipe_clk directly.

CRs-Fixed: 1014989
Change-Id: Icbc3a4a237bd0ac75fbef0857238e18cfb0ca533
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
8 years agoclk: msm: clock-gcc-cobalt: Update the pcie_aux_clk_src frequency
Deepak Katragadda [Mon, 9 May 2016 22:38:55 +0000 (15:38 -0700)]
clk: msm: clock-gcc-cobalt: Update the pcie_aux_clk_src frequency

The pcie_aux_clk_src needs to run at XO frequency instead
of at 1MHz. Update the clock driver to support that.

CRs-Fixed: 1013278
Change-Id: Id8a92b0f36f71ed50726504d1e5b3feab4cfa512
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
8 years agopinctrl: qcom: Fix the base address of various GPIOs
Runmin Wang [Thu, 12 May 2016 22:01:01 +0000 (15:01 -0700)]
pinctrl: qcom: Fix the base address of various GPIOs

Update the base address of GPIOs to the correct value.

CRs-Fixed: 1014950
Change-Id: Id232492bd458dac04e89a94ed5a85092223ebff6
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
8 years agoARM: dts: msm: separate control and config offsets for PPB
Jeykumar Sankaran [Mon, 29 Feb 2016 20:09:15 +0000 (12:09 -0800)]
ARM: dts: msm: separate control and config offsets for PPB

This change separates the control and config register offset nodes
for ping pong blocks. Its not necessary every ping pong
blocks to have both control and config registers.

Change-Id: Ide998ad71abccb35d899f9e1f6093949acb95b09
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
8 years agomsm: thermal: Update the min frequency update logic
Ram Chandrasekar [Thu, 5 May 2016 21:14:03 +0000 (15:14 -0600)]
msm: thermal: Update the min frequency update logic

With LMH DCVSh hardware, the current check will use cpufreq to
limit both scaling min and max frequency. But cpufreq should be
used only for scaling min frequency.

Update the check to use cpufreq only to limit scaling min frequency.

Change-Id: I38de1699a7cdd5bc3fecef80dd34c4d22d2fd200
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
8 years agomsm: thermal: Avoid updating the scaling max frequency to cpufreq
Ram Chandrasekar [Thu, 5 May 2016 19:17:15 +0000 (13:17 -0600)]
msm: thermal: Avoid updating the scaling max frequency to cpufreq

With LMH DCVSh hardware, thermal driver can directly vote in the
hardware to limit the scaling max frequency. Voting to the cpufreq
driver along side the hardware, will introduce software delay when
removing the mitigation.

So avoid voting the scaling max frequency to the cpufreq when LMH DCVSh
is available.

Change-Id: I8a5f913ae41263b06af99b0ee802b4fa68312f33
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
8 years agodefconfig: msmcortex: Enable bcl driver
Ram Chandrasekar [Thu, 12 May 2016 15:28:38 +0000 (09:28 -0600)]
defconfig: msmcortex: Enable bcl driver

Enable bcl peripheral driver. The driver will interact
with the bcl peripheral to get the battery current, battery
voltage and set and receive thresholds for the same.

CRs-Fixed: 1010115
Change-Id: I7168c754e939ef9da001bcac52a5b802dea40b41
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
8 years agoARM: dts: msm: Add slimbus_6_rx back-end dai-link for msmcobalt
Kuirong Wang [Sat, 7 May 2016 21:36:48 +0000 (14:36 -0700)]
ARM: dts: msm: Add slimbus_6_rx back-end dai-link for msmcobalt

Add slimbus_6_rx back-end dai-link for msmcobalt to enable
independent backend for different devices during audio playback.

Change-Id: If22cadbcfac92f8243a3b6d3201935a839cd701a
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
8 years agoARM: dts: msm: Add USB audio via ADSP support for msmcobalt
Kuirong Wang [Wed, 4 May 2016 21:40:05 +0000 (14:40 -0700)]
ARM: dts: msm: Add USB audio via ADSP support for msmcobalt

Add device tree entries for USB audio rx and tx to
support USB audio via ADSP on msmcobalt platform.

Change-Id: I345aa2369d18e2137ce79676049bb59d715d1ee0
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
8 years agomsm: ipa: Add NETIF_F_SG to RMNET_IPA's hw features
Sridhar Ancha [Thu, 28 Apr 2016 16:32:23 +0000 (22:02 +0530)]
msm: ipa: Add NETIF_F_SG to RMNET_IPA's hw features

GSO segmented packets are getting linearized
before being sent to rmnet_ipa interface since SG
feature is not enabled.

Add NETIF_F_SG to IPA's HW features so that
ethtool can be used to enable it.

Change-Id: I7b321c796935febb3fa3e9ae520fd65e00da507c
Acked-by: Chaitanya Pratapa <cpratapa@qti.qualcomm.com>
Signed-off-by: Sridhar Ancha <sancha@codeaurora.org>
8 years agomsm: camera: Increase wait timeout time for kernel probe
Viswanadha Raju Thotakura [Wed, 11 May 2016 22:32:16 +0000 (15:32 -0700)]
msm: camera: Increase wait timeout time for kernel probe

Camera sensor probe happens in camera daemon, because
of delayed start of camera daemon, timeout happens and
camera server is notified with 0 cameras, this is
temporary solution.

CRs-Fixed: 1014373
Change-Id: I957b9744f6f627a74f805933012429c41b910e92
Signed-off-by: Viswanadha Raju Thotakura <viswanad@codeaurora.org>
8 years agoARM: dts: msm: fix panel mode selection GPIO specification
Aravind Venkateswaran [Wed, 11 May 2016 21:07:08 +0000 (14:07 -0700)]
ARM: dts: msm: fix panel mode selection GPIO specification

Commit a240321fd68894659859861b96a618af8370efbb ("ARM: dts: msm: define
primary display interface for msmcobalt CDP") used an incorrect binding
to specify the panel mode selection gpio state for the nt35597 WQXGA
dual dsi panel. Fix this to ensure that the panel mode gpio state is set
correctly.

Change-Id: I895642c231d980633801d094c8f329d209370c88
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
8 years agoARM: dts: msm: Add default configs for bcl in msmcobalt
Ram Chandrasekar [Mon, 25 Apr 2016 22:38:47 +0000 (16:38 -0600)]
ARM: dts: msm: Add default configs for bcl in msmcobalt

Add default battery mitigation configurations for msmcobalt

CRs-Fixed: 1010115
Change-Id: I13f1825f2eb04d606464d1092c222c8269084107
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
8 years agoARM: dts: msm: Configure bcl peripheral driver for PMIcobalt
Ram Chandrasekar [Thu, 7 Apr 2016 17:18:31 +0000 (11:18 -0600)]
ARM: dts: msm: Configure bcl peripheral driver for PMIcobalt

Configure the bcl peripheral driver with the details about the
register address, interrupt and interrupt clear polling delay for
PMIcobalt.

CRs-Fixed: 1010115
Change-Id: I521ee6c715525bd401630ec7948e5746682de6da
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
8 years agoARM: dts: msm: Correct camera nodes for msmcobalt
Viswanadha Raju Thotakura [Fri, 6 May 2016 21:01:27 +0000 (14:01 -0700)]
ARM: dts: msm: Correct camera nodes for msmcobalt

Correct the pinctrl nodes for actuator, change the CCI
source for auxiliary camera node, add eeprom1 node for
auxiliary sensor.

CRs-Fixed: 1014373
Change-Id: Icd9f1478c797fbdbd76d96c3069e5baa2c30ff61
Signed-off-by: Viswanadha Raju Thotakura <viswanad@codeaurora.org>
8 years agopower: bcl_peripheral: Support new bcl peripheral
Ram Chandrasekar [Fri, 11 Mar 2016 21:29:09 +0000 (14:29 -0700)]
power: bcl_peripheral: Support new bcl peripheral

Add support for the new version of bcl peripheral introduced
in PMIcobalt.

The new support includes,
1. support the new address space
2. set the new Ibat too high threshold
3. set the new vbat low comparator threshold
4. set the new vbat too low comparator threshold
5. enable the LMH DCVSh monitor algorithm, when the
   thresholds are configured.

CRs-Fixed: 1010115
Change-Id: I6dad908bbc673ff1b7f7d3d05fecdfc8f48b5815
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
8 years agopower: bcl: snapshot of battery_current_limit driver
Ram Chandrasekar [Sat, 7 May 2016 00:29:46 +0000 (18:29 -0600)]
power: bcl: snapshot of battery_current_limit driver

This snapshot is taken as of msm-3.18 commit
978d23c.

Accommodate the changes in the input arguments for
power_supply_register() API and use
power_supply_get_property() API to get the SoC information
from BMS.

CRs-Fixed: 1010115
Change-Id: I1af565ffd3b61e424aca1cbd5ec6cbef8d89f1fa
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
8 years agoARM: dts: msm: Add mnoc ahb bus fab for msmcobalt
David Dai [Thu, 5 May 2016 23:45:09 +0000 (16:45 -0700)]
ARM: dts: msm: Add mnoc ahb bus fab for msmcobalt

Add mnoc ahb fab used by clients to request for different
speeds on configuration paths.

CRs-Fixed: 1013346
Change-Id: Ic5f3598644a6d93796b8613117e42ff692168c3c
Signed-off-by: David Dai <daidavid1@codeaurora.org>
8 years agoARM: dts: msm: use msmbus_bimc node for bimc_fab for msm_cobalt
David Dai [Thu, 5 May 2016 19:24:14 +0000 (12:24 -0700)]
ARM: dts: msm: use msmbus_bimc node for bimc_fab for msm_cobalt

To prevent a 0 vote on to bimc_clk from late clock init,
there must be a non zero vote on bimc_clk's child as opposed
to itself, vote on the child clock node as opposed to the parent.

CRs-Fixed: 1013348
Change-Id: Id3a9fa3238ce0f04737a7b98aa897ec83ecdc8e2
Signed-off-by: David Dai <daidavid1@codeaurora.org>
8 years agodefconfig: enable CONFIG_DEVMEM and CONFIG_DEVKMEM
Runmin Wang [Tue, 10 May 2016 17:53:18 +0000 (10:53 -0700)]
defconfig: enable CONFIG_DEVMEM and CONFIG_DEVKMEM

Add support to access system's memory.

CRs-Fixed: 1013668
Change-Id: I7cafb74373efbc611bc894bdf3b351aae7e03da5
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
8 years agoASoC: soc-core: change debug level for debugfs fail message
Banajit Goswami [Wed, 15 Jul 2015 22:36:49 +0000 (15:36 -0700)]
ASoC: soc-core: change debug level for debugfs fail message

Debugfs directory creation failure are not critical error.
However, the failure messages might be misleading and might
be interpreted as geniune failure in ASoC functionality.
Mark the failure messages as debug level.

Change-Id: Id61c81753d493b6508cbe87c59077adda4675ada
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
8 years agoclk: msm: osm: initialize PLL test control register
Osvaldo Banuelos [Wed, 27 Apr 2016 17:24:56 +0000 (10:24 -0700)]
clk: msm: osm: initialize PLL test control register

Program the PLL test control register for the power
cluster clock in agreement with hardware guidelines.

Change-Id: I102fd544ea0571d31d2ef9232195d4adbddda6d7
CRs-Fixed: 1009203
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
8 years agomsm: mdss: dsi: fix configuration for mode selection GPIO
Aravind Venkateswaran [Wed, 11 May 2016 21:38:13 +0000 (14:38 -0700)]
msm: mdss: dsi: fix configuration for mode selection GPIO

Configure the mode selection GPIO as direction output in order to
correctly configure the panel operating mode.

Change-Id: Ic79850674c42f3c59512467dbb608942b98cf74a
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
8 years agomsm: mdss: fix qseed3 op_mode register programming
Abhijit Kulkarni [Thu, 5 May 2016 18:45:43 +0000 (11:45 -0700)]
msm: mdss: fix qseed3 op_mode register programming

Initialize the op_mode register and program the direction_enable
field in this register correctly

CRs-Fixed: 1008505
Change-Id: I2dbcb8eb1ef5c6e0ebcbfb9f298a14344fbe7ce3
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
8 years agodefconfig: arm64: msmcortex: Enable VADC_HC and BTM driver
Siddartha Mohanadoss [Wed, 11 May 2016 19:21:21 +0000 (12:21 -0700)]
defconfig: arm64: msmcortex: Enable VADC_HC and BTM driver

Enable VADC_HC and BTM peripheral driver on PMcobalt
to support reading and setting thresholds on ADC
channel such as voltage phone power(vph_pwr) and
thermistors.

Change-Id: I783d87714145f58fefc9e1e6a09d1ecfab56744b
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
8 years agoregmap: improve debugfs interface to dump specific addresses
Abhijeet Dharmapurikar [Thu, 21 Jan 2016 18:58:22 +0000 (10:58 -0800)]
regmap: improve debugfs interface to dump specific addresses

The current method of cat-ing register file dumps the entire
address space. One can use dd command to dump a subrange within
the address space. However one needs to know the string length
of each line which is derived from max address, the character
length of each register entry and the format.

Provide simple means to dump a range by allowing user to specify
the start address and the count of registers. When the data is read
convert the dump address to a starting position in the file. Similarly
if the file offset goes beyond the dump range return 0 to indicate
that the data is already dumped.

Also provide means to write to a register address.

CRs-Fixed: 1001770
Change-Id: I3466ce89007d127151f6760328edad116d679db8
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
8 years agoslim: ngd: retention support in power-collapse
Sagar Dharia [Tue, 12 Apr 2016 20:14:33 +0000 (14:14 -0600)]
slim: ngd: retention support in power-collapse

Support retention by checking interrupt status rather than logical
address register. During retention, interrupt status is zero'ed but
logical address may be retained to avoid report-present generation.

Change-Id: I9e7f24c5f4eb722643bf3fac2d5c898ad107dd24
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
8 years ago[media] v4l: Update v4l2 32bit structures
Arun Menon [Wed, 5 Feb 2014 21:44:21 +0000 (13:44 -0800)]
[media] v4l: Update v4l2 32bit structures

Update v4l2_event32 structure with updated elements
from v4l2_event structure. Also copy and update
reserved and other fields during 32 bit ioctl handling.

CRs-Fixed: 1013345
Change-Id: I3038a2c0c7f2b7f13c412dc04890744d8dbe37ee
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
8 years agodefconfig: arm64: enable Coresight drivers for msmcobalt
Shashank Mittal [Thu, 21 Apr 2016 16:41:27 +0000 (09:41 -0700)]
defconfig: arm64: enable Coresight drivers for msmcobalt

Enable Coresight drivers for msmcoblt. These devices can be used to
configure and enable trace functionality on msmcobalt.

Change-Id: Ib4b50d7df15114d417898c36b229441766bd5b42
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
8 years agomsm: kgsl: Add property to determine GPU bitness
Sunil Khatri [Fri, 29 Apr 2016 15:29:46 +0000 (09:29 -0600)]
msm: kgsl: Add property to determine GPU bitness

Add the property to determine GPU bitness which
is used by the clients via KGSL ioctl.

Certain clients of KGSL such as Open-CL driver
need to know explicitly about the GPU mode.

Change-Id: I77523d7816edb9776014aaf3aa85321af0d20aaf
Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
8 years agomsm: kgsl: Use the crash dumper to read HLSQ/shader memory on 5XX
Jordan Crouse [Fri, 29 Apr 2016 15:29:27 +0000 (09:29 -0600)]
msm: kgsl: Use the crash dumper to read HLSQ/shader memory on 5XX

The host AHB aperture for reading the HSLQ/SP/TP and shader memory
blocks might be blocked on A5XX targets so use the CP crash dump
utility to read them instead.  Downside if the crashdumper goes boom
we'll have to skip those registers in the fallback.

Change-Id: Ic0dedbad3c7b485c696198bdfcb78d45e929ec22
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
8 years agomsm: kgsl: Add effuses read capabilities for A505 GPU
Hareesh Gundu [Fri, 29 Apr 2016 15:29:15 +0000 (09:29 -0600)]
msm: kgsl: Add effuses read capabilities for A505 GPU

A505 GPU is having two different frequency plans, for
loading a specific frequency plan add speed bin read
information capability to A505.

Change-Id: I259020d7e4613d043e213ab2cb41e80ceb11f46a
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
8 years agomsm: kgsl: Do not allocate memory for profiling and sync commands
Sunil Khatri [Fri, 29 Apr 2016 15:28:51 +0000 (09:28 -0600)]
msm: kgsl: Do not allocate memory for profiling and sync commands

Do not allocate memory for IB descriptors for commands
of types profiling buffers, sync and markers.

This fixes the memory leak due to allocation of
memory for such commands and these were never freed.

CRs-Fixed: 996651
Change-Id: Ib168d60ad89e0fd55cd1f10b773b7cdaa7400ace
Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
8 years agomsm: kgsl: Add 1M and 8K pools to the allocator
Shrenuj Bansal [Fri, 29 Apr 2016 15:28:02 +0000 (09:28 -0600)]
msm: kgsl: Add 1M and 8K pools to the allocator

This change includes the below:
- Add 1M and 8k pools and structure the allocator to use all pools
from the largest page to the smallest
- Reserve a set number of pages for each of these pools at init time
- When allocating, use the reserved pools and then fall back to
allocating from system memory using only 8k and 4k pages
- Remove maximums on the pool sizes
- Zero the memory when we create the pool initially and add pages
back to the pool on free

CRs-Fixed: 995735
Change-Id: I9440bad62d3e13b434902f167c9d23467b1c4235
Signed-off-by: Shrenuj Bansal <shrenujb@codeaurora.org>
8 years agomsm: ipa: Fix to polling mode
Sridhar Ancha [Fri, 29 Apr 2016 13:31:03 +0000 (19:01 +0530)]
msm: ipa: Fix to polling mode

When IPA clock is enabled, suspend bit is cleared
and if pipe is non-empty EOT is posted internally.
At the same time, there is a possibility that SPS
driver posts EOT. This can result into incorrect
state of polling state and switch to intr mode is
tried repeatedly. Make a change to check if we are
in intr mode already in addition to the polling state.

Change-Id: I1af08605f7d2d234b0e5a4e3c8928db6cff5c7b4
Acked-by: Chaitanya Pratapa <cpratapa@qti.qualcomm.com>
Signed-off-by: Sridhar Ancha <sancha@codeaurora.org>
8 years agoleds: leds-qpnp-flash-v2: create v2 QPNP flash LED driver
Chun Zhang [Tue, 1 Mar 2016 10:34:54 +0000 (02:34 -0800)]
leds: leds-qpnp-flash-v2: create v2 QPNP flash LED driver

There is a new Qualcomm Technology Inc. Plug-n-play(QPNP) PMIC chip,
which introduces brand new flash LED hardware. The new hardware
comes with up to 3 LEDs support, different register mapping layout,
and different torch enablement requirement. Therefore, a new driver
is introduced to cover this need.

Change-Id: Ic878f1a946955edff3a9228e7fe54b7a525e37b1
Signed-off-by: Chun Zhang <chunz@codeaurora.org>
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
8 years agoARM: dts: msm: Clock fixes and Secure context banks for msmcobalt
Chinmay Sawarkar [Wed, 20 Apr 2016 03:49:58 +0000 (20:49 -0700)]
ARM: dts: msm: Clock fixes and Secure context banks for msmcobalt

Update the Venus clock frequency for different Venus load. There
were kernel panic as the BIMC clocks were OFF. Add the bimc_smmu
gdsc to turn ON the BIMC clocks. Add secure context banks.

Change-Id: I120ce95ea20434b41ac88a5d686b994630516435
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
8 years agodefconfig: msm: enable rndis_ipa on cobalt
Skylar Chang [Thu, 5 May 2016 06:16:41 +0000 (23:16 -0700)]
defconfig: msm: enable rndis_ipa on cobalt

enable rndis_ipa on cobalt build to support
IPA-offload data path.

Change-Id: I98c462b56dbe01930456a16d5eeb6646b0a2db83
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
8 years agoARM: dts: msm: update touch screen resolution
Mohan Pallaka [Fri, 6 May 2016 00:05:04 +0000 (17:05 -0700)]
ARM: dts: msm: update touch screen resolution

Change the touch screen to match WQHD display

Change-Id: Ia0b77f23b26941ea2a53451ae61c46aa0ada731c
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
8 years agoslimbus: Add API to get matching ID table
Phani Kumar Uppalapati [Wed, 4 May 2016 17:33:42 +0000 (10:33 -0700)]
slimbus: Add API to get matching ID table

Add API in slimbus driver for clients to get the
matching ID table which helps in accessing driver
data and name fields.

CRs-fixed: 975738
Change-Id: I09c9f1de74e348b032d215cbb0fb9ba6c7aecf18
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
8 years agousb: gadget: f_gsi: Call ipa_usb_init_teth_prot() from gsi_bind
Hemant Kumar [Thu, 5 May 2016 04:23:59 +0000 (21:23 -0700)]
usb: gadget: f_gsi: Call ipa_usb_init_teth_prot() from gsi_bind

Currently ipa_usb_init_teth_prot() is called before gsi_bind()
gets called as a result of usb_add_function() call. gsi_bind()
is polulating ipa_init_params which is passed to
ipa_usb_init_teth_prot(). Since usb_add_function() is getting
called later after gsi_bind_config() returns, ipa_init_params
remains unpopulated and results into ipa_usb_init_teth_prot()
returning failure. Fix this issue by moving the call to
gsi_bind(). This also matches to ipa_usb_deinit_teth_prot()
call in gsi_unbind().

CRs-Fixed: 1013830
Change-Id: I824d3fa62e2736962680ae1c883b9a2916346331
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
8 years agousb: dwc3: Fix dep name handling upon ep disable
Hemant Kumar [Tue, 10 May 2016 22:23:00 +0000 (15:23 -0700)]
usb: dwc3: Fix dep name handling upon ep disable

dep name needs to be updated only for non-gsi endpoints
since gsi endpoints are statically assigned. Due to merge
from previous kernel dep name is updated twice upon ep
disable. This is causing gsi ep names to get modified
resulting into failure in finding the original gsi ep name
upon function bind. Hence update the dep name only once
at the end of ep disable and skip it for gsi eps.

CRs-Fixed: 1013830
Change-Id: Iea9282cc8fb4f13d066d25c63ccb1da1881c0a8a
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
8 years agousb: gadget: f_gsi: Use gsi ep ops to disable endpoint
Hemant Kumar [Tue, 10 May 2016 22:16:51 +0000 (15:16 -0700)]
usb: gadget: f_gsi: Use gsi ep ops to disable endpoint

gsi driver does not call the gadget API usb_ep_enable()
instead uses gsi ep operation call back to enable gsi ep.
As a result ep->enabled flag remains clear. Later function
driver calls usb_ep_disble() API from gadget framework and
ep disable operation gets skipped. This causes start transfer
command to fail next time when gsi ep gets enabled. Fix this
issue by calling gsi ep disable operation instead of calling
gadget API.

CRs-Fixed: 1013830
Change-Id: I06570dec368b430321ec196a5e4338f657c43b42
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
8 years agousb: dwc3: Add support for gsi endpoint disable operation
Hemant Kumar [Tue, 10 May 2016 22:01:44 +0000 (15:01 -0700)]
usb: dwc3: Add support for gsi endpoint disable operation

gsi driver does not call the gadget API usb_ep_enable()
instead uses gsi ep operation call back to enable gsi ep.
As a result ep->enabled flag remains clear. Later function
driver calls usb_ep_disble() API from gadget framework and
ep disable operation gets skipped. Fix this by adding gsi ep
operation for ep disable. This makes the enable and
disable ep operations both handled by gsi ep ops.

CRs-Fixed: 1013830
Change-Id: I5caa9a839b9fdd144af0a59a7c605777f7a3a659
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
8 years agousb: gadget: rndis: Add packet filter handling for hw accelerated path
Hemant Kumar [Tue, 10 May 2016 21:11:27 +0000 (14:11 -0700)]
usb: gadget: rndis: Add packet filter handling for hw accelerated path

Call flow control API when RNDIS packet filter control message is
received. This allows to call the registered flow control call back
from rndis clients supporting hw accelerated path.

CRs-Fixed: 1013824
Change-Id: I87793e31d4db10acf1103127a2d1ad942d253c67
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
8 years agousb: gadget: composite: Handle OS descriptor request properly
Hemant Kumar [Thu, 5 May 2016 02:30:23 +0000 (19:30 -0700)]
usb: gadget: composite: Handle OS descriptor request properly

In case w_index or w_value of an OS descriptor does not match
for a device or an interface, value remains set to -EOPNOTSUPP.
This is assigned to an unsigned request length and becomes a
large integer value. When driver tries to allocate a buffer
of this large integer value DMA allocator complaints for out of
SW-IOMMU space. Hence check this variable for negative value and
return without queuing ep0 request.

CRs-Fixed: 1013316
Change-Id: I705d0d54fb17ca3042533f0106f91912215bd52a
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
8 years agousb: gadget: composite: Fix double free memory bug
Hemant Kumar [Thu, 5 May 2016 01:22:14 +0000 (18:22 -0700)]
usb: gadget: composite: Fix double free memory bug

configfs_dev_cleanup function can double free os_desc
and buffer when called from different context. For
example, this can be called from composite_unbind() and
when composite_bind() fails. Fix this issue by setting
request and buffer pointer to NULL after kfree.

CRs-Fixed: 1013316
Change-Id: I6e87289627b23fc368f990fc7962854eeb3fbbc1
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
8 years agoclk: msm: clock-gcc-cobalt: Update the FMAXes for hmss_gpll0_clk_src
Deepak Katragadda [Mon, 9 May 2016 22:18:33 +0000 (15:18 -0700)]
clk: msm: clock-gcc-cobalt: Update the FMAXes for hmss_gpll0_clk_src

The hmss_gpll0_clk_src RCG only needs an SVS2 vote on CX
to run. Update the FMAXes in the linux clock driver.

CRs-Fixed: 1013237
Change-Id: I31aaeb7cf965bfbee4aa219936d8e298899b61a8
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
8 years agoregulator: cpr3-regulator: unregister CPR IRQ affinity notifier correctly
David Collins [Thu, 14 Apr 2016 19:04:31 +0000 (12:04 -0700)]
regulator: cpr3-regulator: unregister CPR IRQ affinity notifier correctly

Commit b7d5b597f16a ("regulator: cpr3-regulator: add support for
configuring CPR IRQ affinity") added a call to
register_hotcpu_notifier() but did not add a call to
unregister_hotcpu_notifier().  Correct this so that the IRQ
affinity notifier is unregistered when a cpr3-regulator device
is unregistered.

Change-Id: I6379559e201f14a0fd46c1e06761fae356ec9813
CRs-Fixed: 949650
Signed-off-by: David Collins <collinsd@codeaurora.org>
8 years agoregulator: cpr3-mmss-regulator: add support for msmcobalt partial binning
David Collins [Wed, 27 Apr 2016 00:33:50 +0000 (17:33 -0700)]
regulator: cpr3-mmss-regulator: add support for msmcobalt partial binning

Add support for the partial binning open-loop voltage fuse values
used on MSMCOBALT chips.  Raise the voltage applied for lower
corners when specified by the fuse values in order to ensure
stability.

Change-Id: Ia3f95778d0dab1be9d15fa95d1fc5624606689ec
CRs-Fixed: 1009279
Signed-off-by: David Collins <collinsd@codeaurora.org>
8 years agoicnss: Add support to configure voltage regulator
Hardik Kantilal Patel [Thu, 25 Feb 2016 04:05:46 +0000 (09:35 +0530)]
icnss: Add support to configure voltage regulator

Add voltage regulator support to power the WLAN hardware.

CRs-Fixed: 982993
Change-Id: Ic36ac920497d05131ef8162a42ee5318600a3473
Signed-off-by: Hardik Kantilal Patel <hkpatel@codeaurora.org>
8 years agomsm: mdss: Properly free memory in error case
Ping Li [Thu, 21 Apr 2016 00:09:36 +0000 (17:09 -0700)]
msm: mdss: Properly free memory in error case

Free previously allocated memory in error return cases to avoid
memory leak.

CRs-Fixed: 1005989
Change-Id: I9676eb2c75e7be42b1b1901194ba5c2a206dbeb3
Signed-off-by: Ping Li <pingli@codeaurora.org>
8 years agomsm: mdss: Add NULL check before de-allocating framebuffer
Ping Li [Fri, 15 Apr 2016 23:54:21 +0000 (16:54 -0700)]
msm: mdss: Add NULL check before de-allocating framebuffer

Add NULL check before de-allocating framebuffer to avoid NULL
pointer de-reference.

CRs-Fixed: 1003106
Change-Id: I0f3c44671d3ca1b665e91ad314513bb743f23d3c
Signed-off-by: Ping Li <pingli@codeaurora.org>
8 years agomsm: mdss: Fix memory leak in panel_debugfs_create_array func
Ping Li [Fri, 29 Apr 2016 21:42:46 +0000 (14:42 -0700)]
msm: mdss: Fix memory leak in panel_debugfs_create_array func

Fix the potential memory leak in panel_debugfs_create_array func
by freeing the allocated memory in error return case.

CRs-Fixed: 1005536
Change-Id: If2bf7dbe7caedfa42337639fea739974f99960b4
Signed-off-by: Ping Li <pingli@codeaurora.org>
8 years agoARM: dts: msm: Add Synaptics regulator voltage and current for msm8996
Alex Sarraf [Tue, 3 May 2016 00:42:18 +0000 (17:42 -0700)]
ARM: dts: msm: Add Synaptics regulator voltage and current for msm8996

Add voltage and current specs for regulators for the
Synaptics driver.

Change-Id: I94c7d5b20fc73ba49b0c8613297f0514fedb3d97
Signed-off-by: Alex Sarraf <asarraf@codeaurora.org>
8 years agomsm: mdss: Properly set the PP feature cfg_payload in layers
Ping Li [Wed, 20 Apr 2016 01:52:10 +0000 (18:52 -0700)]
msm: mdss: Properly set the PP feature cfg_payload in layers

Set the PP feature cfg_payload properly to avoid invalid pointer
cases.

CRs-Fixed: 1004933
Change-Id: I44314b49a6ebb5dedfdedfcddd88c12eabd1f125
Signed-off-by: Ping Li <pingli@codeaurora.org>
8 years agomsm: mdss: Correct block id check for mdss_mdp_misr_table
Ping Li [Fri, 15 Apr 2016 22:27:36 +0000 (15:27 -0700)]
msm: mdss: Correct block id check for mdss_mdp_misr_table

DISPLAY_MISR_LCDC block doesn't have corresponding mdss_mdp_misr_table,
this change corrects the block id check for mdss_mdp_misr_table.

CRs-Fixed: 1001224
Change-Id: I74b03c31542d4b239eb2ffdc4dc6345dff5eab86
Signed-off-by: Ping Li <pingli@codeaurora.org>
8 years agomsm: sde: Correct rotator chroma alignment for nv12 ubwc
Alan Kwong [Tue, 10 May 2016 01:07:43 +0000 (21:07 -0400)]
msm: sde: Correct rotator chroma alignment for nv12 ubwc

Correct rotator chroma alignment to 128 byte for nv12 ubwc format.  Chroma
block artifacts are seen without this correction.

CRs-Fixed: 1013358
Change-Id: I715094188dc2b61c04879f8f6ce7b2c8f2d815c5
Signed-off-by: Alan Kwong <akwong@codeaurora.org>
8 years agoARM: dts: msm: Add apps port entries for audio slimbus on msmcobalt
Sagar Dharia [Fri, 29 Apr 2016 22:40:32 +0000 (16:40 -0600)]
ARM: dts: msm: Add apps port entries for audio slimbus on msmcobalt

Add apps side data port entries for audio slimbus instance based
on audio usecases.

CRs-Fixed: 1003083
Change-Id: I4fd83519ab75a1d979573b63761676f7c99593d4
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
8 years agoARM: dts: msm: Add PD PHY peripheral to pmicobalt
Jack Pham [Fri, 1 Apr 2016 01:50:53 +0000 (18:50 -0700)]
ARM: dts: msm: Add PD PHY peripheral to pmicobalt

Add device node for the USB PD PHY peripheral found in PMICOBALT.
Reference this from the USB3 node as its extcon device as it
provides notifications of cable insertion/removal.

Change-Id: I42916b13e5d28dd3f3b0ed40c53767cbd7ae32b1
Signed-off-by: Jack Pham <jackp@codeaurora.org>
8 years agodefconfig: msmcortex: Enable USB PD drivers
Jack Pham [Fri, 1 Apr 2016 01:53:02 +0000 (18:53 -0700)]
defconfig: msmcortex: Enable USB PD drivers

Enable USB_PD_POLICY and QPNP_USB_PDPHY drivers which
support USB Power Delivery.

Change-Id: I44a385af5c68b0bf656fc705a07251850fb38fde
Signed-off-by: Jack Pham <jackp@codeaurora.org>
8 years agousb: pd: Add sysfs entries
Jack Pham [Fri, 4 Mar 2016 23:48:37 +0000 (15:48 -0800)]
usb: pd: Add sysfs entries

Add sysfs attributes that will live under /sys/class/usbpd/usbpd0
which will give state information such as:

   - received PDOs from the peer source
   - whether an explicit contract is established
   - selecting a new PDO (thereby sending a Request message)
   - current and supported power, data roles

Change-Id: I5c3cf9a0239c0274709a1771e4fda8c6f5baaa77
Signed-off-by: Jack Pham <jackp@codeaurora.org>
8 years agousb: pd: Add Protocol layer and Policy Engine
Jack Pham [Fri, 19 Feb 2016 21:04:37 +0000 (13:04 -0800)]
usb: pd: Add Protocol layer and Policy Engine

This change adds protocol layer handling as well as the
policy engine state machine.

Change-Id: I5323f82192960d1fd7d3a20baf040d6d80c06be5
Signed-off-by: Jack Pham <jackp@codeaurora.org>
8 years agousb: pd: Add QPNP Power Delivery PHY driver
Hemant Kumar [Mon, 29 Feb 2016 20:01:27 +0000 (12:01 -0800)]
usb: pd: Add QPNP Power Delivery PHY driver

The QPNP PD PHY resides in the PMIC and handles USB Power Delivery
data transmission and reception over the CC lines. This driver
communicates to this device over SPMI or I2C buses. Introduce APIs
that upper layers will use to implement the protocol layer and
policy engine.

Change-Id: I75dec23c297fd5e07d14741e6627b473012b7a01
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
8 years agousb: pd: Add initial support for USB Power Delivery
Jack Pham [Thu, 17 Mar 2016 07:27:10 +0000 (00:27 -0700)]
usb: pd: Add initial support for USB Power Delivery

Add PD policy engine driver. This driver will interact
with the charger/Type-C module via power_supply framework,
and in turn notify the USB controller on when to begin/end
data operation using extcon. For this initial patch this
driver is simply acting as a pass-through between Type-C
connection states and relaying them as USB/USB_HOST
notifications.

Change-Id: Ieba8e68761beef83a572b75b6b5f3b7ab7802e9e
Signed-off-by: Jack Pham <jackp@codeaurora.org>
8 years agodefconfig: arm64: msmcortex: enable QPNP_SMB2 support for msmcobalt
Nicholas Troast [Fri, 8 Apr 2016 21:20:53 +0000 (14:20 -0700)]
defconfig: arm64: msmcortex: enable QPNP_SMB2 support for msmcobalt

Enable QPNP_SMB2 device support for the msmcobalt platform.

CRs-Fixed: 1005389
Change-Id: I0ecabc0febd38ad55cee69bb415a0856a3e83a73
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
8 years agoARM: dts: msm: add VBUS and VCONN regulators for msmcobalt
Harry Yang [Thu, 7 Apr 2016 01:26:53 +0000 (18:26 -0700)]
ARM: dts: msm: add VBUS and VCONN regulators for msmcobalt

QPNP SMB2 charger controls enabling VBUS and VCONN regulators.

- VBUS is used to support OTG connected devices
- VCONN is used to support Type-C powered cables

Add regulator devices for VBUS and VCONN.

CRs-Fixed: 1005389
Change-Id: Ia8dd2d6c8d51765dc49bdfa15565aed09c6a3893
Signed-off-by: Harry Yang <harryy@codeaurora.org>
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
8 years agoARM: dts: msm: add QPNP SMB2 charger device to PMICOBALT
Nicholas Troast [Fri, 8 Apr 2016 21:00:24 +0000 (14:00 -0700)]
ARM: dts: msm: add QPNP SMB2 charger device to PMICOBALT

Add the QPNP SMB2 charger device that is present in PMICOBALT.

CRs-Fixed: 1005389
Change-Id: I03be96c229095b666d8e1a84c718989d84ec506e
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
8 years agoqcom-charger: introduce QPNP SMB2 charger driver
Nicholas Troast [Thu, 25 Feb 2016 23:42:17 +0000 (15:42 -0800)]
qcom-charger: introduce QPNP SMB2 charger driver

The QPNP SMB2 charger driver supports the charger peripheral present in
the PMICOBALT chip.

This charger peripheral is common among other chips, therefore the
driver uses the smb library to support all common functionality.

Register access is provided by the parent device via regmap. Interrupts
are controlled by the parent device, and handlers are registered by the
QPNP SMB2 charger driver.

The power supply framework is used to communicate battery and usb
properties to userspace and other driver consumers such as fuel gauge,
USB, and USB-PD.

VBUS and VCONN regulators are registered for supporting OTG, and powered
Type-C cables respectively.

CRs-Fixed: 1005389
Change-Id: I160ce3c8caae6999f52590099cf6d1de957dbbaf
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Signed-off-by: Harry Yang <harryy@codeaurora.org>
8 years agoqcom-charger: introduce SMB charger library
Nicholas Troast [Mon, 28 Mar 2016 19:26:44 +0000 (12:26 -0700)]
qcom-charger: introduce SMB charger library

A library of common structures and functions that should be used by all
charger drivers that support an SMB charger peripheral.

The library includes high level register read/write access, interrupt
handlers, voter callbacks, and power supply property getters. It should be
extended with any functionality that can be leveraged by an SMB charger
peripheral.

All drivers that support an SMB charger peripheral should define their own
struct smb_charger to interface with the library.

CRs-Fixed: 1005389
Change-Id: I36796332af667874c1246ec35984122d45de6938
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Harry Yang <harryy@codeaurora.org>
8 years agoqcom-charger: pmic-voter: allow NULL callbacks
Nicholas Troast [Thu, 5 May 2016 17:59:01 +0000 (10:59 -0700)]
qcom-charger: pmic-voter: allow NULL callbacks

Consumers may not want to specify a callback, especially for boolean
votables which only care about the state of the client votes rather than
reacting to a change in the effective result.

CRs-Fixed: 1005389
Change-Id: I72274126a382ef8e32d89e1e8aa98348aaaac420
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
8 years agoandroid: binder: Don't use sched_preempt_enable_no_resched.
Riley Andrews [Wed, 2 Sep 2015 03:31:12 +0000 (20:31 -0700)]
android: binder: Don't use sched_preempt_enable_no_resched.

The correct function is prempt_enable_no_resched(). The other
function is reserved for the scheduler core.

Change-Id: Ib36697de003f6a59a608a0024d5351dc15ff8715
Signed-off-by: Todd Kjos <tkjos@google.com>
Git-commit: 776e5bca6446b3aac03b4685b4f4f72446ddcba0
Git-repo: https://android.googlesource.com/kernel/msm
[odhyade@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Omprakash Dhyade <odhyade@codeaurora.org>
8 years agoandroid: binder: Use wake up hint for synchronous transactions.
Riley Andrews [Tue, 1 Sep 2015 19:42:07 +0000 (12:42 -0700)]
android: binder: Use wake up hint for synchronous transactions.

Use wake_up_interruptible_sync() to hint to the scheduler binder
transactions are synchronous wakeups. Disable premption while waking
to avoid ping-ponging on the binder lock.

Change-Id: Ic406a232d0873662f80148e37acefe5243d912a0
Signed-off-by: Todd Kjos <tkjos@google.com>
Git-commit: 443c026e90820170aa3db2c21d2933ae5922f900
Git-repo: https://android.googlesource.com/kernel/msm
Signed-off-by: Omprakash Dhyade <odhyade@codeaurora.org>
8 years agosoc: qcom: glink: Fix ssr race condition in glink_close
Chris Lew [Sat, 30 Apr 2016 23:11:26 +0000 (16:11 -0700)]
soc: qcom: glink: Fix ssr race condition in glink_close

Add else statement in glink_close for a race condition where the
xprt state is set to GLINK_XPRT_DOWN and glink_close runs before
the channel is migrated.

CRs-Fixed: 988266
Change-Id: I4de6530f1fbffd9f3acd1fa539cf756364ea32ac
Signed-off-by: Chris Lew <clew@codeaurora.org>
8 years agoicnss: Update icnss logs
Yuanyuan Liu [Sat, 7 May 2016 00:12:04 +0000 (17:12 -0700)]
icnss: Update icnss logs

Enable important kernel logs which are essential for cold boot debug.
Remove unnecessary log for normal behavior.

CRs-Fixed: 1013082
Change-Id: I5234f0511fa1c81072e740386e90e07f5e813dd0
Signed-off-by: Yuanyuan Liu <yuanliu@codeaurora.org>
8 years agoregulator: labibb: fix standalone mode configuration
Subbaraman Narayanamurthy [Fri, 1 Apr 2016 02:43:09 +0000 (19:43 -0700)]
regulator: labibb: fix standalone mode configuration

Currently, standalone mode is treated as a mode along with other
modes, LCD and AMOLED. Rather than keeping it like that, LCD and
AMOLED mode configurations should be allowed along with the way
LAB and IBB modules are controlled, i.e. standalone or dual.

Remove the standalone mode from the list of modes and keep it as
a configurable parameter via device tree. This way, LCD and
AMOLED modes can be configured along with the way LAB/IBB needs
to be controlled (dual or standalone).

Add support for parent supply to LABIBB device so that LAB and
IBB regulators can vote for MBG when operating in standalone
mode.

CRs-Fixed: 996961
Change-Id: I56882e3a5a01b017e1ba9cd63ab36933a3d469e7
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
8 years agoRevert "regulator: labibb: avail of simpler regulator registration api"
Subbaraman Narayanamurthy [Tue, 26 Apr 2016 02:02:49 +0000 (19:02 -0700)]
Revert "regulator: labibb: avail of simpler regulator registration api"

This reverts commit 0324b74b3953 ("regulator: labibb: avail of
simpler regulator registration api").

LABIBB regulator driver still needs to obtain init_data from
the device tree not just for the regulator name but it is for
a subsequent change which will pass the parent supply name via
init_data to register with the regulator framework. Hence bring
it back.

Since of_get_regulator_init_data() is brought back, we need to
pass rdesc to that function as the number of arguments got
changed.

CRs-Fixed: 1008400
Change-Id: I027a9ddbbbf6ff0ba7886151e5336d190ac3ce25
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
8 years agoregulator: qpnp-labibb: Add logic to skip second SWIRE command
Anirudh Ghayal [Tue, 1 Mar 2016 10:58:56 +0000 (16:28 +0530)]
regulator: qpnp-labibb: Add logic to skip second SWIRE command

On newer AMOLED panels the second SWIRE command is expected to
control the AVDD voltage. However, the PMI8950/PMI8994 IBB module
interprets this command for VDISN and incorrectly reduces its voltage.

Add DT properties 'qcom,skip-2nd-swire-cmd' to skip the second
SWIRE command and 'qcom,swire-2nd-cmd-delay' to explicitly specify
the delay between the first and second SWIRE command.

CRs-Fixed: 938038
Change-Id: I617a8490784efd760651b3ec8780cc4fd4b17bae
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
8 years agomsm: ipa3: Send limited chained descriptors to IPA
Ghanim Fodi [Thu, 5 May 2016 23:43:26 +0000 (16:43 -0700)]
msm: ipa3: Send limited chained descriptors to IPA

As part of SSR IPA driver code, Filtering and Routing Q6 tables
are being cleaned by pointing to empty tables.
This is done via DMA_SHARED_MEM IPA immediate command to change
SRAM tables pointers. Today code send one command per tables, but
all are chained in single transaction. This will hit the chain
size limitation defined by GSI IPA_IF TLV size.
Change the code to send the commands in smaller chains.

CRs-Fixed: 1012322
Change-Id: I03e9e92c2e01d1fece7e13dd412ea6128210f1fb
Signed-off-by: Ghanim Fodi <gfodi@codeaurora.org>
8 years agoARM: dts: msm: Add VADC_HC and BTM channels for msmcobalt
Siddartha Mohanadoss [Thu, 28 Apr 2016 21:58:56 +0000 (14:58 -0700)]
ARM: dts: msm: Add VADC_HC and BTM channels for msmcobalt

Clients of VADC_HC and BTM include reading voltage phone
power, system thermistors for thermal mitigation such as
msm_therm, case_therm, XO therm. Add the supported VADC
and BTM channels for the msmcobalt platforms.

Change-Id: I87d0b7c8280a57b88a9b9e7c6a2710e4694a2c0b
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
8 years agomsm: mdss: enable additonal clocks
Abhijit Kulkarni [Tue, 12 Apr 2016 22:48:52 +0000 (15:48 -0700)]
msm: mdss: enable additonal clocks

Need to enable clk_mmss_mnoc_ahb_clk before turning on the ahb_clk,
as there is a core fsm dependency between these clocks.

CRs-Fixed: 1008505
Change-Id: I9c87fee27c6a6ef875100c9fc1b9d0cb7c14a2b5
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
8 years agothermal: qpnp-adc-tm: Support refreshed BTM driver
Siddartha Mohanadoss [Thu, 28 Apr 2016 21:12:44 +0000 (14:12 -0700)]
thermal: qpnp-adc-tm: Support refreshed BTM driver

The BTM (Battery temperature module) peripheral driver
on the PMIC (Power management IC) supports threshold
monitoring and notifies clients when thresholds are crossed.
PMCOBALT supports refreshed BTM peripheral register interface
and the driver uses compatible property qpnp-adc-tm-hc to
distinguish using the refreshed peripheral. The external
client interface with the driver remains the same. Updates
include handling the interrupt when the thresholds are
crossed,programming the threholds and configuring
the hardware based on the refreshed design.

BTM peripheral needs the VADC_HC peripheral to compute the
gain/offset that are used to reverse compute the threhold
values to ADC code. Some of the reverse computation API's
such as calculating thermistor thresholds require the
gain and offset values before computing the ADC code to
be programmed. This requires modification to the existing
calibration API in the VADC_HC driver to calculate
the reference calibration points and store these values
for clients to use in the reverse computation

Change-Id: I989cfa4f40e7f1671f04dfa9d4c3fe2ccbbc44ab
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
8 years agoARM: dts: msm: Add clocks MNOC AHB/AXI for smmu
Abhijit Kulkarni [Wed, 13 Apr 2016 00:12:55 +0000 (17:12 -0700)]
ARM: dts: msm: Add clocks MNOC AHB/AXI for smmu

Add additional required clocks mdss device tree to enable
mmss smmu functionality.

Change-Id: I09a7268861663761df716dd18f07069f6b1152ce
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>