firefly-linux-kernel-4.4.55.git
8 years agoUPSTREAM: usb: dwc3: gadget: remove udelay() from generic cmd
Felipe Balbi [Mon, 23 May 2016 11:08:47 +0000 (14:08 +0300)]
UPSTREAM: usb: dwc3: gadget: remove udelay() from generic cmd

We want commands to finish ASAP, so let's remove
that udelay() call.

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

8 years agoUPSTREAM: usb: dwc3: gadget: single return point on generic commands
Felipe Balbi [Mon, 23 May 2016 11:06:07 +0000 (14:06 +0300)]
UPSTREAM: usb: dwc3: gadget: single return point on generic commands

Just like we did for endpoint commands, let's use a
single return point for generic commands as
well. This aids readability.

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

8 years agoUPSTREAM: usb: dwc3: trace: print ep cmd status with a single trace
Felipe Balbi [Mon, 23 May 2016 11:02:33 +0000 (14:02 +0300)]
UPSTREAM: usb: dwc3: trace: print ep cmd status with a single trace

Instead of printing command's status with a separate
trace printout, let's print it within a single call.

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

8 years agoUPSTREAM: usb: dwc3: gadget: loop while (timeout)
Felipe Balbi [Mon, 23 May 2016 10:53:34 +0000 (13:53 +0300)]
UPSTREAM: usb: dwc3: gadget: loop while (timeout)

instead of having infinite loop and always checking
timeout value as a break condition, we can just
decrement timeout inside while's condition.

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

8 years agoUPSTREAM: usb: dwc3: gadget: fix trace output when command fails
Felipe Balbi [Mon, 23 May 2016 10:50:29 +0000 (13:50 +0300)]
UPSTREAM: usb: dwc3: gadget: fix trace output when command fails

We don't need the extra %s when command fails.
Let's remove it

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

8 years agoUPSTREAM: usb: dwc3: trace: fully decode IRQ events
Felipe Balbi [Mon, 23 May 2016 08:10:08 +0000 (11:10 +0300)]
UPSTREAM: usb: dwc3: trace: fully decode IRQ events

This will make it more human-friendly to read trace
output from dwc3.

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

8 years agoUPSTREAM: usb: dwc3: gadget: no more tracking endpoint type with its name
Felipe Balbi [Mon, 23 May 2016 08:27:26 +0000 (11:27 +0300)]
UPSTREAM: usb: dwc3: gadget: no more tracking endpoint type with its name

I really thought this would be useful, but as it
turns out, it creates more problems than fixes. The
amount of times we had to fix this because some
other commit shuffled things around and ended up
regressing this tiny little string manupulation...

Might as well remove it, since it has a negligible
added benefit.

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

8 years agoUPSTREAM: usb: dwc3: trace: pretty-print TRB's ctrl field
Janusz Dziedzic [Fri, 20 May 2016 08:37:13 +0000 (10:37 +0200)]
UPSTREAM: usb: dwc3: trace: pretty-print TRB's ctrl field

Improve trb tracing by showing trb flags, interrupts
trb type.

trb flags:
- h - hardware owner of descriptor
- l - last TRB
- c - chain buffers
- s - continue on short packet

interrupt flags:
- s - interrupt on short packet
- c - interrupt on complete

Capital letter means that bit is set, while
lowercase letter means bit is cleared.

Change-Id: I1f709f56a2fcc707858805289cb66fbace718abb
Signed-off-by: Janusz Dziedzic <januszx.dziedzic@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 22f2c619a116f120fe57de1225cfe7fdeb0b12d2)

8 years agoUPSTREAM: usb: dwc3: gadget: add a per-endpoint request queue lock
Felipe Balbi [Wed, 13 Apr 2016 13:44:39 +0000 (16:44 +0300)]
UPSTREAM: usb: dwc3: gadget: add a per-endpoint request queue lock

This will allow us to process several endpoints at a
time by making sure that we lock only shared
resources.

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

