Re: [PATCH 11/18] usb: typec: ucsi: Simplified registration and I/O API

2019-10-21 Thread Guenter Roeck
On 10/21/19 4:25 AM, Heikki Krogerus wrote: Adding more simplified API for interface registration and read and write operations. The registration is split into separate creation and registration phases. That allows the drivers to properly initialize the interface before registering it if necessa

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

2019-10-20 Thread Guenter Roeck
On 10/18/19 12:57 PM, Hans de Goede wrote: Add support for configuring display-port altmode through device-properties. We could try to add a generic mechanism for describing altmodes in device-properties, but various altmodes will likely need altmode specific configuration. E.g. the display-port

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

2019-10-20 Thread Guenter Roeck
e Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/tcpm/tcpm.c | 90 ++- > include/linux/usb/tcpm.h | 41 > 2 files changed, 3 insertions(+), 128 deletions(-) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/driv

Re: [PATCH v4 1/9] usb: typec: Copy everything from struct typec_capability during registration

2019-10-11 Thread Guenter Roeck
he port uses. > > Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/class.c | 20 ++-- > 1 file changed, 14 insertions(+), 6 deletions(-) > > diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c > ind

Re: [PATCH v3 9/9] usb: typec: Remove unused members from struct typec_capability

2019-10-08 Thread Guenter Roeck
On Tue, Oct 08, 2019 at 02:13:50PM +0300, Heikki Krogerus wrote: > The members for the muxes are not used, so dropping them. > > Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck > --- > include/linux/usb/typec.h | 2 -- > 1 file changed, 2 deletions(-) > &

Re: [PATCH v3 8/9] usb: typec: Remove the callback members from struct typec_capability

2019-10-08 Thread Guenter Roeck
On Tue, Oct 08, 2019 at 02:13:49PM +0300, Heikki Krogerus wrote: > There are no more users for them. > > Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/class.c | 40 +++ > include/linu

Re: [PATCH v3 7/9] usb: typec: hd3ss3220: Start using struct typec_operations

2019-10-08 Thread Guenter Roeck
where in the > driver. > > Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/hd3ss3220.c | 24 +--- > 1 file changed, 13 insertions(+), 11 deletions(-) > > diff --git a/drivers/usb/typec/hd3ss3220.c b/drivers/usb/ty

Re: [PATCH v3 3/9] usb: typec: Separate the operations vector

2019-10-08 Thread Guenter Roeck
ned-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/class.c | 39 +-- > include/linux/usb/typec.h | 20 > 2 files changed, 49 insertions(+), 10 deletions(-) > > diff --git a/drivers/usb/typec

Re: [PATCH v3 2/9] usb: typec: Introduce typec_get_drvdata()

2019-10-08 Thread Guenter Roeck
On Tue, Oct 08, 2019 at 02:13:43PM +0300, Heikki Krogerus wrote: > Leaving the private driver_data pointer of the port device > to the port drivers. > > Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/class.c | 11 +++ > incl

Re: [PATCH v3 1/9] usb: typec: Copy everything from struct typec_capability during registration

2019-10-08 Thread Guenter Roeck
On Tue, Oct 08, 2019 at 02:13:42PM +0300, Heikki Krogerus wrote: > Copying everything from struct typec_capability to struct > typec_port during port registration. This will make sure > that under no circumstances the driver can change the values > in the struct typec_capability that the port uses.

Re: [PATCH v2 4/7] usb: typec: tcpm: Start using struct typec_operations

2019-10-05 Thread Guenter Roeck
On 10/4/19 8:08 AM, Heikki Krogerus wrote: Supplying the operation callbacks as part of a struct typec_operations instead of as part of struct typec_capability during port registration. Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck --- drivers/usb/typec/tcpm/tcpm.c | 45

Re: [PATCH v2 7/7] usb: typec: Remove the callback members from struct typec_capability

2019-10-05 Thread Guenter Roeck
On 10/4/19 8:08 AM, Heikki Krogerus wrote: There are no more users for them. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/class.c | 38 ++ include/linux/usb/typec.h | 17 - 2 files changed, 10 insertions(+), 45 deletions(-) diff -

Re: [PATCH v2 3/7] usb: typec: Separate the operations vector

2019-10-05 Thread Guenter Roeck
On 10/4/19 8:08 AM, Heikki Krogerus wrote: Introducing struct typec_operations which has the same callbacks as struct typec_capability. The old callbacks are kept for now, but after all users have been converted, they will be removed. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/class

