Re: [PATCH v2 2/8] usb: typec: fusb302: Refactor / simplify tcpm_set_cc()

2019-03-07 Thread Heikki Krogerus
On Thu, Mar 07, 2019 at 10:12:59AM -0800, Guenter Roeck wrote: > On Thu, Mar 07, 2019 at 05:36:01PM +0100, Hans de Goede wrote: > > After commit ea3b4d5523bc ("usb: typec: fusb302: Resolve fixed power role > > contract setup"), tcpm_set_cc always calls fusb302_set_toggling. > > > > Before this ref

Re: [PATCH 3/5] usb: roles: add API to get usb_role_switch by node

2019-03-07 Thread Andy Shevchenko
On Fri, Mar 8, 2019 at 8:14 AM Chunfeng Yun wrote: > > Add usb_role_switch_get_by_node() to make easier to get > usb_role_switch by node which register it. > It's useful when there is not device_connection registered > between two drivers and only knows the node which register > usb_role_switch.

[PATCH 5/5] usb: mtu3: register a USB Role Switch for Dual-Role mode

2019-03-07 Thread Chunfeng Yun
Due to extcon is not allowed for new bindings, and the Dual-Role switch is supported by USB Role Switch, especially for Type-C drivers, so register a USB Role Switch to support the new way Signed-off-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3.h | 5 drivers/usb/mtu3/mtu3_dr.c | 50 +

[PATCH 4/5] usb: roles: add USB Type-B connector driver

2019-03-07 Thread Chunfeng Yun
Due to the requirement of usb-connector.txt binding, the old way using extcon to support USB Dual-Role switch is now deprecated when use Type-B connector. This patch introduce a Type-B connector driver and try to replace the function provided by extcon-usb-gpio driver Signed-off-by: Chunfeng Yun

[PATCH 3/5] usb: roles: add API to get usb_role_switch by node

2019-03-07 Thread Chunfeng Yun
Add usb_role_switch_get_by_node() to make easier to get usb_role_switch by node which register it. It's useful when there is not device_connection registered between two drivers and only knows the node which register usb_role_switch. Signed-off-by: Chunfeng Yun --- drivers/usb/roles/class.c | 30

[PATCH 2/5] dt-bindings: usb: mtu3: add properties about USB Role Switch

2019-03-07 Thread Chunfeng Yun
Now the USB Role Switch is supported, so add properties about it Signed-off-by: Chunfeng Yun --- .../devicetree/bindings/usb/mediatek,mtu3.txt | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtu3.txt b/Docume

[PATCH 0/5] add USB Type-B connector driver

2019-03-07 Thread Chunfeng Yun
Because the USB Connector is introduced and the requirement of usb-connector.txt binding, the old way using extcon to support USB Dual-Role switch is now deprecated, meanwhile there is no available common driver when use Type-B connector. This patch series introduce a Type-B connector driver and tr

[PATCH 1/5] dt-bindings: connector: add optional properties for Type-B

2019-03-07 Thread Chunfeng Yun
Add id-gpios, vbus-gpios, vbus-supply and pinctrl properties for usb-b-connector Signed-off-by: Chunfeng Yun --- .../devicetree/bindings/connector/usb-connector.txt| 10 ++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/connector/usb-connector.txt b

Re: [PATCH v2 8/8] usb: typec: fusb302: Add __printf attribute to fusb302_log function

2019-03-07 Thread Guenter Roeck
On Thu, Mar 07, 2019 at 05:36:07PM +0100, Hans de Goede wrote: > Add __printf attribute to fusb302_log function, so that we get > compiler warnings when specifying wrong vararg parameters. > > Signed-off-by: Hans de Goede Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/tcpm/fusb302.c | 2

Re: [PATCH v2 7/8] usb: typec: fusb302: Improve suspend/resume handling

2019-03-07 Thread Guenter Roeck
On Thu, Mar 07, 2019 at 05:36:06PM +0100, Hans de Goede wrote: > Remove the code which avoids doing i2c-transfers while our parent > i2c-adapter may be suspended by busy-waiting for our resume handler > to be called. > > Instead move the interrupt handling from a threaded interrupt handler > to a

Re: [PATCH v2 6/8] usb: typec: fusb302: 2 small misc. fixes

