msm: mdss: Do not override ARGC setting on LM

Layer mixer configuration overrides the ARGC
setting when it updates the blend color settings.
This removes the ARGC setting configured by post
processing module and calibration tool in tuning mode.
This change reads the ARGC setting and applies
it back during blend color setting.

Change-Id: I72612ad428e58a1e343e94ab965137628bcce661
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
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>
NFC: NFCC wake up check by register read.

After setting NFCC into wake mode, we then read back
the status of the wake flag from the corresponding
register of nfcc.Only when the flag is read back as
0 then it confirms that nfcc is woken up.Then the
further read of the version register can be done.

Change-Id: I43eadf5940fd5bba99f11cc68743d6485f77aced
CRs-Fixed: 628122
Signed-off-by: Houston Hoffman <hhoffman@codeaurora.org>
NFC: NFC reset wait causes bark due to excessive logging

It takes almost 15 msec for reset notification to be received from
NFCC and due to this NFC kernel device was waiting for 10uSec loop
which was causing bark due to excessive logging.
GPIO was also not needed to be controlled twice. Add some logging
for the NFC device for debugging.

Change-Id: I4335cbff61f16a2d93fccea8c7e39f0b430e0009
CRs-Fixed: 653737
Signed-off-by: Houston Hoffman <hhoffman@codeaurora.org>
netlink: Queue the kernel socket after setting the flag

Queueing the socket after setting the NETLINK_KERNEL_SOCKET on the
kernel socket.

This change is required in-order to avoid the BUG check which is
caused due to race condition between setting this flag and a
message from the app space for this kernel netlink sock.

Change-Id: I19a8edf2fe009a3020b194684a6172654f8f257a
CRs-Fixed: 681815
Signed-off-by: Vinay Krishna Eranna <veran@codeaurora.org>
msm: mdss: Clear the previous state of pipe during SOLID_FILL

Clear the previous state of pipe when it is being used in SOLID_FILL
operation to prevent wrong register configuration. For ex: Use case
when DMA pipe was used in BLOCK mode in previous frame, then it is
being used in LINE mode for SOLID_FILL operation in current frame.

CRs-Fixed: 655993
Change-Id: I0ed257276428b96c10a92457a16df4dfdc42c1f8
Signed-off-by: Sushil Chauhan <sushilchauhan@codeaurora.org>
Merge "msm: mdss: Clear the previous state of pipe during SOLID_FILL"
USB: ccid_bridge: Don't kill URB in release after device is disconnected

The URBs are killed in disconnect method. If the device is disconnected
before the /dev/ccid_bridge is closed, no need to kill the URBs again.
As the URB reference count is dropped in disconnect, accessing it in
release is causing the kernel panic.

CRs-Fixed: 653776
Change-Id: I7fae9ac2568cce59ea39bdd73c955d388d3f26bd
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
USB: ccid_bridge: Provide bulk message write/read stats via debugfs

The bulk message timeouts are observed occasionally during mass storage
transfers. This debug facility helps in identifying such timeout issues.

The sample output of the stats debugfs file.

ccid_bridge: connected
ccid_bridge: opened
total writes: 444
total reads: 444
write/read timeout val: 1000
write_timeout: 0
read_timeout: 0
write_max_time (msec): 130
read_max_time: (msec): 857

CRs-Fixed: 659909
Change-Id: I9787288c10d23b176c9316feed82d41bd2adae65
Signed-off-by: Pavankumar Kondeti <pkondeti@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>
ARM: dts: msm: enable NFC for 8974pro-ac-pm8941

Added a new nfc device tree entry to give more 8974 devices nfc support.

Change-Id: I29debd8005adf487ca96e8e20e193f13664c2751
Signed-off-by: Houston Hoffman <hhoffman@codeaurora.org>
msm: mdss: Allow display commit in DCM state for CMD panels

Allow display commit in DCM state for command mode panels. QDCM
tool requires explicit display kickoff during the calibration
stage in which the panel power is turned off.

Change-Id: Id6c7a0becf488ad2bfe9652b05d781384109f5c4
Signed-off-by: Zohaib Alam <zalam@codeaurora.org>
msm: vidc: change concealment color

0x8080 is gray color concealment, changing it to
black color, which is 0x8010.

Change-Id: I50897d771913ee33a5b2c2ea486996dfc0c294bf
Signed-off-by: Manikanta Sivapala <msivap@codeaurora.org>
Merge "msm: msm_bus: Arbitrate IB for dual config masters"