8 years agoUPSTREAM: usb: dwc3: pci: add Power Management dummy hooks
Felipe Balbi [Tue, 17 May 2016 07:15:02 +0000 (10:15 +0300)]
UPSTREAM: usb: dwc3: pci: add Power Management dummy hooks

Allow for dwc3-pci to reach D3 and enable pm_runtime
by providing dummy PM hooks. Without them, PCI
subsystem won't put device to D3.

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

8 years agoUPSTREAM: usb: dwc3: implement runtime PM
Felipe Balbi [Mon, 16 May 2016 10:14:48 +0000 (13:14 +0300)]
UPSTREAM: usb: dwc3: implement runtime PM

this patch implements the most basic pm_runtime
support for dwc3. Whenever USB cable is dettached,
then we will allow core to runtime_suspend.

Runtime suspending will involve completely tearing
down event buffers and require a full soft-reset of
the IP.

Note that a further optimization could be
implemented once we decide to support hibernation,
which is to allow runtime_suspend with cable
connected when bus is in U3. That's subject to a
separate patch, however.

Change-Id: I2ff3ca0424151eb15066ccc3a6d8e46e7dc9ec4e
Tested-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit fc8bb91bc83ef82868533e75f5a11abc1158ec81)

8 years agoUPSTREAM: usb: dwc3: gadget: fix for possible endpoint disable race
Felipe Balbi [Wed, 18 May 2016 09:37:21 +0000 (12:37 +0300)]
UPSTREAM: usb: dwc3: gadget: fix for possible endpoint disable race

when we call dwc3_gadget_giveback(), we end up
releasing our controller's lock. Another thread
could get scheduled and disable the endpoint,
subsequently setting dep->endpoint.desc to NULL.

In that case, we would end up dereferencing a NULL
pointer which would result in a Kernel Oops. Let's
avoid the problem by simply returning early if we
have a NULL descriptor.

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

8 years agoUPSTREAM: usb: dwc3: fix for the isoc transfer EP_BUSY flag
Konrad Leszczynski [Mon, 8 Feb 2016 15:13:12 +0000 (16:13 +0100)]
UPSTREAM: usb: dwc3: fix for the isoc transfer EP_BUSY flag

commit f3af36511e60 ("usb: dwc3: gadget: always
enable IOC on bulk/interrupt transfers") ended up
regressing Isochronous endpoints by clearing
DWC3_EP_BUSY flag too early, which resulted in
choppy audio playback over USB.

Fix that by partially reverting original commit and
making sure that we check for isochronous endpoints.

Change-Id: If2b5897f005bc5f6a4f475e8371c2654ac04a44a
Fixes: f3af36511e60 ("usb: dwc3: gadget: always enable IOC
on bulk/interrupt transfers")
Cc: <stable@vger.kernel.org>
Signed-off-by: Konrad Leszczynski <konrad.leszczynski@intel.com>
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@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 9cad39fe4e4a4fe95d8ea5a7b0692b0a6e89e38b)

8 years agoUPSTREAM: usb: dwc3: gadget: only resume USB2 PHY in <=HIGHSPEED
Felipe Balbi [Tue, 17 May 2016 11:55:58 +0000 (14:55 +0300)]
UPSTREAM: usb: dwc3: gadget: only resume USB2 PHY in <=HIGHSPEED

As a micro-power optimization, let's only resume the
USB2 PHY if we're working on <=HIGHSPEED. If we're
gonna work on SUPERSPEED or SUPERSPEED+, there's no
point in resuming the USB2 PHY.

Change-Id: I2661fcde935c6b20afbd54f7a9f74e1ebde2a0d0
Fixes: 2b0f11df84bb ("usb: dwc3: gadget: clear SUSPHY bit before ep cmds")
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit ab2a92e7a608c09f13baf1730b9ba24c73c35d52)

8 years agoUPSTREAM: usb: dwc3: gadget: hold gadget IRQ in dwc->irq_gadget
Felipe Balbi [Mon, 16 May 2016 11:17:06 +0000 (14:17 +0300)]
UPSTREAM: usb: dwc3: gadget: hold gadget IRQ in dwc->irq_gadget

