msm: hotplug: Add io_is_busy interface
mdss: display: edp continuous splash support.

Both edp main link clock and pixel clock are source from PLL.
This patch add edp clock nodes into system clock tree so that
both main link clock and pixel clock are configured properly
to support different panels with different resolution. Edp
related clocks handoff from bootloader are supported.

Change-Id: I6e4096beb9bff0d39f4f850bbc6d2157ac42e524
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
Signed-off-by: Panwar Vivek <vpanwa@codeaurora.org>

Signed-off-by: Manish Kumar <manishku@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_edp.c
msm: mdss: Sanitize read of panel properties

Check panel property's values properly before operating on
them.

CRs-Fixed: 562887
Change-Id: I26ce51e8b3a8e9328e7b6370b9c56d67fcdd1901
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
msm: mdss: Sanitize read of panel properties some more
msm: mdss: perform proper clock handoff during cont. splash screen

During continuous splash screen need to ensure clocks are properly ref
counted once and released once handoff has happened. Doing it in
different places can lead to improper order and cause clocks to be
disabled. Fix this by centralizing this into footswitch ctrl which is
called when continous splash screen is enabled.

Change-Id: I17f3d5517d9a0583221fdb5c354bf1992ddeddbd
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
msm: mdss: implement overlay prepare ioctl

Overlay prepare will allow a full frame with multiple overlays to be
configured at once and perform frame level checks before being pushed to
display. This function guarantees that if the call is successful, the
frame can be displayed successfully on the screen when display commit is
called.

Change-Id: I276b6fe3e0a872a2e93170f3cea1002d3ce0dac9
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Anusha Koduru <kanusha@codeaurora.org>
msm: mdss: dsi-1 as master clock controller at split display case

During split display case, both dsi controllers share the same
dsi pll(dsi0) dsi-0 clock need to be enabled before dsi-1 and disabled
in the reverse order. This mechanism helps using a unified clock control
logic.

Change-Id: I9fe0095b0427c9c2b7fd84c3179bc8364049cce4
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm: mdss: Add support for ULPS mode for DSI

For smart panels that can refresh display from their internal
RAMs, it is possible to configure the DSI clock and data lanes
in Ultra Low Power State (ULPS) during idle static screen
usecase. Add support for this feature.

[myfluxi: Adapt to hammerhead]

Change-Id: I4e94d6a0201262f0675322efc9e39dd93c86edda
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
video: slimport: disable not-supported timings

Disable non-supported timings from the HDMI LUT. ANX7808 is able to
support for max 1080p60.

Change-Id: Iaf26fbdd584153cbd570344830e5ac083872b267
Signed-off-by: Devin Kim <dojip.kim@lge.com>
video: slimport: Fix slimport blinking issue

Link integrity check sometimes failed without external power.
This is a workaround for this failure. Enabling the USB clk prevent
this issue.

Change-Id: I4934c8fe840bd865b6355aefdb565ca00f1c7b69
Signed-off-by: Devin Kim <dojip.kim@lge.com>
arm/dt: hammerhead: slimport: Fix slimport blinking issue

Link integrity check is sometimes failed without external the power.
This is a workaround for this failure. Enabling the USB clk prevent
this issue.

Change-Id: I793127de438d14e71ee0f104e94fd39e09d7b39b
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Revert "mdss: hdmi: Wait for mdss iommu attached on boot with hdmi"

This reverts commit cdc6e7b7f83bceb9b099c56ac2e0c594634febae.

Conflicts:
	drivers/video/msm/mdss/mdss.h

Change-Id: I2026e75a7a252a91c6c08810f1207120a21ecfee
Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
video: slimport: wait until boot done before start detection

If slimport cable inserted during boot up, slimport could not
work properly since other system is not ready yet. So, wait
until boot completion before start cable detection. The boot
completion should be notified by userspace.

Change-Id: I9fbee9568068b03a3b0d6776cc051a7d87e41c94
Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com>
arm/dt: hammerhead: Change the search order of dtb

bootloader searches the dtb matched with board id from appended DTBs.
So changed the order to search latest dtb first.

order:
kernel -> rev11 -> rev11j -> rev10 -> ...

Change-Id: I5d9ff4f1aee6d17616fa67e532283d3d31f8e295
Signed-off-by: Devin Kim <dojip.kim@lge.com>
seq_file: always update file->f_pos in seq_lseek()

This issue was first pointed out by Jiaxing Wang several months ago, but no
further comments:
https://lkml.org/lkml/2013/6/29/41

As we know pread() does not change f_pos, so after pread(), file->f_pos
and m->read_pos become different. And seq_lseek() does not update file->f_pos
if offset equals to m->read_pos, so after pread() and seq_lseek()(lseek to
m->read_pos), then a subsequent read may read from a wrong position, the
following program produces the problem:

    char str1[32] = { 0 };
    char str2[32] = { 0 };
    int poffset = 10;
    int count = 20;

    /*open any seq file*/
    int fd = open("/proc/modules", O_RDONLY);

    pread(fd, str1, count, poffset);
    printf("pread:%s\n", str1);

    /*seek to where m->read_pos is*/
    lseek(fd, poffset+count, SEEK_SET);

    /*supposed to read from poffset+count, but this read from position 0*/
    read(fd, str2, count);
    printf("read:%s\n", str2);