Re: [PATCH 1/7] usb: typec: Copy everything from struct typec_capability during registration

2019-10-02 Thread Guenter Roeck
On 10/2/19 12:16 PM, Heikki Krogerus wrote: On Wed, Oct 02, 2019 at 07:06:55PM +0300, Heikki Krogerus wrote: This is a bit off topic, but that attribute file is really horrible. Right now there is no way to know the actual capability of the port in user space. If something changes a DRP port int

Re: [PATCH 1/7] usb: typec: Copy everything from struct typec_capability during registration

2019-10-02 Thread Guenter Roeck
On 10/2/19 11:29 AM, Heikki Krogerus wrote: On Wed, Oct 02, 2019 at 09:36:39AM -0700, Guenter Roeck wrote: port->cap->type used to be the role provided by the low level driver. That was static, and it was not possible to override it. It did not resemble the current port type, or a conf

Re: [PATCH 1/7] usb: typec: Copy everything from struct typec_capability during registration

2019-10-02 Thread Guenter Roeck
On Wed, Oct 02, 2019 at 07:06:52PM +0300, Heikki Krogerus wrote: > On Tue, Oct 01, 2019 at 06:08:17AM -0700, Guenter Roeck wrote: > > On 10/1/19 2:48 AM, Heikki Krogerus wrote: > > > Copying everything from struct typec_capability to struct > > > typec_po

Re: [PATCH v2] usb: typec: tcpm: usb: typec: tcpm: Fix a signedness bug in tcpm_fw_get_caps()

2019-10-01 Thread Guenter Roeck
TCPM code together") Signed-off-by: Dan Carpenter Reviewed-by: Guenter Roeck --- v2: preserve the error code drivers/usb/typec/tcpm/tcpm.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcp

Re: [PATCH 7/7] usb: typec: Remove the callback members from struct typec_capability

2019-10-01 Thread Guenter Roeck
On 10/1/19 2:48 AM, Heikki Krogerus wrote: There are no more users for them. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/class.c | 65 +-- include/linux/usb/typec.h | 17 -- 2 files changed, 22 insertions(+), 60 deletions(-) diff --git a

Re: [PATCH 5/7] usb: typec: tps6598x: Start using struct typec_operations

2019-10-01 Thread Guenter Roeck
Krogerus Nitpick or not: Reviewed-by: Guenter Roeck --- drivers/usb/typec/tps6598x.c | 49 +++- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/drivers/usb/typec/tps6598x.c b/drivers/usb/typec/tps6598x.c index a38d1409f15b..0698addd1185 100644

Re: [PATCH 6/7] usb: typec: ucsi: Start using struct typec_operations

2019-10-01 Thread Guenter Roeck
On 10/1/19 2:48 AM, Heikki Krogerus wrote: Supplying the operation callbacks as part of a struct typec_operations instead of as part of struct typec_capability during port registration. Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck --- drivers/usb/typec/ucsi/ucsi.c | 22

Re: [PATCH 5/7] usb: typec: tps6598x: Start using struct typec_operations

2019-10-01 Thread Guenter Roeck
On 10/1/19 2:48 AM, Heikki Krogerus wrote: Supplying the operation callbacks as part of a struct typec_operations instead of as part of struct typec_capability during port registration. After this there is not need to keep the capabilities stored anywhere in the driver. Signed-off-by: Heikki Kro

Re: [PATCH 4/7] usb: typec: tcpm: Start using struct typec_operations

2019-10-01 Thread Guenter Roeck
On 10/1/19 2:48 AM, Heikki Krogerus wrote: Supplying the operation callbacks as part of a struct typec_operations instead of as part of struct typec_capability during port registration. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/tcpm/tcpm.c | 47 ---

Re: [PATCH 3/7] usb: typec: Separate the operations vector

2019-10-01 Thread Guenter Roeck
On 10/1/19 2:48 AM, Heikki Krogerus wrote: Introducing struct typec_operations which has the same callbacks as struct typec_capability. The old callbacks are kept for now, but after all users have been converted, they will be removed. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/class

Re: [PATCH 1/7] usb: typec: Copy everything from struct typec_capability during registration

2019-10-01 Thread Guenter Roeck
On 10/1/19 2:48 AM, Heikki Krogerus wrote: Copying everything from struct typec_capability to struct typec_port during port registration. What is the purpose of this patch ? To reduce the number of indirections at runtime, or to avoid having to have cap around ? FWIW, it looks like the code do

Re: [PATCH] typec: tcpm: fix a typo in the comparison of pdo_max_voltage

