Re: [PATCH v6] r8152: Add support for setting pass through MAC address on RTL8153-AD

2016-06-10 Thread David Miller
From: Mario Limonciello Date: Tue, 7 Jun 2016 13:22:37 -0500 > The RTL8153-AD supports a persistent system specific MAC address. > This means a device plugged into two different systems with host side > support will show different (but persistent) MAC addresses. > >

Re: Multiple chatty devices on Intel 5 Series/3400 USB2 EHCI controller act erratic

2016-06-10 Thread Alan Stern
On Fri, 10 Jun 2016, Alan Stern wrote: > On Fri, 10 Jun 2016, Sean M. Pappalardo wrote: > > > > > > > On 06/10/2016 11:06 AM, Alan Stern wrote: > > > Have you tried plugging the audio > > > devices into a USB-2 hub and plugging the hub into bus 2? > > > > That works!! (I forgot, my monitor

Re: Multiple chatty devices on Intel 5 Series/3400 USB2 EHCI controller act erratic

2016-06-10 Thread Alan Stern
On Fri, 10 Jun 2016, Sean M. Pappalardo wrote: > > > On 06/10/2016 11:06 AM, Alan Stern wrote: > > Have you tried plugging the audio > > devices into a USB-2 hub and plugging the hub into bus 2? > > That works!! (I forgot, my monitor has a built-in 2-port USB2.0 hub.) Great! > So what's

Re: Multiple chatty devices on Intel 5 Series/3400 USB2 EHCI controller act erratic

2016-06-10 Thread Sean M. Pappalardo
On 06/10/2016 11:06 AM, Alan Stern wrote: > Have you tried plugging the audio > devices into a USB-2 hub and plugging the hub into bus 2? That works!! (I forgot, my monitor has a built-in 2-port USB2.0 hub.) So what's going on here? How does adding another hub layer help?? Sincerely, Sean M.

Re: Multiple chatty devices on Intel 5 Series/3400 USB2 EHCI controller act erratic

2016-06-10 Thread Sean M. Pappalardo
On 06/10/2016 11:06 AM, Alan Stern wrote: > I suppose it might have something to do with the fact that the docking > station contains its own hub. Have you tried plugging the audio > devices into a USB-2 hub and plugging the hub into bus 2? No, but I can go buy one and try that. > That sort

Re: Re: Re: Re: Re: [PATCH] usb: core: fix a double free in the usb driver

2016-06-10 Thread Alan Stern
Felipe: Can you check the reasoning here? I don't understand how an OTG event could cause dwc3 to remove the shared (SuperSpeed) hcd and then re-instantiate it before removing the primary (HS-FS-LS) hcd, which is what this diagram seems to show. On Wed, 8 Jun 2016, Chung-Geol Kim wrote: >

[PATCH v4 3/4] phy-sun4i-usb: Add workaround for missing Vbus det interrupts on A31

2016-06-10 Thread Hans de Goede
The A31 companion pmic (axp221) does not generate vbus change interrupts when the board is driving vbus, so we must poll when using the pmic for vbus-det _and_ we're driving vbus. Signed-off-by: Hans de Goede --- Changes in v2: -No changes Changes in v3: -No changes Changes

[PATCH v4 2/4] phy-sun4i-usb: Add support for peripheral-only mode

2016-06-10 Thread Hans de Goede
Use the new of_usb_get_dr_mode_by_phy() function to get the dr_mode from the musb controller node instead of assuming that having an id_det gpio means otg mode, and not having one means host mode. Implement peripheral-only mode by adding a sun4i_usb_phy0_get_id_det helper which looks at the

[PATCH v4 0/4] usb: musb: sunxi: Fixes + peripheral-only mode

2016-06-10 Thread Hans de Goede
Hi All, Here is v4 of my patch-set with a couple of fixed and peripheral-only mode for the sunxi musb / otg-phy code. The first patch changes a generic usb helper function, the next 2 patches are phy patches and the last patch is a musb patch. And all 4 patches depend on eachother. As such I

[PATCH v4 4/4] usb: musb: sunxi: Simplify dr_mode handling

2016-06-10 Thread Hans de Goede
phy-sun4i-usb now has proper dr_mode handling, it always registers an extcon, and sends a notify with the mode (even when in peripheral- / host-only mode) at least once. So we can simply the sunxi musb glue by always registering its extcon notifier and relying on sunxi_musb_work() to enable vbus

[PATCH v4 1/4] USB: Fix of_usb_get_dr_mode_by_phy with a shared phy block

2016-06-10 Thread Hans de Goede
Some SoCs have a single phy-hw-block with multiple phys, this is modelled by a single phy dts node, so we end up with multiple controller nodes with a phys property pointing to the phy-node of the otg-phy. Only one of these controllers typically is an otg controller, yet we were checking the

Re: [RFC v4 01/14] regulator: of: Add helper for getting all supplies

2016-06-10 Thread Heiko Stübner
Am Freitag, 10. Juni 2016, 12:30:56 schrieb Rob Herring: > On Thu, Jun 09, 2016 at 01:42:02PM +0200, Krzysztof Kozlowski wrote: > > On 06/09/2016 12:29 PM, Mark Brown wrote: > > > On Thu, Jun 09, 2016 at 11:44:18AM +0200, Krzysztof Kozlowski wrote: > > >> Few drivers have a need of getting

[PATCH] USB: remove race condition in usbfs/libusb when using reap-after-disconnect

2016-06-10 Thread Alan Stern
Hans de Goede has reported a difficulty in the Linux port of libusb. When a device is removed, the poll() system call in usbfs starts returning POLLERR as soon as udev->state is set to USB_STATE_NOTATTACHED, but the outstanding URBs are not available for reaping until some time later (after

Re: [PATCH v4] USB: Fix of_usb_get_dr_mode_by_phy with a shared phy block

2016-06-10 Thread Bin Liu
Hi, On Fri, Jun 10, 2016 at 08:27:03PM +0200, Hans de Goede wrote: > Hi, > > On 10-06-16 17:00, Bin Liu wrote: > >Hi, > > > >On Fri, Jun 10, 2016 at 11:46:25AM +0200, Hans de Goede wrote: > >>Some SoCs have a single phy-hw-block with multiple phys, this is > >>modelled by a single phy dts node,

Re: [PATCH v4] USB: Fix of_usb_get_dr_mode_by_phy with a shared phy block

2016-06-10 Thread Hans de Goede
Hi, On 10-06-16 17:00, Bin Liu wrote: Hi, On Fri, Jun 10, 2016 at 11:46:25AM +0200, Hans de Goede wrote: Some SoCs have a single phy-hw-block with multiple phys, this is modelled by a single phy dts node, so we end up with multiple controller nodes with a phys property pointing to the

Re: Multiple chatty devices on Intel 5 Series/3400 USB2 EHCI controller act erratic

2016-06-10 Thread Alan Stern
On Fri, 10 Jun 2016, Sean M. Pappalardo wrote: > Hello. > > I have a longstanding issue with multiple chatty USB devices on USB bus > 02 acting erratic when activated simultaneously. As soon as the second > device is closed, the first continues communication normally. The > problem does NOT

Re: [PATCH] USB: OHCI: Don't mark EDs as ED_OPER if scheduling fails

2016-06-10 Thread Alan Stern
On Wed, 8 Jun 2016, Michał Pecio wrote: > > The best way to protect against this is to call INIT_LIST_HEAD in > > ed_alloc() and list_del_init() in finish_unlinks(). > > This means silently sweeping a whole class of bugs under the rug. > I wouldn't want to have this in mainline. And as for

Re: Nokia N900: musb is in wrong state after boot

2016-06-10 Thread Bin Liu
Hi, On Fri, Jun 10, 2016 at 06:15:26PM +0200, joerg Reisenweber wrote: > On Fri 10 June 2016 10:59:40 Bin Liu wrote: > > The musb ug says the testmde is not used in normal operation, so my > > opinion is force_host should not be used for hacking n900 host mode if > > this is for real product

Multiple chatty devices on Intel 5 Series/3400 USB2 EHCI controller act erratic

2016-06-10 Thread Sean M. Pappalardo
Hello. I have a longstanding issue with multiple chatty USB devices on USB bus 02 acting erratic when activated simultaneously. As soon as the second device is closed, the first continues communication normally. The problem does NOT occur on Bus 01 (which has many other devices attached as well.)

Re: [RFC v4 01/14] regulator: of: Add helper for getting all supplies

2016-06-10 Thread Rob Herring
On Thu, Jun 09, 2016 at 01:42:02PM +0200, Krzysztof Kozlowski wrote: > On 06/09/2016 12:29 PM, Mark Brown wrote: > > On Thu, Jun 09, 2016 at 11:44:18AM +0200, Krzysztof Kozlowski wrote: > >> Few drivers have a need of getting regulator supplies without knowing > >> their names: > >> 1. The Simple

Re: Nokia N900: musb is in wrong state after boot

2016-06-10 Thread joerg Reisenweber
On Fri 10 June 2016 12:04:43 Nishanth Menon wrote: > I think there was some unfortunately choice of words used in the > thread. It is TI intention to support community effort [...] > software, unfortunately these modes do not tend to be well tested and > the typical "official disclaimer" is "Not

Re: Nokia N900: musb is in wrong state after boot

2016-06-10 Thread Nishanth Menon
On 06/10/2016 11:15 AM, joerg Reisenweber wrote: Sorry for butting in... > On Fri 10 June 2016 10:59:40 Bin Liu wrote: >> The musb ug says the testmde is not used in normal operation, so my >> opinion is force_host should not be used for hacking n900 host mode if >> this is for real product

[PATCH v2 2/2] i2c: ti-smusbdig: add TI SM-USB-DIG I2C bus driver

2016-06-10 Thread Andrew F. Davis
Add support for the I2C bus functionality of the TI SM-USB-DIG. Signed-off-by: Andrew F. Davis --- drivers/i2c/busses/Kconfig | 10 ++ drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-ti-smusbdig.c | 189 +++ 3 files

[PATCH v2 1/2] mfd: ti-smusbdig: Add support for the TI SM-USB-DIG

2016-06-10 Thread Andrew F. Davis
The TI SM-USB-DIG is a USB to SPI/I2C/1Wire/GPIO adapter. Add MFD core support. Signed-off-by: Andrew F. Davis --- drivers/mfd/Kconfig | 8 +++ drivers/mfd/Makefile| 2 + drivers/mfd/ti-smusbdig.c | 138

Re: Nokia N900: musb is in wrong state after boot

2016-06-10 Thread joerg Reisenweber
On Fri 10 June 2016 10:59:40 Bin Liu wrote: > The musb ug says the testmde is not used in normal operation, so my > opinion is force_host should not be used for hacking n900 host mode if > this is for real product development or support. You're aware N900 OS aka maemo is a) FOSS, and b) EOL at

Re: [PATCH v7] input: tablet: add Pegasus Notetaker tablet driver

2016-06-10 Thread Oliver Neukum
On Fri, 2016-06-10 at 15:27 +0200, Martin Kepplinger wrote: > >> +input_set_abs_params(input_dev, ABS_X, -1500, 1500, 8, 0); > >> +input_set_abs_params(input_dev, ABS_Y, 1600, 3000, 8, 0); > >> + > >> +pegasus_set_mode(pegasus, PEN_MODE_XY, NOTETAKER_LED_MOUSE); > > > > If you need to

Re: Nokia N900: musb is in wrong state after boot

2016-06-10 Thread Bin Liu
Hi, On Fri, Jun 10, 2016 at 05:23:11PM +0200, joerg Reisenweber wrote: > On Fri 10 June 2016 10:08:08 Bin Liu wrote: > > Hi, > > > > On Thu, Jun 09, 2016 at 11:25:57PM +0200, joerg Reisenweber wrote: > > > On Thu 09 June 2016 15:58:56 Bin Liu wrote: > > > > But I am not sure how this will fix

Re: Nokia N900: musb is in wrong state after boot

2016-06-10 Thread joerg Reisenweber
On Fri 10 June 2016 10:08:08 Bin Liu wrote: > Hi, > > On Thu, Jun 09, 2016 at 11:25:57PM +0200, joerg Reisenweber wrote: > > On Thu 09 June 2016 15:58:56 Bin Liu wrote: > > > But I am not sure how this will fix n900 host mode problem, since > > > testmode is not used in normal operation. > > > >

Re: Nokia N900: musb is in wrong state after boot

2016-06-10 Thread Bin Liu
Hi, On Thu, Jun 09, 2016 at 11:25:57PM +0200, joerg Reisenweber wrote: > On Thu 09 June 2016 15:58:56 Bin Liu wrote: > > But I am not sure how this will fix n900 host mode problem, since > > testmode is not used in normal operation. > > Please see http://talk.maemo.org/showthread.php?p=685367

Re: [PATCH v4] USB: Fix of_usb_get_dr_mode_by_phy with a shared phy block

2016-06-10 Thread Bin Liu
Hi, On Fri, Jun 10, 2016 at 11:46:25AM +0200, Hans de Goede wrote: > Some SoCs have a single phy-hw-block with multiple phys, this is > modelled by a single phy dts node, so we end up with multiple > controller nodes with a phys property pointing to the phy-node > of the otg-phy. > > Only one of

Re: [PATCH v3 4/4] musb: sunxi: Simplify dr_mode handling

2016-06-10 Thread Bin Liu
Hi, On Sun, Jun 05, 2016 at 04:59:36PM +0200, Hans de Goede wrote: > phy-sun4i-usb now has proper dr_mode handling, it always registers an > extcon, and sends a notify with the mode (even when in peripheral- / > host-only mode) at least once. > > So we can simply the sunxi musb glue by always

[RFC PATCHv3] usb: USB Type-C Connector Class

2016-06-10 Thread Heikki Krogerus
The purpose of this class is to provide unified interface for user space to get the status and basic information about USB Type-C Connectors in the system, control data role swapping, and when USB PD is available, also power role swapping and Alternate Modes. Signed-off-by: Heikki Krogerus

Re: [PATCH v7 0/4] usb: dwc3: dual-role support

2016-06-10 Thread Roger Quadros
On 10/06/16 16:17, Roger Quadros wrote: > Hi, > > This series adds dual role support to dwc3 controller driver. > Series depends on the OTG/dual-role framework [1]. > > [1] - http://thread.gmane.org/gmane.linux.usb.general/143568 > > Patches are based on Felipe's balbi/usb.git testing/next

Re: [PATCH v7] input: tablet: add Pegasus Notetaker tablet driver

2016-06-10 Thread Martin Kepplinger
Am 2016-06-09 um 17:00 schrieb Oliver Neukum: > On Wed, 2016-06-01 at 14:55 +0200, Martin Kepplinger wrote: > >> It's *really* fun to use as an input tablet though! So let's support this >> for everybody. > > Nice job, but a few issues are left. I'll comment in the code. > Hi Oliver, Thanks

[PATCH v7 3/4] ARM: dts: dra7*-evm: Enable dual-role for usb1

2016-06-10 Thread Roger Quadros
Now that we have dual-role support working at USB core, enable dual-role support for usb1 controller. Signed-off-by: Roger Quadros --- arch/arm/boot/dts/dra7-evm.dts | 5 - arch/arm/boot/dts/dra72-evm-common.dtsi | 5 - 2 files changed, 8 insertions(+), 2

[PATCH v7 1/4] usb: dwc3: core.h: add some register definitions

2016-06-10 Thread Roger Quadros
Add OTG and GHWPARAMS6 register definitions Signed-off-by: Roger Quadros --- drivers/usb/dwc3/core.h | 84 - 1 file changed, 83 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index

[PATCH v7 0/4] usb: dwc3: dual-role support

2016-06-10 Thread Roger Quadros
Hi, This series adds dual role support to dwc3 controller driver. Series depends on the OTG/dual-role framework [1]. [1] - http://thread.gmane.org/gmane.linux.usb.general/143568 Patches are based on Felipe's balbi/usb.git testing/next Changelog: v7: - rebased to v4.7-rc1 + balbi/usb.git

Re: [PATCH v5 4/7] phy: da8xx-usb: new driver for DA8xx SoC USB PHY

2016-06-10 Thread Sekhar Nori
On Tuesday 10 May 2016 05:10 AM, David Lechner wrote: > This is a new phy driver for the SoC USB controllers on the TI DA8xx > family of microcontrollers. The USB 1.1 PHY is just a simple on/off. > The USB 2.0 PHY also allows overriding the VBUS and ID pins. > > Signed-off-by: David Lechner

[PATCH v7 2/4] usb: dwc3: add dual-role support

2016-06-10 Thread Roger Quadros
Register with the USB OTG/DRD core. Since we don't support OTG yet we just work as a dual-role device even if device tree says "otg". Get ID and VBUS information from the OTG controller and kick the OTG state machine. Signed-off-by: Roger Quadros --- drivers/usb/dwc3/core.c |

[PATCH v7 4/4] ARM: dts: am43xx: Enable dual-role on USB1

2016-06-10 Thread Roger Quadros
USB1 port is micro-AB type and can function as peripheral as well as host. Enable dual-role mode for USB1. Signed-off-by: Roger Quadros --- arch/arm/boot/dts/am437x-gp-evm.dts | 5 - arch/arm/boot/dts/am437x-sk-evm.dts | 5 - arch/arm/boot/dts/am43x-epos-evm.dts | 5

[PATCH v10 03/14] usb: hcd.h: Add OTG to HCD interface

2016-06-10 Thread Roger Quadros
The OTG core will use struct otg_hcd_ops to interface with the HCD (Host Controller Driver). The main purpose of this interface is to avoid directly calling HCD APIs from the OTG core as they wouldn't be defined in the built-in symbol table if CONFIG_USB is m. Signed-off-by: Roger Quadros

[PATCH v10 04/14] usb: otg-fsm: use usb_otg wherever possible

2016-06-10 Thread Roger Quadros
Move otg_fsm into usb_otg and use usb_otg wherever possible in the usb_otg APIs. Signed-off-by: Roger Quadros Acked-by: Peter Chen --- drivers/usb/chipidea/ci.h| 1 - drivers/usb/chipidea/core.c | 14 +-- drivers/usb/chipidea/debug.c | 2

[PATCH v10 02/14] usb: otg-fsm: Prevent build warning "VDBG" redefined

2016-06-10 Thread Roger Quadros
If usb/otg-fsm.h and usb/composite.h are included together then it results in the build warning [1]. Prevent that by defining VDBG locally. Also get rid of MPC_LOC which doesn't seem to be used by anyone. [1] - warning fixed by this patch: In file included from drivers/usb/dwc3/core.h:33,

[PATCH v10 07/14] usb: otg: get rid of CONFIG_USB_OTG_FSM in favour of CONFIG_USB_OTG

2016-06-10 Thread Roger Quadros
Let's use CONFIG_USB_OTG as a single config option to enable USB OTG and the OTG FSM. This makes things a lot less confusing. Update all users of CONFIG_USB_OTG_FSM to CONFIG_USB_OTG. Signed-off-by: Roger Quadros Acked-by: Peter Chen ---

[PATCH v10 09/14] usb: of: add an API to get OTG device from USB controller node

2016-06-10 Thread Roger Quadros
The OTG controller and the USB controller can be linked via the 'otg-controller' property in the USB controller's device node. of_usb_get_otg() can be used to get the OTG controller device from the USB controller's device node. Signed-off-by: Roger Quadros Acked-by: Peter Chen

[PATCH v10 05/14] usb: otg-fsm: move host controller operations into usb_otg->hcd_ops

2016-06-10 Thread Roger Quadros
This is to prevent missing symbol build error if OTG is enabled (built-in) and HCD core (CONFIG_USB) is module. Signed-off-by: Roger Quadros Acked-by: Peter Chen --- drivers/usb/chipidea/otg_fsm.c | 7 +++ drivers/usb/common/usb-otg-fsm.c | 15

[PATCH v10 10/14] usb: otg: add hcd companion support

2016-06-10 Thread Roger Quadros
From: Yoshihiro Shimoda Since some host controller (e.g. EHCI) needs a companion host controller (e.g. OHCI), this patch adds such a configuration to use it in the OTG core. Signed-off-by: Yoshihiro Shimoda Signed-off-by:

[PATCH v10 01/14] usb: hcd: Initialize hcd->flags to 0

2016-06-10 Thread Roger Quadros
When using the OTG/DRD library we can call hcd_add/remove consecutively without calling usb_put_hcd/usb_create_hcd in between so hcd->flags can be stale. If the HC dies due to whatever reason then without this patch we get the below error on next hcd_add. [ 91.494257] xhci-hcd xhci-hcd.0.auto:

[PATCH v10 11/14] usb: otg: use dev_vdbg() instead of VDBG()

2016-06-10 Thread Roger Quadros
Now that we have a device reference in struct usb_otg let's use dev_vdbg() for debug messages instead of VDBG(). Signed-off-by: Roger Quadros Acked-by: Peter Chen --- drivers/usb/common/usb-otg-fsm.c | 19 +++ 1 file changed, 7 insertions(+),

[PATCH v10 13/14] usb: gadget: udc: adapt to OTG core

2016-06-10 Thread Roger Quadros
The OTG state machine needs a mechanism to start and stop the gadget controller as well as connect/disconnect from the bus. Add usb_gadget_start(), usb_gadget_stop() and usb_gadget_connect_control(). Introduce usb_otg_add_gadget_udc() to allow controller drivers to register a gadget controller

[PATCH v10 12/14] usb: hcd: Adapt to OTG core

2016-06-10 Thread Roger Quadros
Introduce usb_otg_add/remove_hcd() for use by host controllers that are part of OTG/dual-role port. Non device tree platforms can use the otg_dev argument to specify the OTG controller device. If otg_dev is NULL then the device tree node's otg-controller property is used to get the otg_dev

[PATCH v10 14/14] usb: host: xhci-plat: Add otg device to platform data

2016-06-10 Thread Roger Quadros
Host controllers that are part of an OTG/dual-role instance need to somehow pass the OTG controller device information to the HCD core. We use platform data to pass the OTG controller device. Signed-off-by: Roger Quadros Reviewed-by: Peter Chen ---

[PATCH v10 06/14] usb: gadget.h: Add OTG to gadget interface

2016-06-10 Thread Roger Quadros
The OTG core will use struct otg_gadget_ops to start/stop the gadget controller. The main purpose of this interface is to avoid directly calling usb_gadget_start/stop() from the OTG core as they wouldn't be defined in the built-in symbol table if CONFIG_USB_GADGET is m. Signed-off-by: Roger

[PATCH v10 08/14] usb: otg: add OTG/dual-role core

2016-06-10 Thread Roger Quadros
It provides APIs for the following tasks - Registering an OTG/dual-role capable controller - Registering Host and Gadget controllers to OTG core - Providing inputs to and kicking the OTG state machine Provide a dual-role device (DRD) state machine. DRD mode is a reduced functionality OTG mode.

[PATCH v10 00/14] USB OTG/dual-role framework

2016-06-10 Thread Roger Quadros
Hi, This series centralizes OTG/Dual-role functionality in the kernel. As of now I've got Dual-role functionality working pretty reliably on dra7-evm and am437x-gp-evm. DWC3 controller and TI platform related patches will be sent separately. Series is based on v4.7-rc1 + balbi/usb.git

Re: [PATCH v10 5/5] usb: dwc3: core: cleanup IRQ resources

2016-06-10 Thread Sergei Shtylyov
On 6/10/2016 2:46 PM, Roger Quadros wrote: Implementations might use different IRQs for host, gadget so use named interrupt resources to allow device tree to specify the interrupts. Following are the interrupt names Peripheral Interrupt - peripheral HOST Interrupt - host Maintain backward

[PATCH v11 5/5] usb: dwc3: core: cleanup IRQ resources

2016-06-10 Thread Roger Quadros
Implementations might use different IRQs for host, gadget so use named interrupt resources to allow device tree to specify the interrupts. Following are the interrupt names Peripheral Interrupt - peripheral HOST Interrupt - host Maintain backward compatibility for a single named interrupt

Re: [PATCH v10 5/5] usb: dwc3: core: cleanup IRQ resources

2016-06-10 Thread Roger Quadros
On 10/06/16 14:44, Sergei Shtylyov wrote: > On 6/10/2016 2:35 PM, Roger Quadros wrote: >> On 10/06/16 13:39, Sergei Shtylyov wrote: >>> Hello. >>> >>> On 6/10/2016 12:56 PM, Roger Quadros wrote: >>> Implementations might use different IRQs for host, gadget so use named interrupt

Re: [PATCH v10 5/5] usb: dwc3: core: cleanup IRQ resources

2016-06-10 Thread Sergei Shtylyov
On 6/10/2016 2:35 PM, Roger Quadros wrote: On 10/06/16 13:39, Sergei Shtylyov wrote: Hello. On 6/10/2016 12:56 PM, Roger Quadros wrote: Implementations might use different IRQs for host, gadget so use named interrupt resources to allow device tree to specify the interrupts. Following are

[PATCH v2] usb: dwc3: fix runtime PM in error path

2016-06-10 Thread Roger Quadros
If there is a failure after pm_runtime_enable/get_sync() we need to call pm_runtime_disable/put_sync(). Otherwise it will lead to an unbalanced pm_runtime_enable() on the subsequent probe if the earlier probe bailed out due to -EPROBE_DEFER. pm_runtime_get_sync() can fail as well so deal with

Re: [PATCH v10 5/5] usb: dwc3: core: cleanup IRQ resources

2016-06-10 Thread Roger Quadros
On 10/06/16 13:39, Sergei Shtylyov wrote: > Hello. > > On 6/10/2016 12:56 PM, Roger Quadros wrote: > >> Implementations might use different IRQs for >> host, gadget so use named interrupt resources >> to allow device tree to specify the interrupts. >> >> Following are the interrupt names >> >>

[PATCH 1/3] usb: dwc3: gadget: remove udelay() from run_stop()

2016-06-10 Thread Felipe Balbi
testing shows that udelay() is unnecessary as controller reaches Halted state almost instantenously as can be seen by our timeout variable never actually decrementing. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 1 - 1 file changed, 1 deletion(-)

[PATCH 3/3] usb: dwc3: gadget: simplify run_stop() break condition

2016-06-10 Thread Felipe Balbi
it's clear now that when is_on=true, we must loop until DWC3_DSTS_DEVCTRLHLT clears; while when is_on=false we must loop until DWC3_DSTS_DEVCTRLHLT gets set. Instead of adding actual if() statements, we can rely on XOR operation to evaluate to true only when the above conditions apply. Then, we

[PATCH 2/3] usb: dwc3: gadget: avoid while(1) in run_stop()

2016-06-10 Thread Felipe Balbi
instead of looping forever and forcing a return if timeout reaches zero, we can just use timeout and loop's break condition directly. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

Re: [PATCH 1/2] usb: dwc3: gadget: set xfer resource per endpoint

2016-06-10 Thread Felipe Balbi
Hi, John Youn writes: >>> You could try creating a composite device. Interface #1 having a >>> single alt setting, interface #2 with multiple alt-settings. Start >>> traffic to both interfaces, then start setting different alt-settings >>> on interface #2. >>> >>> The

Re: [PATCH v10 08/14] usb: otg: add OTG/dual-role core

2016-06-10 Thread Felipe Balbi
Hi, Roger Quadros writes: >>> What is wrong with calling it gadget controller? >> >>It's not a controller, it's a piece of software AFAIU. Or is my English >> just too weak? :-) > > Everything at this point is a piece of software :). > > struct usb_gadget, represents the