by holding gadget's IRQ number in dwc->irq_gadget,
it'll be simpler to free_irq() and disable the IRQ
in case an IRQ fires while we are runtime suspended.

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

8 years agoUPSTREAM: usb: dwc3: core: simplify suspend/resume operations
Felipe Balbi [Mon, 16 May 2016 07:52:58 +0000 (10:52 +0300)]
UPSTREAM: usb: dwc3: core: simplify suspend/resume operations

now that we have re-factored dwc3_core_init() and
dwc3_core_exit() we can use them for suspend/resume
operations.

This will help us avoid some common mistakes when
patching code when we have duplicated pieces of code
doing the same thing.

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

8 years agoUPSTREAM: usb: dwc3: core: re-factor init and exit paths
Felipe Balbi [Mon, 16 May 2016 07:49:01 +0000 (10:49 +0300)]
UPSTREAM: usb: dwc3: core: re-factor init and exit paths

The idea of this patch is for dwc3_core_init() to
abstract all the details about how to initialize
dwc3 and dwc3_core_exit() to do the same for
teardown.

With this, we can simplify suspend/resume operations
by a large margin and always know that we're going
to start dwc3 from a known starting point.

Change-Id: I3193f375fa153e1636de8f86fb752ef88afa5d95
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
(cherry picked from commit c499ff71ff2a281366c6ec7a904c547d806cbcd1)

Conflicts:
drivers/usb/dwc3/core.c

8 years agoUPSTREAM: usb: dwc3: core: move fladj to dwc3 structure
Felipe Balbi [Mon, 16 May 2016 07:42:23 +0000 (10:42 +0300)]
UPSTREAM: usb: dwc3: core: move fladj to dwc3 structure

this patch is in preparation for some further
re-factoring in dwc3 initialization. No functional
changes.

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

8 years agoUPSTREAM: usb: dwc3: gadget: add a pointer to endpoint registers
Felipe Balbi [Tue, 12 Apr 2016 13:53:39 +0000 (16:53 +0300)]
UPSTREAM: usb: dwc3: gadget: add a pointer to endpoint registers

By adding a pointer to endpoint registers' base
address, we can avoid using our controller-wide
struct dwc3 pointer for everything. At some point
this will allow us to have per-endpoint locks which
will, in turn, let us queue requests to separate
endpoints in parallel.

Because of this change our debugfs interface and io
accessors need to be changed accordingly.

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

8 years agoUPSTREAM: usb: dwc3: gadget: pass dep as argument to endpoint command
Felipe Balbi [Tue, 12 Apr 2016 13:42:43 +0000 (16:42 +0300)]
UPSTREAM: usb: dwc3: gadget: pass dep as argument to endpoint command

In all call sites of dwc3_send_gadget_ep_cmd() we
already had a valid dep pointer, so instead of
passing dwc and dep->number, which would be used to
fetch the same pointer we already had, just pass dep
directly.

In other words, we're changing:

struct dwc3_ep *dep = dwc[dep->number];

to just passing struct dwc3_ep *dep as argument.

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

8 years agoUPSTREAM: usb: dwc3: gadget: initialize NUMP based on RxFIFO Size
Felipe Balbi [Fri, 13 May 2016 11:09:59 +0000 (14:09 +0300)]
UPSTREAM: usb: dwc3: gadget: initialize NUMP based on RxFIFO Size

Instead of using burst size to configure NUMP, we
should be using RxFIFO Size instead. DWC3 is smart
enough to know that it shouldn't burst in case burst
size is 0.

Change-Id: I03b0290e19ed204047ff35fdf7383f57bf3566df
Reported-by: John Youn <johnyoun@synopsys.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 4e99472bc10bda9906526d725ff6d5f27b4ddca1)