2019-08-22 Thread Guenter Roeck
eve this > is a typo. Fix this. > > Addresses-Coverity: ("Copy-paste error") > Fixes: 5007e1b5db73 ("typec: tcpm: Validate source and sink caps") > Signed-off-by: Colin Ian King I think you are correct. Reviewed-by: Guenter Roeck > --- > drivers/usb/typec

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

2019-08-15 Thread Guenter Roeck
006f0 > 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 Reviewed-by: Guenter Roeck &g

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

2019-08-15 Thread Guenter Roeck
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 Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/

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

2019-08-15 Thread Guenter Roeck
dev_name() (on the same device) for the debugfs > entry name. So we also prefix dev_name() with "tcpm-" here to avoid a > name conflict. > > Signed-off-by: Hans de Goede Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/tcpm/tcpm.c | 17 + >

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

2019-08-15 Thread Guenter Roeck
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 directory? > > That's a good point

Re: [PATCH 3/3] usb: typec: fusb302: Always provide fwnode for the port

2019-08-14 Thread Guenter Roeck
tcpc_config platform data. > > Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/tcpm/fusb302.c | 70 +++- > 1 file changed, 41 insertions(+), 29 deletions(-) > > diff --git a/drivers/usb/typec/tcpm/fusb302.c >

Re: [PATCH 2/3] dt-bindings: usb: fusb302: Remove deprecated properties

2019-08-14 Thread Guenter Roeck
On Wed, Aug 14, 2019 at 04:24:18PM +0300, Heikki Krogerus wrote: > There are no platforms using them anymore. > > Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck > --- > Documentation/devicetree/bindings/usb/fcs,fusb302.txt | 7 --- > 1 file changed, 7 dele

Re: [PATCH 1/3] usb: typec: fusb302: Remove unused properties

2019-08-14 Thread Guenter Roeck
On Wed, Aug 14, 2019 at 04:24:17PM +0300, Heikki Krogerus wrote: > Removing the deprecated fusb302 specific properties. There > are no more platforms using them. > > Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/t

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

2019-08-13 Thread Guenter Roeck
On 8/13/19 3:52 AM, 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 call tcpm_register_por

[PATCH v2] usb: typec: tcpm: Ignore unsupported/unknown alternate mode requests

2019-08-02 Thread Guenter Roeck
Modes") Reported-by: Douglas Gilbert Cc: Douglas Gilbert Acked-by: Heikki Krogerus Tested-by: Douglas Gilbert Signed-off-by: Guenter Roeck --- v2: No functional change Dropped RFC Added Tested/by: / Acked-by: tags drivers/usb/typec/tcpm/tcpm.c | 38

Re: [PATCH 03/14] watchdog: pnx4008_wdt: allow compile-testing

2019-07-31 Thread Guenter Roeck
On Wed, Jul 31, 2019 at 10:26:35PM +0200, Arnd Bergmann wrote: > On Wed, Jul 31, 2019 at 10:23 PM Guenter Roeck wrote: > > > > On Wed, Jul 31, 2019 at 09:56:45PM +0200, Arnd Bergmann wrote: > > > The only thing that prevents building this driver on other > > >

Re: [PATCH 03/14] watchdog: pnx4008_wdt: allow compile-testing

2019-07-31 Thread Guenter Roeck
: Arnd Bergmann Reviewed-by: Guenter Roeck What is the plan for this patch ? Push through watchdog or through your branch ? Thanks, Guenter

Re: [RFC PATCH] usb: typec: tcpm: Ignore unsupported/unknown alternate mode requests

2019-07-30 Thread Guenter Roeck
On 7/30/19 5:07 AM, Heikki Krogerus wrote: On Mon, Jul 29, 2019 at 10:31:04AM -0700, Guenter Roeck wrote: On Mon, Jul 29, 2019 at 05:04:57PM +0300, Heikki Krogerus wrote: Hi, On Wed, Jul 24, 2019 at 09:30:37PM -0700, Guenter Roeck wrote: TCPM may receive PD messages associated with unknown

Re: [RFC PATCH] usb: typec: tcpm: Ignore unsupported/unknown alternate mode requests

2019-07-29 Thread Guenter Roeck
On Mon, Jul 29, 2019 at 05:04:57PM +0300, Heikki Krogerus wrote: > Hi, > > On Wed, Jul 24, 2019 at 09:30:37PM -0700, Guenter Roeck wrote: > > TCPM may receive PD messages associated with unknown or unsupported > > alternate modes. If that happens, calls to typec_match_altm