Re: [PATCH v10 08/14] usb: otg: add OTG/dual-role core

2016-06-10 Thread Roger Quadros
On 10/06/16 13:44, Sergei Shtylyov wrote: > On 6/10/2016 1:19 PM, Roger Quadros wrote: > It provides APIs for the following tasks - Registering an OTG/dual-role capable controller - Registering Host and Gadget controllers to OTG core - Providing inputs to and kicking the

Re: [PATCH v10 08/14] usb: otg: add OTG/dual-role core

2016-06-10 Thread Sergei Shtylyov
On 6/10/2016 1:19 PM, Roger Quadros wrote: It provides APIs for the following tasks - Registering an OTG/dual-role capable controller - Registering Host and Gadget controllers to OTG core - Providing inputs to and kicking the OTG state machine Provide a dual-role device (DRD) state machine.

Re: [PATCH v10 5/5] usb: dwc3: core: cleanup IRQ resources

2016-06-10 Thread Sergei Shtylyov
Hello. On 6/10/2016 12:56 PM, Roger Quadros wrote: Implementations might use different IRQs for host, gadget so use named interrupt resources to allow device tree to specify the interrupts. Following are the interrupt names Peripheral Interrupt - peripheral HOST Interrupt - host Maintain

Re: [PATCH v10 08/14] usb: otg: add OTG/dual-role core