8 years agoUPSTREAM: usb: dwc3: gadget: split __dwc3_gadget_kick_transfer()
Felipe Balbi [Fri, 13 May 2016 09:42:44 +0000 (12:42 +0300)]
UPSTREAM: usb: dwc3: gadget: split __dwc3_gadget_kick_transfer()

To aid code readability, we're gonna split
__dwc3_gadget_kick_transfer() into its constituent
parts: scatter gather and linear buffers.

That way, it's easier to follow the code and focus
debug effort when one or the other fails.

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

8 years agoUPSTREAM: usb: dwc3: gadget: return 0 if we try to Wakeup in superspeed
Felipe Balbi [Fri, 13 May 2016 07:19:42 +0000 (10:19 +0300)]
UPSTREAM: usb: dwc3: gadget: return 0 if we try to Wakeup in superspeed

Instead of returning -EINVAL when someone calls
__dwc3_gadget_wakeup() in speeds > highspeed, let's
return 0. There are no problems for the driver for
calling it in superspeed as we cleanly just return.

This avoids an annoying WARN_ONCE() always
triggering during superspeed enumeration with LPM
enabled.

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

8 years agoUPSTREAM: usb: dwc3: gadget: remove udelay(1) when sending ep cmds
Felipe Balbi [Fri, 13 May 2016 07:11:59 +0000 (10:11 +0300)]
UPSTREAM: usb: dwc3: gadget: remove udelay(1) when sending ep cmds

When we send an endpoint command, we want that to
complete as soon as possible, so let's remove the
unnecessary udelay(1) call.

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

8 years agoUPSTREAM: usb: dwc3: gadget: rely on sg_is_last() and list_is_last()
Felipe Balbi [Fri, 13 May 2016 07:07:47 +0000 (10:07 +0300)]
UPSTREAM: usb: dwc3: gadget: rely on sg_is_last() and list_is_last()

sg_is_last() and list_is_last() will encode the
required information for the driver to make
decisions WRT CHN and LST bits.

While at that, also replace '1' with 'true' for
consistency.

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

8 years agoUPSTREAM: usb: dwc3: gadget: simplify __dwc3_gadget_kick_transfer()
Felipe Balbi [Thu, 12 May 2016 13:53:59 +0000 (16:53 +0300)]
UPSTREAM: usb: dwc3: gadget: simplify __dwc3_gadget_kick_transfer()

as it turns out, we don't need the extra 'start_new'
argument as that can be inferred from DWC3_EP_BUSY
flag.

Because of that, we can simplify
__dwc3_gadget_kick_transfer() by quite a bit, even
allowing us to prepare more TRBs unconditionally.

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

8 years agoUPSTREAM: usb: dwc3: gadget: prepare TRBs on update transfers too
Felipe Balbi [Thu, 12 May 2016 11:08:34 +0000 (14:08 +0300)]
UPSTREAM: usb: dwc3: gadget: prepare TRBs on update transfers too

If we're updating transfers, we can also prepare as
many TRBs as we can fit in the ring. Let's start
doing that.

This patch 'solves' a limitation of how many TRBs we
can prepare when we're getting close the end of the
ring. Instead driver to prepare only up to end of
the ring, we check if we have space to wrap around
the ring properly.

Note that this only happens when our enqueue and
dequeue pointers are equal (which is the case for
bulk endpoints after an XferComplete event).

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

8 years agoUPSTREAM: usb: dwc3: core: get rid of DWC3_PM_OPS macro
Felipe Balbi [Mon, 9 May 2016 12:27:01 +0000 (15:27 +0300)]
UPSTREAM: usb: dwc3: core: get rid of DWC3_PM_OPS macro

that macro is unnecessary and just adds pointless
obfuscation. Let's remove it.

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

8 years agoUPSTREAM: usb: dwc3: gadget: fix gadget suspend/resume
Felipe Balbi [Wed, 4 May 2016 12:50:27 +0000 (15:50 +0300)]
UPSTREAM: usb: dwc3: gadget: fix gadget suspend/resume

