power: smb358-charger: Add smb358 charger driver

This driver supports external smb358 switch mode charger,
can reach up to 2A charging current. This driver instead of
original qpnp-charger, will co-work with PMIC internal BMS
(Battery Monitor System).

Change-Id: I4c520e2812284af0af348beae516eba5f95c49f3
Signed-off-by: Zhenhua Huang <zhenhuah@codeaurora.org>
power: qpnp-bms: use better defaults for power supply props

Currently the BMS driver just assumes that the battery power supply will
export whatever properties it requires. However, if an external charger
is being used, having good default values for the power supply
properties that are not exported by the external charger will improve
compatibility.

Change the status property to default to unknown, the present property
to default to true, and the online property to default to true if they
are not exported by the battery power supply.

Change-Id: Ic10429881f221cfb427720bdd73d908e87b912b0
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
msm: kgsl: Add new API's to track device mutex owner

Add new API's kgsl_mutex_lock/unlock to track device mutex owner.
Mutex owner is an atomic variable and all operations set/clear on
it are also atomic to avoid any race conditions.

If a thread tries to acquire the mutex using new API, try to acquire
the mutex only if mutex owner is not same as current thread. This is
to prevent deadlocks which can happen if a thread tries to acquire
mutex with mutex held.

Change-Id: I3da4d0427ede5458f6a663043c57a4799b72d8fd
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Flush TLB when mapping to IOMMU pagetable

Flush TLB when mapping to IOMMU pagetable, this is a requirement
for current IOMMU hardware.

Change-Id: I82e766f4869c737c1f5b73934eacaada40d46e10
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
leds: leds-qpnp: use the proper pwm period in LPG mode

Previously, when the leds were working in LPG mode, the pwm
period was always set to the minimum value supported by hardware.
That's unreasonable. The better way is to set the period to the
expected value.

CRs-Fixed: 655566
Change-Id: I30b17cbfe98639ec132484f314cb9b9234e74354
Signed-off-by: Xu Kai <kaixu@codeaurora.org>
slim_ngd: Support REPEAT_CHANGE_VALUE user message

REPEAT_CHANGE_VALUE user message is used to transfer high amount of
messaging data efficiently.

CRs-Fixed: 503461
Change-Id: I2762ad858b27ac84597f4eaf22fc6f3d14232d76
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
unix: fix a race condition in unix_release()

As reported by Jan, and others over the past few years, there is a
race condition caused by unix_release setting the sock->sk pointer
to NULL before properly marking the socket as dead/orphaned.  This
can cause a problem with the LSM hook security_unix_may_send() if
there is another socket attempting to write to this partially
released socket in between when sock->sk is set to NULL and it is
marked as dead/orphaned.  This patch fixes this by only setting
sock->sk to NULL after the socket has been marked as dead; I also
take the opportunity to make unix_release_sock() a void function
as it only ever returned 0/success.

Dave, I think this one should go on the -stable pile.

Special thanks to Jan for coming up with a reproducer for this
problem.

CRs-Fixed: 660580
Change-Id: I0e39b84464cf3f4c9daf8677bba444d0d6d94825
Reported-by: Jan Stancek <jan.stancek@gmail.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Git-commit: ded34e0fe8fe8c2d595bfa30626654e4b87621e0
Git-repo: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/
Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
leds: leds-qpnp: provide pwm period when leds are set to LPG mode in DT

In the current design, if MPP-controlled leds or RGB leds are configured
to LPG mode in the device tree, the PWM period value is not provided.
This will result in "pwm_cfg->pwm_period_us" being assigned to zero
since no PWM period value will be read from device tree. As a result,
qpnp_pwm_init() returns error, which in turn results in failure of
qpnp_mpp_init() or qpnp_rgb_init() and finally resulting in failure of
qpnp_leds_probe().

So "qcom,pwm-us" property should be provided in DT for the above case and
the property parsing needs to be implemented in the leds-qpnp driver.

Change-Id: Ic32833ea4e685939148e38cdba078391936f8efb
CRs-Fixed: 667825
Signed-off-by: Abinaya P <abinayap@codeaurora.org>
Merge "slim_ngd: Support REPEAT_CHANGE_VALUE user message"
Merge "Merge "slim_ngd: Support REPEAT_CHANGE_VALUE user message""
Merge "Merge "Merge "slim_ngd: Support REPEAT_CHANGE_VALUE user message"""
Merge "power: smb358-charger: Add smb358 charger driver"
Merge "power: qpnp-bms: use better defaults for power supply props"
Revert "msm: mdss: refactor pipe retrieval and ref count logic"

This reverts commit ed0d39c60f1169338d8b68e85f051ee469a36c73.

Change-Id: I053128bd00ae79e39144a067e3995a80facba27c
Signed-off-by: Anusha Koduru <kanusha@codeaurora.org>
ngd_slim: Decouple clock pause from power down/up

NGD slimbus driver itself can never send out clock pause sequence
for slimbus protocol on the HW lines since it can only be sent by
a manager device (which is controlled by ADSP when NGD driver is
instantiated from apps side).
Previously, clock pause of slimbus framework was coupled with power
down/up. That is not correct, since manager device may or may not
decide to send clock-pause on the HW lines. (e.g. if apps is inactive,
but some client on ADSP is active, clock-pause sequence won't be sent
over the bus.
Decouple power-on/off from clock pause to avoid giving incorrect
impression to clients on apps side about clock-pause state. Mark
clock-pause as unsupported by setting wakup function pointer to NULL
instead since this controller on apps cannot send it on HW lines.

CRs-Fixed: 667165
Change-Id: I382bca153deb2fed1d0f0672adaebde1e122dc68
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
Merge "Merge "power: qpnp-bms: use better defaults for power supply props""
Merge "Merge "Merge "power: qpnp-bms: use better defaults for power supply props"""
Merge "msm: kgsl: Add new API's to track device mutex owner"
Merge "msm: kgsl: Flush TLB when mapping to IOMMU pagetable"
Merge "Merge "power: qpnp-bms: use better defaults for power supply props""