[RFC PATCH] usb: typec: tcpm: Ignore unsupported/unknown alternate mode requests

2019-07-24 Thread Guenter Roeck
t;usb: typec: tcpm: Support for Alternate Modes") Signed-off-by: Guenter Roeck --- Taking a stab at the problem. I don't really know if this is the correct fix, or even if my understanding of the problem is correct, thus marking the patch as RFC. drivers/usb/typec/t

Re: lk5.1.18: tcpm: another NULL pointer deref

2019-07-24 Thread Guenter Roeck
On 7/24/19 9:51 AM, Douglas Gilbert wrote: Hi, Same hardware setup as last time*** (NXP OM13588 + SAMA5D2_Xplained + lk 5.1.18) but not sure exactly how it was triggered. I was using the NXP test monitor (NXP software) with another OM13588+KL27Z at the other end of the USB Type C cable (it is als

[PATCH v2] usb: typec: tcpm: Add NULL check before dereferencing config

2019-07-24 Thread Guenter Roeck
is optional when registering a Type-C port. Since it is optional, we have to check if it is NULL before dereferencing it. Reported-by: Douglas Gilbert Cc: Douglas Gilbert Fixes: 96232cbc6c994 ("usb: typec: tcpm: support get typec and pd config from device properties") Signed-off-by:

[PATCH] usb: typec: tcpm: Add NULL check before dereferencing config

2019-07-24 Thread Guenter Roeck
is optional when registering a Type-C port. Since it is optional, we have to check if it is NULL before dereferencing it. Reported-by: Douglas Gilbert Fixes: 96232cbc6c994 ("usb: typec: tcpm: support get typec and pd config from device properties") Signed-off-by: Guenter Roeck --- Doug

Re: 5.1.18 oops: echo source > /sys/class/typec/port0/preferred_role

2019-07-23 Thread Guenter Roeck
Hi Doug, On Tue, Jul 23, 2019 at 07:26:34PM -0400, Douglas Gilbert wrote: > Hi, > Apologies if this is not code you maintain or the wrong medium. > No worries. You should copy the respective mailing lists, but I'll do that for you. > I'm experimenting with a NXP OM 13588 board (USB Type C Arduin

Re: [PATCH v1] usb: typec: tcpm: Switch to use fwnode_property_count_uXX()

2019-07-23 Thread Guenter Roeck
On Tue, Jul 23, 2019 at 10:37:50PM +0300, Andy Shevchenko wrote: > Use use fwnode_property_count_uXX() directly, that makes code neater. > > Signed-off-by: Andy Shevchenko Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/tcpm/tcpm.c | 6 ++ > 1 file changed,

Re: [PATCH 2/2] usb: typec: tcpm: remove tcpm dir if no children

2019-07-17 Thread Guenter Roeck
remove the tcpm dir if no children. Cc: sta...@vger.kernel.org # v4.15+ Fixes: 4b4e02c83167 ("typec: tcpm: Move out of staging") Signed-off-by: Li Jun Reviewed-by: Guenter Roeck --- drivers/usb/typec/tcpm/tcpm.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/usb/

Re: [PATCH 1/2] usb: typec: tcpm: free log buf memory when remove debug file

2019-07-17 Thread Guenter Roeck
On 7/17/19 1:06 AM, jun...@nxp.com wrote: From: Li Jun The logbuffer memory should be freed when remove debug file. Cc: sta...@vger.kernel.org # v4.15+ Fixes: 4b4e02c83167 ("typec: tcpm: Move out of staging") Signed-off-by: Li Jun Reviewed-by: Guenter Roeck --- drivers/usb/

Re: [PATCH v2 1/1] usb: typec: tcpci: Clear the fault status register

2019-05-08 Thread Guenter Roeck
On Wed, May 08, 2019 at 07:48:43AM -0600, Angus Ainslie wrote: > Hi Guenter > > On 2019-05-07 23:18, Guenter Roeck wrote: > >On 5/7/19 7:49 PM, Angus Ainslie wrote: > >>On 2019-05-07 20:03, Guenter Roeck wrote: > >>>On 5/7/19 5:27 PM, Angus Ainslie (Puri

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

2019-04-16 Thread Guenter Roeck
off-by: Hans de Goede Reviewed-by: Guenter Roeck --- Changes in v2: -No changes --- drivers/usb/typec/tcpm/fusb302.c | 55 ++-- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c ind

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

2019-04-16 Thread Guenter Roeck
connection-detection works on single-role ports too. Fixes: ea3b4d5523bc("usb: typec: fusb302: Resolve fixed power role ...") Cc: Adam Thomson Signed-off-by: Hans de Goede Reviewed-by: Guenter Roeck --- Changes in v2: -Adjust for the tcpm core renaming start_drp_toggling to start_toggling,

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

2019-04-16 Thread Guenter Roeck
i, tcpci->data, cc); Wonder if we need to change this as well, but then I guess we can do this if/when actually needed. Otherwise Reviewed-by: Guenter Roeck @@ -511,7 +515,7 @@ struct tcpci *tcpci_register_port(struct device *dev, struct tcpci_data *data) tcpci->tcpc

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

2019-04-15 Thread Guenter Roeck
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 connection > &

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

2019-04-15 Thread Guenter Roeck
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-C port will not be noticed. > > For dual-role por

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

2019-04-15 Thread Guenter Roeck
On 4/15/19 3:37 AM, Hans de Goede wrote: 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 plugge

Re: [PATCH] usb: typec: wcove: Provide fwnode for the port

2019-03-19 Thread Guenter Roeck
> Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/tcpm/wcove.c | 29 - > 1 file changed, 16 insertions(+), 13 deletions(-) > > diff --git a/drivers/usb/typec/tcpm/wcove.c b/drivers/usb/typec/tcpm/wcove.c > ind

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

2019-03-16 Thread Guenter Roeck
commit was noticed with a Type-C to VGA dongle. > LGTM. Reviewed-by: Guenter Roeck One question though: Shouldn't tcpm_pd_send_source_caps() filter out PD 3.0 only capabilities if the revision is reduced ? Thanks, Guenter > Signed-off-by: Hans de Goede > --- > The Type-C to VGA

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

2019-03-15 Thread Guenter Roeck
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 Guenter Roeck
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 entire PD_DATA_SOURCE_CAP message, > causin

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

2019-03-11 Thread Guenter Roeck
determining the polarity based on that, rather then on where the toggling stopped. Signed-off-by: Hans de Goede Reviewed-by: Guenter Roeck --- 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

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

2019-03-11 Thread Guenter Roeck
: Guenter Roeck --- Changes in v3: -Use WARN with a message describing the problem, instead of WARN_ON --- drivers/usb/typec/tcpm/fusb302.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c index c947d18cdc0f..a1256855eaa0

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/ty

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

2019-03-07 Thread Guenter Roeck
2: i2c: pm suspend, retry 2 / 10 > etc. > > Signed-off-by: Hans de Goede Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/tcpm/fusb302.c | 109 +-- > 1 file changed, 45 insertions(+), 64 deletions(-) > > diff --git a/drivers/usb/typec/tc

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

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

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

2019-03-07 Thread Guenter Roeck
nderstand the logic, but I think it would be really beneficial if this (and the rest of the series) can be tested independently (ie by someone with hardware). Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/tcpm/fusb302.c | 85 ++-- > 1 file changed, 15 inse

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
fusb302_chip. > > Signed-off-by: Hans de Goede Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/tcpm/fusb302.c | 48 +++- > 1 file changed, 16 insertions(+), 32 deletions(-) > > diff --git a/drivers/usb/typec/tcpm/fusb302.c > b/drivers/us

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

2019-03-03 Thread Guenter Roeck
On 2/22/19 11:22 AM, 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 Reviewed-by: Guenter Roeck --- drivers/usb/typec/mux/pi3usb30532.c | 3 ++- 1 file

Re: [PATCHv3] usb: typec: tps6598x: handle block writes separately with plain-I2C adapters

2019-02-20 Thread Guenter Roeck
On 2/20/19 7:35 AM, Guenter Roeck wrote: On 2/20/19 7:11 AM, Nikolaus Voss wrote: From: Nikolaus Voss Commit 1a2f474d328f handles block _reads_ separately with plain-I2C adapters, but the problem described with regmap-i2c not handling SMBus block transfers (i.e. read and writes) correctly

Re: [PATCHv3] usb: typec: tps6598x: handle block writes separately with plain-I2C adapters

2019-02-20 Thread Guenter Roeck
quot;) Signed-off-by: Nikolaus Voss Reviewed-by: Guenter Roeck Note that tps6598x_exec_cmd() is only called with in_len == out_len == 0 and NULL data pointers. It might make sense to simplify the function and drop the unused parameters as well as the associated code. Guenter --- v2: fix tps65

Re: [PATCHv2] usb: typec: tps6598x: handle block writes separately with plain-I2C adapters

2019-02-20 Thread Guenter Roeck
On 2/20/19 4:57 AM, Nikolaus Voss wrote: Commit 1a2f474d328f handles block _reads_ separately with plain-I2C adapters, but the problem described with regmap-i2c not handling SMBus block transfers (i.e. read and writes) correctly also exists with writes. As workaround, this patch adds a block wri

Re: [PATCH] usb: typec: tcpm: Export partner Source Capabilities

2019-02-14 Thread Guenter Roeck
On 2/14/19 6:17 AM, Adam Thomson wrote: On 12 February 2019 16:20, Guenter Roeck wrote: On 2/12/19 2:54 AM, Greg KH wrote: On Tue, Feb 12, 2019 at 06:29:39PM +0800, Kyle Tso wrote: On Thu, Jan 31, 2019 at 3:02 PM Greg KH wrote: On Thu, Jan 31, 2019 at 11:54:11AM +0800, Kyle Tso wrote

Re: [PATCH] usb: typec: tcpm: Export partner Source Capabilities

2019-02-12 Thread Guenter Roeck
On 2/12/19 2:54 AM, Greg KH wrote: On Tue, Feb 12, 2019 at 06:29:39PM +0800, Kyle Tso wrote: On Thu, Jan 31, 2019 at 3:02 PM Greg KH wrote: On Thu, Jan 31, 2019 at 11:54:11AM +0800, Kyle Tso wrote: Provide a function to get the partner Source Capabilities. Signed-off-by: Kyle Tso --- dri

[PATCH] usb: typec: tcpm: Remove unused functions

2019-02-12 Thread Guenter Roeck
: Kyle Tso Signed-off-by: Guenter Roeck --- drivers/usb/typec/tcpm/tcpm.c | 60 --- include/linux/usb/tcpm.h | 6 - 2 files changed, 66 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index f1c39a3c7534..a6

Re: [PATCH] usb: typec: tcpm: Export partner Source Capabilities

2019-01-31 Thread Guenter Roeck
On Thu, Jan 31, 2019 at 08:02:38AM +0100, Greg KH wrote: > On Thu, Jan 31, 2019 at 11:54:11AM +0800, Kyle Tso wrote: > > Provide a function to get the partner Source Capabilities. > > > > Signed-off-by: Kyle Tso > > --- > > drivers/usb/typec/tcpm/tcpm.c | 23 +++ > > include/

Re: [PATCH] usb: typec: tcpm: Correct the PPS out_volt calculation

2019-01-30 Thread Guenter Roeck
previous voltage and > the new min_volt first. And ensure that this value will not exceed the > new max_volt. The new out_volt will fall within the new voltage range > while being the closest value compared to the previous out_volt. > > Signed-off-by: Kyle Tso Reviewed-by: Guent

Re: [PATCH] usb: typec: tpcm: improve error handling of tcpm_register_port

2019-01-22 Thread Guenter Roeck
On Tue, Jan 22, 2019 at 09:00:24AM +, Jun Li wrote: > Remove debugfs if tcpm register port fails. > > Signed-off-by: Li Jun Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/tcpm/tcpm.c | 8 +--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff -

Re: [PATCH] usb: typec: tcpm: Extend the matching rules on PPS APDO selection

2018-12-16 Thread Guenter Roeck
power Signed-off-by: Kyle Tso Reviewed-by: Guenter Roeck --- Changelog since v1: - updated the commit message as suggested by Guenter Roeck --- drivers/usb/typec/tcpm/tcpm.c | 29 + 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/usb/typec

Re: [PATCH] usb: typec: tcpm: Extend the matching rules on PPS APDO selection

2018-12-06 Thread Guenter Roeck
th a few adapters ? With the expectation that you did, Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/tcpm/tcpm.c | 29 + > 1 file changed, 17 insertions(+), 12 deletions(-) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/t

Re: [PATCH v1 3/5] staging: typec: fusb302: Rename fcs,extcon-name to linux,extcon-name

2018-11-10 Thread Guenter Roeck
On 11/10/18 10:10 AM, Andy Shevchenko wrote: Since we are going to use the same in Designware USB 3 driver, rename the property to be consistent across the drivers. No functional change intended. Cc: Hans de Goede Cc: Guenter Roeck Signed-off-by: Andy Shevchenko Acked-by: Guenter Roeck

Re: [PATCH v1 2/5] extcon: Return -EPROBE_DEFER when extcon device is not found

2018-11-10 Thread Guenter Roeck
duplication and a burden to the callers, return -EPROBE_DEFER directly from extcon_get_extcon_dev(). Signed-off-by: Andy Shevchenko Acked-by: Guenter Roeck --- drivers/extcon/extcon-axp288.c| 4 ++-- drivers/extcon/extcon.c | 2 +- drivers/power/supply

Re: [PATCH v2] usb: typec: tcpm: Report back negotiated PPS voltage and current

2018-10-08 Thread Guenter Roeck
platform, which previously could have been slightly out due to not using valid PPS units of voltage and current. Signed-off-by: Adam Thomson Reviewed-by: Guenter Roeck --- Changes are based on usb-testing (e7a2c3fa2857) Changes in v2: - Rounding down of PPS voltage and current values moved to

Re: [PATCH 2/3] [PATCH v2 2/3] usb: typec: tcpm: Do not disconnect link for self powered devices

2018-09-30 Thread Guenter Roeck
disconnections from hard reset. Also, speeds up the enumeration time when connected to Type-A ports. Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Guenter Roeck - Version history: V2: Based on feedback from heikki.kroge...@linux.intel.com - self_powered added to the struct

Re: [PATCH 3/3] [PATCH v2 3/3] usb: typec: tcpm: charge current handling for sink during hard reset

2018-09-30 Thread Guenter Roeck
based of CC pull up and resume the charge path when port enters SNK_HARD_RESET_SINK_ON. Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Guenter Roeck Changes in V2: Based on feedback of ja...@codeaurora.org - vsafe_5v_hard_reset flag from tcpc_config is removed - Patch only

Re: [PATCH v3 -next] usb: typec: remove set but not used variables 'snk_ma, min_mv'

2018-09-29 Thread Guenter Roeck
iable] drivers/usb/typec/tcpm/tcpm.c: In function 'tcpm_pd_build_pps_request': drivers/usb/typec/tcpm/tcpm.c:2405:37: warning: variable 'min_mv' set but not used [-Wunused-but-set-variable] Signed-off-by: YueHaibing Reviewed-by: Guenter Roeck --- v3: fix patch subject