Instead of trying hard to stay connected to the
host, it's best (and far easier) to disconnect from
the host already.

Anything relying on KEEP_CONNECT will just have that
ignored, but we don't have proper hibernation
implementation yet, so there are no regressions.

In any case, hibernation is only useful for runtime
PM, not system sleep.

While at that, also remove dwc3.dcfg which has been
rendered unnecessary.

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

8 years agoUPSTREAM: usb: dwc3: gadget: re-factor ->udc_start and ->udc_stop
Felipe Balbi [Wed, 4 May 2016 12:49:37 +0000 (15:49 +0300)]
UPSTREAM: usb: dwc3: gadget: re-factor ->udc_start and ->udc_stop

we will be re-using it for suspend/resume, so
instead of duplicating code, let's just re-factor
the functions so they can be re-used.

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

8 years agoUPSTREAM: usb: dwc3: Set the ClearPendIN bit on Clear Stall EP command
John Youn [Wed, 1 Jun 2016 00:49:56 +0000 (17:49 -0700)]
UPSTREAM: usb: dwc3: Set the ClearPendIN bit on Clear Stall EP command

As of core revision 2.60a the recommended programming model is to set
the ClearPendIN bit when issuing a Clear Stall EP command for IN
endpoints. This is to prevent an issue where some (non-compliant) hosts
may not send ACK TPs for pending IN transfers due to a mishandled error
condition. Synopsys STAR 9000614252.

Change-Id: Ic513ca50aa900fbfc64b8197a6311113630ce18a
Signed-off-by: John Youn <johnyoun@synopsys.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 50c763f8c1bac0dc00f7788a75f227276c0efd54)

8 years agoUPSTREAM: usb: dwc3: st: Fix USB_DR_MODE_PERIPHERAL configuration.
Peter Griffin [Wed, 11 May 2016 16:33:11 +0000 (17:33 +0100)]
UPSTREAM: usb: dwc3: st: Fix USB_DR_MODE_PERIPHERAL configuration.

Set USB3_FORCE_VBUSVALID when configured for USB_DR_MODE_PERIPHERAL
mode, as it is required to have a working setup.

This worked on the internal driver by relying on the reset
value of the syscfg register as the bits aren't explicity cleared
and set like the upstream driver.

Also add a comment about what setting this bit means.

Change-Id: Ibd3a18b3a85b53dcf8471a1231b502185641c010
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit 27a0faafdca53bda21ed340ca8f8960696dda049)

8 years agoUPSTREAM: usb: dwc3: gadget: fix mask and shift order in DWC3_DCFG_NUMP()
Dan Carpenter [Tue, 3 May 2016 07:49:00 +0000 (10:49 +0300)]
UPSTREAM: usb: dwc3: gadget: fix mask and shift order in DWC3_DCFG_NUMP()

In the original DWC3_DCFG_NUMP() was always zero.  It looks like the
intent was to shift first and then do the mask.

Change-Id: I290fe7bb82bbf7adf626fcb5ee2474fce60167bd
Fixes: 2a58f9c12bb3 ('usb: dwc3: gadget: disable automatic calculation of ACK TP NUMP')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit 973986126a4152ab83d09263a02bf7d2d1bf3b6e)

8 years agoUPSTREAM: usb: dwc3: gadget: disable automatic calculation of ACK TP NUMP
Felipe Balbi [Thu, 28 Apr 2016 07:56:28 +0000 (10:56 +0300)]
UPSTREAM: usb: dwc3: gadget: disable automatic calculation of ACK TP NUMP

Now that we calculate DCFG.NUMP, we can disable
dwc3's automatic calculation so we maximize our
chances of very high throughtput through the use of
bursts.

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

8 years agoUPSTREAM: usb: dwc3: gadget: update DCFG.NumP to max burst size
Felipe Balbi [Tue, 26 Apr 2016 07:49:07 +0000 (10:49 +0300)]
UPSTREAM: usb: dwc3: gadget: update DCFG.NumP to max burst size

