[PATCH 2/3] usb: typec: tcpm: Add support for configuring DP altmode through device-properties

2019-10-18 Thread Hans de Goede
set of DP pins on the GPU is connected to the USB Type-C connector. As such it is better to have a separate set of altmode specific properties per altmode and this commit adds a property for basic display-port altmode support. Signed-off-by: Hans de Goede --- .../bindings/connector/usb

[PATCH 3/3] platform/x86/intel_cht_int33fe: Add displayport-vdo property to the connector node

2019-10-18 Thread Hans de Goede
Add a displayport-vdo property to the usb-connector fwnode, devices which use this driver support display-port altmode through the PI3USB30532 USB switch, this enabled support for this. Signed-off-by: Hans de Goede --- drivers/platform/x86/intel_cht_int33fe.c | 1 + 1 file changed, 1 insertion

[PATCH 1/3] usb: typec: tcpm: Remove tcpc_config configuration mechanism

2019-10-18 Thread Hans de Goede
All configuration can and should be done through fwnodes instead of through the tcpc_config struct and there are no existing users left of struct tcpc_config, so lets remove it. Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/tcpm.c | 90 ++- include

Re: [PATCH v4 2/2] usb: roles: intel: Enable static DRD mode for role switch

2019-08-29 Thread Hans de Goede
ict fixed this series is: Tested-by: Hans de Goede Reviewed-by: Hans de Goede Regards, Hans --- changes since v3: Initialized drd_config variable to fix warning changes since v2: Revised SoB tags changes since v1: Added drd_config to avoid multiple if checks Other

Re: [PATCH 2/2] usb: roles: intel: Enable static DRD mode for role switch

2019-08-27 Thread Hans de Goede
Hi, On 26-08-19 16:32, Heikki Krogerus wrote: From: Saranya Gopal Enable static DRD mode in Intel platforms which guarantees successful role switch all the time. This fixes issues like software role switch failure after cold boot and issue with role switch when USB 3.0 cable is used. But, do n

Re: [PATCH 0/2] usb: roles: intel: Use static mode by default

2019-08-27 Thread Hans de Goede
Hi Heikki, On 26-08-19 16:32, Heikki Krogerus wrote: Hi Hans, These have been in my queue for a while now. For some reason I've been under the impression that there was still an issue with them, but that was a misunderstanding. Saranya and Balaji, I'm really sorry about that. Hans, I don't kno

Re: AW: [Resend] [PATCH v3] usb: xhci-pci: reorder removal to avoid use-after-free

2019-08-22 Thread Hans de Goede
Hi, On 22-08-19 17:48, Schmid, Carsten wrote: On 22-08-19 17:23, Mathias Nyman wrote: On 16.8.2019 12.03, Schmid, Carsten wrote: On driver removal, the platform_device_unregister call attached through devm_add_action_or_reset was executed after usb_hcd_pci_remove. This lead to a use-after-free

Re: [Resend] [PATCH v3] usb: xhci-pci: reorder removal to avoid use-after-free

2019-08-22 Thread Hans de Goede
Hi, On 22-08-19 17:23, Mathias Nyman wrote: On 16.8.2019 12.03, Schmid, Carsten wrote: On driver removal, the platform_device_unregister call attached through devm_add_action_or_reset was executed after usb_hcd_pci_remove. This lead to a use-after-free for the iomem resource of the xhci-ext-cap

[PATCH v2 2/3] usb: typec: fusb302: Use usb_debug_root as root for our debugfs entry

2019-08-17 Thread Hans de Goede
Use usb_debug_root as root for our debugfs entry instead of creating our own subdirectory under the debugfs root. Reviewed-by: Guenter Roeck Reviewed-by: Heikki Krogerus Signed-off-by: Hans de Goede --- Changes in v2: - Prefix debugfs entry filename with "fusb302-" --- drivers/usb/

[PATCH v2 1/3] usb: typec: tcpm: Use usb_debug_root as root for our debugfs entry

2019-08-17 Thread Hans de Goede
() with "tcpm-" here to avoid a name conflict. Reviewed-by: Guenter Roeck Reviewed-by: Heikki Krogerus Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/tcpm.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/d

[PATCH v2 3/3] usb: typec: fusb302: Call fusb302_debugfs_init earlier

2019-08-17 Thread Hans de Goede
1006f0 Call Trace: ? find_held_lock+0x39/0x90 ? _fusb302_log+0x81/0x1d0 [fusb302] ? vsnprintf+0x3aa/0x4f0 ? _fusb302_log+0x81/0x1d0 [fusb302] _fusb302_log+0x81/0x1d0 [fusb302] ... Reviewed-by: Guenter Roeck Reviewed-by: Heikki Krogerus Signed-off-by: Hans de Goede --- drivers/