2016-06-10 Thread Roger Quadros
Hi, On 09/06/16 15:34, Sergei Shtylyov wrote: > On 6/9/2016 10:53 AM, Roger Quadros wrote: > >> It provides APIs for the following tasks >> >> - Registering an OTG/dual-role capable controller >> - Registering Host and Gadget controllers to OTG core >> - Providing inputs to and kicking the OTG

Re: [PATCH] usb: dwc3: fix runtime PM in error path

2016-06-10 Thread Felipe Balbi
Roger Quadros writes: > [ Unknown signature status ] > On 10/06/16 12:16, Felipe Balbi wrote: >> >> Hi, >> >> Roger Quadros writes: >>> If there is a failure after pm_runtime_enable/get_sync() >>> we need to call pm_runtime_disable/put_sync(). >>> >>> Otherwise

[PATCH v10 5/5] usb: dwc3: core: cleanup IRQ resources

2016-06-10 Thread Roger Quadros
Implementations might use different IRQs for host, gadget so use named interrupt resources to allow device tree to specify the interrupts. Following are the interrupt names Peripheral Interrupt - peripheral HOST Interrupt - host Maintain backward compatibility for a single named interrupt

Re: [PATCH] usb: dwc3: fix runtime PM in error path

2016-06-10 Thread Roger Quadros
On 10/06/16 12:16, Felipe Balbi wrote: > > Hi, > > Roger Quadros writes: >> If there is a failure after pm_runtime_enable/get_sync() >> we need to call pm_runtime_disable/put_sync(). >> >> Otherwise it will lead to an unbalanced pm_runtime_enable() on the >> subsequent probe if