out put:
pread:
 ck_netbios_ns 12665
read:
 nf_conntrack_netbios

/proc/modules:
nf_conntrack_netbios_ns 12665 0 - Live 0xffffffffa038b000
nf_conntrack_broadcast 12589 1 nf_conntrack_netbios_ns, Live 0xffffffffa0386000

So we always update file->f_pos to offset in seq_lseek() to fix this issue.

cherry-picked from https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/fs/seq_file.c?id=05e16745c0c471bba313961b605b6da3b21a853d

Signed-off-by: Jiaxing Wang <hello.wjx@gmail.com>
Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Conflicts:
	fs/seq_file.c

Change-Id: If419b92498e2c3e08669a4342e9b9ebf99ad3768
Signed-off-by: Devin Kim <dojip.kim@lge.com>
seq_file: always clear m->count when we free m->buf

Once we'd freed m->buf, m->count should become zero - we have no valid
contents reachable via m->buf.

cherry-picked from https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/fs/seq_file.c?id=801a76050bcf8d4e500eb8d048ff6265f37a61c8

Change-Id: I4c1d3e69db4ecf5362e2a5d05bfd7db754dc6dc6
Reported-by: Charley (Hao Chuan) Chu <charley.chu@broadcom.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
fs/dcache.c: Fix the too small buffer for dname

temp[64] is used for internal temporary buffer in dynamic_dname().
This is for dname. But It's too small. dname's size may be > 64.
In that case, it returns as -ENAMETOOLONG. So Increase the buffer size
to 256 for avoiding this issue.

The following was caused by the small buffer.
WARNING: at /kernel/mm/page_alloc.c:2470 __alloc_pages_nodemask+0x24c/0x938()
CPU: 2 PID: 505 Comm: android.bg Not tainted 3.10.0-g2f73780-00003-g2ff41d9-dirty #13
[<c010ba3c>] (unwind_backtrace+0x0/0x11c) from [<c0109cac>] (show_stack+0x10/0x14)
[<c0109cac>] (show_stack+0x10/0x14) from [<c01939a0>] (warn_slowpath_common+0x48/0x68)
[<c01939a0>] (warn_slowpath_common+0x48/0x68) from [<c0193a7c>] (warn_slowpath_null+0x18/0x20)
[<c0193a7c>] (warn_slowpath_null+0x18/0x20) from [<c0222454>] (__alloc_pages_nodemask+0x24c/0x938)
[<c0222454>] (__alloc_pages_nodemask+0x24c/0x938) from [<c0222b50>] (__get_free_pages+0x10/0x24)
[<c0222b50>] (__get_free_pages+0x10/0x24) from [<c024faf8>] (kmalloc_order_trace+0x24/0xf0)
[<c024faf8>] (kmalloc_order_trace+0x24/0xf0) from [<c024fe20>] (__kmalloc+0x30/0x244)
[<c024fe20>] (__kmalloc+0x30/0x244) from [<c02723c8>] (seq_read+0x270/0x464)
[<c02723c8>] (seq_read+0x270/0x464) from [<c0256a18>] (vfs_read+0xa4/0x134)
[<c0256a18>] (vfs_read+0xa4/0x134) from [<c0256de8>] (SyS_read+0x38/0x68)
[<c0256de8>] (SyS_read+0x38/0x68) from [<c0106140>] (ret_fast_syscall+0x0/0x30)

Change-Id: I74f5217ba3c4be73e91f33f900f1f0c26810cc05
Signed-off-by: Devin Kim <dojip.kim@lge.com>
ping: prevent NULL pointer dereference on write to msg_name

A plain read() on a socket does set msg->msg_name to NULL. So check for
NULL pointer first.

[Backport of net-next cf970c002d270c36202bd5b9c2804d3097a52da0]

Bug: 12780426
Change-Id: Ida66892d359d2dfbb32803d8b0872bf8c0bb3865
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
arm/dt: hammerhead: change usb otg detection level

The vadc value on the USB ID pin should be less than 20 milivolts
when the otg cable has been connected.
However some devices return over 15 milivolts with PMIC ES 3.1
and couldn't recognize an otg cable connection in that case.
Fix this by adjusting vadc threshold value on the USB ID pin to 100 milivolts.

Bug: 13312153
Change-Id: I8342d447c1e3ab5861e702a24fa973df16b1ffb2
Signed-off-by: jude84.kim <jude84.kim@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
(cherry picked from commit df13a5d7a4328b193edf8111b82d7463b4bb71f6)
msm: msm_watchdog_v2: Increase watchdog bark timeout during panic

We now wait for 10 seconds during panic handling before triggerring a
watchdog bark. This is done because the earlier timeout of 4 seconds
was not sufficient for all targets which resulted in the device resetting
in the middle of the panic handler.

Bug: 11293746

Change-Id: I1a45ac2ccf626d93848763fe56bb6ad164c2471d
Signed-off-by: Ameya Thakur <ameyat@codeaurora.org>
(cherry picked from commit c2acf59dc892653e1a67852c5bdb298ed1a09689)