platform/kernel/linux-exynos.git
7 years agodma-buf: Remove range-based flush 26/115826/2
Tiago Vignatti [Tue, 22 Dec 2015 21:36:45 +0000 (19:36 -0200)]
dma-buf: Remove range-based flush

This patch removes range-based information used for optimizations in
begin_cpu_access and end_cpu_access.

We don't have any user nor implementation using range-based flush. It seems a
consensus that if we ever want something like that again (or even more robust
using 2D, 3D sub-range regions) we can use the upcoming dma-buf sync ioctl for
such.

Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1450820214-12509-3-git-send-email-tiago.vignatti@intel.com
[mszyprow: fixed begin/end_cpu_access calls in
 drivers/gpu/arm/midgard/r12p0_04rel0/mali_kbase_softjobs.c,
 backport of mainline commit 831e9da7dc5c22fd2a5fb64e999f6e077a4338c3]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ic0b70da15ce997dad5da9d53c808bf92a9f332ac

7 years agodrm/exynos: change default win layer of mixer to zpos 1 55/117155/2 accepted/tizen/common/20170306.165243 accepted/tizen/ivi/20170306.103724 accepted/tizen/mobile/20170306.103645 accepted/tizen/tv/20170306.103655 accepted/tizen/unified/20170310.084417 accepted/tizen/wearable/20170306.103710 submit/tizen/20170306.073645 submit/tizen_unified/20170308.100411 submit/tizen_unified/20170310.083425
Joonyoung Shim [Fri, 3 Mar 2017 01:43:28 +0000 (10:43 +0900)]
drm/exynos: change default win layer of mixer to zpos 1

Exynos tdm backend of tizen needs that default window layer has zpos 1.
Exynos drm mixer driver of this kernel doesn't support to change zpos
priority of win layer by userspace yet, so this patch modifies zpos of
default window layer to 1 in exynos drm mixer driver.