NumP field of DCFG register is used on NumP field of
ACK TP header and it tells the host how many packets
an endpoint can receive before waiting for
synchronization.

Documentation says it should be set to anything
<=bMaxBurst. Interestingly, however, this setting is
not per-endpoint how it should be (different
endpoints could have different burst sizes), but
things seem to work okay right now.

Change-Id: I2fd8e68f88b15e64fc06770ffdc6376fcb4cff62
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
(cherry picked from commit 676e3497448177bdb1934cbc4402f921730a5864)

Conflicts:
drivers/usb/dwc3/gadget.c

8 years agoUPSTREAM: usb: dwc3: gadget: give better command return code
Konrad Leszczynski [Fri, 12 Feb 2016 15:21:46 +0000 (15:21 +0000)]
UPSTREAM: usb: dwc3: gadget: give better command return code

if Start Transfer command fails, let's try a little
harder to figure out why the command failed and give
slightly better return codes. This will be usefulf
or isochronous endpoints, at least, which could
decide to retry a given request.

Change-Id: Id3ce609ba9149235dc8c9203798dc19cb2fae4bd
Signed-off-by: Konrad Leszczynski <konrad.leszczynski@intel.com>
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@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 7b9cc7a2b101cc73f6abe3468441381c98817e54)

8 years agoUPSTREAM: usb: dwc3: pci: pass the platform device as a parameter to dwc3_pci_quirks()
Heikki Krogerus [Fri, 22 Apr 2016 08:17:38 +0000 (11:17 +0300)]
UPSTREAM: usb: dwc3: pci: pass the platform device as a parameter to dwc3_pci_quirks()

For convenience, passing the dwc3 platform device as a
parameter to dwc3_pci_quirks() function.

Change-Id: Ibe81e416772780cf98c8606e84e9fbd558d88d52
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 ce046d323d74ee9d280688a2cb499716f555a89f)

8 years agoUPSTREAM: usb: dwc3: pci: make build-in device properties available
Heikki Krogerus [Fri, 22 Apr 2016 08:17:37 +0000 (11:17 +0300)]
UPSTREAM: usb: dwc3: pci: make build-in device properties available

Setting the ACPI companion before calling dwc3_pci_quirks.
The ACPI companion will be set unconditionally as the
primary fwnode, overriding any previously set primary
fwnode. This will make sure that any build-in properties
added to the platform device will be added as the secondary
fwnode in cases where also ACPI companion exists.

Change-Id: Ib1a5ff15cc644f8c42e6dccf7c5cf0368857e9c8
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 474799f073763b868e158b04b74f8ddd1da38da2)

8 years agoUPSTREAM: usb: dwc3: ep0: sanity check test mode selector
Fei Yang [Wed, 20 Apr 2016 06:08:43 +0000 (09:08 +0300)]
UPSTREAM: usb: dwc3: ep0: sanity check test mode selector

In case host sends us an unsupported test mode, we
*must* stall this request. This will tell the host
that the selector is invalid and we won't put the
controller in unsupported test modes which could
have undetermined side-effects.

Change-Id: Iaf6a0ae78864efa342a514fdd5e6fc7f2e94e314
Signed-off-by: Fei Yang <fei.yang@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 ae411413760785a0a2ce6cb44d5afe95115aa24d)

8 years agoUPSTREAM: usb: dwc3: debugfs: dump out endpoint details
Felipe Balbi [Thu, 14 Apr 2016 11:53:44 +0000 (14:53 +0300)]
UPSTREAM: usb: dwc3: debugfs: dump out endpoint details

There's a bunch of information in the debug register
set from dwc3 which is useful in some debugging
scenarios. Let's dump them out in endpoint-specific
directories and designated files.

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

8 years agoUPSTREAM: usb: dwc3: core: add helper to extract trb type
Felipe Balbi [Thu, 14 Apr 2016 13:05:54 +0000 (16:05 +0300)]
UPSTREAM: usb: dwc3: core: add helper to extract trb type