Re: [PATCH 2/3] usb: typec: fusb: Use usb_debug_root as root for our debugfs entry

2019-08-17 Thread Hans de Goede
Hi, On 16-08-19 09:51, Heikki Krogerus wrote: On Thu, Aug 15, 2019 at 09:18:14PM +0200, Hans de Goede wrote: Use usb_debug_root as root for our debugfs entry instead of creating our own subdirectory under the debugfs root. Signed-off-by: Hans de Goede I have one question below. Otherwise

[PATCH 3/3] usb: typec: fusb302: Call fusb302_debugfs_init earlier

2019-08-15 Thread Hans de Goede
1006f0 Call Trace: ? find_held_lock+0x39/0x90 ? _fusb302_log+0x81/0x1d0 [fusb302] ? vsnprintf+0x3aa/0x4f0 ? _fusb302_log+0x81/0x1d0 [fusb302] _fusb302_log+0x81/0x1d0 [fusb302] ... Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/fusb302.c | 3 ++- 1 file changed, 2 in

[PATCH 1/3] usb: typec: tcpm: Use usb_debug_root as root for our debugfs entry

2019-08-15 Thread Hans de Goede
() with "tcpm-" here to avoid a name conflict. Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/tcpm.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 15abe1d9958f..5241d17c3

[PATCH 2/3] usb: typec: fusb: Use usb_debug_root as root for our debugfs entry

2019-08-15 Thread Hans de Goede
Use usb_debug_root as root for our debugfs entry instead of creating our own subdirectory under the debugfs root. Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/fusb302.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/usb/typec/tcpm/fusb302.c b

Re: [PATCH 0/3] usb: typec: fusb302: Small changes

2019-08-15 Thread Hans de Goede
ed-by: Hans de Goede Regards, Hans

Re: [PATCH v2] usb: xhci-pci: reorder removal to avoid use-after-free

2019-08-15 Thread Hans de Goede
the parent of the resource was freed earlier. Fix this by reordering of the removal sequence. Signed-off-by: Carsten Schmid Patch looks good to me: Reviewed-by: Hans de Goede Regards, Hans --- v2: - more speaking name for private data element - consider failure in driver init

Re: [PATCH] usb: typec: fusb302: Call fusb302_debugfs_init earlier

2019-08-15 Thread Hans de Goede
Hi, On 15-08-19 17:20, Guenter Roeck wrote: On Thu, Aug 15, 2019 at 04:31:59PM +0300, Heikki Krogerus wrote: As Guenter points out, don't check this, just call it anb move on. But are you _SURE_ you want this to be the name, at the root of debugfs? Why not put it under the usb debugfs directo

Re: [PATCH 0/3] usb: typec: fusb302: Small changes

2019-08-15 Thread Hans de Goede
Hi, On 15-08-19 14:55, Greg Kroah-Hartman wrote: On Wed, Aug 14, 2019 at 03:42:46PM +0200, Hans de Goede wrote: Hi, On 14-08-19 15:24, Heikki Krogerus wrote: Hi, This series removes the deprecated fusb302 specific properties, and stops using struct tcpc_config in the driver. Series looks

Re: [PATCH 0/3] usb: typec: fusb302: Small changes

2019-08-14 Thread Hans de Goede
Hi, On 14-08-19 15:24, Heikki Krogerus wrote: Hi, This series removes the deprecated fusb302 specific properties, and stops using struct tcpc_config in the driver. Series looks good to me: Reviewed-by: Hans de Goede This has a small conflict with my "[PATCH] usb: typec: fusb302:

Re: AW: [PATCH] usb: xhci-pci: reorder removal to avoid use-after-free

2019-08-14 Thread Hans de Goede
Hi, On 14-08-19 15:32, Schmid, Carsten wrote: On driver removal, the platform_device_unregister call attached through devm_add_action_or_reset was executed after usb_hcd_pci_remove. This lead to a use-after-free for the iomem resorce of the xhci-ext-caps driver in the platform removal because th

Re: [PATCH] usb: xhci-pci: reorder removal to avoid use-after-free

2019-08-14 Thread Hans de Goede
Hi, On 14-08-19 13:39, Schmid, Carsten wrote: On driver removal, the platform_device_unregister call attached through devm_add_action_or_reset was executed after usb_hcd_pci_remove. This lead to a use-after-free for the iomem resorce of the xhci-ext-caps driver in the platform removal because th

Re: [PATCH] usb: typec: fusb302: Call fusb302_debugfs_init earlier