Re: [PATCH] usb: typec: tcpm: Report back negotiated PPS voltage and current

2018-09-28 Thread Guenter Roeck
On Fri, Sep 28, 2018 at 04:33:49PM +0100, Adam Thomson wrote: > Currently when requesting a specific voltage or current through > the psy interface, for PPS, when reading back from that interface > the values will always be the same as previously given, if the > request was successful. However PPS

Re: [PATCH 2/2] usb: typec: fusb302: Resolve fixed power role contract setup

2018-09-26 Thread Guenter Roeck
way by the 'fusb302_handle_togdone()' function, and CC events > are generated as expected for TCPM allowing a contract to be > established. > > Signed-off-by: Adam Thomson Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/tcpm/fusb302.c | 24 +++

Re: [PATCH 1/2] usb: typec: fusb302: Correct spelling mistake for toggling state

2018-09-26 Thread Guenter Roeck
On Wed, Sep 26, 2018 at 04:23:51PM +0100, Adam Thomson wrote: > There's a typo in the enum name of the 'OFF' state for toggling > (TOGGLINE instead of TOGGLING). This commit resolves that trivial > spelling inconsistency. > > Signed-off-by: Adam Thomso

Re: [PATCH] usb: typec: tcpm: Fix APDO PPS order checking to be based on voltage

