firefly-linux-kernel-4.4.55.git
8 years agoUPSTREAM: usb: dwc3: gadget: extract unlocked dwc3_gadget_wakeup()
Felipe Balbi [Mon, 4 Apr 2016 08:24:04 +0000 (11:24 +0300)]
UPSTREAM: usb: dwc3: gadget: extract unlocked dwc3_gadget_wakeup()

we will need this from StartTransfer to make sure
link is in U0 before starting a transfer.

Change-Id: Id6c9497969e2a65b4fae725a0ecf6ff6c369815b
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit 218ef7b647e3367c9f81e18f63fbb0066f10b9a5)

8 years agoUPSTREAM: usb: dwc3: gadget: clear SUSPHY bit before ep cmds
Felipe Balbi [Mon, 4 Apr 2016 06:19:17 +0000 (09:19 +0300)]
UPSTREAM: usb: dwc3: gadget: clear SUSPHY bit before ep cmds

Synopsys Databook 2.60a has a note that if we're
sending an endpoint command we _must_ make sure that
DWC3_GUSB2PHY(n).SUSPHY bit is cleared.

This patch implements that particular detail.

Change-Id: Iee711b2a1035af1e82201eacf1ac236e87614819
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit 2b0f11df84bb66c9ac71395382c018f33c3ff9a4)

8 years agoUPSTREAM: usb: dwc3: gadget: combine return points into a single one
Felipe Balbi [Mon, 4 Apr 2016 06:11:51 +0000 (09:11 +0300)]
UPSTREAM: usb: dwc3: gadget: combine return points into a single one

dwc3_send_gadget_ep_cmd() had three return
points. That becomes a pain to track when we need to
debug something or if we need to add more code
before returning.

Let's combine all three return points into a single
one just by introducing a local 'ret' variable.

Change-Id: I7faecdab1a78c973e59570fc6a32462ac4ddf6fb
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit c0ca324d09a041ab56be1aaeb5a7cc64c47f877b)

8 years agoUPSTREAM: usb: dwc3: gadget: pass ev_buff as cookie to irq handler
Felipe Balbi [Wed, 30 Mar 2016 06:39:34 +0000 (09:39 +0300)]
UPSTREAM: usb: dwc3: gadget: pass ev_buff as cookie to irq handler

we don't plan on using multiple event buffers, but
if we find a good use case for it, this little trick
will help us avoid a loop in hardirq handler looping
for each and every event buffer.

Change-Id: I841862a0b825e50137f6237750c963651b1fdeb7
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit dea520a4a28307034b1842adbfde947e1ed385d2)

8 years agoUPSTREAM: usb: dwc3: gadget: Fix suspend/resume during device mode
Roger Quadros [Tue, 12 Apr 2016 08:33:29 +0000 (11:33 +0300)]
UPSTREAM: usb: dwc3: gadget: Fix suspend/resume during device mode

Gadget controller might not be always active during system
suspend/resume as gadget driver might not have yet been loaded or
might have been unloaded prior to system suspend.

Check if we're active and only then perform
necessary actions during suspend/resume.

Change-Id: I1efb16ec3b2d1c32904c7bcc8cc947d266786e20
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit 9772b47a4c2916d645c551228b6085ea24acbe5d)

8 years agoUPSTREAM: usb: dwc3: fix memory leak of dwc->regset
Du, Changbin [Tue, 12 Apr 2016 08:24:34 +0000 (16:24 +0800)]
UPSTREAM: usb: dwc3: fix memory leak of dwc->regset

dwc->regset is allocated on dwc3_debugfs_init, and should
be released on init failure or dwc3_debugfs_exit. Btw,
The line "dwc->root = NULL" is unnecessary, so remove it.

Change-Id: I57f72554e8fc6eab95bd9103c0a44f4328613d15
Signed-off-by: Du, Changbin <changbin.du@intel.com>
[ felipe.balbi@linux.intel.com : add another err label for the new
error condition ]
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit e6bdf8195b4a43ebff71f25fc7ca5e436e79161a)

8 years agoUPSTREAM: usb: dwc3: core: fix PHY handling during suspend
Felipe Balbi [Mon, 11 Apr 2016 14:12:34 +0000 (17:12 +0300)]
UPSTREAM: usb: dwc3: core: fix PHY handling during suspend

we need to power off the PHY during suspend and
power it back on during resume.

Change-Id: Ied8a2927e522ce1a94e5bb06ce13af678e47ca18
Signed-off-by: Felipe Balbi <balbi@kernel.org>
[nsekhar@ti.com: fix call to usb_phy_set_suspend() in dwc3_suspend()]
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit 5c4ad318de3b8e8680d654c82a254c4b65243739)

8 years agoUPSTREAM: usb: dwc3: omap: fix up error path on probe()
Felipe Balbi [Mon, 11 Apr 2016 14:12:33 +0000 (17:12 +0300)]
UPSTREAM: usb: dwc3: omap: fix up error path on probe()

Even if pm_runtime_get*() fails, we *MUST* call
pm_runtime_put_sync() before disabling PM.

While at it, remove superfluous dwc3_omap_disable_irqs()
in error path.

Change-Id: I9dfb77af15b831f0e0e2578536d64f0a36d2fc74
Signed-off-by: Felipe Balbi <balbi@kernel.org>
[nsekhar@ti.com: patch description updates]
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit 45d49cb706e5d8f0ca5e868118b5d453afbb938f)

8 years agoUPSTREAM: usb: dwc3: drop ev_buffs array
Felipe Balbi [Wed, 30 Mar 2016 06:37:03 +0000 (09:37 +0300)]
UPSTREAM: usb: dwc3: drop ev_buffs array

we will be using a single event buffer and that
renders ev_buffs array unnecessary. Let's remove it
in favor of a single pointer to a single event
buffer.

Change-Id: I3c7b2e306be660baaa570cf63abaa532f4b87eee
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit 696c8b1282205caa5206264449f80ef756f14ef7)

8 years agoUPSTREAM: usb: dwc3: remove num_event_buffers
Felipe Balbi [Wed, 30 Mar 2016 06:26:24 +0000 (09:26 +0300)]
UPSTREAM: usb: dwc3: remove num_event_buffers

We never, ever route any of the other event buffers
so we might as well drop support for them.

Until someone has a real, proper benefit for
multiple event buffers, we will rely on a single
one. This also helps reduce memory footprint of
dwc3.ko which won't allocate memory for the extra
event buffers.

Change-Id: I70bf36abecc422e59e90a89bb3438be6de0f8ef1
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit 660e9bde74d6915227d7ee3485b11e5f52637b26)

8 years agoUPSTREAM: usb: dwc3: better name for our request management lists
Felipe Balbi [Mon, 14 Mar 2016 09:01:31 +0000 (11:01 +0200)]
UPSTREAM: usb: dwc3: better name for our request management lists

request_list and req_queued were, well, weird naming
choices.

Let's give those better names and call them,
respectively, pending_list and started_list. These
new names better reflect what these lists are
supposed to do.

While at that also rename req->queued to req->started.

Change-Id: I0055847591aa22310fd4e142729596c54010eefe
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit aa3342c8bb618ae25beccddacc3efb415c3a987b)