2019-08-13 Thread Hans de Goede
Hi Heikki, On 13-08-19 12:52, Heikki Krogerus wrote: Hi Hans, On Tue, Aug 13, 2019 at 12:15:24PM +0200, Hans de Goede wrote: tcpm_register_port() will call some of the fusb302 code's callbacks wich in turn will call fusb302_log(). So we need to call fusb302_debugfs_init() before we

[PATCH] usb: typec: fusb302: Call fusb302_debugfs_init earlier

2019-08-13 Thread Hans de Goede
1006f0 Call Trace: ? find_held_lock+0x39/0x90 ? _fusb302_log+0x81/0x1d0 [fusb302] ? vsnprintf+0x3aa/0x4f0 ? _fusb302_log+0x81/0x1d0 [fusb302] _fusb302_log+0x81/0x1d0 [fusb302] ... Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/fusb302.c | 3 ++- 1 file changed, 2 in

Re: AW: AW: AW: KASAN: use-after-free Read in usbhid_power

2019-08-10 Thread Hans de Goede
Hi, On 09-08-19 14:38, Schmid, Carsten wrote: Hi again, Hey, i did not want to trigger an eartquake in the basement of the kernel ;-) My intention was to prevent some crashes, and help developers to find their bugs. I think my patch exactly does this. Hehe, actually drivers not being able

Re: AW: AW: KASAN: use-after-free Read in usbhid_power

2019-08-09 Thread Hans de Goede
Hi, On 8/9/19 12:47 PM, Schmid, Carsten wrote: We are talking memory-mapped io here, so it cannot just be "re-used", it is wat it is. I guess the PCI BAR could be released and then the physical address the resource was at could be re-used for another piece of MMIo, but AFAIK outside of PI=CI ho

Re: AW: KASAN: use-after-free Read in usbhid_power

2019-08-09 Thread Hans de Goede
Hi, On 8/9/19 11:34 AM, Schmid, Carsten wrote: -Ursprüngliche Nachricht- Von: Greg KH [mailto:gre...@linuxfoundation.org] Gesendet: Freitag, 9. August 2019 09:56 An: Schmid, Carsten Cc: Alan Stern ; Andrey Konovalov ; Oliver Neukum ; syzkaller-bugs ; syzbot ; USB list ; Hillf Danton Be

[PATCH v2 3/3] usb: typec: fusb302: Revert "Resolve fixed power role contract setup"

2019-04-16 Thread Hans de Goede
en, codewise this is not a straight forward revert. Functionality wise this is a straight revert and the original functionality is fully restored. Fixes: ea3b4d5523bc ("usb: typec: fusb302: Resolve fixed power role ...") Cc: Adam Thomson Signed-off-by: Hans de Goede --- Changes in v2: -No

[PATCH v2 1/3] usb: typec: tcpm: Notify the tcpc to start connection-detection for SRPs

2019-04-16 Thread Hans de Goede
role ...") Cc: Adam Thomson Signed-off-by: Hans de Goede --- Changes in v2: -Rename start_drp_toggling to start_toggling and make it multi-purpose, rather then adding a new start_srp_connection_detect callback --- drivers/usb/typec/tcpm/fusb302.c | 10 +++--- drivers/usb/typec/tcpm/tcpc

[PATCH v2 2/3] usb: typec: fusb302: Implement start_toggling for all port-types

2019-04-16 Thread Hans de Goede
. Fixes: ea3b4d5523bc("usb: typec: fusb302: Resolve fixed power role ...") Cc: Adam Thomson Signed-off-by: Hans de Goede --- Changes in v2: -Adjust for the tcpm core renaming start_drp_toggling to start_toggling, instead of adding a new start_srp_connection_detect callback --- drivers

Re: [PATCH 1/3] usb: typec: tcpm: Add start_srp_connection_detect callback

2019-04-16 Thread Hans de Goede
Hi, On 15-04-19 20:38, Guenter Roeck wrote: On Mon, Apr 15, 2019 at 07:53:58PM +0200, Hans de Goede wrote: Hi Guenter, On 15-04-19 17:51, Guenter Roeck wrote: On Sat, Apr 13, 2019 at 10:39:53PM +0200, Hans de Goede wrote: Some tcpc device-drivers need to explicitly be told to watch for

Re: [PATCH 2/3] usb: typec: fusb302: Implement start_srp_connection_detect

2019-04-16 Thread Hans de Goede
Hi, Thank you for the review. On 14-04-19 09:40, Sergei Shtylyov wrote: Hello! On 13.04.2019 23:39, Hans de Goede wrote: When in single role port mode, we most start single-role toggling to    Must, perhaps? Right, fixed for the upcoming v2 of the patch-set. get an interrupt when a

Re: [PATCH 1/3] usb: typec: tcpm: Add start_srp_connection_detect callback