[PATCH v4] USB: Fix of_usb_get_dr_mode_by_phy with a shared phy block

2016-06-10 Thread Hans de Goede
Some SoCs have a single phy-hw-block with multiple phys, this is modelled by a single phy dts node, so we end up with multiple controller nodes with a phys property pointing to the phy-node of the otg-phy. Only one of these controllers typically is an otg controller, yet we were checking the

Re: [PATCH v3 1/4] USB: Fix of_usb_get_dr_mode_by_phy with a shared phy block

2016-06-10 Thread Hans de Goede
Hi, On 09-06-16 21:49, Bin Liu wrote: Hi, On Thu, Jun 09, 2016 at 04:51:45PM +0200, Hans de Goede wrote: Hi, On 09-06-16 16:30, Bin Liu wrote: Hi, On Sun, Jun 05, 2016 at 04:59:33PM +0200, Hans de Goede wrote: Some SoCs have a single phy-hw-block with multiple phys, this is modelled by a

Re: Add MediaTek USB3 DRD Driver

2016-06-10 Thread Felipe Balbi
Hi, Chunfeng Yun writes: > From 8fdc924cecf0ca14da6e8aba360501e53437e548 Mon Sep 17 00:00:00 2001 > From: Chunfeng Yun > Date: Fri, 10 Jun 2016 15:20:20 +0800 > Subject: [PATCH 0/5] Add MediaTek USB3 DRD Driver > > These patches introduce

