qpnp-rtc: clear alarm register when rtc irq is disabled

The rtc alarm register should be cleared when the rtc irq is
disabled

Change-Id: I97a8bf989ff610093240a6b308a297702da6cb89
Signed-off-by: Xiaocheng Li <lix@codeaurora.org>
msm: kgsl: Take the pagetable reference count only when needed

There could be a race condition where one thread is iterating
over ptlist inside kgsl_get_pagetable() with spinlock acquired
and going to call kref_put(). At the same time another thread is
inside kgsl_put_pagetable() without any spinlock calls kref_put()
and returns without calling kgsl_destroy_pagetable(). The decrement
of refcount by second thread leads to a situation where first thread
enters kgsl_destroy_pagetable_locked() and hence destroying the pt
node from list. This causes the destroyed pt node's next and prev
pointers set to POISON value resulting in kernel panic while executing
next iteration of ptlist.

Taking pt refcount while iterating over ptlist should be avoided if the
spinlock is already held and the pt is not returned to the caller. In
kgsl_get_pagetable(), since the loop is already holding the mutex, it
is safe to look at pt before taking a reference.

CRs-Fixed: 661374
Change-Id: Ide1f57cc1eb3cbf66fa399b6b72491755b999c7a
Signed-off-by: Prabhat Awasthi <pawasthi@codeaurora.org>
clock-8974: Support the USB UTMI clock source divider

The gcc_usb30_mock_utmi_clk also contains a CDIV divider
that can do integer division on 8974V2 and newer targets.
Support this divider in clock-gcc-8974.
Drivers will need to set a rate on usb30_utmi_clk_src, and
then set a divider on gcc_usb30_mock_utmi_clk. Both of these
operations shall make use of the clk_set_rate API.
Also update the frequency table on usb30_utmi_clk_src to
include a new 48MHz rate.

Change-Id: I0952fc25b187456eeb98b8bc4a3c5d51fd10a67a
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
usb: dwc3: Enable newer refclk-based SOF/ITP generation

Add support for refclk-based SOF and ITP generation, which is
present on DWC3 cores starting in revision 2.50a. This supersedes
the functionality provided by GCTL.SOFTITPSYNC which handled ITP
generation only. This introduces the new GFLADJ register and
writes its fields based on the reference clock period to the
core, which can now be specified as a device tree parameter.

Change-Id: I2c57586cd8b5275b77ebe64cf0835617f0340b62
Signed-off-by: Jack Pham <jackp@codeaurora.org>
USB: dwc3-msm: Add support for 24MHz utmi clock

For ref clk based SOF/ITP generation, utmi clock needs to be set
to frequencies like 19.2MHz, 24MHz etc. Hence add support for
setting utmi clock to 24MHz.

Change-Id: Ia64eaa5320846ab219c516f43e6dcdf0fb05eb89
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
ARM/dts: Set ref clock to 24MHz for msm8974

Set ref clock rate to 24MHz for 8974 platform for ref clock
based SOF/ITP generation. Otherwise enumeration of peripherals
will fail.

Change-Id: I8425e82f5ceaf3a8bcb4a5d1a3ccc7954e44d752
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
defconfig: msm8974: Enable USB Monitor

USB host mode is used on MSM8974 for UICC. Enable usbmon for
debugging.

Change-Id: Ie429d8a4a65696c4d356ccb5160bb78aa82939d0
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
ARM: dts: msm: Add UICC mass storage luns for msm8974

USB UICC cards are supported on MSM8974. Add 1 lun to expose the user
partition in mass storage function.

Change-Id: I8836589bf45a5b7692ea033f8da2dd8972388552
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
msm: vidc: flush queued work during device suspend

This change flushes any queued work related to power collapse,
once the device is power suspended.
There are applications which do not destroy video instance
on suspending the device. For such applications, if the device
is power suspended, video driver does not prepare venus for
power collapse.
Considerable power saving is observed by power collapsing
venus before the device goes in suspend state.

Change-Id: I11252e45b10d0d3d3eefb38994acd083c847bbb8
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
msm: cpp: Validate frame message before manipulating it

CPP frame message is used to send all frame data
to Microcontroller. It is sent every frame. CPP kernel
driver has to add information to it before transfer it.
The message has to be validated before manipulations.
If it is not valid the message and corresponding frame
are discarded.
Change-Id: Ib5b9b5d2e1886d3d671966b693ce212d58e34041
Signed-off-by: Manish Poddar <mpoddar@codeaurora.org>
net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol()

memset() the structure ethtool_wolinfo that has padded bytes
but the padded bytes have not been zeroed out.

Change-Id: If3fd2d872a1b1ab9521d937b86a29fc468a8bbfe
Signed-off-by: Avijit Kanti Das <avijitnsec@codeaurora.org>
Merge "defconfig: msm8974: Enable USB Monitor"
Merge "ARM: dts: msm: Add UICC mass storage luns for msm8974"
ARM: dt: msm8974: Add AV timer specific data

LPASS exposes registers from which timestamp can be
read by clients for audio & video synchronization.
Change adds the register address of AV timer in LPASS.

CRs-fixed: 677082
Change-Id: Idee2aeb3cb73fcbca37976629c798abeae544774
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
avtimer: Update avtimer driver to parse driver tree data

LPASS exposes registers from which timestamp can be
read by clients for audio & video synchronization.
Change adds to retrieve the register address of AV
timer in LPASS passing from driver tree data.

CRs-fixed: 677082
Change-Id: Id7cf3455e22ddc27f5350a7a37c3b40d44eb0873
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
avtimer: Update avtimer driver to support Qdsp6v2

AVtimer in Qdsp6 provides the timer ticks for synchronization
of audio and video streams for capture and playback use cases.
Qdsp6 AVtimer interface has been updated for v2 version.
Update avtimer driver to support Qdsp6v2.

CRs-fixed: 677082
Change-Id: Ia68b04421edf13a96685654761bb71b866a5327b
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
defconfig: 8974: Enable AV timer

Change enables AV timer driver which provides audio
and video synchronization clock support

CRs-fixed: 677082
Change-Id: I318de660e6f52d0c62bafc5cb2c9907fe007c997
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
avtimer: fix uninitialized variable compilation warning

Fix the following compilation warning in the avtimer driver:

kernel/drivers/platform/msm/avtimer.c:
	In function 'dev_avtimer_probe':
kernel/drivers/platform/msm/avtimer.c:316:
	warning: 'result' may be used uninitialized in this function
error, forbidden warning: avtimer.c:316
make[5]: *** [drivers/platform/msm/avtimer.o] Error 1

CRs-fixed: 677082
Change-Id: Ia760ba174e36bbcd63ed1c18cfcdce4308c825e1
Signed-off-by: David Collins <collinsd@codeaurora.org>
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
Merge "net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol()"
power: qpnp-charger: enable vtrkl comparator and disable trickle clamp

An issue with digital logic can cause the charger to get stuck
in trickle charging. In order to avoid this the bootloader
overrides the trickle charge comparator when VBAT > 3.7 V.

Once kernel is initialized, these comparators need to be
re-enabled and the trickle clamp to be disabled.

Change-Id: Ida3f18519137e3a7ccfe483cc3168e92d484b429
CRs-Fixed: 646222
Signed-off-by: David Keitel <dkeitel@codeaurora.org>