2019-04-15 Thread Hans de Goede
Hi Guenter, On 15-04-19 17:51, Guenter Roeck wrote: On Sat, Apr 13, 2019 at 10:39:53PM +0200, Hans de Goede wrote: Some tcpc device-drivers need to explicitly be told to watch for connection events, otherwise the tcpc will not generate any TCPM_CC_EVENTs and devices being plugged into the Type

Re: [PATCH 1/3] usb: typec: tcpm: Add start_srp_connection_detect callback

2019-04-15 Thread Hans de Goede
Hi, On 15-04-19 12:31, Adam Thomson wrote: On 13 April 2019 21:40, Hans de Goede wrote: Some tcpc device-drivers need to explicitly be told to watch for connection events, otherwise the tcpc will not generate any TCPM_CC_EVENTs and devices being plugged into the Type-C port will not be

[PATCH 2/3] usb: typec: fusb302: Implement start_srp_connection_detect

2019-04-13 Thread Hans de Goede
When in single role port mode, we most start single-role toggling to get an interrupt when a device / cable gets plugged into the port. This commit implements the tcpc_dev start_srp_connection_detect callback for this. Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/fusb302.c | 30

[PATCH 1/3] usb: typec: tcpm: Add start_srp_connection_detect callback

2019-04-13 Thread Hans de Goede
ented calls this in place of start_drp_toggling for SRP devices. Fixes: ea3b4d5523bc("usb: typec: fusb302: Resolve fixed power role ...") Cc: Adam Thomson Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/tcpm.c | 8 include/linux/usb/tcpm.h | 6 ++ 2 fi

[PATCH 3/3] usb: typec: fusb302: Revert "Resolve fixed power role contract setup"

2019-04-13 Thread Hans de Goede
en, codewise this is not a straight forward revert. Functionality wise this is a straight revert and the original functionality is fully restored. Fixes: ea3b4d5523bc ("usb: typec: fusb302: Resolve fixed power role ...") Cc: Adam Thomson Signed-off-by: Hans de Goede --- d

Re: Question about regulators

2019-04-09 Thread Hans de Goede
Hi, On 09-04-19 09:26, Miquel Raynal wrote: Hello, Adding Greg & Hans just in case they have an idea, or someone else to ping in mind. Miquel Raynal wrote on Wed, 3 Apr 2019 10:13:43 +0200: Hello, I am reading the document named "xHCI interoperability testing v0.94" available on usb.org. T

Re: [PATCH] usb: typec: Registering real device entries for the muxes

2019-04-01 Thread Hans de Goede
HI, On 01-04-19 14:40, Heikki Krogerus wrote: On Mon, Apr 01, 2019 at 12:34:29PM +0200, Greg KH wrote: On Mon, Apr 01, 2019 at 01:15:53PM +0300, Heikki Krogerus wrote: Registering real device entries (struct device) for the mode muxes as well as for the orientation switches. The Type-C mux co

[PATCH v2] usb: typec: tcpm: Try PD-2.0 if sink does not respond to 3.0 source-caps

2019-03-16 Thread Hans de Goede
working by re-trying the contract negotiation with PD-2.0 source-caps messages if we don't have a contract after PD_N_HARD_RESET_COUNT hard-reset attempts. The problem fixed by this commit was noticed with a Type-C to VGA dongle. Signed-off-by: Hans de Goede --- The Type-C to VGA dongle on which

Re: [PATCH] usb: typec: tcpm: Try PD-2.0 if sink does not respond to 3.0 source-caps

2019-03-16 Thread Hans de Goede
Hi, On 15-03-19 17:53, Guenter Roeck wrote: On Fri, Mar 15, 2019 at 05:43:05PM +0100, Hans de Goede wrote: Hi, On 3/15/19 3:57 PM, Guenter Roeck wrote: On Fri, Mar 15, 2019 at 03:42:19PM +0100, Hans de Goede wrote: PD 2.0 sinks are supposed to accept src-capabilities with a 3.0 header and

Re: [PATCH] usb: typec: tcpm: Try PD-2.0 if sink does not respond to 3.0 source-caps

2019-03-15 Thread Hans de Goede
Hi, On 3/15/19 3:57 PM, Guenter Roeck wrote: On Fri, Mar 15, 2019 at 03:42:19PM +0100, Hans de Goede wrote: PD 2.0 sinks are supposed to accept src-capabilities with a 3.0 header and simply ignore any src PDOs which the sink does not understand such as PPS but some 2.0 sinks instead ignore the

[PATCH] usb: typec: tcpm: Try PD-2.0 if sink does not respond to 3.0 source-caps