Re: [PATCH v3,2/5] dt-bindings: mt8173-mtu3: add devicetree bindings

2016-06-10 Thread Felipe Balbi
Hi, Chunfeng Yun writes: > + - enable-manual-drd : supports manual dual-role switch via sysfs; only used > + when receptacle is TYPE-A and also wants to support dual-role mode. sorry, but this manual-drd can't be accepted. You should rely on a DT property for

Re: [PATCH v9 5/5] usb: dwc3: core: cleanup IRQ resources

2016-06-10 Thread Felipe Balbi
Hi, Roger Quadros writes: > On 10/06/16 11:18, Felipe Balbi wrote: >> >> Hi, >> >> Roger Quadros writes: dwc->xhci_resource[1] = *res; >>> >>> Probably not as we don't want to change parent/child members. >> >> oh, you had already replied. Sorry. This

Re: [PATCH] usb: dwc3: fix runtime PM in error path

2016-06-10 Thread Felipe Balbi
Hi, Roger Quadros writes: > If there is a failure after pm_runtime_enable/get_sync() > we need to call pm_runtime_disable/put_sync(). > > Otherwise it will lead to an unbalanced pm_runtime_enable() on the > subsequent probe if the earlier probe bailed out due to -EPROBE_DEFER. >

Re: Add MediaTek USB3 DRD Driver