2019-03-07 Thread Guenter Roeck
On Thu, Mar 07, 2019 at 05:36:05PM +0100, Hans de Goede wrote: > Fix a copy and paste error in an error message and a spelling error > in a comment. > > Signed-off-by: Hans de Goede Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/tcpm/fusb302.c | 4 ++-- > 1 file changed, 2 insertions(+)

Re: [PATCH v2 5/8] usb: typec: fusb302: Fix fusb302_handle_togdone_src Ra handling

2019-03-07 Thread Guenter Roeck
On Thu, Mar 07, 2019 at 05:36:04PM +0100, Hans de Goede wrote: > The FUSB302 will stop toggling with a FUSB_REG_STATUS1A_TOGSS_SRC? status, > as soon as it sees either Ra or Rd on a CC pin. > > Before this commit fusb302_handle_togdone_src would assume that the toggle- > engine always stopped at t

Re: [PATCH v2 3/8] usb: typec: fusb302: Fold fusb302_set_cc_pull into tcpm_set_cc

2019-03-07 Thread Guenter Roeck
On Thu, Mar 07, 2019 at 05:36:02PM +0100, Hans de Goede wrote: > After the recent cleanups, tcpm_set_cc is the only caller of > fusb302_set_cc_pull, fold fusb302_set_cc_pull directly into > tcpm_set_cc for a nice cleanup. > > Signed-off-by: Hans de Goede Reviewed-by: Guenter Roeck > --- > dri

Re: [PATCH v2 2/8] usb: typec: fusb302: Refactor / simplify tcpm_set_cc()

2019-03-07 Thread Guenter Roeck
On Thu, Mar 07, 2019 at 05:36:01PM +0100, Hans de Goede wrote: > After commit ea3b4d5523bc ("usb: typec: fusb302: Resolve fixed power role > contract setup"), tcpm_set_cc always calls fusb302_set_toggling. > > Before this refactor tcpm_set_cc does the following: > > 1) fusb302_set_toggling(TOGGLI

Re: [PATCH v2 4/8] usb: typec: fusb302: Check vconn is off when we start toggling

2019-03-07 Thread Guenter Roeck
On Thu, Mar 07, 2019 at 05:36:03PM +0100, Hans de Goede wrote: > The datasheet says the vconn MUST be off when we start toggling. The > tcpm.c state-machine is responsible to make sure vconn is off, but > lets add a WARN_ON check to catch any cases where vconn is not off > for some reason. > Curi

Re: [PATCH v2 1/8] usb: typec: fusb302: Make fusb302_set_cc_polarity also set pull ups / downs

2019-03-07 Thread Guenter Roeck
On Thu, Mar 07, 2019 at 05:36:00PM +0100, Hans de Goede wrote: > The 2 callers of fusb302_set_cc_polarity both call fusb302_set_cc_pull > directly before calling fusb302_set_cc_polarity, this is not ideal for > 2 reasons: > > 1) fusb302_set_cc_pull uses the cached polarity when applying pull-ups,

[PATCH v2 7/8] usb: typec: fusb302: Improve suspend/resume handling

2019-03-07 Thread Hans de Goede
Remove the code which avoids doing i2c-transfers while our parent i2c-adapter may be suspended by busy-waiting for our resume handler to be called. Instead move the interrupt handling from a threaded interrupt handler to a work-queue and install a non-threaded interrupt handler which normally queu

[PATCH v2 8/8] usb: typec: fusb302: Add __printf attribute to fusb302_log function

2019-03-07 Thread Hans de Goede
Add __printf attribute to fusb302_log function, so that we get compiler warnings when specifying wrong vararg parameters. Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/fusb302.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drive

[PATCH v2 6/8] usb: typec: fusb302: 2 small misc. fixes

2019-03-07 Thread Hans de Goede
Fix a copy and paste error in an error message and a spelling error in a comment. Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/fusb302.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c index b7

[PATCH v2 5/8] usb: typec: fusb302: Fix fusb302_handle_togdone_src Ra handling

2019-03-07 Thread Hans de Goede
The FUSB302 will stop toggling with a FUSB_REG_STATUS1A_TOGSS_SRC? status, as soon as it sees either Ra or Rd on a CC pin. Before this commit fusb302_handle_togdone_src would assume that the toggle- engine always stopped at the CC pin indicating the polarity, IOW it assumed that it stopped at the

[PATCH v2 1/8] usb: typec: fusb302: Make fusb302_set_cc_polarity also set pull ups / downs

