Gregory CLEMENT [Thu, 15 May 2014 10:17:33 +0000 (12:17 +0200)]
usb: host: xhci-plat: add support for the Armada 375/38x XHCI controllers
The Armada 375 and 38x SoCs come with an XHCI controller that requires
some specific initialization related to the MBus windows
configuration. This patch adds the support for this special
configuration as an XHCI quirk executed during probe.
Two new compatible strings are added to identify the Armada 375 and
Armada 38x XHCI controllers, and therefore enable the relevant quirk.
Gregory CLEMENT [Thu, 15 May 2014 10:17:32 +0000 (12:17 +0200)]
usb: host: xhci-plat: add clock support
Some platforms (such as the Armada 38x ones) can gate the clock of
their USB controller. This patch adds the support for one clock in
xhci-plat, by enabling it during probe and disabling it on remove.
To achieve this, it adds a 'struct clk *' member in xhci_hcd. While
only used for now in xhci-plat, it might be used by other drivers in
the future. Moreover, the xhci_hcd structure already holds other
members such as msix_count and msix_entries, which are MSI-X specific,
and therefore only used by xhci-pci.
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Felipe Balbi <balbi@ti.com> Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit updates the Device Tree binding documentation of
ehci-orion to take into account the fact that we can now optionally
pass a clock and a PHY reference.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gregory CLEMENT [Thu, 15 May 2014 10:17:29 +0000 (12:17 +0200)]
usb: ehci-orion: add optional PHY support
This commit extends the ehci-orion so that it can optionally be passed
a reference to a PHY through the Device Tree. It will be useful for
the Armada 375 SoCs. If no PHY is provided then the behavior of the
driver is unchanged.
[Thomas: use devm_phy_optional_get() so that we handle -EPROBE_DEFER
properly. Also call phy_power_off() when needed, and rename goto
labels.]
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gregory CLEMENT [Thu, 15 May 2014 10:17:28 +0000 (12:17 +0200)]
usb: ehci-orion: fix clock reference leaking
In order to disable the clock in the ->remove() function, a call to
devm_clk_get() is being made, which further increases the reference
count of the clock.
In order to clean this up, a private structure holding a pointer to
the clock is added using the override mechanism provided by the ehci
framework. This makes the driver clock handling much more logical.
The bug was introduced in v3.6, however the ehci framework allowing to
use the override mechanism has only been introduced in v3.8, so this
patch won't apply before it.
Thomas Petazzoni [Thu, 15 May 2014 10:17:27 +0000 (12:17 +0200)]
usb: ehci-orion: rename error goto labels in ehci_orion_drv_probe()
In preparation to the introduction of additional initialization steps
in ehci_orion_drv_probe(), we rename the error goto labels from err1,
err2 and err3 names to some more meaningful names.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Thomas Petazzoni [Thu, 15 May 2014 10:17:26 +0000 (12:17 +0200)]
usb: ehci-orion: use platform_get_irq() for DT probing
Commit 77dae54ab385033e488d8b07045bc7f8d931740f ('ARM: Kirkwood:
ehci-orion: Add device tree binding') added the Device Tree binding
for the ehci-orion driver. To achieve that with the irq, it used the
irq_of_parse_and_map() function when probed in DT-mode, and
platform_get_irq() when probed in non-DT mode.
This is not necessary: platform_get_irq() works just as fine in
DT-mode, since the conversion from DT information to 'struct resource'
is done by the generic layers of the kernel.
Therefore, this commit switches back to use just platform_get_irq().
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Peter Chen [Tue, 29 Apr 2014 00:35:58 +0000 (08:35 +0800)]
usb: move usb/usb-common.c to usb/common/usb-common.c
Since we will have more usb-common things, and it will let
usb-common.c be larger and larger, we create a folder named usb/common
for all usb common things.
Cc: Felipe Balbi <balbi@ti.com> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Mon, 26 May 2014 17:23:50 +0000 (19:23 +0200)]
USB: cdc-acm: remove redundant usb_mark_last_busy
There's no need to call usb_mark_last_busy after having increased the PM
counter in write(). The device will be marked busy by USB core when the
PM counter is balanced in the completion handler.
Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Mon, 26 May 2014 17:23:48 +0000 (19:23 +0200)]
USB: cdc-acm: minimise no-suspend window during shutdown
Now that acm_set_control() handles runtime PM properly, the only
remaining reason for the PM operations in shutdown is to clear the
needs_remote_wakeup flag before the final put.
Note that this also means that we now need to grab the write_lock to
prevent racing with resume.
Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Mon, 26 May 2014 17:23:43 +0000 (19:23 +0200)]
USB: cdc-acm: fix failed open not being detected
Fix errors during open not being returned to userspace. Specifically,
failed control-line manipulations or control or read urb submissions
would not be detected.
Johan Hovold [Mon, 26 May 2014 17:23:40 +0000 (19:23 +0200)]
USB: cdc-acm: fix shutdown and suspend race
We should stop I/O unconditionally at suspend rather than rely on the
tty-port initialised flag (which is set prior to stopping I/O during
shutdown) in order to prevent suspend returning with URBs still active.
Fixes: 11ea859d64b6 ("USB: additional power savings for cdc-acm devices
that support remote wakeup")
Johan Hovold [Mon, 26 May 2014 17:23:38 +0000 (19:23 +0200)]
USB: cdc-acm: fix broken runtime suspend
The current ACM runtime-suspend implementation is broken in several
ways:
Firstly, it buffers only the first write request being made while
suspended -- any further writes are silently dropped.
Secondly, writes being dropped also leak write urbs, which are never
reclaimed (until the device is unbound).
Thirdly, even the single buffered write is not cleared at shutdown
(which may happen before the device is resumed), something which can
lead to another urb leak as well as a PM usage-counter leak.
Fix this by implementing a delayed-write queue using urb anchors and
making sure to discard the queue properly at shutdown.
Fixes: 11ea859d64b6 ("USB: additional power savings for cdc-acm devices
that support remote wakeup")
Reported-by: Xiao Jin <jin.xiao@intel.com> Cc: <stable@vger.kernel.org> # v2.6.27 Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Mon, 26 May 2014 17:23:37 +0000 (19:23 +0200)]
USB: cdc-acm: fix write and resume race
Fix race between write() and resume() due to improper locking that could
lead to writes being reordered.
Resume must be done atomically and susp_count be protected by the
write_lock in order to prevent racing with write(). This could otherwise
lead to writes being reordered if write() grabs the write_lock after
susp_count is decremented, but before the delayed urb is submitted.
Fixes: 11ea859d64b6 ("USB: additional power savings for cdc-acm devices
that support remote wakeup")
Johan Hovold [Mon, 26 May 2014 17:23:36 +0000 (19:23 +0200)]
USB: cdc-acm: fix write and suspend race
Fix race between write() and suspend() which could lead to writes being
dropped (or I/O while suspended) if the device is runtime suspended
while a write request is being processed.
Specifically, suspend() releases the write_lock after determining the
device is idle but before incrementing the susp_count, thus leaving a
window where a concurrent write() can submit an urb.
Fixes: 11ea859d64b6 ("USB: additional power savings for cdc-acm devices
that support remote wakeup")
Johan Hovold [Mon, 26 May 2014 17:23:33 +0000 (19:23 +0200)]
USB: serial: fix potential runtime pm imbalance at device remove
Only call usb_autopm_put_interface() if the corresponding
usb_autopm_get_interface() was successful.
This prevents a potential runtime PM counter imbalance should
usb_autopm_get_interface() fail. Note that the USB PM usage counter is
reset when the interface is unbound, but that the runtime PM counter may
be left unbalanced.
Also add comment on why we don't need to worry about racing
resume/suspend on autopm_get failures.
Fixes: d5fd650cfc7f ("usb: serial: prevent suspend/resume from racing
against probe/remove")
Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Mon, 26 May 2014 17:23:32 +0000 (19:23 +0200)]
USB: usb_wwan: do not resume I/O on closing ports
Use tty-port initialised flag rather than private flag to determine when
port is closing down.
Since the tty-port flag is set prior to dropping DTR/RTS (when HUPCL is
set) this avoid submitting the read urbs when resuming the interface in
dtr_rts() only to immediately kill them again in shutdown().
Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Mon, 26 May 2014 17:23:24 +0000 (19:23 +0200)]
USB: usb_wwan: kill interrupt urb explicitly at suspend
As the port interrupt URB is submitted by the subdriver at open, we
should also kill it explicitly at suspend (even though this will be
taken care of by USB serial core otherwise).
Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Mon, 26 May 2014 17:23:20 +0000 (19:23 +0200)]
USB: usb_wwan: fix remote wakeup
Make sure that needs_remote_wake up is always set when there are open
ports.
Currently close() would unconditionally set needs_remote_wakeup to 0
even though there might still be open ports. This could lead to blocked
input and possibly dropped data on devices that do not support remote
wakeup (and which must therefore not be runtime suspended while open).
Add an open_ports counter (protected by the susp_lock) and only clear
needs_remote_wakeup when the last port is closed.
Note that there are currently no multi-port drivers using the usb_wwan
implementation.
Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Mon, 26 May 2014 17:23:18 +0000 (19:23 +0200)]
USB: usb_wwan: fix potential blocked I/O after resume
Keep trying to submit urbs rather than bail out on first read-urb
submission error, which would also prevent I/O for any further ports
from being resumed.
Instead keep an error count, for all types of failed submissions, and
let USB core know that something went wrong.
Also make sure to always clear the suspended flag. Currently a failed
read-urb submission would prevent cached writes as well as any
subsequent writes from being submitted until next suspend-resume cycle,
something which may not even necessarily happen.
Note that USB core currently only logs an error if an interface resume
failed.
Fixes: 383cedc3bb43 ("USB: serial: full autosuspend support for the
option driver")
Johan Hovold [Mon, 26 May 2014 17:23:17 +0000 (19:23 +0200)]
USB: usb_wwan: fix potential NULL-deref at resume
The interrupt urb was submitted unconditionally at resume, something
which could lead to a NULL-pointer dereference in the urb completion
handler as resume may be called after the port and port data is gone.
Fix this by making sure the interrupt urb is only submitted and active
when the port is open.
Fixes: 383cedc3bb43 ("USB: serial: full autosuspend support for the
option driver")
Johan Hovold [Mon, 26 May 2014 17:23:16 +0000 (19:23 +0200)]
USB: usb_wwan: fix urb leak at shutdown
The delayed-write queue was never emptied at shutdown (close), something
which could lead to leaked urbs if the port is closed before being
runtime resumed due to a write.
When this happens the output buffer would not drain on close
(closing_wait timeout), and after consecutive opens, writes could be
corrupted with previously buffered data, transfered with reduced
throughput or completely blocked.
Note that unbusy_queued_urb() was simply moved out of CONFIG_PM.
Fixes: 383cedc3bb43 ("USB: serial: full autosuspend support for the
option driver")
Johan Hovold [Mon, 26 May 2014 17:23:15 +0000 (19:23 +0200)]
USB: usb_wwan: fix write and suspend race
Fix race between write() and suspend() which could lead to writes being
dropped (or I/O while suspended) if the device is runtime suspended
while a write request is being processed.
Specifically, suspend() releases the susp_lock after determining the
device is idle but before setting the suspended flag, thus leaving a
window where a concurrent write() can submit an urb.
Fixes: 383cedc3bb43 ("USB: serial: full autosuspend support for the
option driver")
xiao jin [Mon, 26 May 2014 17:23:14 +0000 (19:23 +0200)]
USB: usb_wwan: fix race between write and resume
We find a race between write and resume. usb_wwan_resume run play_delayed()
and spin_unlock, but intfdata->suspended still is not set to zero.
At this time usb_wwan_write is called and anchor the urb to delay
list. Then resume keep running but the delayed urb have no chance
to be commit until next resume. If the time of next resume is far
away, tty will be blocked in tty_wait_until_sent during time. The
race also can lead to writes being reordered.
This patch put play_Delayed and intfdata->suspended together in the
spinlock, it's to avoid the write race during resume.
Fixes: 383cedc3bb43 ("USB: serial: full autosuspend support for the
option driver")
Signed-off-by: xiao jin <jin.xiao@intel.com> Signed-off-by: Zhang, Qi1 <qi1.zhang@intel.com> Reviewed-by: David Cohen <david.a.cohen@linux.intel.com> Cc: <stable@vger.kernel.org> # v2.6.32 Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
xiao jin [Mon, 26 May 2014 17:23:13 +0000 (19:23 +0200)]
USB: usb_wwan: fix urb leak in write error path
When enable usb serial for modem data, sometimes the tty is blocked
in tty_wait_until_sent because portdata->out_busy always is set and
have no chance to be cleared.
We find a bug in write error path. usb_wwan_write set portdata->out_busy
firstly, then try autopm async with error. No out urb submit and no
usb_wwan_outdat_callback to this write, portdata->out_busy can't be
cleared.
This patch clear portdata->out_busy if usb_wwan_write try autopm async
with error.
Fixes: 383cedc3bb43 ("USB: serial: full autosuspend support for the
option driver")
Signed-off-by: xiao jin <jin.xiao@intel.com> Signed-off-by: Zhang, Qi1 <qi1.zhang@intel.com> Reviewed-by: David Cohen <david.a.cohen@linux.intel.com> Cc: <stable@vger.kernel.org> # v2.6.32 Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Mon, 26 May 2014 17:23:09 +0000 (19:23 +0200)]
USB: sierra: do not resume I/O on closing ports
Use tty-port initialised flag rather than private flag to determine when
port is closing down.
Since the tty-port flag is set prior to dropping DTR/RTS (when HUPCL is
set) this avoid submitting the read urbs when resuming the interface in
dtr_rts() only to immediately kill them again in shutdown().
Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Mon, 26 May 2014 17:23:08 +0000 (19:23 +0200)]
USB: sierra: minimise no-suspend window during close
Move usb_autopm_get_interface_no_resume to the end of close(). This
makes the window during which suspend is prevented before the final put
in USB serial core slightly smaller.
Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The tty-port implementation has already made sure that DTR/RTS have been
raised and lowered by calling dtr_rts so remove the redundant calls from
open and close.
Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Mon, 26 May 2014 17:23:03 +0000 (19:23 +0200)]
USB: sierra: do not resume I/O on closed ports
Do not resume any I/O, including the delayed write queue, on closed
ports.
Note that this currently has no functional impact due to the
usb_autopm_get_interface() in close(), but that call is about to be
removed by a follow-up patch.
Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Mon, 26 May 2014 17:23:02 +0000 (19:23 +0200)]
USB: sierra: remove disconnected test from close
Remove no longer needed disconnected test from close, which is never
called post disconnect (and drivers must handle failed I/O during
disconnect anyway).
Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Mon, 26 May 2014 17:22:55 +0000 (19:22 +0200)]
USB: sierra: fix characters being dropped at close
Fix characters potentially being dropped at close due to missing
chars_in_buffer implementation.
Note that currently the write urbs are not even killed at close (will be
fixed separately), but this could still lead to dropped data since we
have lowered DTR/RTS.
Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Mon, 26 May 2014 17:22:54 +0000 (19:22 +0200)]
USB: sierra: fix remote wakeup
Make sure that needs_remote_wake up is always set when there are open
ports.
Currently close() would unconditionally set needs_remote_wakeup to 0
even though there might still be open ports. This could lead to blocked
input and possibly dropped data on devices that do not support remote
wakeup (and which must therefore not be runtime suspended while open).
Add an open_ports counter (protected by the susp_lock) and only clear
needs_remote_wakeup when the last port is closed.
Fixes: e6929a9020ac ("USB: support for autosuspend in sierra while
online")
Johan Hovold [Mon, 26 May 2014 17:22:53 +0000 (19:22 +0200)]
USB: sierra: fix urb and memory leak on disconnect
The delayed-write queue was never emptied on disconnect, something which
would lead to leaked urbs and transfer buffers if the device is
disconnected before being runtime resumed due to a write.
Fixes: e6929a9020ac ("USB: support for autosuspend in sierra while
online")
Johan Hovold [Mon, 26 May 2014 17:22:52 +0000 (19:22 +0200)]
USB: sierra: fix urb and memory leak in resume error path
Neither the transfer buffer or the urb itself were released in the
resume error path for delayed writes. Also on errors, the remainder of
the queue was not even processed, which leads to further urb and buffer
leaks.
The same error path also failed to balance the outstanding-urb counter,
something which results in degraded throughput or completely blocked
writes.
Fix this by releasing urb and buffer and balancing counters on errors,
and by always processing the whole queue even when submission of one urb
fails.
Fixes: e6929a9020ac ("USB: support for autosuspend in sierra while
online")
Johan Hovold [Mon, 26 May 2014 17:22:51 +0000 (19:22 +0200)]
USB: sierra: fix use after free at suspend/resume
Fix use after free or NULL-pointer dereference during suspend and
resume.
The port data may never have been allocated (port probe failed)
or may already have been released by port_remove (e.g. driver is
unloaded) when suspend and resume are called.
Fixes: e6929a9020ac ("USB: support for autosuspend in sierra while
online")
Joe Perches [Tue, 20 May 2014 20:09:33 +0000 (13:09 -0700)]
USB: iowarrior: Convert local dbg macro to dev_dbg
Use a more standard logging style.
Add terminating newlines to formats.
Remove __func__ as that can be added via dynamic debug.
Remove now unnecessary debug module parameter.
Remove the dbg macro too.
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Matching on interface numbers was not such a good idea
for multi-function serial devices after all. It is much
better do create well defined device layouts, allowing
a single match entry per device.
usb: qcserial: define and use Sierra Wireless layout
All the "non Gobi" Qualcomm based devices handled by this
driver share a common standard Sierra Wireless specific
layout. Adding code specifically for this layout allow
us to reduce the number of match entries per device from
three to one.
This change will result in a penalty wrt stable backports,
but simplifies new Sierra device addtitions in the long
term.
Preparing for more supported standard device layouts. Keeping
the matching macros unchanged to avoid breaking stable
backporting of new device additions.
Thomas Pugliese [Fri, 25 Apr 2014 15:30:32 +0000 (10:30 -0500)]
uwb: fix channel change failure
Make the transition to the UWB_RSV_STATE_NONE state synchronous so that
there is not a race between uwb_rsv_terminate and uwb_rsv_establish.
uwb_rsv_terminate would set the rsv->state to UWB_RSV_STATE_NONE but did
not release the stream resource until a 320ms timeout had expired. If a
user called uwb_rsv_establish during that time, it could fail to
establish the reservation because no stream resources were available.
This patch removes the timer from the uwb_rsv_terminate process since it
is not needed when transitioning to UWB_RSV_STATE_NONE.
Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vivek Gautam [Sat, 10 May 2014 12:00:10 +0000 (17:30 +0530)]
usb: host: ohci-exynos: Use devm_ioremap_resource instead of devm_ioremap
Using devm_ioremap_resource() API should actually be preferred over
devm_ioremap(), since the former request the mem region first and then
gives back the ioremap'ed memory pointer.
devm_ioremap_resource() calls request_mem_region(), therby preventing
other drivers to make any overlapping call to the same region.
Vivek Gautam [Sat, 10 May 2014 12:00:09 +0000 (17:30 +0530)]
usb: host: ehci-tegra: Use devm_ioremap_resource instead of devm_ioremap
Using devm_ioremap_resource() API should actually be preferred over
devm_ioremap(), since the former request the mem region first and then
gives back the ioremap'ed memory pointer.
devm_ioremap_resource() calls request_mem_region(), therby preventing
other drivers to make any overlapping call to the same region.
Vivek Gautam [Sat, 10 May 2014 12:00:08 +0000 (17:30 +0530)]
usb: host: ehci-spear: Use devm_ioremap_resource instead of devm_ioremap
Using devm_ioremap_resource() API should actually be preferred over
devm_ioremap(), since the former request the mem region first and then
gives back the ioremap'ed memory pointer.
devm_ioremap_resource() calls request_mem_region(), therby preventing
other drivers to make any overlapping call to the same region.
Vivek Gautam [Sat, 10 May 2014 12:00:07 +0000 (17:30 +0530)]
usb: host: ehci-mv: Use devm_ioremap_resource instead of devm_ioremap
Using devm_ioremap_resource() API should actually be preferred over
devm_ioremap(), since the former request the mem region first and then
gives back the ioremap'ed memory pointer.
devm_ioremap_resource() calls request_mem_region(), therby preventing
other drivers to make any overlapping call to the same region.
Vivek Gautam [Sat, 10 May 2014 12:00:06 +0000 (17:30 +0530)]
usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap
Using devm_ioremap_resource() API should actually be preferred over
devm_ioremap(), since the former request the mem region first and then
gives back the ioremap'ed memory pointer.
devm_ioremap_resource() calls request_mem_region(), therby preventing
other drivers to make any overlapping call to the same region.
Vivek Gautam [Sat, 10 May 2014 12:00:05 +0000 (17:30 +0530)]
usb: host: ehci-exynos: Use devm_ioremap_resource instead of devm_ioremap
Using devm_ioremap_resource() API should actually be preferred over
devm_ioremap(), since the former request the mem region first and then
gives back the ioremap'ed memory pointer.
devm_ioremap_resource() calls request_mem_region(), therby preventing
other drivers to make any overlapping call to the same region.
Kamil Debski [Mon, 5 May 2014 05:02:28 +0000 (10:32 +0530)]
usb: ehci-exynos: Change to use phy provided by the generic phy framework
Add the phy provider, supplied by new Exynos-usb2phy using
Generic phy framework.
Keeping the support for older USB phy intact right now, in order
to prevent any functionality break in absence of relevant
device tree side change for ehci-exynos.
Once we move to new phy in the device nodes for ehci, we can
remove the support for older phys.
Signed-off-by: Kamil Debski <k.debski@samsung.com>
[gautam.vivek@samsung.com: Addressed review comments from mailing list]
[gautam.vivek@samsung.com: Kept the code for old usb-phy, and just
added support for new exynos5-usb2phy in generic phy framework]
[gautam.vivek@samsung.com: Edited the commit message] Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Cc: Jingoo Han <jg1.han@samsung.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vivek Gautam [Mon, 5 May 2014 05:02:57 +0000 (10:32 +0530)]
usb: ohci-exynos: Add facility to use phy provided by the generic phy framework
Add support to consume phy provided by Generic phy framework.
Keeping the support for older usb-phy intact right now, in order
to prevent any functionality break in absence of relevant
device tree side change for ohci-exynos.
Once we move to new phy in the device nodes for ohci, we can
remove the support for older phys.
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Cc: Jingoo Han <jg1.han@samsung.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>