2016-06-10 Thread chunfeng yun
Hi, On Fri, 2016-06-10 at 15:32 +0800, Chunfeng Yun wrote: > From 8fdc924cecf0ca14da6e8aba360501e53437e548 Mon Sep 17 00:00:00 2001 > From: Chunfeng Yun > Date: Fri, 10 Jun 2016 15:20:20 +0800 > Subject: [PATCH 0/5] Add MediaTek USB3 DRD Driver > > These patches

RE: [PATCH v3 1/2] usb: ohci-at91: Forcibly suspend ports while USB suspend

2016-06-10 Thread Yang, Wenyou
Hi Alan, > -Original Message- > From: Alan Stern [mailto:st...@rowland.harvard.edu] > Sent: 2016年6月9日 3:14 > To: Yang, Wenyou > Cc: Greg Kroah-Hartman ; Ferre, Nicolas > ; Rob Herring ; Pawel

[PATCH] usb: dwc3: fix runtime PM in error path

2016-06-10 Thread Roger Quadros
If there is a failure after pm_runtime_enable/get_sync() we need to call pm_runtime_disable/put_sync(). Otherwise it will lead to an unbalanced pm_runtime_enable() on the subsequent probe if the earlier probe bailed out due to -EPROBE_DEFER. Signed-off-by: Roger Quadros ---