2019-03-15 Thread Hans de Goede
working by re-trying the contract negotiation with PD-2.0 source-caps messages if we don't have a contract after PD_N_HARD_RESET_COUNT hard-reset attempts. The problem fixed by this commit was noticed with a Type-C to VGA dongle. Signed-off-by: Hans de Goede --- The Type-C to VGA dongle on which

Re: [PATCH v3 1/2] dt-bindings: usb: add documentation for typec switch via GPIO

2019-03-12 Thread Hans de Goede
Hi, On 12-03-19 11:45, Heikki Krogerus wrote: Hi, On Tue, Mar 12, 2019 at 10:32:00AM +, Jun Li wrote: Hi Hans -Original Message- From: Hans de Goede Sent: 2019年3月11日 19:03 To: Jun Li ; robh...@kernel.org; heikki.kroge...@linux.intel.com Cc: gre...@linuxfoundation.org

Re: [PATCH v3 1/2] dt-bindings: usb: add documentation for typec switch via GPIO

2019-03-11 Thread Hans de Goede
Hi, On 11-03-19 12:02, Hans de Goede wrote: Hi, On 11-03-19 11:40, Jun Li wrote: Some typec super speed active channel switch can be controlled via a GPIO, this binding can be used to specify the switch node by a GPIO and the remote endpoint of its consumer. Signed-off-by: Li Jun

Re: [PATCH v3 1/2] dt-bindings: usb: add documentation for typec switch via GPIO

2019-03-11 Thread Hans de Goede
Hi, On 11-03-19 11:40, Jun Li wrote: Some typec super speed active channel switch can be controlled via a GPIO, this binding can be used to specify the switch node by a GPIO and the remote endpoint of its consumer. Signed-off-by: Li Jun --- .../devicetree/bindings/usb/typec-switch-gpio.txt

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

2019-03-11 Thread Hans de Goede
wake setting on the irq and also properly stop the delayed work for bcl handling. Reviewed-by: Guenter Roeck Signed-off-by: Hans de Goede --- Changes in v3: -Change devm_request_irq to a regular request_irq free_irq, so that the work can be properly stopped Changes in v2: -Use a work_queue item

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

2019-03-11 Thread Hans de Goede
set all bits, so we can skip the read, turning 4 (slowish) i2c-transfers into 1. Doing this also avoids the need to cache the pull_up state in struct fusb302_chip. Reviewed-by: Guenter Roeck Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/fusb302.c | 48

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

2019-03-11 Thread Hans de Goede
Add __printf attribute to fusb302_log function, so that we get compiler warnings when specifying wrong vararg parameters. Reviewed-by: Guenter Roeck 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

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

2019-03-11 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. Reviewed-by: Guenter Roeck Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/fusb302.c | 51 1 file

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

2019-03-11 Thread Hans de Goede
Hi All, Here is v3 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). Changes in v3: [PAT

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

2019-03-11 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 to catch any cases where vconn is not off for some reason. Signed-off-by: Hans de Goede --- Changes in v3: -Use WARN with a message describing

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

2019-03-11 Thread Hans de Goede
2_handle_togdone_src when toggling is done. Together this allows us to simplify things to: 1) fusb302_set_cc_pull(...) 2) "reset cc status" 3) fusb302_set_src_current(...) 4) fusb302_set_toggling(new-toggling-mode) This commit does this, leading to a nice cleanup. Reviewed-by: Guenter

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

2019-03-11 Thread Hans de Goede
, rather then on where the toggling stopped. Signed-off-by: Hans de Goede --- Changes in v3 -Keep the delays for measuring Rd / Ra the same as before instead of multiplying them by a factor 100 --- drivers/usb/typec/tcpm/fusb302.c | 149 --- 1 file changed, 97 insertions

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

2019-03-11 Thread Hans de Goede
Fix a copy and paste error in an error message and a spelling error in a comment. Reviewed-by: Guenter Roeck 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

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

2019-03-08 Thread Hans de Goede
Hi, On 07-03-19 19:11, Guenter Roeck wrote: 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

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

2019-03-08 Thread Hans de Goede
Hi, On 08-03-19 07:13, Chunfeng Yun wrote: 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/de

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

2019-03-08 Thread Hans de Goede
Hi, On 07-03-19 19:19, Guenter Roeck wrote: 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

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

2019-03-08 Thread Hans de Goede
Hi, On 08-03-19 08:33, Heikki Krogerus wrote: 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 al

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

2019-03-07 Thread Hans de Goede
woken from suspend by plugging in a Type-C device: fusb302: i2c: pm suspend, retry 1 / 10 fusb302: i2c: pm suspend, retry 2 / 10 etc. Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/fusb302.c | 109 +-- 1 file changed, 45 insertions(+), 64 deletions(-) diff