2019-03-07 Thread Hans de Goede
The 2 callers of fusb302_set_cc_polarity both call fusb302_set_cc_pull directly before calling fusb302_set_cc_polarity, this is not ideal for 2 reasons: 1) fusb302_set_cc_pull uses the cached polarity when applying pull-ups, which maybe changed immediately afterwards, to fix this set_cc_polarity a

[PATCH v2 2/8] usb: typec: fusb302: Refactor / simplify tcpm_set_cc()

2019-03-07 Thread Hans de Goede
After commit ea3b4d5523bc ("usb: typec: fusb302: Resolve fixed power role contract setup"), tcpm_set_cc always calls fusb302_set_toggling. Before this refactor tcpm_set_cc does the following: 1) fusb302_set_toggling(TOGGLING_MODE_OFF), this sets both FUSB_REG_MASK_BC_LVL and FUSB_REG_MASK_COMP

[PATCH v2 3/8] usb: typec: fusb302: Fold fusb302_set_cc_pull into tcpm_set_cc

2019-03-07 Thread Hans de Goede
After the recent cleanups, tcpm_set_cc is the only caller of fusb302_set_cc_pull, fold fusb302_set_cc_pull directly into tcpm_set_cc for a nice cleanup. Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/fusb302.c | 51 1 file changed, 13 insertions(+), 38 d

[PATCH v2 4/8] usb: typec: fusb302: Check vconn is off when we start toggling

2019-03-07 Thread Hans de Goede
The datasheet says the vconn MUST be off when we start toggling. The tcpm.c state-machine is responsible to make sure vconn is off, but lets add a WARN_ON check to catch any cases where vconn is not off for some reason. Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/fusb302.c | 2 ++ 1

[PATCH v2 0/8] usb: typec: fusb302: Various fixes

2019-03-07 Thread Hans de Goede
Hi All, Here is v2 of my fusb302 bug-fix series, the main fix in this series makes active adapters like Type-C to HDMI (often HDMI + USB-3-A) adapters work when they are to be powered by the Type-C port and thus present both an Ra and a Rd resistor on their Cc pins (patch 5). Without this fix the

Re: MUSB interrupt storm on device removal

2019-03-07 Thread Bin Liu
Hi, On Tue, Mar 05, 2019 at 11:30:28AM +, Måns Rullgård wrote: [...] > > Thanks for the info. > > I will handle this case in musb driver. > > What's happening to this? There's no immediate urgency from my side, > but I don't want it to get forgotten either. no, it is not forgotten. it is

Re: usb: gadget: net2280: Fix function net2280_dequeue()

2019-03-07 Thread Alan Stern
On Wed, 27 Feb 2019 gu...@kiener-muenchen.de wrote: > Zitat von Alan Stern : > > > On Tue, 19 Feb 2019 gu...@kiener-muenchen.de wrote: > > > >> Hi Alan, > >> > >> My last proposal "udc: net2280: Fix overrun of OUT messages" is still > >> under investigation. > >> > >> During the random stress tes

RE: [PATCH 4/9] usb: gadget: udc: renesas_usb3: use extcon framework to receive connect/disconnect

2019-03-07 Thread Biju Das
Hi Heikki, Thanks for the feedback. > Subject: Re: [PATCH 4/9] usb: gadget: udc: renesas_usb3: use extcon > framework to receive connect/disconnect > > On Wed, Mar 06, 2019 at 09:07:21AM +, Biju Das wrote: > > RZ/G2E cat874 board is capable of detecting cable connect and > > disconnect event

RE: [PATCH 3/9] usb: typec: driver for TI HD3SS3220 USB Type-C DRP port controller

2019-03-07 Thread Biju Das
Hi Heikki, Thanks for the feedback. > Subject: Re: [PATCH 3/9] usb: typec: driver for TI HD3SS3220 USB Type-C DRP > port controller > > On Wed, Mar 06, 2019 at 09:07:20AM +, Biju Das wrote: > > Driver for TI HD3SS3220 USB Type-C DRP port controller. > > > > The driver currently registers the

Re: Using EHSET module

2019-03-07 Thread Greg KH
On Thu, Mar 07, 2019 at 03:24:29PM +0100, rchmielarz wrote: > Hi, > > I'm trying to certify USB on our device that is running Linux 4.14. > For windows systems we were using https://www.usb.org/usb2tools. For > linux the only option I have found is a kernel module called EHSET. > Unfortunately I c