2018-09-21 Thread Guenter Roeck
APDO having a lower maximum current output, > which is actually valid. > > Fixes: 2eadc33f40d4 ("typec: tcpm: Add core support for sink side PPS") > Cc: > Signed-off-by: Adam Thomson Makes sense. Reviewed-by: Guenter Roeck > --- > Code based on usb-testing bran

Re: usb typec not doing handling in-kernel

2018-09-20 Thread Guenter Roeck
On Thu, Sep 20, 2018 at 10:21:59AM +0200, Heiko Stuebner wrote: > Hi Guenter, > > Am Montag, 13. August 2018, 14:29:15 CEST schrieb Guenter Roeck: > > On 08/13/2018 03:36 AM, Heiko Stuebner wrote: > > > Hi, > > > > > > I'm currently trying to

Re: [PATCH 1/2] typec: tcpm: Do not disconnect link for self powered devices

2018-09-13 Thread Guenter Roeck
On Thu, Sep 13, 2018 at 04:24:08PM +0300, Heikki Krogerus wrote: > +Guenter > > On Wed, Sep 12, 2018 at 07:11:12PM -0700, Badhri Jagan Sridharan wrote: > > During HARD_RESET the data link is disconnected. > > For self powered device, the spec is advising against doing that. > > > > >From USB_PD_R