As the zpos of default win layer is to 1, this patch also removes
workaround of commit 68395cb68321 ("drm/exynos: workaround to change
graphic layers priority"), so will revert priority of win layer.

Change-Id: I9f5a2b0c1a6527f8848ee98e80ec953904b0c630
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agodma-buf: Minor coding style fixes 25/115825/1
Jagan Teki [Wed, 20 May 2015 19:39:31 +0000 (01:09 +0530)]
dma-buf: Minor coding style fixes

- WARNING: Missing a blank line after declarations
- WARNING: line over 80 characters
- WARNING: please, no space before tabs

Signed-off-by: Jagan Teki <jteki@openedev.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
[backport of mainline commit 5136629dc5a19701746abd7c8ad98ce0b84dda1d]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ie8ae6a4c99f6ea1561923db3b09620ff63f562d7

7 years agodma-buf: add ref counting for module as exporter 24/115824/1
Sumit Semwal [Tue, 5 May 2015 09:26:15 +0000 (14:56 +0530)]
dma-buf: add ref counting for module as exporter

Add reference counting on a kernel module that exports dma-buf and
implements its operations. This prevents the module from being unloaded
while DMABUF file is in use.

The original patch [1] was submitted by Tomasz Stanislawski, but this
is a simpler way to do it.

v3: call module_put() as late as possible, per gregkh's comment.
v2: move owner to struct dma_buf, and use DEFINE_DMA_BUF_EXPORT_INFO
    macro to simplify the change.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
[1]: https://lkml.org/lkml/2012/8/8/163

[backport from mainline commit 9abdffe286c1532a54d5aee31571d3029be4026c]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I05cd9440f26222f877a8bfa2313a6b757419f682

7 years agodrm/exynos: dsi: Remove bridge node reference in removal 84/113984/4
Hoegeun Kwon [Thu, 9 Feb 2017 11:34:54 +0000 (20:34 +0900)]
drm/exynos: dsi: Remove bridge node reference in removal

Since bridge node is referenced during in the probe, it should be
released on removal.

Change-Id: I54c0759098d44eff327889e6c21d6a8e585bbb38
Suggested-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
7 years agoRevert "usb: core: lpm: set lpm_capable for root hub device" 50/113450/1 accepted/tizen/common/20170213.174421 accepted/tizen/ivi/20170214.011029 accepted/tizen/mobile/20170214.010859 accepted/tizen/tv/20170214.010936 accepted/tizen/wearable/20170214.010957 submit/tizen/20170213.015421
Marek Szyprowski [Tue, 7 Feb 2017 13:54:33 +0000 (14:54 +0100)]
Revert "usb: core: lpm: set lpm_capable for root hub device"

After a rebase onto 4.1.36 xHCI ports on OdroidXU4 stopped working. This
has been caused by commit e951f84074b84a3f5aecbffd01da74576e0068d5 applied
in mainline. This patch reverts it to get xHCI ports working again.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I86feaf60472efaf6c045b4f1ecb28f9ab936a01f

7 years ago[media] uvcvideo: Add video formats for Intel real sense F200 camera 71/112071/3 accepted/tizen/common/20170203.161647 accepted/tizen/ivi/20170203.090751 accepted/tizen/mobile/20170203.090649 accepted/tizen/tv/20170203.090719 accepted/tizen/wearable/20170203.090736 submit/tizen/20170203.054341
Daniel Patrick Johnson [Tue, 3 Mar 2015 04:30:48 +0000 (20:30 -0800)]
[media] uvcvideo: Add video formats for Intel real sense F200 camera

This patch adds video format support for Intel real sense F200 camera.
Multimedia team requested me to support this.

Signed-off-by: Daniel Patrick Johnson <teknotus@teknot.us>
[Port from https://github.com/teknotus/depthview/tree/kernelpatchfmt]
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Change-Id: I48de58feb46fc1a91fcee449213c03bdbbcbb905

7 years agopackaging: add provided name for kernel image package 38/112138/2
Seung-Woo Kim [Thu, 26 Jan 2017 06:26:37 +0000 (15:26 +0900)]
packaging: add provided name for kernel image package

This patch adds default provided name for kernel image package as
linux-kernel.

Change-Id: Iab0ca17fef6fc51b93107aa857b291c7fefe55ef
Suggested-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoRevert "Revert "kdbus: add CMD_UPDATE_METADATA ioctl (reinitialize connection metadata)"" 07/112407/2
Hyotaek Shim [Wed, 1 Feb 2017 01:25:36 +0000 (17:25 -0800)]
Revert "Revert "kdbus: add CMD_UPDATE_METADATA ioctl (reinitialize connection metadata)""

This reverts commit 80b9e0d4a216cabc94399cc0f7dbb3064fd350ff.

Change-Id: I72edcdc79d93b5b888deb5c210b537cef52fff11

7 years agolib/Kconfig.debug: disable -Wframe-larger-than warnings with KASAN=y 16/110816/1
Andrey Ryabinin [Thu, 22 Oct 2015 20:32:24 +0000 (13:32 -0700)]
lib/Kconfig.debug: disable -Wframe-larger-than warnings with KASAN=y

When the kernel compiled with KASAN=y, GCC adds redzones for each
variable on stack.  This enlarges function's stack frame and causes:

'warning: the frame size of X bytes is larger than Y bytes'

The worst case I've seen for now is following:

   ../net/wireless/nl80211.c: In function `nl80211_send_wiphy':
   ../net/wireless/nl80211.c:1731:1: warning: the frame size of 5448 bytes is larger than 2048 bytes [-Wframe-larger-than=]

That kind of warning becomes useless with KASAN=y.  It doesn't
necessarily indicate that there is some problem in the code, thus we
should turn it off.

(The KASAN=y stack size in increased from 16k to 32k for this reason)

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Abylay Ospan <aospan@netup.ru>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: Kozlov Sergey <serjk@netup.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[Backport from mainline to remove build warning from KASAN option with GCC 6]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I765080564f7b312fd48988b2f70aaa6f9b2eb71c

7 years agonet: bcm4358: fix not to check same value in macro 51/110551/3
Seung-Woo Kim [Tue, 17 Jan 2017 04:22:22 +0000 (13:22 +0900)]
net: bcm4358: fix not to check same value in macro

When BCMBUSTYPE is not defined, then BUSTYPE(bustype) is just
bustype. So comparing bustype and BUSTYPE(bustype) is not necessary.

This patch removes following build warning with gcc 6.
   drivers/net/wireless/bcmdhd4358/siutils.c: In function 'si_doattach':
   drivers/net/wireless/bcmdhd4358/siutils.c:512:14: warning: self-comparison always evaluates to false [-Wtautological-compare]
     if (bustype != BUSTYPE(bustype)) {
                 ^~

Change-Id: I1cac3dd31bcb86983469830013a1093ed9ceaa89
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoRevert "Revert "[media] s4p-mfc: set allow_zero_bytesused flag for vb2_queue_init"" 30/110430/2 accepted/tizen/common/20170117.174849 accepted/tizen/ivi/20170118.040402 accepted/tizen/mobile/20170118.040314 accepted/tizen/tv/20170118.040333 accepted/tizen/wearable/20170118.040348 submit/tizen/20170117.061257
Seung-Woo Kim [Mon, 16 Jan 2017 10:18:07 +0000 (19:18 +0900)]
Revert "Revert "[media] s4p-mfc: set allow_zero_bytesused flag for vb2_queue_init""

This reverts commit d5c117ccdde0b9a25161ea033364dbed479a1d55.

Without allow_zero_byteused flag, during decoding the last EOS buffer
with zero bytesused from userspace is not properly processed, so
stream is stuck without finishing all queued buffer.

Change-Id: I5725d3514885c104febb12adb44b13ae9b527817
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoarm64: dts: exynos5433-tm2: Adjust the minimum voltage for LITTLE core 93/110193/1
Chanwoo Choi [Mon, 24 Oct 2016 05:59:28 +0000 (14:59 +0900)]
arm64: dts: exynos5433-tm2: Adjust the minimum voltage for LITTLE core

This patch adjusts the minimum voltage for LITTLE core
because the requested minimum voltage is 750mV on the
lowest frequency level.

Change-Id: I335e89d71e45c10f43db7e2e14469c90f03c92b1
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoRevert "kdbus: add CMD_UPDATE_METADATA ioctl (reinitialize connection metadata)" 85/110085/1
Inki Dae [Fri, 13 Jan 2017 01:42:48 +0000 (17:42 -0800)]
Revert "kdbus: add CMD_UPDATE_METADATA ioctl (reinitialize connection metadata)"

This reverts commit d07e0df0ca20a1df62100485117df3d90a1a2a80.

Change-Id: I895dad38c5f4c850b7d986e39d61a70ecdea20bf

7 years agokdbus: add CMD_UPDATE_METADATA ioctl (reinitialize connection metadata) 74/103874/4
Konrad Lipinski [Fri, 9 Dec 2016 16:21:48 +0000 (17:21 +0100)]
kdbus: add CMD_UPDATE_METADATA ioctl (reinitialize connection metadata)

Added to satisfy efl/launchpad developers' request.

Tizen code routinely performs the following operation sequence:
1. create kdbus connection
2. update seclabel
3. rely on updated seclabel

CONN_INFO has always returned seclabel collected at HELLO time (behavior
consistent across all kdbus versions and documented in kdbus man). This
would break step 3 of the above sequence.

KDBUS_CMD_UPDATE_METADATA ioctl updates a connection's metadata to
reflect the current state. Metadata is collected in the exact same way
as during HELLO.

Semantics Required by efl/launchpad can be obtained by altering the
sequence like so:
1. create kdbus connection
2. update seclabel
+2b. ioctl(connection_fd, KDBUS_CMD_UPDATE_METADATA);
3. rely on updated seclabel

Change-Id: I4a4b2aea4256f8bfb3bd1c0d3df5e963d243cb52
Signed-off-by: Konrad Lipinski <konrad.l@samsung.com>
7 years agopackaging: Do Not Use To-Be-Unsupported Macro 30/109930/2
MyungJoo Ham [Thu, 12 Jan 2017 08:11:36 +0000 (17:11 +0900)]
packaging: Do Not Use To-Be-Unsupported Macro

In Tizen 4.0, it is prohibited to use "profile", "_repository", "tizen_target_name"
in spec file, which requires to have seperated OBS projects and repositories,
because we are going to merge ALL repositories and projects into ONE.

Plus, you do not need to worry about building odroid kernel for TM1 because
the package name is different.

Change-Id: I1b3684987c2e2fa3d803510ace8369c586aad8cc
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agoARM64: dts: exynos5433-tm2(e): fix earjack key codes 02/107202/1
Joonyoung Shim [Tue, 27 Dec 2016 06:35:42 +0000 (15:35 +0900)]
ARM64: dts: exynos5433-tm2(e): fix earjack key codes

In Tizen 3.0, keycodes for earjack should be below.

volume down: 114
volume up: 115
media key: 226

Change-Id: Ifc9c5c444980fcdc691daa0066966ba860cb9081
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM: tizen_{odroid,tm2}_defconfig: enable SECURITY_SMACK_APPEND_SIGNALS 10/104510/3 accepted/tizen/common/20161219.151653 accepted/tizen/ivi/20161216.084414 accepted/tizen/mobile/20161216.084214 accepted/tizen/tv/20161216.084333 accepted/tizen/wearable/20161216.084351 submit/tizen/20161216.052309
Rafal Krypa [Tue, 13 Dec 2016 11:37:32 +0000 (12:37 +0100)]
ARM: tizen_{odroid,tm2}_defconfig: enable SECURITY_SMACK_APPEND_SIGNALS

Change-Id: I2a6a9380323f780d327e5e57009ab2edc6aae399
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
7 years agoSmack: Signal delivery as an append operation 09/104509/3
Casey Schaufler [Tue, 30 Aug 2016 17:31:39 +0000 (10:31 -0700)]
Smack: Signal delivery as an append operation

Under a strict subject/object security policy delivering a
signal or delivering network IPC could be considered either
a write or an append operation. The original choice to make
both write operations leads to an issue where IPC delivery
is desired under policy, but delivery of signals is not.
This patch provides the option of making signal delivery
an append operation, allowing Smack rules that deny signal
delivery while allowing IPC. This was requested for Tizen.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
[mainline backport of commit c60b906673eebb4f65840fa9dc204401caf276ea]
Change-Id: I474d9a2b51b653c9c6d21391a2c281c1f1f2d709

7 years agoSmack: fix d_instantiate logic for sockfs and pipefs 59/104259/2
Rafal Krypa [Tue, 13 Dec 2016 02:25:11 +0000 (11:25 +0900)]
Smack: fix d_instantiate logic for sockfs and pipefs

Since 4b936885a (v2.6.32) all inodes on sockfs and pipefs are disconnected.
It caused filesystem specific code in smack_d_instantiate to be skipped,
because all inodes on those pseudo filesystems were treated as root inodes.
As a result all sockfs inodes had the Smack label set to floor.

In most cases access checks for sockets use socket_smack data so the inode
label is not important. But there are special cases that were broken.
One example would be calling fcntl with F_SETOWN command on a socket fd.

Now smack_d_instantiate expects all pipefs and sockfs inodes to be
disconnected and has the logic in appropriate place.

Change-Id: I87ab9fa19cea3e8df8f2c814946e56a9df20d36d
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
7 years agopackaging: update kernel version of spec to v4.1.36
Seung-Woo Kim [Wed, 2 Nov 2016 02:33:30 +0000 (11:33 +0900)]
packaging: update kernel version of spec to v4.1.36

This patch updates kernel version to v4.1.36 from spec file.

Change-Id: Ia34ea318665891b4430c6b77fcc9f43f533806fc
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoARM: defconfig: rinato: sync with v4.1.36 rebased tree
Seung-Woo Kim [Fri, 28 Oct 2016 05:19:01 +0000 (14:19 +0900)]
ARM: defconfig: rinato: sync with v4.1.36 rebased tree

This patch is to sync rinato defconfig with v4.1.36 rebased tree.

Change-Id: Ia299861792631dcd0dbe3fb0a78cf96ec954593e
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoARM: defconfig: trats2: sync with v4.1.36 rebased tree
Seung-Woo Kim [Fri, 28 Oct 2016 05:17:27 +0000 (14:17 +0900)]
ARM: defconfig: trats2: sync with v4.1.36 rebased tree

This patch is to sync trats2 defconfig with v4.1.36 rebased tree.

Change-Id: Ib0a5eaf7fbed9ddeb1e8fed1941f8185b1001c86
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoARM: defconfig: odroid: sync with v4.1.36 rebased tree
Seung-Woo Kim [Fri, 28 Oct 2016 05:16:04 +0000 (14:16 +0900)]
ARM: defconfig: odroid: sync with v4.1.36 rebased tree

This patch is to sync odroid defconfig with v4.1.36 rebased tree.

Change-Id: I6de9150678bb53ccf5ba2e319da2744fb472866a
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoarm64: defconfig: tm2: sync with v4.1.36 rebased tree
Seung-Woo Kim [Fri, 28 Oct 2016 05:14:26 +0000 (14:14 +0900)]
arm64: defconfig: tm2: sync with v4.1.36 rebased tree

This patch is to sync tm2 defconfig with v4.1.36 rebased tree.

Change-Id: I8ceda9fa5747fd5790e5393ede573cc09fd13876
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agopackaging: odroid: Do Not Use profile macro
MyungJoo Ham [Mon, 14 Nov 2016 07:42:32 +0000 (16:42 +0900)]
packaging: odroid: Do Not Use profile macro

It is to be obsolete in 4.0.

It is allowed to use "profile" macro ONLY for backward compatibility while
keeping the compatibility with unified build environment.
- Both are false in this usage.

Change-Id: Icd3d5f77304ca5f30d66c8dc8180360ad06cd0e9
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agopackaging: tm2: Do Not Use profile macro
MyungJoo Ham [Mon, 14 Nov 2016 07:40:13 +0000 (16:40 +0900)]
packaging: tm2: Do Not Use profile macro

It is going to be obsolete soon.

Change-Id: I5add63e38f223ddf015e7bea600c3deef4458935
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agopackaging: tm2: Useless and Dangerous Spec Statement
MyungJoo Ham [Mon, 14 Nov 2016 07:38:41 +0000 (16:38 +0900)]
packaging: tm2: Useless and Dangerous Spec Statement

- Do Not Use "profile"

- If you do not want tm2 in non-mobile, just do not include
it in non-mobile Build Project.

Change-Id: Iec9652db7480d00d1e4de2405d3826bd98ddc039
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agopackaging: switch find calls from -exec to -delete and xargs
Slava Barinov [Wed, 12 Oct 2016 09:06:23 +0000 (12:06 +0300)]
packaging: switch find calls from -exec to -delete and xargs

The -delete and xargs approach is faster than -exec and in
Tizen 3.0 cross-builds it grants huge build acceleration due
to tool acceleration system peculiarities.

Change-Id: Ibbbb82962235cd098cd6952c288e9f120bb63ed3
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agopackaging: devel package name unification
Dmitry Kovalenko [Tue, 4 Oct 2016 08:32:04 +0000 (11:32 +0300)]
packaging: devel package name unification

All kernels provides unified kernel-devel-tizen package and located at
/boot/kernel/devel/tizen-devel (solved using symlink)

Change-Id: Ia8d5091db9a1073c170abbadb0d7cc37bc6380f6
Signed-off-by: Dmitry Kovalenko <d.kovalenko@samsung.com>
[Update commit-msg and just add Provided name for devel package instead of replacing]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agopacket: fix race condition in packet_set_ring
Philip Pettersson [Tue, 6 Dec 2016 23:51:56 +0000 (08:51 +0900)]
packet: fix race condition in packet_set_ring

When packet_set_ring creates a ring buffer it will initialize a
struct timer_list if the packet version is TPACKET_V3. This value
can then be raced by a different thread calling setsockopt to
set the version to TPACKET_V1 before packet_set_ring has finished.

This leads to a use-after-free on a function pointer in the
struct timer_list when the socket is closed as the previously
initialized timer will not be deleted.

The bug is fixed by taking lock_sock(sk) in packet_setsockopt when
changing the packet version while also taking the lock at the start
of packet_set_ring.

Ps. This is CVE-2016-8655 patch,
http://seclists.org/oss-sec/2016/q4/607

Change-Id: I3396f1bfe60b03082a981ae9d8a787b41cb5a529
Fixes: f6fb8f100b80 ("af-packet: TPACKET_V3 flexible buffer implementation.")
Signed-off-by: Philip Pettersson <philip.pettersson@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agommc: sdhci-s3c: add spin_unlock_irq() before calling clk_round_rate
Jaehoon Chung [Wed, 30 Nov 2016 06:05:42 +0000 (15:05 +0900)]
mmc: sdhci-s3c: add spin_unlock_irq() before calling clk_round_rate

Before calling clk_round_rate(), put the spin_unlock_irq() in
sdhci_s3c_consider_clock() function.

Change-Id: Ifedfb52d0c32eadae77b7fe3fd3040ed486a5080
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
7 years agopwm: samsung: Fix to use lowest div for large enough modulation bits
Seung-Woo Kim [Tue, 16 Aug 2016 14:22:01 +0000 (23:22 +0900)]
pwm: samsung: Fix to use lowest div for large enough modulation bits

From pwm_samsung_calc_tin(), there is routine to find the lowest divider
possible to generate lower frequency than requested one. But it is
always possible to generate requested frequency with large enough
modulation bits except on s3c24xx, so this patch fixes to use lowest div
for the case. This patch removes following UBSAN warning:

   UBSAN: Undefined behaviour in drivers/pwm/pwm-samsung.c:197:13
   shift exponent 32 is too large for 32-bit type 'long unsigned int'
   [...]
   [<c0670248>] (ubsan_epilogue) from [<c06707b4>] (__ubsan_handle_shift_out_of_bounds+0xd8/0x120)
   [<c06707b4>] (__ubsan_handle_shift_out_of_bounds) from [<c0694b28>] (pwm_samsung_config+0x508/0x6a4)
   [<c0694b28>] (pwm_samsung_config) from [<c069286c>] (pwm_apply_state+0x174/0x40c)
   [<c069286c>] (pwm_apply_state) from [<c0b2e070>] (pwm_fan_probe+0xc8/0x488)
   [<c0b2e070>] (pwm_fan_probe) from [<c07ba8b0>] (platform_drv_probe+0x70/0x150)
   [...]

Cc: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
[Backport from mainline to remove UBSAN warning]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Idf20ea7ccb2d20d0317e5c82498dd1e7fa3656cc

7 years agoASoC: max98090: Add extcon support for jack detection notification
Dongwoo Lee [Fri, 21 Oct 2016 02:51:46 +0000 (11:51 +0900)]
ASoC: max98090: Add extcon support for jack detection notification

This patch applies extcon for jack detection notification.
Changes in jack state is reported to input driver with snd-soc
framework, as well as to extcon framework.

Change-Id: Id46f10320b18258472521fad57cbbfc98547bb6d
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
7 years agoASoC: max98090: fix interrupt handling problem
Dongwoo Lee [Fri, 21 Oct 2016 07:51:40 +0000 (16:51 +0900)]
ASoC: max98090: fix interrupt handling problem

The max98090_interrupt handler currently will read the device status
register. After that, it will act only when the JDET bit is set.
However, when max98090_interrupt handler is triggered and jack status
register has really changed, the JDET bit of device status register
is not set as expected for unknown reason. Because of this, the jack status cannot be reported.

This patch adds a workaround solution for jack detection, by adding
the second chance to recognize the reason of interrupt generation.
If the interrupt is generated without setting any values on device
status register, jack status register is compared to the current jack
states. If the jack status is changed, the JDET bit is manually set.

Change-Id: I74f6fb54fb9cc47e292f1f8e116032faae89c063
Reported-by: Huang Chao <chao7.huang@samsung.com>
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
7 years agodrm/exynos/hdmi: fix PLL for 27MHz settings
Andrzej Hajda [Mon, 12 Dec 2016 13:18:26 +0000 (14:18 +0100)]
drm/exynos/hdmi: fix PLL for 27MHz settings

Current settings for 27MHz and 27.027MHz do not work. Use the settings from
vendor code instead.

Change-Id: I701555eff3fca430736664e0f628fc50d9a6dc4f
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: enable interlace modes
Andrzej Hajda [Fri, 9 Dec 2016 09:56:23 +0000 (10:56 +0100)]
drm/bridge/sii8620: enable interlace modes

Bug in DECON(CRTC) driver prevented interlace modes from proper work.
Since DECON is fixed interlace modes can be enabled in MHL.

Change-Id: Ifdebbf921e173a1c10af36d678aa6f8e2921e74a
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/exynos/decon5433: do not stop DECON before reset
Andrzej Hajda [Fri, 9 Dec 2016 09:52:15 +0000 (10:52 +0100)]
drm/exynos/decon5433: do not stop DECON before reset

DECON fails to stop in reasonable time in case of interlaced mode. But since
device is reset anyway this step can be safely omitted.

Change-Id: I15a78685c9573b9799ac63b7810ff3655763e461
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/exynos/decon5433: fix porch calculation in interlaced mode
Andrzej Hajda [Fri, 9 Dec 2016 09:49:18 +0000 (10:49 +0100)]
drm/exynos/decon5433: fix porch calculation in interlaced mode

Interlaced mode requires different porch calculation in DECON.

Change-Id: I1bfc2554cd3204ebb270ab2e4a396d0f69f5a7f4
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/exynos/decon5433: signal vblank only on odd fields
Andrzej Hajda [Fri, 9 Dec 2016 09:45:20 +0000 (10:45 +0100)]
drm/exynos/decon5433: signal vblank only on odd fields

In case of interlace mode irq is generated for odd and even fields, but
vblank should be signaled only for the last emitted field.

Change-Id: Icfae5a6729a0168b4f565e79825083b39cce5ca3
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: enable MHL3 mode if possible
Andrzej Hajda [Tue, 6 Dec 2016 13:59:35 +0000 (14:59 +0100)]
drm/bridge/sii8620: enable MHL3 mode if possible

Since all sub-protocols of MHL3 are already supported MHL3 mode can be enabled.
With this patch it is possible to use packed pixel modes and clocks up
to 300MHz - 1920x1080@60Hz and 4K modes.

Change-Id: I04ade01bff1af0cd0c44818bd4be45a33acf2ecd
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: add HSIC initialization code
Andrzej Hajda [Tue, 6 Dec 2016 13:51:56 +0000 (14:51 +0100)]
drm/bridge/sii8620: add HSIC initialization code

In case of MHL3 HSIC should be initialized.

Change-Id: Ieda42af182300d0f2f9c8da1bfb9f5b6a0c014ef
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: improve gen2 write burst IRQ routine
Andrzej Hajda [Tue, 6 Dec 2016 13:49:02 +0000 (14:49 +0100)]
drm/bridge/sii8620: improve gen2 write burst IRQ routine

The patch adds code to report back feature complete IRQ, and code
to read and drop burst writes from peer.

Change-Id: I19df1e7d08c43661896aced305fe32e88b919a09
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: send EMSC features on request
Andrzej Hajda [Tue, 6 Dec 2016 13:05:10 +0000 (14:05 +0100)]
drm/bridge/sii8620: send EMSC features on request

Device should report to the peer which features are really supported.

Change-Id: I6aeeef9bfdf28bc38a7026f4289a89cbabd62544
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: rewrite hdmi start sequence
Andrzej Hajda [Tue, 6 Dec 2016 12:58:45 +0000 (13:58 +0100)]
drm/bridge/sii8620: rewrite hdmi start sequence

MHL3 protocol requires registry adjustments depending on chosen video mode.
Necessary information is gathered in mode_fixup callback. In case of HDMI
video modes driver should also send special AVI and MHL infoframes.

Change-Id: I418f79aef2e2b58c5baf8052db5645c873a2c0b2
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: fix disconnect sequence
Andrzej Hajda [Tue, 6 Dec 2016 12:43:42 +0000 (13:43 +0100)]
drm/bridge/sii8620: fix disconnect sequence

The patch allows to avoid rare cases when discovery fails.

Change-Id: I29094f719f8a2ec23a74b0c7981bf80e9a6200d3
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: fix peer re-initialization in CBUS mode
Andrzej Hajda [Tue, 6 Dec 2016 12:37:33 +0000 (13:37 +0100)]
drm/bridge/sii8620: fix peer re-initialization in CBUS mode

In CBUS mode peer should be re-intialized the same way as in MHL3.

Change-Id: Ie631511037929b5c034750a2cdd017367b9ba004
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: split EDID read and write code
Andrzej Hajda [Tue, 6 Dec 2016 12:34:03 +0000 (13:34 +0100)]
drm/bridge/sii8620: split EDID read and write code

MHL3 requires that after reading EDID from the sink source should ask
peer for features. To make both protocols happy the patch splits code
accordingly.

Change-Id: I367a05e4c4aac0b0de31692027da117ec56ff039
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: add delay during cbus reset
Andrzej Hajda [Tue, 6 Dec 2016 12:22:19 +0000 (13:22 +0100)]
drm/bridge/sii8620: add delay during cbus reset

Without delay CBUS sometimes was not reset properly.

Change-Id: I4392297d13c9f9b8551e292fa4e2c070202d7e7f
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: do not stop MHL output when TMDS input is stopped
Andrzej Hajda [Tue, 6 Dec 2016 12:18:38 +0000 (13:18 +0100)]
drm/bridge/sii8620: do not stop MHL output when TMDS input is stopped

Stopping output causes full re-detection of the sink and slows down the process.

Change-Id: I2089437635a6df5ba2a75a45a31b7431c365a861
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: make local functions statics
Andrzej Hajda [Tue, 6 Dec 2016 12:06:25 +0000 (13:06 +0100)]
drm/bridge/sii8620: make local functions statics

These functions are not exported.

Change-Id: If0660466cf41f2e7c281970f05402429537fb3e2
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: set gen2 write burst before sending MSC command
Andrzej Hajda [Mon, 5 Dec 2016 13:50:10 +0000 (14:50 +0100)]
drm/bridge/sii8620: set gen2 write burst before sending MSC command

Write burst should be enabled for MHL_INT_RC_FEAT_REQ and disabled for
other commands. The patch moves functions up and adds delay setting
for MHL3 burst mode.

Change-Id: Id554364c9156eac720672363fd5437b029efbd26
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: abstract out sink detection code
Andrzej Hajda [Fri, 25 Nov 2016 14:29:38 +0000 (15:29 +0100)]
drm/bridge/sii8620: abstract out sink detection code

MHL1 and MHL3 have different initialization paths. To make both protocols
happy sink detection is put into continuation after link mode enablement.

Change-Id: I739fd47dce782b151e9a498364ed42de9223996b
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: fix initialization sequence for MHL2 receivers
Andrzej Hajda [Fri, 25 Nov 2016 14:21:27 +0000 (15:21 +0100)]
drm/bridge/sii8620: fix initialization sequence for MHL2 receivers

MHL2 receiver require disabling transmitter on initialization.

Change-Id: I85fa2c3c7a8dc2ed39d8b012a7d017a7fd55addd
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: fix MSC message removal
Andrzej Hajda [Fri, 25 Nov 2016 14:17:59 +0000 (15:17 +0100)]
drm/bridge/sii8620: fix MSC message removal

Messages queue can be cleaned up by message callbacks, to avoid premature
removal of current message it should be removed from the queue before calling
these callbacks.

Change-Id: Ie95c291d27a1be52291cc2cd1b7dead8f24560b4
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: fix CBUS bring-up sequence
Andrzej Hajda [Fri, 25 Nov 2016 14:07:16 +0000 (15:07 +0100)]
drm/bridge/sii8620: fix CBUS bring-up sequence

In case of MHL3 CBUS is bring-up already in sii8620_got_ecbus_speed.

Change-Id: I4abafa944113528eb6cc71799a35f4215aeac428
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: fix peer device capabilities read code
Andrzej Hajda [Tue, 22 Nov 2016 15:39:09 +0000 (16:39 +0100)]
drm/bridge/sii8620: fix peer device capabilities read code

Peer capabilities should be read differently depending on protocol version.

Change-Id: I3344af6068da07ccc7842a6e8affc63ee31a33a0
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: respond to feature requests
Andrzej Hajda [Tue, 22 Nov 2016 15:32:15 +0000 (16:32 +0100)]
drm/bridge/sii8620: respond to feature requests

MHL3 protocol requires device to respond to feature request from peer.
This minimal answer fulfills the requirement and allows to continue
negotiation.

Change-Id: Ifa2ed4d4db2cd29e50eef8144eef3eeb16aa2d72
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: add support for burst eMSC transmissions
Andrzej Hajda [Tue, 6 Dec 2016 15:44:51 +0000 (16:44 +0100)]
drm/bridge/sii8620: add support for burst eMSC transmissions

Burst transmissions are used in MHL3 mode negotiation.

Change-Id: Iec7261a46c9743ef95fae0e8e921aeee11cf0cc4
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/mhl: add write burst related definitions
Andrzej Hajda [Tue, 6 Dec 2016 15:44:27 +0000 (16:44 +0100)]
drm/bridge/mhl: add write burst related definitions

Burst transmissions are used in MHL3 mode.

Change-Id: If59f1aa3e8bd53c5075de2b2284fa5cbadb2cc6c
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: initial support for eCBUS-S mode
Andrzej Hajda [Tue, 15 Nov 2016 15:37:36 +0000 (16:37 +0100)]
drm/bridge/sii8620: initial support for eCBUS-S mode

The Single-ended eCBUS Mode (eCBUS-S) mode provides 60 Mb/s full-duplex
bidirectional traffic for three channels:
 - CBUS data (CBUS1 channel),
 - High-bandwidth MHL data (eMSC channel),
 - tunneling data (T-CBUS channel).
It is required to fully support MHL3 dongles.

Change-Id: I64f78981126cc30033b2b4330df042feccd6ffe0
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: add continuations to messages
Andrzej Hajda [Tue, 15 Nov 2016 14:02:01 +0000 (15:02 +0100)]
drm/bridge/sii8620: add continuations to messages

Due to asynchronous nature of MHL flow of execution is dispersed. Logical
continuation of some actions happens after response of peer, i.e in interrupt
handler. To simplify coding continuation mechanism has been added - it is now
possible to provide continuation callback, which will be called after peer
responds to given action.

Change-Id: I93a9d25912e17787dd9856b65d1fc75b2644b940
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: add reading device capability registers
Andrzej Hajda [Thu, 10 Nov 2016 10:05:06 +0000 (11:05 +0100)]
drm/bridge/sii8620: add reading device capability registers

This functionality is necessary to implement MHL3 modes.

Change-Id: I267d27815527403ace25470f620cb4e5600a2520
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: simplify MHL3 mode setting
Andrzej Hajda [Thu, 10 Nov 2016 10:30:52 +0000 (11:30 +0100)]
drm/bridge/sii8620: simplify MHL3 mode setting

It is not necessary to set REG_COC_CTL0, REG_MHL_COC_CTL1 registers.

Change-Id: Id363df66baffe0be9f96e61597bc04a16bf42aad
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: limit supported modes to MHL1/2 modes
Andrzej Hajda [Fri, 18 Nov 2016 09:14:19 +0000 (10:14 +0100)]
drm/bridge/sii8620: limit supported modes to MHL1/2 modes

MHL3 modes are unstable on MHL3 dongle working in compatibility mode.
The patch denies them until full MHL3 mode is supported.

Change-Id: I0e18ce16e6194c346dde8a67a864feb452cf7b12
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/exynos/hdmi: fix VSI infoframe registers
Andrzej Hajda [Mon, 5 Dec 2016 13:32:07 +0000 (14:32 +0100)]
drm/exynos/hdmi: fix VSI infoframe registers

VSI infoframe registers address space is non-contiguous, so infoframe write
should be split into two chunks.

Change-Id: I40b4598dd64ec205d85a6f99828e2f22ae568918
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm: exynos: Remove unreachable code
Sylwester Nawrocki [Fri, 18 Nov 2016 13:57:41 +0000 (14:57 +0100)]
drm: exynos: Remove unreachable code

This patch reworks function arguments testing to avoid unreachable code
as pointed out with an SVACE warning:

* UNREACHABLE_CODE: This statement in the source code might be unreachable
  during program execution.
   [unreachable] unreachable at drivers/gpu/drm/exynos/exynos_drm_ipp.c:1442
   [The condition property == 0 is always false because at this program
  point the variable property is always not equal to 0] The condition
  property == 0 is always false because at this program point the variable
  property is always not equal to 0 at drivers/gpu/drm/exynos/exynos_drm_ipp.c:1441

* UNREACHABLE_CODE: This statement in the source code might be unreachable
  during program execution.
    [unreachable] unreachable at drivers/gpu/drm/exynos/exynos_drm_ipp.c:1569
    [The condition event_work == 0 is always false because at this program point the
  variable event_work is always not equal to 0] The condition event_work == 0
  is always false because at this program point the variable event_work is
  always not equal to 0 at drivers/gpu/drm/exynos/exynos_drm_ipp.c:1568

Change-Id: I2a9426685c87047bf5ec3ee88b6cce4d1d7d6158
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agodrm/exynos: fix error handling in exynos_drm_subdrv_open
Arnd Bergmann [Mon, 14 Mar 2016 14:22:25 +0000 (15:22 +0100)]
drm/exynos: fix error handling in exynos_drm_subdrv_open

gcc-6 warns about a pointless loop in exynos_drm_subdrv_open:

drivers/gpu/drm/exynos/exynos_drm_core.c: In function 'exynos_drm_subdrv_open':
drivers/gpu/drm/exynos/exynos_drm_core.c:104:199: error: self-comparison always evaluates to false [-Werror=tautological-compare]
  list_for_each_entry_reverse(subdrv, &subdrv->list, list) {

Here, the list_for_each_entry_reverse immediately terminates because
the subdrv pointer is compared to itself as the loop end condition.

If we were to take the current subdrv pointer as the start of the
list (as we would do if list_for_each_entry_reverse() was not a macro),
we would iterate backwards over the &exynos_drm_subdrv_list anchor,
which would be even worse.

Instead, we need to use list_for_each_entry_continue_reverse()
to go back over each subdrv that was successfully opened until
the first entry.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
[Backport from mainline to fix build warning with gcc6]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Iee4b9078f0bd521507716521a339b37ea5dd8776

7 years agodrm/exynos/hdmi: Don't print error on deferral due to regulators
Javier Martinez Canillas [Thu, 21 Apr 2016 18:51:38 +0000 (14:51 -0400)]
drm/exynos/hdmi: Don't print error on deferral due to regulators

The regulators may not be available just because their driver's probe
function was just not executed and so the regulators not registered.

So, in this case the Exynos HDMI driver should not print logs since
a -EPROBE_DEFER is not really an error and that will just pollute
the kernel log and confuse users.

This patch prevents the following misleading messages to be printed:

[    1.443638] [drm:hdmi_probe] *ERROR* failed to get regulators
[    1.449326] [drm:hdmi_probe] *ERROR* hdmi_resources_init failed

Change-Id: Ib23cf62b86f9aacb6e23b64b7716a77d96da83f8
Reported-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agogpu: drm: exynos_hdmi: Remove duplicate initialization of regulator bulk consumer
Andrzej Hajda [Tue, 25 Oct 2016 10:49:00 +0000 (12:49 +0200)]
gpu: drm: exynos_hdmi: Remove duplicate initialization of regulator bulk consumer

The helper, devm_regulator_bulk_get() initializes the consumer as NULL,
so this code can be ignored.

Change-Id: Ib23cf62b86f9aacb6e23b64b7716a77d96da87f8
Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agogpu: drm: exynos_hdmi: Move PHY logic into single function
Andrzej Hajda [Tue, 25 Oct 2016 10:47:22 +0000 (12:47 +0200)]
gpu: drm: exynos_hdmi: Move PHY logic into single function

Paring DT properties and getting PHY IO (memory mapped or I2C) in one
function.

Change-Id: Ibc94c66df85a81a8f5239b5d4f334686b6ae863d
Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agogpu: drm: exynos_hdmi: Move DDC logic into single function
Andrzej Hajda [Tue, 25 Oct 2016 10:45:14 +0000 (12:45 +0200)]
gpu: drm: exynos_hdmi: Move DDC logic into single function

Paring DT properties and getting the I2C adapter in one function.

Change-Id: I1df1b6294f61013110bcddb223a3b35fb5c17169
Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos/hdmi: improve infoframe configuration
Andrzej Hajda [Tue, 25 Oct 2016 08:56:27 +0000 (10:56 +0200)]
drm/exynos/hdmi: improve infoframe configuration

Use core helpers to generate infoframes and add VSI frame generation
for UHD modes.

Change-Id: Ibea33cff20c6c4fa6b07a8e206770708a36fe53f
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/exynos/hdmi: always set PHY_POWER_OFF_EN bit
Andrzej Hajda [Mon, 24 Oct 2016 13:17:41 +0000 (15:17 +0200)]
drm/exynos/hdmi: always set PHY_POWER_OFF_EN bit

The bit is present in all variants (its default value only differs).
The patch makes the code in-sync with mainline.

Change-Id: I6a2a8fcf9d7f8a5616f64eafec7722a4bf1675fa
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/exynos/hdmi: remove unused field
Andrzej Hajda [Mon, 24 Oct 2016 13:11:56 +0000 (15:11 +0200)]
drm/exynos/hdmi: remove unused field

The patch removes unused hdmi_context field.

Change-Id: Id8836961b6dca7c2a09f7d4a99c3455c96057eb6
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos/hdmi: use array specifier for HDMI-PHY configurations
Andrzej Hajda [Mon, 24 Oct 2016 13:09:26 +0000 (15:09 +0200)]
drm/exynos/hdmi: use array specifier for HDMI-PHY configurations

HDMI-PHY configurations are stored as array pointer and count pair,
we can re-use existing helpers to simplify their initialization.

Change-Id: Ie387a23428711edc5c027661ac0b1c623c19c468
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos/hdmi: synchronize sysreg code with mainline
Andrzej Hajda [Mon, 24 Oct 2016 12:15:12 +0000 (14:15 +0200)]
drm/exynos/hdmi: synchronize sysreg code with mainline

There are no other users of sysreg besides 5433. The code can be simplified.
The patch synchronizes the code with mainline.

Change-Id: Ie6996e69388b2ea5afece292b56317d60caa91b0
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/exynos/hdmi: improve clock routines
Andrzej Hajda [Mon, 24 Oct 2016 11:53:22 +0000 (13:53 +0200)]
drm/exynos/hdmi: improve clock routines

The patch:
- adds unwind code to hdmi_clk_enable_gates,
- simplifies code,
- moves routines up, to match mainline.

Change-Id: I79055471688400b6f449c87d210ae698166acb68
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/exynos/hdmi: constify global variables
Andrzej Hajda [Mon, 24 Oct 2016 11:08:44 +0000 (13:08 +0200)]
drm/exynos/hdmi: constify global variables

These variables should not be modified.

Change-Id: I9cef5d79465e24d3bc1d825afb94cccc09ff1756
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos/hdmi: convert to gpiod API
Andrzej Hajda [Mon, 24 Oct 2016 10:12:24 +0000 (12:12 +0200)]
drm/exynos/hdmi: convert to gpiod API

The patch converts API to gpiod and moves initialization code
to hdmi_resources_init.

Change-Id: I5136395b16f3f50defa81be6406d137f3c103e35
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos/hdmi: fix edid memory leak
Andrzej Hajda [Thu, 9 Jul 2015 06:25:38 +0000 (08:25 +0200)]
drm/exynos/hdmi: fix edid memory leak

edid returned by drm_get_edid should be freed.
The patch fixes it.

Change-Id: Ied8d60b6a1e12409037defb04be4bcf0c906690d
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos/hdmi: remove registry dump
Andrzej Hajda [Mon, 24 Oct 2016 09:51:13 +0000 (11:51 +0200)]
drm/exynos/hdmi: remove registry dump

HDMI registry dump unnecessary spoils console and is not very helpful.

Change-Id: I6155d370fa69e3da620c28c86bf41d17a398c6c3
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos/hdmi: use optional regulator_get for hdmi-en
Andrzej Hajda [Mon, 24 Oct 2016 09:40:48 +0000 (11:40 +0200)]
drm/exynos/hdmi: use optional regulator_get for hdmi-en

hdmi-en is an optional regulator so it should be better handled by
devm_regulator_get_optional call.

Change-Id: I2cbb12c54c43b10ebac76a00a5ef954c2ae627f6
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos/hdmi: use constant size array for regulators
Andrzej Hajda [Mon, 24 Oct 2016 09:33:49 +0000 (11:33 +0200)]
drm/exynos/hdmi: use constant size array for regulators

Driver always uses the same number of regulators, so there is no point in
dynamic allocation.

Change-Id: I8227ea4e341c55f1932f1e88e1138bb50271a749
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos/hdmi: remove deprecated hdmi_resources structure
Andrzej Hajda [Mon, 24 Oct 2016 09:04:03 +0000 (11:04 +0200)]
drm/exynos/hdmi: remove deprecated hdmi_resources structure

hdmi_resources structure was filled by old platform data code and is not
necessary anymore. The patch removes it at groups together resource related
fields in hdmi_context.
The patch is back-ported from mainline.

Change-Id: Iab2209a9177749ce526569e32c6695d4b09272dc
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/exynos/hdmi: improve HDMI/ACR related code
Andrzej Hajda [Fri, 25 Sep 2015 12:48:27 +0000 (14:48 +0200)]
drm/exynos/hdmi: improve HDMI/ACR related code

Simple formula can be used to calculate CTS and N coefficients.
Additionaly ACR registers have different offsets for different versions
of IP.

Change-Id: I41be0b432da51651c007428fce7c7c4870ef1cb6
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos/hdmi: use mappings for registers with IP dependent address
Andrzej Hajda [Mon, 24 Oct 2016 07:57:34 +0000 (09:57 +0200)]
drm/exynos/hdmi: use mappings for registers with IP dependent address

Some registers resides at different offsets depending on device version.
This patch adds infrastructure for mapping such registers to proper address
based on hdmi_type. It adds also mappings to some registers.

Change-Id: Ic345e1a4cb398aebea62b50fd86a44f30b5fd1e5
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos/hdmi: stop duplicating drv_data fields
Andrzej Hajda [Fri, 21 Oct 2016 13:34:37 +0000 (15:34 +0200)]
drm/exynos/hdmi: stop duplicating drv_data fields

The patch removes duplicated drv_data fields and simplifies drv_data
matching.

Change-Id: I78abbd6dfee0d05c7095ae176fc8e080e233fd64
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/exynos/hdmi: refactor struct str_array_spec
Andrzej Hajda [Fri, 21 Oct 2016 12:56:43 +0000 (14:56 +0200)]
drm/exynos/hdmi: refactor struct str_array_spec

The patch constifies array and renames symbols to be in sync with mainline.

Change-Id: Ife8aa1b6adde978dbf71fc7c57bd18e01f50fdd7
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/exynos/hdmi: stop programming registers with default values
Andrzej Hajda [Fri, 21 Oct 2016 12:16:08 +0000 (14:16 +0200)]
drm/exynos/hdmi: stop programming registers with default values

There is no point in rewriting default values, as the IP is reset anyway.

Change-Id: I9c0856d48be83a36ed4a8741e86715353acbf2d0
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos/hdmi: move hdmi_start to hdmi_mode_apply
Andrzej Hajda [Fri, 21 Oct 2016 12:14:37 +0000 (14:14 +0200)]
drm/exynos/hdmi: move hdmi_start to hdmi_mode_apply

hdmi_start is called for both variants.

Change-Id: I6da89cf21599a760c793121f3ae637eca7cc77ff
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/exynos/hdmi: remove hdmi_v14_conf struct
Andrzej Hajda [Fri, 21 Oct 2016 12:00:13 +0000 (14:00 +0200)]
drm/exynos/hdmi: remove hdmi_v14_conf struct

The patch removes intermediate struct for HDMIv14 register configuration,
instead registry values are calculated on the fly.

Change-Id: Ib440e0ab375f4eafdc5e6d3e06fcf64ce212ad84
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos/hdmi: remove hdmi_v13_conf struct
Andrzej Hajda [Fri, 21 Oct 2016 11:40:38 +0000 (13:40 +0200)]
drm/exynos/hdmi: remove hdmi_v13_conf struct

The patch removes intermediate struct for HDMIv13 register configuration,
instead registry values are calculated on the fly.

Change-Id: I4a47b99afda16f9fc928ff3f91359be67c4dc55f
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos/hdmi: remove redundant configuration fields
Andrzej Hajda [Thu, 27 Oct 2016 08:24:05 +0000 (10:24 +0200)]
drm/exynos/hdmi: remove redundant configuration fields

The patch removes redundant fields from hdmi_conf_regs. Their values
can be calculated from current_mode. This patch is the first step to remove
whole hdmi_conf_regs structure.

Change-Id: Id40fe15302b2546410f68323e92d136eb93b990a
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos/hdmi: add 297MHz pixel clock support
Andrzej Hajda [Thu, 20 Oct 2016 07:14:42 +0000 (09:14 +0200)]
drm/exynos/hdmi: add 297MHz pixel clock support

297MHz is used by UHD modes.

Change-Id: I2040adcc3f132dbf1d510309527a9e1574008961
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: synchronize headers with mainline
Andrzej Hajda [Wed, 19 Oct 2016 12:20:44 +0000 (14:20 +0200)]
drm/bridge/sii8620: synchronize headers with mainline

This patch does not provide functional change.
Its main role is to synchronize header files with mainline.

Change-Id: Ia6f338cc3ec1d50728a9e0e946211451f40e7420
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: rename files according to mainline
Andrzej Hajda [Wed, 19 Oct 2016 12:15:06 +0000 (14:15 +0200)]
drm/bridge/sii8620: rename files according to mainline

The patch synchronizes file names with mainline.

Change-Id: I6aa491f2d7858f90055e7ea9bce00e8bb7db50e2
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: coding style fixes
Andrzej Hajda [Wed, 19 Oct 2016 11:52:20 +0000 (13:52 +0200)]
drm/bridge/sii8620: coding style fixes

The patch does not provide functional change beside code style fixing
and synchronizing driver with mainline.

Change-Id: I5dc303ead4af81883c5199e9eaef7e73733a599b
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: use lower-case for i2c_device_id
Andrzej Hajda [Wed, 19 Oct 2016 11:43:38 +0000 (13:43 +0200)]
drm/bridge/sii8620: use lower-case for i2c_device_id

Linux I2C device use lower-case for identification.

Change-Id: I7a86fef880c5c969897658a710c05ead37b74f2b
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/bridge/sii8620: add missing error checking
Andrzej Hajda [Wed, 19 Oct 2016 11:42:05 +0000 (13:42 +0200)]
drm/bridge/sii8620: add missing error checking

The patch adds error checking during initialization and in irq handler.

Change-Id: I26777455fb5ff86c91455a683b6cf5642fe2ed31
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>