This helper will be used later to convert trb type
into a human-readable string for debugfs.

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

8 years agoUPSTREAM: usb: dwc3: core: add fifo space helper
Felipe Balbi [Thu, 14 Apr 2016 12:03:39 +0000 (15:03 +0300)]
UPSTREAM: usb: dwc3: core: add fifo space helper

this helper will be used, initially, to dump space
of different queues and fifos in dwc3 to
debugfs. Later, it'll be used to issue remote wakeup
when we want to start a transfer and there's
something in a TX FIFO.

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

8 years agoUPSTREAM: usb: dwc3: make dwc3_debugfs_init return value be void
Du, Changbin [Tue, 12 Apr 2016 11:10:18 +0000 (19:10 +0800)]
UPSTREAM: usb: dwc3: make dwc3_debugfs_init return value be void

Debugfs init failure is not so important. We can continue our job on
this failure. Also no break need for debugfs_create_file call failure.

Signed-off-by: Du, Changbin <changbin.du@intel.com>
[felipe.balbi@linux.intel.com :
- remove out-of-memory message, we get that from OOM.
- switch dev_err() to dev_dbg() ]

Change-Id: I73e5345b64c20e327d0b941e256c518e5c2b195e
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
(cherry picked from commit 4e9f311833a946e984c82086b21b128918f4a6a4)

Conflicts:
drivers/usb/dwc3/debugfs.c

8 years agoUPSTREAM: usb: dwc3: omap: get rid of dma_status
Roger Quadros [Mon, 11 Apr 2016 14:18:25 +0000 (17:18 +0300)]
UPSTREAM: usb: dwc3: omap: get rid of dma_status

dma_status bit flag is set but never really used
so get rid of it.

Change-Id: If11b9522e8592dbeebf1e5d8e9a1eaad43d65f7d
Reported-by: Felipe Balbi <balbi@kernel.org>
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 af566a0be6e49b946708532a6a7a7ae29ab83aed)

8 years agoUPSTREAM: usb: dwc3: gadget: don't interrupt when chained
Felipe Balbi [Wed, 6 Apr 2016 07:01:14 +0000 (10:01 +0300)]
UPSTREAM: usb: dwc3: gadget: don't interrupt when chained

It makes no sense to interrupt in the middle of
chained transfer. This patch just makes sure we
don't do that.

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

8 years agoUPSTREAM: usb: dwc3: gadget: remove newline from trace
Felipe Balbi [Tue, 5 Apr 2016 12:05:05 +0000 (15:05 +0300)]
UPSTREAM: usb: dwc3: gadget: remove newline from trace

trace already adds a newline character for us, we
don't need to do it ourselves.

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

8 years agoUPSTREAM: usb: dwc3: gadget: use link TRB for all endpoint types
Felipe Balbi [Tue, 5 Apr 2016 10:24:36 +0000 (13:24 +0300)]
UPSTREAM: usb: dwc3: gadget: use link TRB for all endpoint types

instead of limiting link TRB only to Isoc endpoints,
let's use it for all endpoint types, this way we are
more likely to transfer more data before a
XferComplete event.

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

8 years agoUPSTREAM: usb: dwc3: gadget: move % operation to increment helpers
Felipe Balbi [Tue, 5 Apr 2016 10:14:31 +0000 (13:14 +0300)]
UPSTREAM: usb: dwc3: gadget: move % operation to increment helpers

By moving our % DWC3_NUM_TRB operation to the
increment helpers, the rest of the driver can be
simplified.

It's also a good practice to make sure we will have
a single place dealing with details about how to
increment our enqueue and dequeue pointers.

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

8 years agoUPSTREAM: usb: dwc3: gadget: add trb enqueue/dequeue helpers
Felipe Balbi [Tue, 5 Apr 2016 10:09:51 +0000 (13:09 +0300)]
UPSTREAM: usb: dwc3: gadget: add trb enqueue/dequeue helpers