Re: [PATCH v3] usb: typec: get the vbus source and charge values from the devicetree

2018-09-13 Thread Guenter Roeck
On Thu, Sep 13, 2018 at 05:10:09AM -0600, Angus Ainslie wrote: > > > >staging: typec: don't do vbus source disable for dead battery > > > >In PTN5110 design, DisableSourceVBUS command also disables the sink > >enable signal because the EN_SNK can be used to source higher voltage, > >and, there is o

Re: [PATCH v3] usb: typec: get the vbus source and charge values from the devicetree

2018-09-12 Thread Guenter Roeck
On Wed, Sep 12, 2018 at 10:08:58AM -0600, Angus Ainslie wrote: > On 2018-09-11 09:33, Guenter Roeck wrote: > >I cant put my finger on it but this seems wrong. As i said both src > >and sink should never be true at the same time. I also din’t > >understand why turning off src

Re: [PATCH v3] usb: typec: get the vbus source and charge values from the devicetree

2018-09-11 Thread Guenter Roeck
I cant put my finger on it but this seems wrong. As i said both src and sink should never be true at the same time. I also din’t understand why turning off src should power off your board. Ultimately my concern is that we may be just painting over the real problem, and that would be really bad t

Re: [PATCH v2] usb: typec: get the vbus source and charge values from the devicetree