[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

[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

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

2019-03-07 Thread Hans de Goede
, rather then on where the toggling stopped. Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/fusb302.c | 149 --- 1 file changed, 97 insertions(+), 52 deletions(-) diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c index f43fe34b7a73

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

2019-03-07 Thread Hans de Goede
all bits, so we can skip the read, turning 4 (slowish) i2c-transfers into 1. Doing this also avoids the need to cache the pull_up state in struct fusb302_chip. Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/fusb302.c | 48 +++- 1 file changed, 16 insertions

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

2019-03-07 Thread Hans de Goede
2_handle_togdone_src when toggling is done. Together this allows us to simplify things to: 1) fusb302_set_cc_pull(...) 2) "reset cc status" 3) fusb302_set_src_current(...) 4) fusb302_set_toggling(new-toggling-mode) This commit does this, leading to a nice cleanup. Signed-off-by: Hans de

[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

[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: [PATCH 0/3] Propagate DP-over-Type-C hotplug events from Type-C subsys to drm-drivers

2019-03-04 Thread Hans de Goede
Hi, On 04-03-19 16:17, Heikki Krogerus wrote: Hi Hans, On Thu, Feb 28, 2019 at 05:54:21PM +0100, Hans de Goede wrote: Hi Heikki, On 28-02-19 15:47, Heikki Krogerus wrote: Hi Hans, On Thu, Feb 28, 2019 at 12:24:25PM +0100, Hans de Goede wrote: Hi, On 28-02-19 10:15, Heikki Krogerus wrote

Re: [PATCH 0/3] Propagate DP-over-Type-C hotplug events from Type-C subsys to drm-drivers

2019-02-28 Thread Hans de Goede
Hi Heikki, On 28-02-19 15:47, Heikki Krogerus wrote: Hi Hans, On Thu, Feb 28, 2019 at 12:24:25PM +0100, Hans de Goede wrote: Hi, On 28-02-19 10:15, Heikki Krogerus wrote: I've been thinking about this... Do we actually need to link the correct drm_connector to the Type-C conn

Re: [PATCH 0/3] Propagate DP-over-Type-C hotplug events from Type-C subsys to drm-drivers

2019-02-28 Thread Hans de Goede
Hi, On 28-02-19 10:15, Heikki Krogerus wrote: On Wed, Feb 27, 2019 at 04:45:32PM +0100, Hans de Goede wrote: Hi, On 27-02-19 12:16, Jani Nikula wrote: On Wed, 27 Feb 2019, Heikki Krogerus wrote: One thing that this series does not consider is the DP lane count problem. The GPU drivers

Re: [PATCH 3/3] usb: typec: altmodes/displayport: Notify drm subsys of hotplug events

2019-02-27 Thread Hans de Goede
Hi, On 27-02-19 10:44, Heikki Krogerus wrote: On Mon, Feb 25, 2019 at 02:20:37PM +0100, Hans de Goede wrote: Use the new drm_kms_call_oob_hotplug_notifier_chain() function to load drm/kms drivers know about DisplayPort over Type-C hotplug events. Signed-off-by: Hans de Goede I'm OK

Re: [PATCH 0/3] Propagate DP-over-Type-C hotplug events from Type-C subsys to drm-drivers

2019-02-27 Thread Hans de Goede
Hi, On 27-02-19 12:16, Jani Nikula wrote: On Wed, 27 Feb 2019, Heikki Krogerus wrote: One thing that this series does not consider is the DP lane count problem. The GPU drivers (i915 in this case) does not know is four, two or one DP lanes in use. Also, orientation. The orientation should

Re: [PATCH] usb: typec: pi3usb30532: Keep orientation when setting mux to safe mode

2019-02-25 Thread Hans de Goede
Hi, On 25-02-19 16:50, Heikki Krogerus wrote: On Fri, Feb 22, 2019 at 08:22:39PM +0100, Hans de Goede wrote: Keep the orientation value when setting the mux to safe mode, this fixes the orientation getting reset when switching alt-modes. Signed-off-by: Hans de Goede Should this be also a

Re: [PATCH] usb: typec: altmodes/displayport: Fall back to multi-func pins

2019-02-25 Thread Hans de Goede
Hi Heikki, On 25-02-19 16:49, Heikki Krogerus wrote: On Mon, Feb 25, 2019 at 01:56:37PM +0100, Hans de Goede wrote: If our port-partner supports both DP-only operation (pin-assignment C) and multi-func operation (pin-assignment D) and we only support pin-assignment D and the port-partner

Re: [PATCH 3/3] usb: typec: altmodes/displayport: Notify drm subsys of hotplug events

2019-02-25 Thread Hans de Goede
Hi, On 25-02-19 15:06, Greg Kroah-Hartman wrote: On Mon, Feb 25, 2019 at 02:20:37PM +0100, Hans de Goede wrote: Use the new drm_kms_call_oob_hotplug_notifier_chain() function to load s/load/let/ fixed in my tree. drm/kms drivers know about DisplayPort over Type-C hotplug events. Signed

[PATCH 3/3] usb: typec: altmodes/displayport: Notify drm subsys of hotplug events

2019-02-25 Thread Hans de Goede
Use the new drm_kms_call_oob_hotplug_notifier_chain() function to load drm/kms drivers know about DisplayPort over Type-C hotplug events. Signed-off-by: Hans de Goede --- drivers/usb/typec/altmodes/displayport.c | 34 1 file changed, 23 insertions(+), 11 deletions

[PATCH 2/3] i915: Add support for out-of-bound hotplug events

2019-02-25 Thread Hans de Goede
ommit adds support for this. Together with the recent addition of DP alt-mode support to the Type-C subsystem this makes DP over Type-C work on these devices. Signed-off-by: Hans de Goede --- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/i915_irq.c | 2 ++ drivers/gp

[PATCH 0/3] Propagate DP-over-Type-C hotplug events from Type-C subsys to drm-drivers

2019-02-25 Thread Hans de Goede
Hi All, On some Cherry Trail devices, DisplayPort over Type-C is supported through a USB-PD microcontroller (e.g. a fusb302) + a mux to switch the superspeed datalines between USB-3 and DP (e.g. a pi3usb30532). The kernel in this case does the PD/alt-mode negotiation itself, rather then everything

[PATCH 1/3] drm: Add support for out-of-band hotplug notification

2019-02-25 Thread Hans de Goede
ifier. Signed-off-by: Hans de Goede --- Documentation/gpu/drm-kms-helpers.rst | 1 + drivers/gpu/drm/drm_probe_helper.c| 67 +++ include/drm/drm_probe_helper.h| 12 + 3 files changed, 80 insertions(+) diff --git a/Documentation/gpu/drm-kms-helpers.r

[PATCH] usb: typec: altmodes/displayport: Fall back to multi-func pins

2019-02-25 Thread Hans de Goede
and fail to pick a pin-assignment. Instead only mask out the multi-func pin-assignments if we support dp-only pin-assignments, so that we correctly fall-back to a multi-func pin-assignment in this case (by picking pin-assignment D). Signed-off-by: Hans de Goede --- drivers/usb/typec/altmodes

[PATCH] usb: typec: pi3usb30532: Keep orientation when setting mux to safe mode

2019-02-22 Thread Hans de Goede
Keep the orientation value when setting the mux to safe mode, this fixes the orientation getting reset when switching alt-modes. Signed-off-by: Hans de Goede --- drivers/usb/typec/mux/pi3usb30532.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/typec/mux

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

2019-02-22 Thread Hans de Goede
de Goede --- drivers/usb/typec/tcpm/fusb302.c | 62 ++-- 1 file changed, 3 insertions(+), 59 deletions(-) diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c index 637ea1232fa0..940e096a4ac6 100644 --- a/drivers/usb/typec/tcpm/fusb302.c

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

2019-02-22 Thread Hans de Goede
2_handle_togdone_src when toggling is done. Together this allows us to simplify things to: 1) fusb302_set_cc_pull(...) 2) "reset cc status" 3) fusb302_set_src_current(...) 4) fusb302_set_toggling(new-toggling-mode) This commit does this, leading to a nice cleanup. Signed-off-by: Hans de

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