Using EHSET module

2019-03-07 Thread rchmielarz
Hi, I'm trying to certify USB on our device that is running Linux 4.14. For windows systems we were using https://www.usb.org/usb2tools. For linux the only option I have found is a kernel module called EHSET. Unfortunately I can't manage to get it working, can You please help? I have added the fo

Re: [PATCH v2 8/8] usb: dwc3: Add Amlogic G12A DWC3 glue

2019-03-07 Thread Chunfeng Yun
On Thu, 2019-03-07 at 10:45 +0100, Neil Armstrong wrote: > On 07/03/2019 03:02, Chunfeng Yun wrote: > > Hi, > > On Mon, 2019-03-04 at 11:38 +0100, Neil Armstrong wrote: > >> Adds support for Amlogic G12A USB Control Glue HW. > >> > >> The Amlogic G12A SoC Family embeds 2 USB Controllers : > >> - a

Re: [PATCH v2 8/8] usb: dwc3: Add Amlogic G12A DWC3 glue

2019-03-07 Thread Neil Armstrong
On 07/03/2019 03:02, Chunfeng Yun wrote: > Hi, > On Mon, 2019-03-04 at 11:38 +0100, Neil Armstrong wrote: >> Adds support for Amlogic G12A USB Control Glue HW. >> >> The Amlogic G12A SoC Family embeds 2 USB Controllers : >> - a DWC3 IP configured as Host for USB2 and USB3 >> - a DWC2 IP configured

Re: [PATCH v4 6/6] usb:cdns3 Fix for stuck packets in on-chip OUT buffer.

2019-03-07 Thread Roger Quadros
On 07/03/2019 09:06, Pawel Laszczak wrote: > Hi, > >> Hi, >> >> On 21/02/2019 09:14, Felipe Balbi wrote: >>> >>> Hi, >>> >>> (please break your emails at 80-columns) >>> >>> Pawel Laszczak writes: >> One more thing. Workaround has implemented algorithm that decide for >> which >> end

Re: [PATCH v2 6/8] phy: amlogic: Add Amlogic G12A USB3 + PCIE Combo PHY Driver

2019-03-07 Thread Neil Armstrong
On 06/03/2019 22:04, Martin Blumenstingl wrote: > Hi Neil, > > On Mon, Mar 4, 2019 at 11:40 AM Neil Armstrong > wrote: > [...] >> +static int phy_g12a_usb3_init(struct phy *phy) >> +{ >> + struct phy_g12a_usb3_pcie_priv *priv = phy_get_drvdata(phy); >> + int data, ret; >> + >> +

Re: [PATCH v2 5/8] phy: amlogic: add Amlogic G12A USB2 PHY Driver

2019-03-07 Thread Neil Armstrong
On 06/03/2019 22:00, Martin Blumenstingl wrote: > Hi Neil, > > On Mon, Mar 4, 2019 at 11:40 AM Neil Armstrong > wrote: > [...] >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include > there's a "regmap" include right above. this driver doesn't use sysco

Re: [PATCH v2 4/8] dt-bindings: usb: dwc3: Add Amlogic G12A DWC3 Glue Bindings

2019-03-07 Thread Neil Armstrong
On 06/03/2019 22:27, Martin Blumenstingl wrote: > Hi Neil, > > On Mon, Mar 4, 2019 at 11:40 AM Neil Armstrong > wrote: >> >> Adds the bindings for the Amlogic G12A USB Glue HW. >> >> The Amlogic G12A SoC Family embeds 2 USB Controllers : >> - a DWC3 IP configured as Host for USB2 and USB3 >> - a

Re: [PATCH v2 2/8] dt-bindings: phy: Add Amlogic G12A USB3+PCIE Combo PHY Bindings

2019-03-07 Thread Neil Armstrong
On 05/03/2019 22:42, Martin Blumenstingl wrote: > Hi Neil, > > On Mon, Mar 4, 2019 at 11:38 AM Neil Armstrong > wrote: >> >> Add the Amlogic G12A Family USB3 + PCIE Combo PHY Bindings. >> >> This PHY can provide exclusively USB3 or PCIE support on shared I/Os. >> >> Signed-off-by: Neil Armstrong