Re: [PATCH v9 5/5] usb: dwc3: core: cleanup IRQ resources

2016-06-10 Thread Roger Quadros
On 10/06/16 11:18, Felipe Balbi wrote: > > Hi, > > Roger Quadros writes: >>> dwc->xhci_resource[1] = *res; >> >> Probably not as we don't want to change parent/child members. > > oh, you had already replied. Sorry. This is correct > np :). So what i'll do is get the irq

Re: [PATCH v9 5/5] usb: dwc3: core: cleanup IRQ resources

2016-06-10 Thread Felipe Balbi
Hi, Roger Quadros writes: >> dwc->xhci_resource[1] = *res; > > Probably not as we don't want to change parent/child members. oh, you had already replied. Sorry. This is correct -- balbi signature.asc Description: PGP signature

Re: [PATCH v9 5/5] usb: dwc3: core: cleanup IRQ resources

2016-06-10 Thread Felipe Balbi
Hi, Roger Quadros writes: >> Is it expected to have more than one IRQ here? >> >> if not - it will better to use platform_get_irq[_byname](). >> > > The reason I used platform_get_resource variant is that i'm passing the > resource directly to the XHCI platform device below. >>

Re: [PATCH v9 5/5] usb: dwc3: core: cleanup IRQ resources

2016-06-10 Thread Roger Quadros
On 10/06/16 11:02, Roger Quadros wrote: > Grygorii, > > On 02/06/16 14:52, Grygorii Strashko wrote: >> On 06/01/2016 10:46 AM, Roger Quadros wrote: >>> Implementations might use different IRQs for >>> host, gadget and OTG so use named interrupt resources >>> to allow Device tree to specify the 3

Re: [PATCH v9 5/5] usb: dwc3: core: cleanup IRQ resources

2016-06-10 Thread Roger Quadros
Grygorii, On 02/06/16 14:52, Grygorii Strashko wrote: > On 06/01/2016 10:46 AM, Roger Quadros wrote: >> Implementations might use different IRQs for >> host, gadget and OTG so use named interrupt resources >> to allow Device tree to specify the 3 interrupts. >> >> Following are the interrupt

Re: [PATCH v9 5/5] usb: dwc3: core: cleanup IRQ resources

2016-06-10 Thread Roger Quadros
On 07/06/16 14:49, Grygorii Strashko wrote: > On 06/07/2016 12:34 PM, Roger Quadros wrote: >> On 02/06/16 14:52, Grygorii Strashko wrote: >>> On 06/01/2016 10:46 AM, Roger Quadros wrote: Implementations might use different IRQs for host, gadget and OTG so use named interrupt resources