8 years agoUPSTREAM: usb: dwc3: increase maximum number of TRBs per endpoint
Felipe Balbi [Thu, 10 Mar 2016 12:40:31 +0000 (14:40 +0200)]
UPSTREAM: usb: dwc3: increase maximum number of TRBs per endpoint

previously we were using a maximum of 32 TRBs per
endpoint. With each TRB being 16 bytes long, we were
using 512 bytes of memory for each endpoint.

However, SLAB/SLUB will always allocate PAGE_SIZE
chunks. In order to better utilize the memory we
allocate and to allow deeper queues for gadgets
which would benefit from it (g_ether comes to mind),
let's increase the maximum to 256 TRBs which rounds
up to 4096 bytes for each endpoint.

Change-Id: I2591378bfa8e9c98804d52a1862509c91c4b00f5
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit 8495036e986bdc7e82523d47097e7833d2782ff9)

8 years agoUPSTREAM: usb: dwc3: gadget: always enable CSP
Felipe Balbi [Thu, 10 Mar 2016 11:53:27 +0000 (13:53 +0200)]
UPSTREAM: usb: dwc3: gadget: always enable CSP

CSP bit of TRB Control is useful for protocols such
CDC EEM/ECM/NCM where we're transferring in blocks
of MTU-sized requests (usually MTU is 1500 bytes).

We know we will always have a short packet after two
(for HS) wMaxPacketSize packets and, usually, we
will have a long(-ish) queue of requests (for our
g_ether gadget, we have at least 10
requests).

Instead of always stopping the queue processing to
interrupt, giveback and restart, let's tell dwc3 to
interrupt but continue processing following request
if we have anything already pending in the queue.

This gave me a considerable improvement of 40% on my
test setup.

Change-Id: I02ba152fff9cacad4ffabb3c03a70b06774c09ee
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit ca4d44ea2a91b922e1514f5ed77f6bcf3657fd67)

8 years agoUPSTREAM: usb: dwc3: drop FIFO resizing logic
Felipe Balbi [Thu, 4 Feb 2016 12:18:01 +0000 (14:18 +0200)]
UPSTREAM: usb: dwc3: drop FIFO resizing logic

That FIFO resizing logic was added to support OMAP5
ES1.0 which had a bogus default FIFO size. I can't
remember the exact size of default FIFO, but it was
less than one bulk superspeed packet (<1024) which
would prevent USB3 from ever working on OMAP5 ES1.0.

However, OMAP5 ES1.0 support has been dropped by
commit aa2f4b16f830 ("ARM: OMAP5: id: Remove ES1.0
support") which renders FIFO resizing unnecessary.

Change-Id: I0c5843d4da7ab9ed975a723075b4b31b6c2fcc54
Tested-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit bc5081617faeb3b2f0c126dc37264b87af7da47f)

8 years agoUPSTREAM: usb: dwc3: keystone: drop dma_mask configuration
Grygorii Strashko [Mon, 4 Apr 2016 11:33:31 +0000 (14:33 +0300)]
UPSTREAM: usb: dwc3: keystone: drop dma_mask configuration

The Keystone 2 supports DT-boot only, as result dma_mask will be
always configured properly from DT -
of_platform_device_create_pdata()->of_dma_configure(). More over,
dwc3-keystone.c can be built as module and in this case it's unsafe to
assign local variable as dma_mask.

Hence, remove dma_mask configuration code.

Change-Id: I10ec6c75bf6deb68d27430bf52e1dc3a56ab151c
Cc: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit adf9a3ab90eb44e57f9dbf757acd897838b5ec21)

8 years agoUPSTREAM: usb: dwc3: pci: add ID for one more Intel Broxton platform
Heikki Krogerus [Fri, 1 Apr 2016 14:13:10 +0000 (17:13 +0300)]
UPSTREAM: usb: dwc3: pci: add ID for one more Intel Broxton platform

BXT-M is a Intel Broxton SoC based platform with unique PCI ID.

Change-Id: If37a323423a54e1a04396082ba672d79043082e9
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit 1ffb4d5cc78a3a99109ff0808ce6915de07a0588)

8 years agoUPSTREAM: usb: dwc3: gadget: fix endpoint renaming
Felipe Balbi [Wed, 16 Mar 2016 12:01:37 +0000 (14:01 +0200)]
UPSTREAM: usb: dwc3: gadget: fix endpoint renaming

We were exitting the function before actually
renaming anything. While at that, also always leave
control endpoint un-renamed.

Change-Id: Ia0c8f3d5451e0f5c2e1a6bf61d5b769736bf606d
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit e901aa159dac9988c9961c31c01730effe8f5c22)

8 years agoUPSTREAM: usb: dwc3: gadget: release spin lock during gadget resume
Jiebing Li [Thu, 11 Dec 2014 05:26:29 +0000 (13:26 +0800)]
UPSTREAM: usb: dwc3: gadget: release spin lock during gadget resume

It's a requirement that we release controller's lock
while calling gadget API function pointers. This
patch just fixes that long standing bug.

Change-Id: I19c2cd36fa48a6c27d59305ef2d6cb4c35512433
Signed-off-by: Jiebing Li <jiebing.li@intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit ad14d4e0308afda06a60036020a15025571604af)

8 years agoUPSTREAM: usb: dwc3: DWC_usb31 controller check
John Youn [Sat, 6 Feb 2016 01:08:18 +0000 (17:08 -0800)]
UPSTREAM: usb: dwc3: DWC_usb31 controller check

Add a convenience function to check if the controller is DWC_usb31.

Change-Id: I2018d882b389a8499d4c88171650ac22059139be
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit c4137a9c841ec7fb300782d211f2d6907f4d6e20)

8 years agoUPSTREAM: usb: dwc3: Remove impossible check for of_clk_get_parent_count() < 0
Stephen Boyd [Mon, 22 Feb 2016 19:12:47 +0000 (11:12 -0800)]
UPSTREAM: usb: dwc3: Remove impossible check for of_clk_get_parent_count() < 0

The check for < 0 is impossible now that
of_clk_get_parent_count() returns an unsigned int. Simplify the
code and update the types.

Change-Id: Iadb562ddbb14a61e7e7c65ec947bab12047b100b
Acked-by: Felipe Balbi <balbi@kernel.org>
Cc: <linux-usb@vger.kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
(cherry picked from commit 3d755dcc20dd452b52532eca17da40ebbd12aee9)

8 years agoRevert "usb: dwc3: of-simple: add compatible for rk3399"
Wu Liang feng [Wed, 10 Aug 2016 03:19:25 +0000 (11:19 +0800)]
Revert "usb: dwc3: of-simple: add compatible for rk3399"

This reverts commit 5807cf2b7abb7f8a66cfc3563b387703417e3bb4.

8 years agoRevert "usb: dwc3: add dis_u2_freeclk_exists_quirk"
Wu Liang feng [Wed, 10 Aug 2016 03:19:12 +0000 (11:19 +0800)]
Revert "usb: dwc3: add dis_u2_freeclk_exists_quirk"

This reverts commit ea8f0b113f549f7f89041890212136bcd13a3772.

8 years agoRevert "usb: dwc3: make usb2 phy interface configurable in DT"
Wu Liang feng [Wed, 10 Aug 2016 03:18:59 +0000 (11:18 +0800)]
Revert "usb: dwc3: make usb2 phy interface configurable in DT"