Add three little helpers which will aid in making
the code slightly easier to read. One helper
increments enqueue pointer, another increments
dequeue pointer and the last one tests if we're
dealing with the last TRB.

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

8 years agoUPSTREAM: usb: dwc3: get rid of DWC3_TRB_MASK
Felipe Balbi [Tue, 5 Apr 2016 09:47:15 +0000 (12:47 +0300)]
UPSTREAM: usb: dwc3: get rid of DWC3_TRB_MASK

instead of using a bitwise and, let's rely on the %
operator since that's a lot more clear. Also, GCC
will optimize % 256 to nothing anyway.

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

8 years agoUPSTREAM: usb: dwc3: switch trb enqueue/dequeue and first_trb_index to u8
Felipe Balbi [Tue, 5 Apr 2016 09:42:15 +0000 (12:42 +0300)]
UPSTREAM: usb: dwc3: switch trb enqueue/dequeue and first_trb_index to u8

We *know* that we have 1 PAGE (4096 bytes) for our
TRB poll. We also know the size of each TRB and know
that we can fit 256 of them in one PAGE. By using a
u8 type we can make sure that:

enqueue++ % 256;

gets optimized to an increment only.

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

8 years agoUPSTREAM: usb: dwc3: core: document struct dwc3_request
Felipe Balbi [Tue, 5 Apr 2016 08:33:30 +0000 (11:33 +0300)]
UPSTREAM: usb: dwc3: core: document struct dwc3_request

No functional changes. Merely adding useful
documentation for future readers.

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

8 years agoUPSTREAM: usb: dwc3: gadget: rename busy/free_slot to trb_enqueue/dequeue
Felipe Balbi [Mon, 4 Apr 2016 12:33:41 +0000 (15:33 +0300)]
UPSTREAM: usb: dwc3: gadget: rename busy/free_slot to trb_enqueue/dequeue

This makes it clear that we're dealing with a queue
of TRBs. No functional changes. While at that, also
rename start_slot to first_trb_index for similar
reasons.

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

8 years agoUPSTREAM: usb: dwc3: omap: drop dma_mask configuration
Grygorii Strashko [Tue, 5 Apr 2016 12:09:44 +0000 (15:09 +0300)]
UPSTREAM: usb: dwc3: omap: drop dma_mask configuration

The DWC3 OMAP driver 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-omap.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: I48f756ccc2d84b0e5eb4afc7b3789261d735600c
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 495dd5f78145c44274eeb8ec297195ac71a8fed0)

8 years agoUPSTREAM: usb: dwc3: add disable receiver detection in P3 quirk
Rajesh Bhagat [Mon, 14 Mar 2016 09:10:50 +0000 (14:40 +0530)]
UPSTREAM: usb: dwc3: add disable receiver detection in P3 quirk

Some freescale QorIQ platforms require to disable receiver detection
in P3 for correct detection of USB devices. If GUSB3PIPECTL(DISRXDETINP3)
is set, Core will change PHY power state to P2 and then perform receiver
detection. After receiver detection, Core will change PHY power state to
P3. Same quirk would be added in dts file in future patches.

Change-Id: Idf29b70a5c9815a87c96e2b7d8d724157f35d8da
Signed-off-by: Sriram Dash <sriram.dash@nxp.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.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 e58dd357741b93f5bc5487aabba968c76bb099ef)

8 years agoUPSTREAM: usb: dwc3: gadget: put link to U0 before Start Transfer
Felipe Balbi [Mon, 4 Apr 2016 09:46:33 +0000 (12:46 +0300)]
UPSTREAM: usb: dwc3: gadget: put link to U0 before Start Transfer

Synopsys Databook says we should move link to U0
before issuing a Start Transfer command. We could
require the gadget driver to call
usb_gadget_wakeup() however I feel that changing all
gadget drivers to keep track of Link State and
conditionally call usb_gadget_wakeup() would be far
too much work. For now we will handle this at the
UDC level, but at some point composite.c should be
one handling this.

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

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>