[PATCH v3,3/5] usb: xhci-mtk: make IPPC register optional

2016-06-10 Thread Chunfeng Yun
Make IPPC register optional to support host side of dual-role mode, due to it is moved into common glue layer for simplification. Signed-off-by: Chunfeng Yun --- drivers/usb/host/xhci-mtk.c | 32 +++- 1 file changed, 27 insertions(+), 5

[PATCH v3,4/5] usb: Add MediaTek USB3 DRD Driver

2016-06-10 Thread Chunfeng Yun
This patch adds support for the MediaTek USB3 controller integrated into MT8173. It can be configured as Dual-Role Device (DRD), Peripheral Only and Host Only (xHCI) modes. Signed-off-by: Chunfeng Yun --- drivers/usb/Kconfig|2 +

[PATCH v3,5/5] arm64: dts: mediatek: add USB3 DRD driver

2016-06-10 Thread Chunfeng Yun
USB3 DRD driver is added for MT8173-EVB, and xHCI driver becomes its subnode Signed-off-by: Chunfeng Yun --- arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 46 +-- arch/arm64/boot/dts/mediatek/mt8173.dtsi| 28 2 files

[PATCH v3,1/5] dt-bindings: mt8173-xhci: support host side of dual-role mode

2016-06-10 Thread Chunfeng Yun
Some resources, such as IPPC register etc, shared with device driver are moved into common glue layer when xHCI driver is the host side of dual-role mode and they should be changed as optional properties if they are required ones before. For clarity, add a new part of binding to support host side

[PATCH v3,2/5] dt-bindings: mt8173-mtu3: add devicetree bindings

2016-06-10 Thread Chunfeng Yun
add a DT binding doc for MediaTek USB3 DRD driver Signed-off-by: Chunfeng Yun --- .../devicetree/bindings/usb/mt8173-mtu3.txt| 85 1 file changed, 85 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/mt8173-mtu3.txt

Add MediaTek USB3 DRD Driver

2016-06-10 Thread Chunfeng Yun
>From 8fdc924cecf0ca14da6e8aba360501e53437e548 Mon Sep 17 00:00:00 2001 From: Chunfeng Yun Date: Fri, 10 Jun 2016 15:20:20 +0800 Subject: [PATCH 0/5] Add MediaTek USB3 DRD Driver These patches introduce the MediaTek USB3 dual-role controller driver. The driver can be

Re: [PATCH v9 13/14] usb: gadget: udc: adapt to OTG core

2016-06-10 Thread Roger Quadros
Hi Yoshihiro, On 09/06/16 13:49, Yoshihiro Shimoda wrote: > Hi Roger, > >> From: Roger Quadros >> Sent: Wednesday, June 08, 2016 6:04 PM >> >> The OTG state machine needs a mechanism to start and >> stop the gadget controller as well as connect/disconnect >> from the bus. Add usb_gadget_start(),

Re: [PATCH v10 11/14] usb: otg: use dev_dbg() instead of VDBG()

2016-06-10 Thread Roger Quadros
On 09/06/16 18:43, Joe Perches wrote: > On Thu, 2016-06-09 at 10:55 +0300, Roger Quadros wrote: >> Now that we have a device reference in struct usb_otg >> let's use dev_vdbg() for debug messages instead of VDBG(). >> >> Signed-off-by: Roger Quadros >> Acked-by: Peter Chen

Re: [PATCH v10 08/14] usb: otg: add OTG/dual-role core

2016-06-10 Thread Roger Quadros
Hi Sergei, On 09/06/16 15:34, Sergei Shtylyov wrote: > On 6/9/2016 10:53 AM, Roger Quadros wrote: > >> It provides APIs for the following tasks >> >> - Registering an OTG/dual-role capable controller >> - Registering Host and Gadget controllers to OTG core >> - Providing inputs to and kicking

Re: [PATCH v9 03/14] usb: hcd.h: Add OTG to HCD interface

2016-06-10 Thread Roger Quadros
On 09/06/16 17:11, Alan Stern wrote: > On Thu, 9 Jun 2016, Sergei Shtylyov wrote: > >> Hello. >> >> On 6/9/2016 10:31 AM, Roger Quadros wrote: >> >>> The OTG core will use struct otg_hcd_ops to interface >>> with the HCD controller. >> >>Host controller driver (HCD)

[PATCH 1/3] arm: dts: ls1021a: Add dis_rxdet_inp3_quirk property to USB3 node

2016-06-10 Thread Rajesh Bhagat
Add "dis_rxdet_inp3_quirk" boolean property to USB3 node. This property is used to disable rx detection in P3 PHY mode. Signed-off-by: Rajesh Bhagat --- arch/arm/boot/dts/ls1021a.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/ls1021a.dtsi

Re: [RESENDING] dwc2: Using internal phy (fs mode) for STM32F4x9 platform

2016-06-10 Thread Felipe Balbi
Hi, John Youn writes: > On 6/9/2016 10:18 AM, Bruno Herrera wrote: >> Hello all, >> I'm bringing the linux kernel for the STM32F4 MCU (mmu-less). This MCU >> has two DWC2 cores on it:one for USB OTG HS and one for USB OTG FS. >> I was able to make the DWC2 driver to work

  1   2   >