This reverts commit 2ef6df639e07b312f9cde351ba4a5d28c0009a82.

8 years agoRevert "usb: dwc3: add dis_del_phy_power_chg_quirk"
Wu Liang feng [Wed, 10 Aug 2016 03:17:40 +0000 (11:17 +0800)]
Revert "usb: dwc3: add dis_del_phy_power_chg_quirk"

This reverts commit ffee25e68d518aed3a505543355bff1d961159ff.

8 years agoRevert "usb: dwc3: add functions to set force mode"
Wu Liang feng [Wed, 10 Aug 2016 03:17:20 +0000 (11:17 +0800)]
Revert "usb: dwc3: add functions to set force mode"

This reverts commit 9607f47dfec23c5773d74e45ed561859eabce2b7.

8 years agoRevert "usb: dwc3: fix compile failure if config host only mode"
Wu Liang feng [Wed, 10 Aug 2016 03:17:08 +0000 (11:17 +0800)]
Revert "usb: dwc3: fix compile failure if config host only mode"

This reverts commit 268399dd6510997f0cce07f20ab9fbd5dcd89ee9.

8 years agoRevert "UPSTREAM: usb: dwc3: drop FIFO resizing logic"
Wu Liang feng [Wed, 10 Aug 2016 03:15:19 +0000 (11:15 +0800)]
Revert "UPSTREAM: usb: dwc3: drop FIFO resizing logic"

This reverts commit fea44d339a409a3270c75f91e332c7e54e0ff59d.

8 years agoRevert "usb: dwc3: add a quirk xhci_slow_suspend_quirk"
Wu Liang feng [Wed, 10 Aug 2016 03:05:25 +0000 (11:05 +0800)]
Revert "usb: dwc3: add a quirk xhci_slow_suspend_quirk"

This reverts commit 362400b86170bc0cf776ce19c8c133427646cebc.

8 years agoRevert "usb: dwc3: core: support DRD mode switch with extcon notifier"
Wu Liang feng [Wed, 10 Aug 2016 03:03:48 +0000 (11:03 +0800)]
Revert "usb: dwc3: core: support DRD mode switch with extcon notifier"

This reverts commit 26ecf99bd66fe915083fb69c7c20b9b9b67d38f0.

8 years agoarm64: dts: rockchip: add HDMI DDC pinctrl for RK3399 HDMI
Yakir Yang [Thu, 11 Aug 2016 06:24:41 +0000 (14:24 +0800)]
arm64: dts: rockchip: add HDMI DDC pinctrl for RK3399 HDMI

Default to enable the HDMI DDC internal module.

Change-Id: I14e4e3f0b5abb37eb0bb4451e2fcf48bceb3e3b2
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: drm: bridge/dw_hdmi: Reorg hdmi_unmute_interrupts()
Douglas Anderson [Wed, 16 Sep 2015 16:06:08 +0000 (09:06 -0700)]
CHROMIUM: drm: bridge/dw_hdmi: Reorg hdmi_unmute_interrupts()

Reorganize hdmi_unmute_interrupts() to put all the HPD-related config
together.  This also eliminates an extra clearning of the HPD
interrupt.

BUG=chrome-os-partner:44922
TEST=HDMI still works fine.

Change-Id: I9d3cd847a00f9c887e2d054ff2b5671b0eeb8a42
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/299777
Reviewed-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: drm: bridge/dw_hdmi: Eliminate dw_hdmi_fb_registered()
Douglas Anderson [Wed, 16 Sep 2015 15:49:33 +0000 (08:49 -0700)]
CHROMIUM: drm: bridge/dw_hdmi: Eliminate dw_hdmi_fb_registered()

This is a no-op change that eliminates the dw_hdmi_fb_registered()
function and just folds the code into the one caller of the function:
hdmi_unmute_interrupts().

Eliminated because:

* The name and comment of the function implied that it was to be called
  after the frame buffer was registered.  ...but it wasn't called when
  that happened, at least not directly.

* The function does some parts of enabling the HPD interrupt but not all
  parts.  Other parts are done by the calling function, and the calling
  function also duplicates some bits (like clearing existing HPD).  The
  split doesn't make sense.

A future change will reorganize hdmi_unmute_interrupts() a little.

BUG=chrome-os-partner:44922
TEST=HDMI still works fine.

Change-Id: Ib77c03dd8f4791bc7276ccab184ff5b766de5ddd
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/299776
Reviewed-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: drm: bridge/dw_hdmi: fix i2cm standard mode setting error
Yakir Yang [Mon, 28 Sep 2015 08:58:24 +0000 (16:58 +0800)]
CHROMIUM: drm: bridge/dw_hdmi: fix i2cm standard mode setting error