2019-02-22 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

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

2019-02-22 Thread Hans de Goede
all bits, so we can skip the read, turning 4 (slowish) i2c-transfers into 1. Doing this also avoids the need to cache the pull_up state in struct fusb302_chip. Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/fusb302.c | 48 +++- 1 file changed, 16 insertions

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

2019-02-22 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 5/8] usb: typec: fusb302: Fix fusb302_handle_togdone_src Ra handling

2019-02-22 Thread Hans de Goede
, rather then on where the toggling stopped. Signed-off-by: Hans de Goede --- drivers/usb/typec/tcpm/fusb302.c | 149 --- 1 file changed, 97 insertions(+), 52 deletions(-) diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c index f83e777aeabf

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

2019-02-22 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

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

2019-02-22 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

Re: [PATCH 1/8] platform/x86: intel_cht_int33fe: Remove connection for the alt mode mux

2019-01-31 Thread Hans de Goede
Hi, On 28-01-19 16:27, Heikki Krogerus wrote: Hi Hans, On Mon, Jan 28, 2019 at 11:44:29AM +0100, Hans de Goede wrote: Hi, On 28-01-19 10:45, Andy Shevchenko wrote: On Fri, Jan 25, 2019 at 3:17 PM Heikki Krogerus wrote: Driver for fusb302 does not support alternate modes, so the

