There is no need to init .owner field.
Based on the patch from Peter Griffin <[email protected]>
"mmc: remove .owner field for drivers using module_platform_driver"
This patch removes the superflous .owner field for drivers which
use the module_platform_driver API, as this is overriden in
platform_driver_register anyway."
Signed-off-by: Kiran Padwal <[email protected]>
Reviewed-by: Ivan T. Ivanov <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Use the recently introduced usb_gadget_giveback_request() in favor of
direct invocation of the completion routine.
All places in drivers/usb/ matching "[-.]complete(" were replaced with a
call to usb_gadget_giveback_request(). This was compile-tested with all
ARM drivers enabled and runtime-tested for musb.
Signed-off-by: Michal Sojka <[email protected]>
Acked-by: Felipe Balbi <[email protected]>
Tested-by: Felipe Balbi <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Linux 3.17-rc5
Signed-off-by: Felipe Balbi <[email protected]>
Conflicts:
Documentation/devicetree/bindings/usb/mxs-phy.txt
drivers/usb/phy/phy-mxs-usb.c
DWC3 glue layer is hardware layer around Synopsys DesignWare
USB3 core. Its purpose is to supply Synopsys IP with required
clocks, voltages and interface it with the rest of the SoC.
Signed-off-by: Ivan T. Ivanov <[email protected]>
Signed-off-by: Andy Gross <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Merge Linux 3.17-rc4 here so we have all the latest
fixes on next too. This also cleans up a few conflicts
when applying patches.
Signed-off-by: Felipe Balbi <[email protected]>
Conflicts:
drivers/usb/gadget/Makefile
drivers/usb/gadget/function/Makefile
drivers/usb/gadget/legacy/Makefile
drivers/usb/phy/phy-samsung-usb.h
This patch adds the ST glue logic to manage the DWC3 HC
on STiH407 SoC family. It manages the powerdown signal,
and configures the internal glue logic and syscfg registers.
[ [email protected] : actually switch over to of_platform_depopulate() ]
Signed-off-by: Giuseppe Cavallaro <[email protected]>
Signed-off-by: Peter Griffin <[email protected]>
Acked-by: Lee Jones <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
When we're debugging hard-to-reproduce and time-sensitive
use cases, printk() poses too much overhead. That's when
the kernel's tracing infrastructure comes into play.
This patch implements a few initial tracepoints for the
dwc3 driver. More traces can be added as necessary in order
to ease the task of debugging dwc3.
Reviewed-by: Paul Zimmerman <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Those functions are only using within debugging
messages, grouping them into debug.h makes sense.
While at that, also add missing multiple inclusion
guard.
Signed-off-by: Felipe Balbi <[email protected]>
After commit 2ec2a8be (usb: dwc3: gadget:
always enable IOC on bulk/interrupt transfers)
we created a situation where it was possible to
hang a bulk/interrupt endpoint if we had more
than one pending request in our queue and they
were both started with a single Start Transfer
command.
The problems triggers because we had not enabled
Transfer In Progress event for those endpoints
and we were not able to process early giveback
of requests completed without LST bit set.
Fix the problem by finally enabling Xfer In Progress
event for all endpoint types, except control.
Fixes: 2ec2a8be (usb: dwc3: gadget: always
enable IOC on bulk/interrupt transfers)
Cc: <[email protected]> # v3.14+
Reported-by: Pratyush Anand <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
we don't to gate clocks until our children are
done with their remove path.
Fixes: af310e9 (usb: dwc3: omap: use runtime API's to enable clocks)
Cc: <[email protected]> # v3.9+
Signed-off-by: Felipe Balbi <[email protected]>
We can't suspend the PHYs before dwc3_core_exit_mode()
has been called, that's because the host and/or device
sides might still need to communicate with the far end
link partner.
Fixes: 8ba007a (usb: dwc3: core: enable the USB2 and USB3 phy in probe)
Cc: <[email protected]> # v3.9+
Suggested-by: Alan Stern <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Currently, we disable pm_runtime before all register
accesses are done, this is dangerous and might lead
to abort exceptions due to the driver trying to access
a register which is clocked by a clock which was long
gated.
Fix that by moving pm_runtime_put_sync() and pm_runtime_disable()
as the last thing we do before returning from our ->remove()
method.
Fixes: 72246da (usb: Introduce DesignWare USB3 DRD Driver)
Cc: <[email protected]> # v3.2+
Signed-off-by: Felipe Balbi <[email protected]>
dep->endpoint.desc is checked at the beginning of
dwc3_gadget_ep_queue(), but after that it may be set to NULL
by another thread and then accessed again in dwc3_gadget_ep_queue().
This will lead to kernel oops.
Expand spinlock protection area to aviod race condition.
Signed-off-by: Zhuang Jin Can <[email protected]>
Signed-off-by: Jiebing Li <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message.
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
"ret" should be signed. It's only used for zero and negative error
codes.
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Felipe writes:
usb: patches for v3.17 merge window
Surprisingly enough, while a big set of patches, the majority is
composed of cleanups (using devm_*, fixing sparse errors, moving
code around, adding const, etc).
The highlights are addition of new support for PLX USB338x devices,
and support for USB 2.0-only configurations of the DWC3 IP core.
Signed-of-by: Felipe Balbi <[email protected]>
Move the extcon related code to its own function.
Improve code readability, decrease the dwc3_probe() size.
Signed-off-by: George Cherian <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Move find and set the utmi mode to its own separate function.
Improve code readability, decrease the dwc3_probe() size.
Signed-off-by: George Cherian <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Move map offset to its own separate function.
Improve code readability, decrease the dwc3_probe() size.
Signed-off-by: George Cherian <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Remove the x_major calculation logic from the wrapper revision register
to differentiate between OMAP5 and AM437x. This was done to find the
register offsets of wrapper register. Now that We do it using dt
compatible, remove the whole logic.
Signed-off-by: George Cherian <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Remove 'start_new' variable from dwc3_endpoint_transfer_complete(),
since this variable has not been used.
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
All dwc3 based xhci host controller supports USB3.0 LPM functionality.
Therefore enable it in platform data for all dwc3 based xhci device if
DWC3_HOST_USB3_LPM_ENABLE is selected in Kconfig.
Signed-off-by: Pratyush Anand <[email protected]>
Signed-off-by: Mathias Nyman <[email protected]>
Signed-of-by: Felipe Balbi <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Newer DWC3 controllers can be built for USB 2.0-only mode, where
most of the USB 3.0 circuitry is left out. To support this mode,
the driver must limit the speed programmed into the DCFG register
to Hi-Speed or lower.
Reads and writes to the PIPECTL register are left as-is, since
they should be no-ops in USB 2.0-only mode. Calls to phy_init()
etc. for the USB3 phy are also left as-is, since the no-op USB3
phy should be used for USB 2.0-only mode controllers.
Signed-off-by: Paul Zimmerman <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Putting together the code related to getting the 'IORESOURCE_MEM'
and assigning the same to dwc->xhci_resources, for increasing
the readability.
Signed-off-by: Vivek Gautam <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
The dwc3 wrapper driver should not be fiddling with the core interrupts.
Disabling the core interrupts in prepare stops xhci from proper operation.
So remove disable/enable of core interrupts from prepare/complete.
Signed-off-by: George Cherian <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
In ISOC transfers, when free_slot points to the last TRB (i.e. Link
TRB), and all queued requests meet Missed Interval Isoc error, busy_slot
points to trb0.
busy_slot->trb0
trb1
...
free_slot->trb31(Link TRB)
After end transfer and receiving the XferNotReady event, trb_left is
caculated as 1 which is wrong, and no TRB will be primed to the
endpoint.
The root cause is free_slot is not increased the same way as busy_slot.
When busy_slot is increased by one, it checks if points to a link TRB
after increasement, but free_slot checks it before increasement.
free_slot should behave the same as busy_slot to make the trb_left
caculation correct.
Reviewed-by: Pratyush Anand <[email protected]>
Signed-off-by: Zhuang Jin Can <[email protected]>
Signed-off-by: Jiebing Li <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Felipe writes:
usb: patches for v3.16 merge window
Not a lot here during this merge window. Mostly we just have
the usual miscellaneous patches (removal of unnecessary prints,
proper dependencies being added to Kconfig, build warning fixes,
new device ID, etc.
Other than those, the only important new features are the
new support for OS Strings which should help Linux Gadget
Drivers behave better under MS Windows. Also Babble Recovery
implementation for MUSB on AM335x. Lastly, we also have
ARCH_QCOM PHY support though phy-msm.
Signed-of-by: Felipe Balbi <[email protected]>
Conflicts:
drivers/usb/phy/phy-mv-u3d-usb.c
This fixes a bug when dwc3_pci_register_phys() fails and leaves device enabled.
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
First usage of ret variable will re-write initial value. Thus, there is no need
to initialize it.
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
this makes it slightly easier to read generic CMD
logs. It also helps make sure we're sending proper
parameters for each command.
Signed-off-by: Felipe Balbi <[email protected]>
Facilitate getting required 3.3V and 1.0V VDD supply for
DWC3 controller on Exynos.
With patches for regulators' nodes merged in 3.15:
c8c253f ARM: dts: Add regulator entries to smdk5420
275dcd2 ARM: dts: add max77686 pmic node for smdk5250,
certain perripherals will now need to ensure that,
they request VDD regulators in their drivers, and enable
them so as to make them working.
Signed-off-by: Vivek Gautam <[email protected]>
Cc: Anton Tikhomirov <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Glue layers for the DWC3 driver only make sense on specific platforms.
Add dependencies so that they are not built where they aren't needed.
Cc: Greg Kroah-Hartman <[email protected]>
Cc: WingMan Kwok <[email protected]>
Signed-off-by: Jean Delvare <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
now that all functions match the driver name,
the only missing piece is to rename the header
file itself.
Signed-off-by: Felipe Balbi <[email protected]>
no functional changes, just renaming the function
in order to make it slightly clearer what it should
be used for, also matching the driver name.
Signed-off-by: Felipe Balbi <[email protected]>
Move mode (Host, Peripheral, OTG) initialization
to its own function in order to decrease the size
of our probe() routine.
Signed-off-by: Felipe Balbi <[email protected]>
our probe() routine is too large and we can
easily refactor PHY-related code out to another
function to make it slightly less painful to read.
Signed-off-by: Felipe Balbi <[email protected]>
so it seems like DWC3 IP doesn't clear stalls
automatically when we disable an endpoint, because
of that, we _must_ make sure stalls are cleared
before clearing the proper bit in DALEPENA register.
Cc: <[email protected]> # v3.4+
Reported-by: Johannes Stezenbach <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Make dwc3_gadget_resize_tx_fifos() iterate only over IN
endpoints that are actually present, based on the
num_in_eps parameter. This terminates the loop so as to
prevent dereferencing a potential NULL dwc->eps[i] where
i >= (num_in_eps + num_out_eps).
Signed-off-by: Jack Pham <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Pull USB patches from Greg KH:
"Here's the big USB pull request for 3.15-rc1.
The normal set of patches, lots of controller driver updates, and a
smattering of individual USB driver updates as well.
All have been in linux-next for a while"
* tag 'usb-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (249 commits)
xhci: Transition maintainership to Mathias Nyman.
USB: disable reset-resume when USB_QUIRK_RESET is set
USB: unbind all interfaces before rebinding any
usb: phy: Add ulpi IDs for SMSC USB3320 and TI TUSB1210
usb: gadget: tcm_usb_gadget: stop format strings
usb: gadget: f_fs: add missing spinlock and mutex unlock
usb: gadget: composite: switch over to ERR_CAST()
usb: gadget: inode: switch over to memdup_user()
usb: gadget: f_subset: switch over to PTR_RET
usb: gadget: lpc32xx_udc: fix wrong clk_put() sequence
USB: keyspan: remove dead debugging code
USB: serial: add missing newlines to dev_<level> messages.
USB: serial: add missing braces
USB: serial: continue to write on errors
USB: serial: continue to read on errors
USB: serial: make bulk_out_size a lower limit
USB: cypress_m8: fix potential scheduling while atomic
devicetree: bindings: document lsi,zevio-usb
usb: chipidea: add support for USB OTG controller on LSI Zevio SoCs
usb: chipidea: imx: Use dev_name() for ci_hdrc name to distinguish USBs
...
This patch move simply OF helper function to extcon core and change function
name as following:
- of_extcon_get_extcon_dev() -> extcon_get_edev_by_phandle()
Signed-off-by: Chanwoo Choi <[email protected]>
Acked-by: Felipe Balbi <[email protected]>
We know what "value" is and it upsets static checkers that we appear to
have doubts about it.
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
These were cut and paste from the ->disconnect function.
Fixes commit 30d577b9bcc4 ('usb: dwc3: gadget: call gadget driver's
->suspend/->resume')
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Adapted dwc3 core to use the Generic PHY Framework. So for init, exit,
power_on and power_off the following APIs are used phy_init(), phy_exit(),
phy_power_on() and phy_power_off().
However using the old USB phy library wont be removed till the PHYs of all
other SoC's using dwc3 core is adapted to the Generic PHY Framework.
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Since PHYs for dwc3 is optional (not all SoCs having PHYs for DWC3
should be programmed), do not return from probe if the USB PHY library
returns -ENODEV as that indicates the platform does not have a
programmable PHY.
While this can be considered as a temporary fix, a long term solution
would be to add 'nop' PHY for platforms that does not have programmable
PHY.
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
Reviewed-by: Roger Quadros <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>