2018-09-10 Thread Guenter Roeck
On 09/10/2018 06:11 AM, Angus Ainslie wrote: Hi Heikki On 2018-09-10 01:35, Heikki Krogerus wrote: On Sun, Sep 09, 2018 at 12:05:31PM -0600, Angus Ainslie (Purism) wrote: If the board is being powered by USB disabling the source and sink can remove power from the board. Allow the source and si

Re: [PATCHv2] usb: typec: Group all TCPCI/TCPM code together

2018-09-10 Thread Guenter Roeck
On 09/10/2018 04:58 AM, Heikki Krogerus wrote: Moving all the drivers that depend on the Port Controller Manager under a new directory drivers/usb/typec/tcpm/ and making Guenter Roeck the designated reviewer of that code. Signed-off-by: Heikki Krogerus Acked-by: Guenter Roeck --- Changes

Re: [PATCH v2] usb: typec: get the vbus source and charge values from the devicetree

2018-09-09 Thread Guenter Roeck
On 09/09/2018 11:05 AM, Angus Ainslie (Purism) wrote: If the board is being powered by USB disabling the source and sink can remove power from the board. Allow the source and sink to be initallized based on devicetree values. Changed since V1: use devicetree values instead of hardcoded initiali

Re: [PATCH] usb: typec: don't disable sink or source on initialization

2018-09-09 Thread Guenter Roeck
On 09/09/2018 07:36 AM, Angus Ainslie wrote: On 2018-09-09 08:20, Guenter Roeck wrote: On 09/09/2018 07:08 AM, Angus Ainslie wrote: Hi Guenter On 2018-09-07 06:55, Guenter Roeck wrote: On 09/07/2018 03:34 AM, Heikki Krogerus wrote: +Guenter On Thu, Sep 06, 2018 at 01:26:44PM -0600, Angus

Re: [PATCH] usb: typec: don't disable sink or source on initialization

2018-09-09 Thread Guenter Roeck
On 09/09/2018 07:08 AM, Angus Ainslie wrote: Hi Guenter On 2018-09-07 06:55, Guenter Roeck wrote: On 09/07/2018 03:34 AM, Heikki Krogerus wrote: +Guenter On Thu, Sep 06, 2018 at 01:26:44PM -0600, Angus Ainslie (Purism) wrote: If the board is being powered by USB disabling the source and

Re: [PATCH] usb: typec: Group all TCPCI/TCPM code together

2018-09-08 Thread Guenter Roeck
On 09/08/2018 04:12 AM, Hans de Goede wrote: HI, On 07-09-18 18:19, Guenter Roeck wrote: On Fri, Sep 07, 2018 at 05:06:12PM +0300, Heikki Krogerus wrote: On Fri, Sep 07, 2018 at 06:35:12AM -0700, Guenter Roeck wrote: On 09/07/2018 05:56 AM, Heikki Krogerus wrote: Moving all the drivers that

  1   2   3   4   5   6   >