Re: [PATCH v2 0/9] device connection: Add support for device graphs

2019-01-31 Thread Hans de Goede
d it looks good to me. Patches 1-3 are: Reviewed-by: Hans de Goede I'm slightly less familiar with the material in patches 4-9, so they are: Acked-by: Hans de Goede I will also add this series to my personal git tree for testing. Regards, Hans That was actually happening also in th

Re: [PATCH 1/8] platform/x86: intel_cht_int33fe: Remove connection for the alt mode mux

2019-01-28 Thread Hans de Goede
Hi, On 28-01-19 10:45, Andy Shevchenko wrote: On Fri, Jan 25, 2019 at 3:17 PM Heikki Krogerus wrote: Driver for fusb302 does not support alternate modes, so the connection is not really needed for now. Removing that connection description allows us to improve the USB Type-C mux API. Acked-

Re: [PATCH V2] roles: Fix for Enabling USB ROLE SWITCH QUIRK on INTEL_SUNRISEPOINT_LP_XHCI

2019-01-07 Thread Hans de Goede
Hi, On 08-01-19 11:04, m.bal...@intel.com wrote: From: M, Balaji This fix enables USB role feature on intel commercial nuc platform which is based on Kabylake chipset. Signed-off-by: M, Balaji Reviewed-by: Hans de Goede --- Changes from v1: Added Reviewed-by There is no need to send

Re: [PATCH] roles: Fix for Enabling USB ROLE SWITCH QUIRK on INTEL_SUNRISEPOINT_LP_XHCI

2019-01-07 Thread Hans de Goede
Hi, On 08-01-19 07:25, m.bal...@intel.com wrote: From: M, Balaji This fix enables USB role feature on intel commercial nuc platform which is based on Kabylake chipset. Signed-off-by: M, Balaji Patch looks good to me: Reviewed-by: Hans de Goede Regards, Hans --- drivers/usb/host

Re: tusb1210 probe of dwc3.0.auto.ulpi fails with EBUSY on 4.19+

2018-12-16 Thread Hans de Goede
Hi, On 16-12-18 18:36, Stephan Gerhold wrote: On Mon, Dec 03, 2018 at 11:50:53AM +0100, Hans de Goede wrote: Hi, Somewhat off topic, but: To be exact my device does not have them in the (original) ACPI table either. At the moment I override the ACPI DSDT table because there are some things

Re: [PATCH] Revert "usb: dwc3: pci: Use devm functions to get the phy GPIOs"

2018-12-09 Thread Hans de Goede
Hi, On 09-12-18 16:07, Stephan Gerhold wrote: On Sun, Dec 09, 2018 at 04:44:16PM +0200, Andy Shevchenko wrote: On Thu, Dec 6, 2018 at 8:49 PM Stephan Gerhold wrote: Commit 211f658b7b40 ("usb: dwc3: pci: Use devm functions to get the phy GPIOs") changed the code to claim the PHY GPIOs permane

Re: [PATCH] Revert "usb: dwc3: pci: Use devm functions to get the phy GPIOs"

2018-12-09 Thread Hans de Goede
Hi, On 09-12-18 15:44, Andy Shevchenko wrote: On Thu, Dec 6, 2018 at 8:49 PM Stephan Gerhold wrote: Commit 211f658b7b40 ("usb: dwc3: pci: Use devm functions to get the phy GPIOs") changed the code to claim the PHY GPIOs permanently for Intel Baytrail devices. This causes issues when the actu

Re: [PATCH] Revert "usb: dwc3: pci: Use devm functions to get the phy GPIOs"

2018-12-09 Thread Hans de Goede
I did not realize that the phy driver would take over managing the GPIOs (and on my test device it doesn't due to an unrelated issue). So reverting this is the right thing to do: Acked-by: Hans de Goede Regards, Hans --- drivers/usb/dwc3/dwc3-pci.c | 8 1 file changed, 4 i

Re: tusb1210 probe of dwc3.0.auto.ulpi fails with EBUSY on 4.19+

2018-12-03 Thread Hans de Goede
Hi, On 03-12-18 17:21, Stephan Gerhold wrote: On Mon, Dec 03, 2018 at 11:50:53AM +0100, Hans de Goede wrote: Hi, On 02-12-18 18:08, Stephan Gerhold wrote: Hi, thanks for the quick reply! :) On Sun, Dec 02, 2018 at 03:41:29PM +0100, Hans de Goede wrote: Hi, On 01-12-18 13:22, Stephan

  1   2   3   4   5   6   7   8   9   10   >