I have uploaded a patch to switch DDC to standard mode in
(https://chromium-review.googlesource.com/298270), but that change
have influence the "spare register" in I2CM_DIV, I know this haven't
cause some know bug, but we need to fix it.

BUG=chrome-os-partner:34741
TEST=None

Change-Id: Iff678fb49828db9b8026422e302a03f687a7c862
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/302751
Commit-Ready: Douglas Anderson <dianders@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
8 years agoCHROMIUM: drm: bridge/dw_hdmi: Reorder soft reset of i2c
Douglas Anderson [Mon, 28 Sep 2015 16:26:04 +0000 (09:26 -0700)]
CHROMIUM: drm: bridge/dw_hdmi: Reorder soft reset of i2c

We should really do the reset of i2c before we set the speed.  There are
no actual known problems fixed by this, but it seems like a good idea
and the latest upstream patch does this.

BUG=chrome-os-partner:34741
TEST=HDMI vs. suspend/resume, broken monitor, HDCP, etc.

Change-Id: I5207f39e074b7ab0d56d945bd1ae74d06f89c74b
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/302629
Commit-Ready: Yakir Yang <ykk@rock-chips.com>
Reviewed-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: drm: bridge/dw_hdmi: switch ddc mode to standard mode
Yakir Yang [Wed, 9 Sep 2015 02:13:53 +0000 (21:13 -0500)]
CHROMIUM: drm: bridge/dw_hdmi: switch ddc mode to standard mode

DDC have two modes: fast mode, standard mode. The previous ddc support
patch(https://chromium-review.googlesource.com/#/c/292012/) configure
the ddc to fast mode.

It works rightly in most HDTV case, but I found that ddc would always
failed if I used the VGA->HDMI adapter. And after I switch ddc to
standard mode, no failed anymore. I believe the standard mode could
provide better compatibility.

BUG=chrome-os-partner:34741
TEST=My VGA->HDMI adapter can read edid now

Change-Id: Ia33ade0a4fda998483baf454b9ccb9f31802f6bc
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/298270
Commit-Ready: Douglas Anderson <dianders@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
8 years agoCHROMIUM: drm: bridge/dw_hdmi: Provide an of_node to DDC i2c bus
Douglas Anderson [Wed, 2 Sep 2015 18:04:11 +0000 (11:04 -0700)]
CHROMIUM: drm: bridge/dw_hdmi: Provide an of_node to DDC i2c bus

In (3b9ba9a FROMLIST: drm: bridge/dw_hdmi: add dw hdmi i2c bus adapter
support) we added a new i2c bus adapter but no of_node was provided to
the adapter.  This made it difficult to assign a bus number to the
adapter in the device tree.

Because of the fact that dynamic bus numbering of i2c starts at 0 and
the fact that i2c busses are no longer allowed to be loaded extra-early
at boot (because deferred probe solves the boot order problem), it's
possible that this could cause the DDC i2c bus to get ID 0 and could
cause later SoC i2c busses to fail to probe because they're expecting to
get ID 0.

Note that probe ordering of mickey is slightly different than probe
ordering of other veyron devices, which is why this only shows up on
mickey.

BUG=chrome-os-partner:44802
TEST=With dts patch can now boot mickey again

Change-Id: I8f971a967f398ab58a6713a2b6471a4a2fe61dc6
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/297040
Reviewed-by: Alexandru Stan <amstan@chromium.org>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoFROMLIST: drm: bridge/dw_hdmi: add dw hdmi i2c bus adapter support
Vladimir Zapolskiy [Sun, 30 Aug 2015 21:34:30 +0000 (00:34 +0300)]
FROMLIST: drm: bridge/dw_hdmi: add dw hdmi i2c bus adapter support

The change adds support of internal HDMI I2C master controller, this
subdevice is used by default, if "ddc-i2c-bus" DT property is omitted.

The main purpose of this functionality is to support reading EDID from
an HDMI monitor on boards, which don't have an I2C bus connected to
DDC pins.

The current implementation does not support "I2C Master Interface
Extended Read Mode" to read data addressed by non-zero segment
pointer, this means that if EDID has more than 1 extension blocks,
EDID reading operation won't succeed, in my practice all tested HDMI
monitors have at maximum one extension block.
(am from https://patchwork.kernel.org/patch/7098101)

Change-Id: Ic3abe878a02f89bda15f39676164803b467c62a1
Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/292012
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
8 years agodt-bindings: screen-timing: add AUO mipi screen H381DLN01
Andy Yan [Thu, 11 Aug 2016 09:16:02 +0000 (17:16 +0800)]
dt-bindings: screen-timing: add AUO mipi screen H381DLN01

H381DLN01 is a 3.81" signle channel MIPI SCREEN with resolution 1080x1200,
it can connect to RK3399 via one DSI channel or dual channel with two panels.

Change-Id: Ib6b5e021b65ac5d24f32ef4a6c0e3fdf5aa4cf08
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
8 years agoarm64: rockchip_defconfig: enable console thread
Huibin Hong [Tue, 16 Aug 2016 01:24:03 +0000 (09:24 +0800)]
arm64: rockchip_defconfig: enable console thread

Change-Id: Id8b01e7379fda8de10997bb32a24640665b95b9f
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
8 years agofiq_debugger: print log by console thread
Huibin Hong [Fri, 12 Aug 2016 03:19:48 +0000 (11:19 +0800)]
fiq_debugger: print log by console thread

Change-Id: Id664cdfe02f87b1f8bb37b9a4e3985c1eafef226
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
8 years agoARM: configs: rockchip: enable configfs usb gadget and dw2 otg in rockchip_linux_defc...
Jacob Chen [Sun, 14 Aug 2016 05:39:29 +0000 (13:39 +0800)]
ARM: configs: rockchip: enable configfs usb gadget and dw2 otg in rockchip_linux_defconfig

Required by ADB

Change-Id: I2f0b85131839bfb62402a7fa8b36e5be2b360b29
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
8 years agoARM: dts: rk3288: enable usb otg for evb-board
Jacob Chen [Sun, 14 Aug 2016 05:40:10 +0000 (13:40 +0800)]
ARM: dts: rk3288: enable usb otg for evb-board

Required by ADB

Change-Id: I80bd0205aabd03978c8070cf6c4eca2359386219
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
8 years agoARM: dts: rk3288: support AP6212 bt for rk3288-Fennec
Nickey Yang [Mon, 8 Aug 2016 07:07:56 +0000 (15:07 +0800)]
ARM: dts: rk3288: support AP6212 bt for rk3288-Fennec

This patch add and enable AP6212 bt node for rk3288-Fennec

Change-Id: I71b7c3a59cad92c6867d3b9f4bcfb44fe560c39c
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
8 years agodt-bindings: screen-timing: lcd-LP097Qx2: add cabc-lut for cabc
Zhou weixin [Mon, 15 Aug 2016 02:50:44 +0000 (10:50 +0800)]
dt-bindings: screen-timing: lcd-LP097Qx2: add cabc-lut for cabc

Change-Id: I836780fd37f4623c5ee23be1594a75f838aae645
Signed-off-by: Zhou weixin <zwx@rock-chips.com>
8 years agoarm64: dts: rockchip: rename RK3399 Excavator files name
Yakir Yang [Thu, 11 Aug 2016 06:45:31 +0000 (14:45 +0800)]
arm64: dts: rockchip: rename RK3399 Excavator files name

Let Sapphire SoC board name at the front of Excavator Main board.

Change-Id: Ie6bcd411900b43a1412197927238337e3a7ae5b0
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoarm64: dts: rockchip: resort RK3399 Excavator boards by alpha
Yakir Yang [Thu, 11 Aug 2016 06:42:14 +0000 (14:42 +0800)]
arm64: dts: rockchip: resort RK3399 Excavator boards by alpha

Resort the RK3399 Excavator and Sapphire dts files by alpha.

Change-Id: I1942144c20d25c6776c5a28132a3ea961cf4ac0f
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agopwm: rockchip: fix ioremap failed for voppwm
David Wu [Tue, 5 Apr 2016 18:26:29 +0000 (02:26 +0800)]
pwm: rockchip: fix ioremap failed for voppwm

Change-Id: I3df7e2ee2b8cb24c4c8aad30cf6d55d11adf0573
Signed-off-by: David Wu <david.wu@rock-chips.com>
8 years agoarm64: dts: rockchip: add voppwm support for rk3399
David Wu [Tue, 5 Apr 2016 13:58:04 +0000 (21:58 +0800)]
arm64: dts: rockchip: add voppwm support for rk3399

Change-Id: I16b4f77083c05ffa71d569e378ea6e3cc9b1ee54
Signed-off-by: David Wu <david.wu@rock-chips.com>
8 years agoarm64: dts: rk3399: add device node for loader display
Mark Yao [Mon, 1 Aug 2016 10:04:30 +0000 (18:04 +0800)]
arm64: dts: rk3399: add device node for loader display

Change-Id: I11e144fa8c7c0dfae70a03c23e392cebc6303177
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agodrm/rockchip: support loader display
Mark Yao [Mon, 1 Aug 2016 10:00:50 +0000 (18:00 +0800)]
drm/rockchip: support loader display

Change-Id: Ia3708d4dff638380aa03f83e38248840454e2b70
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agoFROMLIST: drm/bridge: dw-hdmi: fix hdmi display lost
Mark Yao [Thu, 11 Aug 2016 07:54:03 +0000 (15:54 +0800)]
FROMLIST: drm/bridge: dw-hdmi: fix hdmi display lost

hdmi->disabled maybe not match to the real hardware status.

->dw_hdmi_bridge_enable()
  hdmi->disabled = false;
-->dw_hdmi_update_power()
   if (hdmi->rxsense)
       force = DRM_FORCE_ON;
   else
       force = DRM_FORCE_OFF;

hdmi->rxsense maybe false on bridge enable path, then hdmi->disabled
is false, but actually hardware is power off, they are not match.

So on dw_hdmi_irq, judge the hardware status with hdmi->disabled is wrong.
This bug would cause display lost, unplug/plug can't recovery display.

Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Liu Ying <gnuiyl@gmail.com>
Change-Id: Iaa5c56b5df32c6d3811f4131d63033fbccd005ae
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
(am from https://patchwork.kernel.org/patch/9274599)

8 years agopd: rockchip: support active_wakeup for rockchip pd
Elaine Zhang [Thu, 11 Aug 2016 05:23:15 +0000 (13:23 +0800)]
pd: rockchip: support active_wakeup for rockchip pd

Register gpd_dev_ops.active_wakeup function to support keep power
during suspend state. And add flag to each power domain to
decide whether keep power during suspend or not.

Change-Id: I00b5111c4703be871180d859993dbea00ec82953
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
8 years agoARM64: dts: rk3399: fix pwm id for vdd_center
Jianqun Xu [Wed, 10 Aug 2016 03:11:29 +0000 (11:11 +0800)]
ARM64: dts: rk3399: fix pwm id for vdd_center

RK3399 EVB1 and EVB2 use pwm3 for vdd_center, but EVB3 use pwm2.
This patch moved the vdd_center node to each board dtsi file.

Change-Id: I2b46b06b622c30ab65f26663a3628e73733472ad
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
8 years agodriver,sensor,ak8963: compatible with hardware code
Zorro Liu [Fri, 12 Aug 2016 02:40:07 +0000 (10:40 +0800)]
driver,sensor,ak8963: compatible with hardware code

Change-Id: I18bccedb914cf373188f2e199c6b15b917e0e366
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
8 years agoARM64: rockchip_defconfig: cpufreq: use interactive as default policy
Chen Liang [Fri, 12 Aug 2016 03:48:18 +0000 (11:48 +0800)]
ARM64: rockchip_defconfig: cpufreq: use interactive as default policy

We meet some problem of performance with sched policy, interactive is
better.

Change-Id: Ie62c0e7b82b1c67b5646f6b90d3e4666015c5816
Signed-off-by: Chen Liang <cl@rock-chips.com>
8 years agoUPSTREAM: mmc: mmc: use ops->card_busy() to check card status in __mmc_switch()
Chaotian Jing [Thu, 19 May 2016 08:47:40 +0000 (16:47 +0800)]
UPSTREAM: mmc: mmc: use ops->card_busy() to check card status in __mmc_switch()

some MMC host do not support MMC_CAP_WAIT_WHILE_BUSY but provides
ops->card_busy(), So, add this method to check card status after
switch command.

This patch also fix CMD23 command response timeout which found on
evb-rk3288.

[   13.725563  ] mmcblk0: timed out sending SET_BLOCK_COUNT
command,card status 0x400e00
[   13.733328  ] mmcblk0: command error, retrying timeout
[   13.741792  ] mmcblk0: timed out sending SET_BLOCK_COUNT command,card
status 0x400e00
[   13.749555  ] mmcblk0: command error, retrying timeout
[   13.758246  ] mmcblk0: timed out sending SET_BLOCK_COUNT command,card
status 0x400e00

(cherry picked from commit 87a18a6a565271a886d48df49e5e27ba99e26c60)

Change-Id: I7e1b0f0001639e0b43d4a6951148ed5f625e18dd
Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
8 years agoUPSTREAM: mmc: mmc: fix switch timeout issue caused by jiffies precision
Chaotian Jing [Thu, 19 May 2016 08:47:42 +0000 (16:47 +0800)]
UPSTREAM: mmc: mmc: fix switch timeout issue caused by jiffies precision

with CONFIG_HZ=100, the precision of jiffies is 10ms, and the
generic_cmd6_time of some card is also 10ms. then, may be current
time is only 5ms, but already timed out caused by jiffies precision.

(cherry picked from commit 987aa5f8059613bf85cbb6f64ffbd34f5cb7a9d1)

Change-Id: I43f1bc93e1100e86b138ec20a37612338a7153c6
Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
8 years agoUPSTREAM: mmc: sdhci: Fix sdhci_card_busy()
Adrian Hunter [Thu, 23 Jun 2016 11:00:58 +0000 (14:00 +0300)]
UPSTREAM: mmc: sdhci: Fix sdhci_card_busy()

host->card_busy() was introduced for SD voltage switching which checks all
4 data lines.

Increasingly, host->card_busy is being used to poll the the busy signal
which is only data line 0 (DAT[0]).

The current logic in sdhci_card_busy() does not work in that case because
it returns false if any of the data lines is high.  It also ignores
possibilities:
- data lines 1-3 are not connected and could show at any level
- data lines 1-2 can be used by SDIO for other purposes

According to the SD specification, it is OK to check any of the data lines
for voltage switching, so change to use DAT[0] only.

(cherry picked from commit e613cc477c777a175c89d607d1f7a8ef528d2c43)

Change-Id: I11862e4ab67867271caedc01c0e74c5e24daea37
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
8 years agoMALI: midgard: rockchip: change devfreq_dvfs_interval to 20 ms
chenzhen [Thu, 11 Aug 2016 08:15:38 +0000 (16:15 +0800)]
MALI: midgard: rockchip: change devfreq_dvfs_interval to 20 ms

Change-Id: I2ba7988bd08bb05661a324b66a27cf2028ebd5db
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
8 years agoARM64: dts: rk3399: vr: set NO_DUAL vop mode
wlq [Wed, 10 Aug 2016 12:37:21 +0000 (20:37 +0800)]
ARM64: dts: rk3399: vr: set NO_DUAL vop mode

Change-Id: I0e951dad9d733e0765e65cb0cb9216e7422b9fbc
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
8 years agoARM: dts: rk3288: add asoc simple-audio-card for DW-HDMI audio for miniarm
Nickey Yang [Mon, 1 Aug 2016 09:13:38 +0000 (17:13 +0800)]
ARM: dts: rk3288: add asoc simple-audio-card for DW-HDMI audio for miniarm

Change-Id: Iccc88ef5cdc926f79d65b6bcfcf1b4e8c1a84055
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
8 years agopower: rk818-battery: add POWER_SUPPLY_PROP_STATUS report property
Jianhong Chen [Wed, 10 Aug 2016 13:08:13 +0000 (21:08 +0800)]
power: rk818-battery: add POWER_SUPPLY_PROP_STATUS report property

Change-Id: Ie301f934e8f8cf88702d89b733d7006bbf1ed023
Signed-off-by: Jianhong Chen <chenjh@rock-chips.com>
8 years agovideo: rockchip: fb: only open vop one time when switch screen
Huang Jiachai [Mon, 8 Aug 2016 06:26:32 +0000 (14:26 +0800)]
video: rockchip: fb: only open vop one time when switch screen

Change-Id: I7c95d25d80e303aae41dd9bec0e3eb326c4baba7
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
8 years agodrm/rockchip: add plane feature scale and alpha
Mark Yao [Tue, 2 Aug 2016 07:40:53 +0000 (15:40 +0800)]
drm/rockchip: add plane feature scale and alpha

Change-Id: I64b89e616ff9f2059df38a7f9995ff98e670104a
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agovideo: rockchip: vop: 3368: add FBDC_ABGR_888 data format
Huang Jiachai [Wed, 10 Aug 2016 13:35:50 +0000 (21:35 +0800)]
video: rockchip: vop: 3368: add FBDC_ABGR_888 data format

Change-Id: I6e0ae64c988038d65eb74be99ccfdd170fd61320
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
8 years agodrm/rockchip: fix compile warning when build as modules
Mark Yao [Thu, 11 Aug 2016 01:19:52 +0000 (09:19 +0800)]
drm/rockchip: fix compile warning when build as modules

rockchip_drm_fb.c:In function 'rockchip_drm_fb_destroy':
rockchip_drm_fb.c:51:21: warning: unused variable 'dev' [-Wunused-variable]

Change-Id: I4b9f976c71b310c411a4d1fb9990743d7109b45f
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agoARM: dts: rockchip: enable vpu for rk3288-firefly
Nickey Yang [Tue, 9 Aug 2016 08:01:38 +0000 (16:01 +0800)]
ARM: dts: rockchip: enable vpu for rk3288-firefly

Change-Id: I551cc01e658228656fed1a423a9dbeee23dbdcd3
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
8 years agoARM: dts: rockchip: bump sd card pin drive strength up on rk3288-firefly
Nickey Yang [Tue, 9 Aug 2016 07:40:02 +0000 (15:40 +0800)]
ARM: dts: rockchip: bump sd card pin drive strength up on rk3288-firefly

This patch fix a corruption when reading card information during probe time.

Change-Id: I3fe1b32db12b7d71f7ae0c724b7c6d70382e3210
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
8 years agoARM: dts: rk3288: support AP6335 bt for rk3288-firefly
Nickey Yang [Mon, 8 Aug 2016 10:18:17 +0000 (18:18 +0800)]
ARM: dts: rk3288: support AP6335 bt for rk3288-firefly

Change-Id: Ib9ea03fe42eecde3bf0292b57a9aa0754f849bf5
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
8 years agoARM: dts: rk3288: support AP6335 wifi for rk3288-firefly
Nickey Yang [Mon, 8 Aug 2016 06:19:17 +0000 (14:19 +0800)]
ARM: dts: rk3288: support AP6335 wifi for rk3288-firefly

This patch add and enable AP6335 wifi node for rk3288-firefly

Change-Id: I5db126aa50b7d83cd50498d487c35383c900b855
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
8 years agovideo: rockchip: vop: 3399: pm_runtime_put_sync will close pd immediately
Huang Jiachai [Thu, 4 Aug 2016 13:22:24 +0000 (21:22 +0800)]
video: rockchip: vop: 3399: pm_runtime_put_sync will close pd immediately

Change-Id: Iba58351d19f5af776897ee95a4e668b192d4631d
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
8 years agoUPSTREAM: PM / devfreq: add missing of_node_put after calling of_parse_phandle
Peter Chen [Fri, 1 Jul 2016 09:42:00 +0000 (17:42 +0800)]
UPSTREAM: PM / devfreq: add missing of_node_put after calling of_parse_phandle

of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.

Change-Id: I59404551678a7e56fe51a1996c9e53b6e935dac9
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
(cherry picked from commit 3427c6f0b6f5643543f9b6c55f80bee83c0d5ff3)

8 years agoUPSTREAM: PM / devfreq: Send the DEVFREQ_POSTCHANGE notification when target() is...
Chanwoo Choi [Thu, 23 Jun 2016 02:18:43 +0000 (11:18 +0900)]
UPSTREAM: PM / devfreq: Send the DEVFREQ_POSTCHANGE notification when target() is failed

This patch sends the DEVFREQ_POSTCHANGE notification when
devfreq->profile->targer() is failed. The PRECHANGE/POSTCHANGE
should be paired.

Fixes: 0fe3a66410a3 (PM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifier)
Change-Id: I571fcc0ba95da6f7533d20818dfbd5f628c2f3ee
Reported-by: Lin Huang <hl@rock-chips.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 0d37189e80163c653771916afe28fae1a8d14daa)

8 years agoUPSTREAM: PM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifier
Chanwoo Choi [Tue, 26 Jan 2016 04:21:26 +0000 (13:21 +0900)]
UPSTREAM: PM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifier

This patch adds the new DEVFREQ_TRANSITION_NOTIFIER notifier to send
the notification when the frequency of device is changed.
This notifier has two state as following:
- DEVFREQ_PRECHANGE  : Notify it before chaning the frequency of device
- DEVFREQ_POSTCHANGE : Notify it after changed the frequency of device

And this patch adds the resourced-managed function to release the resource
automatically when error happen.

Change-Id: Id92ce7b9b2fba0e8776b1bc6980996b16a2902f3
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
[m.reichl and linux.amoon: Tested it on exynos4412-odroidu3 board]
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
(cherry picked from commit 0fe3a66410a3ba96679be903f1e287d7a0a264a9)

8 years agoUPSTREAM: PM / devfreq: Add devfreq_get_devfreq_by_phandle()
Chanwoo Choi [Tue, 10 Nov 2015 11:31:07 +0000 (20:31 +0900)]
UPSTREAM: PM / devfreq: Add devfreq_get_devfreq_by_phandle()

This patch adds the new devfreq_get_devfreq_by_phandle() OF helper function
which can find the instance of devfreq device by using phandle ("devfreq").

Change-Id: I0d0ed78930811e896215c2b7a9125cad69310407
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
[m.reichl and linux.amoon: Tested it on exynos4412-odroidu3 board]
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
(cherry picked from commit 8f510aeb223b26c4ffbece9fa92e4befea470f57)

8 years agoUPSTREAM: ARM: 8481/2: drivers: psci: replace psci firmware calls
Jens Wiklander [Mon, 4 Jan 2016 14:46:47 +0000 (15:46 +0100)]
UPSTREAM: ARM: 8481/2: drivers: psci: replace psci firmware calls

Switch to use a generic interface for issuing SMC/HVC based on ARM SMC
Calling Convention. Removes now the now unused psci-call.S.

Change-Id: Ifd601acaec79a7c7f7ce2af6c5b8e8661e26508a
Acked-by: Will Deacon <will.deacon@arm.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tested-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
(cherry picked from commit e679660dbb8347f275fe5d83a5dd59c1fb6c8e63)

8 years agoUPSTREAM: ARM: 8480/2: arm64: add implementation for arm-smccc
Jens Wiklander [Mon, 4 Jan 2016 14:44:32 +0000 (15:44 +0100)]
UPSTREAM: ARM: 8480/2: arm64: add implementation for arm-smccc

Adds implementation for arm-smccc and enables CONFIG_HAVE_SMCCC.

Change-Id: I066b36d31a1ff5411e3bca49588402d5c7b3f4bc
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
(cherry picked from commit 14457459f9ca2ff8521686168ea179edc3a56a44)

8 years agoUPSTREAM: ARM: 8479/2: add implementation for arm-smccc
Jens Wiklander [Mon, 4 Jan 2016 14:42:55 +0000 (15:42 +0100)]
UPSTREAM: ARM: 8479/2: add implementation for arm-smccc

Adds implementation for arm-smccc and enables CONFIG_HAVE_SMCCC for
architectures that may support arm-smccc. It's the responsibility of the
caller to know if the SMC instruction is supported by the platform.

Change-Id: Ic7fd73fb040a900cfaa783f70c29b1d984da558b
Reviewed-by: Lars Persson <lars.persson@axis.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
(cherry picked from commit b329f95d70f3f955093e9a2b18ac1ed3587a8f73)

8 years agoUPSTREAM: ARM: 8478/2: arm/arm64: add arm-smccc
Jens Wiklander [Mon, 4 Jan 2016 14:37:32 +0000 (15:37 +0100)]
UPSTREAM: ARM: 8478/2: arm/arm64: add arm-smccc

Adds helpers to do SMC and HVC based on ARM SMC Calling Convention.
CONFIG_HAVE_ARM_SMCCC is enabled for architectures that may support the
SMC or HVC instruction. It's the responsibility of the caller to know if
the SMC instruction is supported by the platform.

This patch doesn't provide an implementation of the declared functions.
Later patches will bring in implementations and set
CONFIG_HAVE_ARM_SMCCC for ARM and ARM64 respectively.

Change-Id: I7b403bb56c05a52e248cb02f154e2ab31c62fddf
Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
(cherry picked from commit 98dd64f34f47ce19b388d9015f767f48393a81eb)

8 years agoarm64: dts: rockchip: add gsl3673 node for rk3399-evb
buluess.li [Tue, 9 Aug 2016 08:55:44 +0000 (16:55 +0800)]
arm64: dts: rockchip: add gsl3673 node for rk3399-evb

Change-Id: Ie2af9afdef987924a94fad3b65adf0ccd7c8001d
Signed-off-by: buluess.li <buluess.li@rock-chips.com>
8 years agoarm64: dts: rk3399-mid: update backlight brightness-levels
Bin Yang [Tue, 9 Aug 2016 03:49:29 +0000 (11:49 +0800)]
arm64: dts: rk3399-mid: update backlight brightness-levels

Change-Id: I4416f3f53347e8efa5452777cf0c918961a6f5f3
Signed-off-by: Bin Yang <yangbin@rock-chips.com>
8 years agoARM64: dts: rk3399: add 3399 sapphire&excavator box and edp board support
Huang zhibao [Tue, 9 Aug 2016 06:56:50 +0000 (14:56 +0800)]
ARM64: dts: rk3399: add 3399 sapphire&excavator box and edp board support

Change-Id: I14fd6d2e49eee6852625241cfd9ef22b549588c0
Signed-off-by: Huang zhibao <hzb@rock-chips.com>
8 years agoMerge tag 'lsk-v4.4-16.07-android'
Huang, Tao [Wed, 10 Aug 2016 07:15:47 +0000 (15:15 +0800)]
Merge tag 'lsk-v4.4-16.07-android'

LSK 16.07 v4.4-android

* tag 'lsk-v4.4-16.07-android': (160 commits)
  arm64: kaslr: increase randomization granularity
  arm64: relocatable: deal with physically misaligned kernel images
  arm64: don't map TEXT_OFFSET bytes below the kernel if we can avoid it
  arm64: kernel: replace early 64-bit literal loads with move-immediates
  arm64: introduce mov_q macro to move a constant into a 64-bit register
  arm64: kernel: perform relocation processing from ID map
  arm64: kernel: use literal for relocated address of __secondary_switched
  arm64: kernel: don't export local symbols from head.S
  arm64: simplify kernel segment mapping granularity
  arm64: cover the .head.text section in the .text segment mapping
  arm64: move early boot code to the .init segment
  arm64: use 'segment' rather than 'chunk' to describe mapped kernel regions
  arm64: mm: Mark .rodata as RO
  Linux 4.4.16
  ovl: verify upper dentry before unlink and rename
  drm/i915: Revert DisplayPort fast link training feature
  tmpfs: fix regression hang in fallocate undo
  tmpfs: don't undo fallocate past its last page
  crypto: qat - make qat_asym_algs.o depend on asn1 headers
  xen/acpi: allow xen-acpi-processor driver to load on Xen 4.7
  ...

8 years agodrm/panel: Don't init gpio value at probe
Mark Yao [Tue, 2 Aug 2016 07:19:27 +0000 (15:19 +0800)]
drm/panel: Don't init gpio value at probe

When enable display on loader, init gpio would change gpio status,
that would make screen flash,

Change-Id: I4b69a8d3d83c5bef09014c2134abaee6522a7046
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agoarm64: dts: rk3399: enable hdmi node for android-next
Mark Yao [Tue, 2 Aug 2016 09:21:10 +0000 (17:21 +0800)]
arm64: dts: rk3399: enable hdmi node for android-next

Change-Id: I4a6542592adb2b0fd947aa368c1714b33a2eb4bc
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agoUPSTREAM: drm/rockchip: allocate correct crtc state structure on reset
John Keeping [Thu, 14 Jul 2016 15:29:15 +0000 (16:29 +0100)]
UPSTREAM: drm/rockchip: allocate correct crtc state structure on reset

Because we are using a custom crtc_state structure, we must override the
reset helper to allocate the correct amount of memory.

Cc: stable@vger.kernel.org
Change-Id: I1895dbe994232991c1659cf2f4d63c4aa957b794
Fixes: 4e257d9eee23 ("drm/rockchip: get rid of rockchip_drm_crtc_mode_config")
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
(cherry picked from dc0b408f5a87cce3ea3f81a6800244fb7d395435)

8 years agodrm/rockchip: fix compile error when build as modules
Mark Yao [Wed, 10 Aug 2016 02:24:42 +0000 (10:24 +0800)]
drm/rockchip: fix compile error when build as modules

Build fail with:
  ERROR: "memblock_free" [drivers/gpu/drm/rockchip/rockchipdrm.ko] undefined!

memblok_free fuction not export symbol, and use the flag __init, so it
can't be used on modules.

the memblock_free function only used for loader memory manager, not use
on modules context, so just use it when build-in drm/rockchip.

Change-Id: Ib88b6ca6c61f7ef85b4126d705a4911e207b57e5
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agoARM64: dts: rk3399: support fusb302 for box rev1/2
Meng Dongyang [Tue, 9 Aug 2016 04:17:37 +0000 (12:17 +0800)]
ARM64: dts: rk3399: support fusb302 for box rev1/2

Change-Id: Iea3f9e673a08bc959b3f57d169fff738ce746645
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
8 years agoFROMLIST: Documentation: bindings: add dt documentation for cdn DP controller
Chris Zhong [Fri, 29 Jul 2016 07:48:22 +0000 (15:48 +0800)]
FROMLIST: Documentation: bindings: add dt documentation for cdn DP controller

This patch adds a binding that describes the cdn DP controller for
rk3399.

(am from https://patchwork.kernel.org/patch/9256921/)

Change-Id: Ibf5ed51f9b049b2b310ea049f30d237ee4f9e6aa
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
8 years agoFROMLIST: arm64: dts: rockchip: add Type-C phy for RK3399
Chris Zhong [Fri, 29 Jul 2016 07:48:21 +0000 (15:48 +0800)]
FROMLIST: arm64: dts: rockchip: add Type-C phy for RK3399

There are 2 Type-C phy on RK3399, they are almost same, except the
address of register. They support USB3.0 Type-C and DisplayPort1.3
Alt Mode on USB Type-C. Register a phy, supply it to USB3 controller
and DP controller.

(am from https://patchwork.kernel.org/patch/9256949/)

Change-Id: I840fbb0cc5e9b95e4d2fa88409ef1a98990dffb7
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
8 years agoFROMLIST: phy: Add USB Type-C PHY driver for rk3399
Chris Zhong [Fri, 29 Jul 2016 07:48:20 +0000 (15:48 +0800)]
FROMLIST: phy: Add USB Type-C PHY driver for rk3399

Add a PHY provider driver for the rk3399 SoC Type-c PHY. The USB
Type-C PHY is designed to support the USB3 and DP applications. The
PHY basically has two main components: USB3 and DisplyPort. USB3
operates in SuperSpeed mode and the DP can operate at RBR, HBR and
HBR2 data rates. Hence, create 2 PHY deivces, the phy[0] for DP,
and phy[1] for USB3.

(am from https://patchwork.kernel.org/patch/9260745/)

Change-Id: I0cd851a59c00a1249415da109598007a09088591
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
8 years agoFROMLIST: Documentation: bindings: add dt doc for Rockchip USB Type-C PHY
Chris Zhong [Fri, 29 Jul 2016 07:48:19 +0000 (15:48 +0800)]
FROMLIST: Documentation: bindings: add dt doc for Rockchip USB Type-C PHY

This patch adds a binding that describes the Rockchip USB Type-C PHY
for rk3399

(am from https://patchwork.kernel.org/patch/9256943/)

Change-Id: I91d9451126e37ac1786e19f269f547fc0d0df96e
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
8 years agoARM64: dts: rk3399: support fusb302 for evb1/2/3
Zain Wang [Thu, 7 Apr 2016 10:05:32 +0000 (18:05 +0800)]
ARM64: dts: rk3399: support fusb302 for evb1/2/3

Change-Id: I27d3c4848466a672b42446cc2b208fed067c4417
Signed-off-by: Zain Wang <wzz@rock-chips.com>
8 years agoarm64: dts: rk3399-mid: add support for new hardware
Bin Yang [Tue, 2 Aug 2016 02:58:26 +0000 (10:58 +0800)]
arm64: dts: rk3399-mid: add support for new hardware

Change-Id: Id832c96aec605f38dfe7639271becdf83740e9f3
Signed-off-by: Bin Yang <yangbin@rock-chips.com>
8 years agoARM64: dts: rk3399: adjust box temperature patameters
buluess.li [Mon, 8 Aug 2016 02:17:00 +0000 (10:17 +0800)]
ARM64: dts: rk3399: adjust box temperature patameters

Change-Id: I24982ee8ccb0fc9cbc92f357661d3b07ca275920
Signed-off-by: buluess.li <buluess.li@rock-chips.com>
8 years agoarm64: dts: rockchip: rk3399: fix pd_sd as sub domain of pd_perihp
Elaine Zhang [Mon, 8 Aug 2016 11:05:30 +0000 (19:05 +0800)]
arm64: dts: rockchip: rk3399: fix pd_sd as sub domain of pd_perihp

Change-Id: I62e53b85444f0f4bbb1d2e786a23ff1f91c89000
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
8 years agoRevert "driver, iio, mpuxxx: do nothing when fifo count is zero"
Zorro Liu [Fri, 5 Aug 2016 08:54:59 +0000 (16:54 +0800)]
Revert "driver, iio, mpuxxx: do nothing when fifo count is zero"

This reverts commit 98827e305e4c13add79acbfc58f15bd96c09cc92.

Change-Id: I603799406f380fc649083e2ef66e8e78608f378c
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
8 years agoFROMLIST: drm/rockchip: fix fbdev crash when not use DRM_FBDEV_EMULATION
Mark Yao [Thu, 4 Aug 2016 01:40:51 +0000 (09:40 +0800)]
FROMLIST: drm/rockchip: fix fbdev crash when not use DRM_FBDEV_EMULATION

[    1.162571] Unable to handle kernel NULL pointer dereference at virtual address 00000200
[    1.165656] Modules linked in:
[    1.165941] CPU: 5 PID: 143 Comm: kworker/5:2 Not tainted 4.4.15 #237
[    1.166506] Hardware name: Rockchip RK3399 Evaluation Board v1 (Android) (DT)
[    1.167153] Workqueue: events output_poll_execute
[    1.168231] PC is at mutex_lock+0x14/0x44
[    1.168586] LR is at drm_fb_helper_hotplug_event+0x28/0xcc
[    1.172192] [<ffffff8008982110>] mutex_lock+0x14/0x44
[    1.172196] [<ffffff80084025a4>] drm_fb_helper_hotplug_event+0x28/0xcc
[    1.172201] [<ffffff8008427ae4>] rockchip_drm_output_poll_changed+0x14/0x1c
[    1.172204] [<ffffff80083f7c4c>] drm_kms_helper_hotplug_event+0x28/0x34
[    1.172207] [<ffffff80083f7ddc>] output_poll_execute+0x150/0x198
[    1.172212] [<ffffff80080b0ea8>] process_one_work+0x218/0x3dc
[    1.172215] [<ffffff80080b1578>] worker_thread+0x24c/0x374
[    1.172217] [<ffffff80080b5bcc>] kthread+0xdc/0xe4
[    1.172222] [<ffffff8008084cd0>] ret_from_fork+0x10/0x40

Change-Id: I681b9260ad7f2e3cae5cd08a109dad89b3575c2c
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
(am from https://patchwork.kernel.org/patch/9262523)

8 years agoUPSTREAM: drm/rockchip: Use atomic PM helpers
Tomeu Vizoso [Mon, 6 Jun 2016 14:53:32 +0000 (16:53 +0200)]
UPSTREAM: drm/rockchip: Use atomic PM helpers

This driver was still using the old legacy helpers and that caused a few
NULL dereferences when trying to call empty callbacks.

Change-Id: I9656aed34892260dbf9b571b95befd6af4d9b70f
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: Caesar Wang <wxt@rock-chips.com>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1465224813-7359-1-git-send-email-tomeu.vizoso@collabora.com
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
(cherry picked from 5a5873830972e7d8983dd205b3686f728047d556)

8 years agoUPSTREAM: drm/atomic-helper: Implement subsystem-level suspend/resume
Thierry Reding [Wed, 2 Dec 2015 16:50:04 +0000 (17:50 +0100)]
UPSTREAM: drm/atomic-helper: Implement subsystem-level suspend/resume

Provide subsystem-level suspend and resume helpers that can be used to
implement suspend/resume on atomic mode-setting enabled drivers.

v2: simplify locking, enhance kerneldoc comments
v3: pass lock acquisition context by parameter, improve kerneldoc
v4: - remove redundant code (already provided by atomic helpers)
      (Maarten Lankhorst)
    - move backoff dance from drm_modeset_lock_all_ctx() into suspend
      helper (Daniel Vetter)
v5: handle potential EDEADLK from drm_atomic_helper_duplicate_state()
    and drm_atomic_helper_disable_all() (Daniel Vetter)

Change-Id: I58c5b794cdafa6c9f2594376fc2e98918156e409
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1449075005-13937-2-git-send-email-thierry.reding@gmail.com
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
(cherry picked from 1494276000db789c6d2acd85747be4707051c801)