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

2018-09-29 Thread Guenter Roeck
/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 'flags' -> 'min_mv' v2: remove the right va

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 w

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] 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

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

2018-09-07 Thread Guenter Roeck
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 depend on the Port Controller > > > Manager under a new

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

2018-09-07 Thread Guenter Roeck
On 09/07/2018 05:56 AM, Heikki Krogerus wrote: Moving all the drivers that depend on the Port Controller Manager under a new a new directory drivers/usb/typec/tcpci/ and making Guenter Roeck as the designated reviewer of that code. Signed-off-by: Heikki Krogerus --- Hi guys, This should

Re: usb typec not doing handling in-kernel

2018-08-13 Thread Guenter Roeck
On 08/13/2018 03:36 AM, Heiko Stuebner wrote: Hi, I'm currently trying to wrap my head around the new typec subsystem and also how to do it correctly on Rockchip rk3399 devices. The issue (and Guenter might know quite a bit about that) is that on ChromeOS devices the embedded controller hides

Re: fusb302 type-c chip driver supply cutting out

2018-08-01 Thread Guenter Roeck
On Wed, Aug 01, 2018 at 11:37:56AM -0700, Tim Harvey wrote: > On Tue, Jul 31, 2018 at 2:22 AM Adam Thomson > wrote: > > > > On 27 July 2018 17:41, Tim Harvey wrote: > > > > Adding Guenter to the thread. > > > > > Greetings, > > > > > > I have a custom design with a Fairchild FUSB302 Type-C chip

Re: [PATCH 4.18 REGRESSION fix 2/2] i2c-cht-wc: Fix bq24190 supplier

2018-07-01 Thread Guenter Roeck
Cc: Adam Thomson Signed-off-by: Hans de Goede Reviewed-by: Guenter Roeck --- drivers/i2c/busses/i2c-cht-wc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-cht-wc.c b/drivers/i2c/busses/i2c-cht-wc.c index 44cffad43701..c4d176f5ed79 100644 ---

Re: [PATCH 4.18 REGRESSION fix 1/2] typec: tcpm: Correctly report power_supply current and voltage for non pd supply

2018-07-01 Thread Guenter Roeck
which now already sets these to 0. Fixes: f2a8aa053c17 ("typec: tcpm: Represent source supply through...") Cc: Adam Thomson Signed-off-by: Hans de Goede Reviewed-by: Guenter Roeck --- drivers/usb/typec/tcpm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --

Re: [PATCH] USB: typec: fsusb302: Drop empty set_current_limit implementation

2018-07-01 Thread Guenter Roeck
On 07/01/2018 05:27 AM, Hans de Goede wrote: The set_current_limit tcpm_dev callback is optional and the tcpm core will already log the passed in values, so there is no need to have an empty implementation of this. Signed-off-by: Hans de Goede Reviewed-by: Guenter Roeck --- drivers/usb

Re: [usb:usb-next 36/38] drivers/usb/typec/tcpci.c:549: undefined reference to `__devm_regmap_init_i2c'

2018-06-29 Thread Guenter Roeck
On Fri, Jun 29, 2018 at 12:52:34PM +0800, kbuild test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git > usb-next > head: aaf3f4e925dc2bdc4715142103660285632a245c > commit: 990da41530b31ed7de29340ce1d78c04bee9670c [36/38] staging: typec: > tcpci: move tcpci

Re: [PATCH v8 14/14] staging: typec: tcpci: move tcpci drivers out of staging

2018-06-26 Thread Guenter Roeck
On 06/26/2018 04:45 PM, Li Jun wrote: Move TCPCI(Typec port controller interface) driver and rt1711h driver out of staging. Signed-off-by: Li Jun Reviewed-by: Guenter Roeck --- drivers/staging/Kconfig| 2 -- drivers/staging/Makefile | 1

Re: [PATCH v8 12/14] staging: typec: tcpci: keep the disconnected cc line open

2018-06-26 Thread Guenter Roeck
On 06/26/2018 04:45 PM, Li Jun wrote: While set polarity, we should keep the disconnected cc line to be open. Reviewed-by: Heikki Krogerus Signed-off-by: Li Jun Reviewed-by: Guenter Roeck --- drivers/staging/typec/tcpci.c | 18 ++ 1 file changed, 14 insertions(+), 4

Re: [PATCH v8 09/14] staging: typec: tcpci: register port before request irq

2018-06-26 Thread Guenter Roeck
On 06/26/2018 04:45 PM, Li Jun wrote: From: Peter Chen With that we can clear any pending events and the port is registered so driver can be ready to handle typec events once we request irq. Reviewed-by: Heikki Krogerus Signed-off-by: Peter Chen Signed-off-by: Li Jun Reviewed-by: Guenter

Re: [PATCH v8 08/14] staging: typec: tcpci: use IS_ERR() instead of PTR_ERR_OR_ZERO()

2018-06-26 Thread Guenter Roeck
On 06/26/2018 04:45 PM, Li Jun wrote: As tcpm_register_port() and tcpci_register_port() never return NULL and NULL is not a success in this case, use IS_ERR() to check the return value of both. Reviewed-by: Heikki Krogerus Signed-off-by: Li Jun Reviewed-by: Guenter Roeck --- drivers

Re: [PATCH v8 07/14] staging: typec: tcpci: remove unused tcpci_tcpc_config

2018-06-26 Thread Guenter Roeck
On 06/26/2018 04:45 PM, Li Jun wrote: Since we will use config settings via device properties, so remove the hard code tcpci_tcpc_config. Reviewed-by: Heikki Krogerus Signed-off-by: Li Jun Reviewed-by: Guenter Roeck --- drivers/staging/typec/tcpci.c | 7 --- 1 file changed, 7

Re: [PATCH v8 04/14] usb: typec: add fwnode to tcpc

2018-06-26 Thread Guenter Roeck
On 06/26/2018 04:45 PM, Li Jun wrote: Add fwnode handle to get the fwnode so we can get typec configs it contains. Suggested-by: Heikki Krogerus Reviewed-by: Heikki Krogerus Signed-off-by: Li Jun Reviewed-by: Guenter Roeck --- drivers/staging/typec/tcpci.c | 7 +++ drivers/usb

Re: [PATCH v8 03/14] staging: typec: tcpci: add compatible string for nxp ptn5110

2018-06-26 Thread Guenter Roeck
Reviewed-by: Heikki Krogerus Signed-off-by: Li Jun Reviewed-by: Guenter Roeck --- drivers/staging/typec/tcpci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c index 076d97e..dd29288 100644 --- a/drivers/staging

Re: [PATCH 1/1] usb: typec: tcpm: fix logbuffer index is wrong if _tcpm_log is re-entered

2018-06-12 Thread Guenter Roeck
ies to use log buffer, the index has already updated by the 1st process, so it will get NULL pointer for updated logbuffer, the error message like below: tcpci 0-0050: Log buffer index 6 is NULL Cc: Heikki Krogerus Cc: Guenter Roeck Cc: Jun Li Signed-off-by: Peter Chen Reviewed-by: Guen

Re: [PATCH v6 12/15] usb: typec: tcpm: set cc for drp toggling attach

2018-06-11 Thread Guenter Roeck
On 06/11/2018 05:29 AM, Heikki Krogerus wrote: On Mon, May 28, 2018 at 10:52:44AM +0800, Li Jun wrote: In case of drp toggling, we may need set correct cc value for role control after attach as it may never been set. Is this something that should be considered as a fix? The problem with

Re: [PATCH v6 06/15] usb: typec: tcpm: support get typec and pd config from device properties

2018-06-11 Thread Guenter Roeck
On 05/27/2018 07:52 PM, Li Jun wrote: This patch adds support of get typec and power delivery config from firmware description. Signed-off-by: Li Jun Except for the nitpick. on top of Heikki's comments: Reviewed-by: Guenter Roeck --- drivers/usb/typec/tcpm.c | 132

Re: [PATCH] typec: tcpm: Fix a msecs vs jiffies bug

2018-06-08 Thread Guenter Roeck
On Thu, Jun 7, 2018 at 6:17 AM Dan Carpenter wrote: > > The tcpm_set_state() function take msecs not jiffies. > Nice catch. Reviewed-by: Guenter Roeck > Fixes: f0690a25a140 ("staging: typec: USB Type-C Port Manager (tcpm)") > Signed-off-by: Dan Carpenter > >

Re: [PATCH 02/22 v2] USB: typec: fsusb302: no need to check return value of debugfs_create_dir()

2018-05-31 Thread Guenter Roeck
was created, as the code should work properly either way. Cc: Heikki Krogerus Cc: Guenter Roeck Cc: Hans de Goede Cc: Andy Shevchenko Cc: Adam Thomson Signed-off-by: Greg Kroah-Hartman Reviewed-by: Guenter Roeck --- v2: changes based on review from Guenter, we still need to keep

Re: [PATCH 01/22] USB: typec: tcpm: no need to check return value of debugfs_create_dir()

2018-05-30 Thread Guenter Roeck
On 05/30/2018 03:36 AM, Greg Kroah-Hartman wrote: On Wed, May 30, 2018 at 01:30:20PM +0300, Heikki Krogerus wrote: +Guenter On Tue, May 29, 2018 at 05:30:46PM +0200, Greg Kroah-Hartman wrote: When calling debugfs functions, there is no need to ever check the return value. The function can

Re: [PATCH 01/22] USB: typec: tcpm: no need to check return value of debugfs_create_dir()

2018-05-30 Thread Guenter Roeck
... Yes. I'll send a patch. Cc: Heikki Krogerus Signed-off-by: Greg Kroah-Hartman Revieved-by: Heikki Krogerus Reviewed-by: Guenter Roeck --- drivers/usb/typec/tcpm.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/usb/typec/tcpm.c b/drivers

Re: [PATCH 02/22] USB: typec: fsusb302: no need to check return value of debugfs_create_dir()

2018-05-29 Thread Guenter Roeck
On Tue, May 29, 2018 at 06:27:03PM +0200, Greg Kroah-Hartman wrote: > On Tue, May 29, 2018 at 09:15:30AM -0700, Guenter Roeck wrote: > > On Tue, May 29, 2018 at 05:30:47PM +0200, Greg Kroah-Hartman wrote: > > > When calling debugfs functions, there is no need to ever check the

Re: [PATCH 02/22] USB: typec: fsusb302: no need to check return value of debugfs_create_dir()

2018-05-29 Thread Guenter Roeck
o only work for one device per system, > otherwise the debugfs directories are going to get confused when a > device is removed. > > Cc: Heikki Krogerus > Cc: Guenter Roeck > Cc: Hans de Goede > Cc: Andy Shevchenko > Cc: Adam Thomson > Signed-off-by: Greg Kroah-H

Re: [PATCH v3 3/4] usb: typec: fusb302: Fix debugfs issue

2018-05-24 Thread Guenter Roeck
This fixes an issue where the driver can't be re-loaded if it has been unloaded as the "fusb302" debugfs directory already exists. Fixes: 76f0c53d08b9 ("usb: typec: fusb302: Move out of staging") Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Reviewed-b

Re: [PATCH 2/2] typec: tcpm: Provide fwnode pointer as part of psy_cfg

2018-05-22 Thread Guenter Roeck
g the 'power-supplies' DT property, but in the > future should also work for ACPI platforms when the relevant support > is added to the power_supply core. > > Signed-off-by: Adam Thomson <adam.thomson.opensou...@diasemi.com> > Suggested-by: Heikki Krogerus <heikki.kroge...@li

Re: [RFC PATCH v3 0/5] usb: typec: Support for Alternate Modes

2018-05-12 Thread Guenter Roeck
On 05/11/2018 06:18 AM, Heikki Krogerus wrote: Hi, This is the third version of my proposal for more complete alternate mode support. In this version I'm including a proposal for the mux handling. Basically, I'm proposing that every supported alternate will have its own mux handle. That should

Re: [PATCH 2/4] usb: typec: tcpm: Release the role mux when exiting

2018-04-30 Thread Guenter Roeck
;heikki.kroge...@linux.intel.com> Reviewed-by: Guenter Roeck <li...@roeck-us.net> --- drivers/usb/typec/tcpm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c index 1ee259bc14a5..66dc0773b9bf 100644 --- a/drivers/usb/typec/tcpm.c +

Re: [PATCH 3/4] usb: typec: fusb302: Fix debugfs issue

2018-04-30 Thread Guenter Roeck
On 04/30/2018 05:41 AM, Heikki Krogerus wrote: Removing the "fusb302" debugfs directory when unloading the driver. That allows the driver to be loaded more then ones. This fixes an issue where the driver, if unloaded, can't be re-loaded, as the "fusb302" debugfs directory already exists. While

Re: [PATCH 1/2] usb: typec: tps6598x: handle block reads separately with plain-I2C adapters

2018-04-24 Thread Guenter Roeck
On 04/24/2018 04:46 AM, Heikki Krogerus wrote: On Mon, Apr 23, 2018 at 09:43:57AM -0700, Guenter Roeck wrote: On Mon, Apr 23, 2018 at 11:03:09AM +0300, Heikki Krogerus wrote: On Fri, Apr 20, 2018 at 10:26:08AM -0700, Guenter Roeck wrote: On Wed, Apr 18, 2018 at 03:34:09PM +0300, Heikki

Re: [PATCH 1/2] usb: typec: tps6598x: handle block reads separately with plain-I2C adapters

2018-04-23 Thread Guenter Roeck
On Mon, Apr 23, 2018 at 11:03:09AM +0300, Heikki Krogerus wrote: > On Fri, Apr 20, 2018 at 10:26:08AM -0700, Guenter Roeck wrote: > > On Wed, Apr 18, 2018 at 03:34:09PM +0300, Heikki Krogerus wrote: > > > If the I2C adapter that the PD controller is attached to > >

Re: [PATCH 1/2] usb: typec: tps6598x: handle block reads separately with plain-I2C adapters

2018-04-20 Thread Guenter Roeck
ad(tps->regmap, reg, data, sizeof(data)); > + if (ret) > + return ret; > + Sanity check ? if (data[0] != len) return -Esomething; Other than that, Reviewed-by: Guenter Roeck <li...@roeck-us.net> > + memcpy(val, [1], len); > +

Re: [PATCH v5 0/5] usb: typec: remove max_snk_mv/ma/mw

2018-04-20 Thread Guenter Roeck
riable to get the return value of tcpm_pd_select_pdo() > in patch 1/5, tested on my platform. > - Add document in fusb302_composite_snk_pdo_array() to explain > why use deprecated properties in patch 2/5. > For the series: Reviewed-by: Guenter Roeck <li...@roeck-us.net> > Change for v4:

Re: [PATCH v5 1/5] usb: typec: tcpm: pdo matching optimization

2018-04-20 Thread Guenter Roeck
; > > Signed-off-by: Li Jun <jun...@nxp.com> > > I don't see any problem with this, but I hope Guenter has time to > check it. > I don't see anything wrong, but then the changes are so complex that I can only hope they were well tested. Unfortunately, I won't have time to d

Re: [PATCH RFC] usb: typec: tcpm: remove operating_snk_mw for rdo

2018-04-20 Thread Guenter Roeck
On 04/20/2018 03:51 AM, Jun Li wrote: -Original Message- From: Hans de Goede [mailto:hdego...@redhat.com] Sent: 2018年4月20日 17:21 To: Jun Li ; li...@roeck-us.net; heikki.kroge...@linux.intel.com Cc: gre...@linuxfoundation.org; linux-usb@vger.kernel.org; dl-linux-imx

Re: [PATCH v4 3/5] dt-bindings: usb: fusb302: remove max-sink-* properties

2018-04-13 Thread Guenter Roeck
On 04/13/2018 08:42 PM, Jun Li wrote: Hi Guenter, -Original Message- From: Guenter Roeck [mailto:groe...@gmail.com] On Behalf Of Guenter Roeck Sent: 2018年4月14日 11:03 To: Jun Li <jun...@nxp.com> Cc: gre...@linuxfoundation.org; robh...@kernel.org; heikki.kroge...@linux.intel.com;

Re: [PATCH v4 3/5] dt-bindings: usb: fusb302: remove max-sink-* properties

2018-04-13 Thread Guenter Roeck
On 04/13/2018 04:31 PM, Jun Li wrote: -Original Message- From: Guenter Roeck [mailto:li...@roeck-us.net] Sent: 2018年4月14日 0:04 To: Jun Li <jun...@nxp.com> Cc: gre...@linuxfoundation.org; robh...@kernel.org; heikki.kroge...@linux.intel.com; hdego...@redhat.com; rmf...@gmail.com;

Re: [PATCH v4 1/5] usb: typec: tcpm: pdo matching optimization

2018-04-13 Thread Guenter Roeck
On Fri, Apr 13, 2018 at 10:18:41PM +0800, Li Jun wrote: > This patch is a combination of commit 57e6f0d7b804 > ("typec: tcpm: Only request matching pdos") and source > pdo selection optimization based on it, instead of only > compare between the same pdo type of sink and source, > we should check

Re: [PATCH v4 2/5] usb: typec: fusb302: remove max_snk_* for sink config

2018-04-13 Thread Guenter Roeck
On Fri, Apr 13, 2018 at 10:18:42PM +0800, Li Jun wrote: > Since max_snk_* is to be deprecated, so remove max_snk_* by adding a > variable PDO for sink config. max_snk or max_sink ? > > Reviewed-by: Hans de Goede > Signed-off-by: Li Jun > --- >

Re: [PATCH v4 3/5] dt-bindings: usb: fusb302: remove max-sink-* properties

2018-04-13 Thread Guenter Roeck
On Fri, Apr 13, 2018 at 10:18:43PM +0800, Li Jun wrote: > Remove max-sink-* properties since they are deprecated. > > Reviewed-by: Rob Herring > Reviewed-by: Hans de Goede > Signed-off-by: Li Jun > --- >

Re: [PATCH v4 11/13] staging: typec: tcpci: keep the not connecting cc line open

2018-03-30 Thread Guenter Roeck
On 03/28/2018 09:06 AM, Li Jun wrote: While set polarity, we should keep the not connecting cc line to be open. The more I look at this code, the more I am confused by it. The original code doesn't touch the CC lines. This function only sets the polarity. Is it really appropriate to touch

Re: [PATCH v4 10/13] usb: typec: tcpm: set cc for drp toggling attach

2018-03-29 Thread Guenter Roeck
On Thu, Mar 29, 2018 at 12:06:15AM +0800, Li Jun wrote: > In case of drp toggling, we may need set correct cc value for role control > after attach as it may never been set. > Isn't CC set by the lower level driver in this case ? In other words, is it ever necessary to call back into the low

Re: [PATCH v7 6/6] typec: tcpm: Add support for sink PPS related messages

2018-03-25 Thread Guenter Roeck
messagescreceived but not yet handled. Signed-off-by: Adam Thomson <adam.thomson.opensou...@diasemi.com> Acked-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Reviewed-by: Guenter Roeck <li...@roeck-us.net> --- drivers/usb/

Re: [PATCH v7 5/6] typec: tcpm: Represent source supply through power_supply

2018-03-25 Thread Guenter Roeck
: Represent source supply through power_supply class' Signed-off-by: Adam Thomson <adam.thomson.opensou...@diasemi.com> Reviewed-by: Guenter Roeck <li...@roeck-us.net> --- drivers/usb/typec/Kconfig | 1 + drivers/usb/typec/fusb302/Kconfig | 2 +- drivers/usb/typec/fusb3

Re: [PATCH v7 1/6] typec: tcpm: Add core support for sink side PPS

2018-03-25 Thread Guenter Roeck
<adam.thomson.opensou...@diasemi.com> Acked-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Reviewed-by: Guenter Roeck <li...@roeck-us.net> --- drivers/usb/typec/tcpm.c | 517 ++- include/linux/usb/pd.h | 4 +- include/linux/usb/

Re: [PATCH v6 6/6] typec: tcpm: Add support for sink PPS related messages

2018-03-22 Thread Guenter Roeck
On Thu, Mar 22, 2018 at 03:52:07PM +, Adam Thomson wrote: > This commit adds sink side support for Get_Status, Status, > Get_PPS_Status and PPS_Status handling. As there's the > potential for a partner to respond with Not_Supported, > handling of this message is also added. Sending of >

Re: [PATCH v6 5/6] typec: tcpm: Represent source supply through power_supply

2018-03-22 Thread Guenter Roeck
On Thu, Mar 22, 2018 at 03:52:06PM +, Adam Thomson wrote: > This commit adds a power_supply class instance to represent a > PD source's voltage and current properties. This provides an > interface for reading these properties from user-space or other > drivers. > > For PPS enabled Sources,

Re: [PATCH v6 1/6] typec: tcpm: Add core support for sink side PPS

2018-03-22 Thread Guenter Roeck
On Thu, Mar 22, 2018 at 03:52:02PM +, Adam Thomson wrote: > This commit adds code to handle requesting of PPS APDOs. Switching > between standard PDOs and APDOs, and re-requesting an APDO to > modify operating voltage/current will be triggered by an > external call into TCPM. > >

Re: [PATCH v5 4/5] typec: tcpm: Represent source supply through power_supply

2018-03-22 Thread Guenter Roeck
On 03/22/2018 03:40 AM, Adam Thomson wrote: On 22 March 2018 04:09, Guenter Roeck wrote: +static int tcpm_psy_set_prop(struct power_supply *psy, +enum power_supply_property psp, +const union power_supply_propval *val) +{ + struct

Re: [PATCH v5 4/5] typec: tcpm: Represent source supply through power_supply

2018-03-21 Thread Guenter Roeck
On 03/20/2018 07:33 AM, Adam Thomson wrote: This commit adds a power_supply class instance to represent a PD source's voltage and current properties. This provides an interface for reading these properties from user-space or other drivers. For PPS enabled Sources, this also provides write

Re: [PATCH v5 3/5] power: supply: Add 'usb_type' property and supporting code

2018-03-21 Thread Guenter Roeck
On 03/20/2018 07:33 AM, Adam Thomson wrote: This commit adds the 'usb_type' property to represent USB supplies which can report a number of different types based on a connection event. Examples of this already exist in drivers whereby the existing 'type' property is updated, based on an event,

Re: [PATCH v5 1/5] typec: tcpm: Add core support for sink side PPS

2018-03-21 Thread Guenter Roeck
On 03/20/2018 07:33 AM, Adam Thomson wrote: This commit adds code to handle requesting of PPS APDOs. Switching between standard PDOs and APDOs, and re-requesting an APDO to modify operating voltage/current will be triggered by an external call into TCPM. Signed-off-by: Adam Thomson

Re: [PATCH v5 5/5] typec: tcpm: Add support for sink PPS related messages

2018-03-21 Thread Guenter Roeck
On 03/20/2018 07:33 AM, Adam Thomson wrote: This commit adds sink side support for Get_Status, Status, Get_PPS_Status and PPS_Status handling. As there's the potential for a partner to respond with Not_Supported, handling of this message is also added. Sending of Not_Supported is added to handle

Re: [PATCH 2/2] dt-bindings: usb: rt1711h device tree binding document

2018-03-19 Thread Guenter Roeck
On Mon, Mar 19, 2018 at 11:49:35AM +0800, ShuFan Lee wrote: > From: ShuFan Lee > > Add device tree binding document for Richtek RT1711H Type-C chip driver Cc: Rob Herring , devicet...@vger.kernel.org is missing. Added here but it might make sense to

Re: [PATCH 1/2] staging: typec: rt1711h typec chip driver

2018-03-19 Thread Guenter Roeck
product IDs. But I think for now we are good. Reviewed-by: Guenter Roeck <li...@roeck-us.net> > --- > drivers/staging/typec/Kconfig | 8 + > drivers/staging/typec/Makefile| 1 + > drivers/staging/typec/tcpci.h | 1 + > drivers/staging/typec/tcpci_r

Re: [PATCH v2] staging: typec: rt1711h typec chip driver

2018-03-17 Thread Guenter Roeck
On 03/16/2018 10:52 PM, 李書帆 wrote: Hi Guenter, 2018-03-17 10:16 GMT+08:00 Guenter Roeck <li...@roeck-us.net>: On 03/16/2018 10:40 AM, ShuFan Lee wrote: From: ShuFan Lee <shufan_...@richtek.com> Richtek RT1711H Type-C chip driver that works with Type-C Port Controller Manager to

Re: [PATCH v2] staging: typec: rt1711h typec chip driver

2018-03-16 Thread Guenter Roeck
On 03/16/2018 10:40 AM, ShuFan Lee wrote: From: ShuFan Lee Richtek RT1711H Type-C chip driver that works with Type-C Port Controller Manager to provide USB PD and USB Type-C functionalities. Add definition of TCPC_CC_STATUS_TOGGLING. Signed-off-by: ShuFan Lee

Re: [RFC PATCH v2 2/3] usb: typec: Bus type for alternate modes

2018-03-16 Thread Guenter Roeck
On Fri, Mar 09, 2018 at 06:19:17PM +0300, Heikki Krogerus wrote: > Introducing a simple bus for the alternate modes. Bus allows > binding drivers to the discovered alternate modes the > partners support. > > Signed-off-by: Heikki Krogerus > --- >

Re: [RFC PATCH v2 3/3] usb: typec: tcpm: Support for Alternate Modes

2018-03-16 Thread Guenter Roeck
On Fri, Mar 09, 2018 at 06:19:18PM +0300, Heikki Krogerus wrote: > This adds more complete handling of VDMs and registration of > partner alternate modes, and introduces callbacks for > alternate mode operations. > > Only DFP role is supported for now. > > Signed-off-by: Heikki Krogerus

Re: [PATCH v3 07/12] staging: typec: tcpci: register port before request irq

2018-03-14 Thread Guenter Roeck
On Tue, Mar 13, 2018 at 05:34:33PM +0800, Li Jun wrote: > With that we can clear any pending events and the port is registered > so driver can be ready to handle typec events once we request irq. > > Signed-off-by: Peter Chen > Signed-off-by: Li Jun > --- >

Re: [PATCH v3 08/12] staging: typec: tcpci: enable vbus detection

2018-03-14 Thread Guenter Roeck
g the power status at the beginnng of the function. Any thoughts ? Otherwise Reviewed-by: Guenter Roeck <li...@roeck-us.net> > --- > drivers/staging/typec/tcpci.c | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging

Re: [PATCH v3 11/12] staging: typec: tcpci: Only touch target bit when enable vconn

2018-03-14 Thread Guenter Roeck
On Tue, Mar 13, 2018 at 05:34:37PM +0800, Li Jun wrote: > We need regmap_update_bits to avoid touch any other bits when > enable or disable vconn. > > Signed-off-by: Li Jun <jun...@nxp.com> Reviewed-by: Guenter Roeck <li...@roeck-us.net> > --- > drivers/staging/ty

Re: [PATCH v3 09/12] typec: tcpm: add starting value for drp toggling

2018-03-14 Thread Guenter Roeck
On Tue, Mar 13, 2018 at 05:34:35PM +0800, Li Jun wrote: > As DRP port autonomously toggles the Rp/Rd need a start value to > begin with, so add one parameter for it in tcpm_start_drp_toggling. > > Signed-off-by: Li Jun <jun...@nxp.com> Reviewed-by: Guenter Roeck &

Re: [PATCH v7] staging: typec: handle vendor defined part and modify drp toggling flow

2018-03-09 Thread Guenter Roeck
Rp > - Set LOOK4CONNECTION command > > Signed-off-by: ShuFan Lee <shufan_...@richtek.com> I am fine with this version. Reviewed-by: Guenter Roeck <li...@roeck-us.net> > --- > drivers/staging/typec/tcpci.c | 127 > +- &g

Re: [PATCH] usb: typec: Separate the definitions for data and power roles

2018-03-09 Thread Guenter Roeck
> > In order to allow the port drivers to describe the > capabilities of the ports more clearly according to the > newest specifications, introducing separate definitions for > the data roles. > > Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Review

Re: [PATCH 4.16 REGRESSION fix] Revert "typec: tcpm: Only request matching pdos"

2018-03-06 Thread Guenter Roeck
com> Signed-off-by: Hans de Goede <hdego...@redhat.com> Reviewed-by: Guenter Roeck <li...@roeck-us.net> --- drivers/usb/typec/tcpm.c | 163 --- 1 file changed, 42 insertions(+), 121 deletions(-) diff --git a/drivers/usb/typec/tcpm

Re: [PATCH v6] staging: typec: handle vendor defined part and modify drp toggling flow

2018-03-05 Thread Guenter Roeck
On 03/04/2018 08:16 PM, ShuFan Lee wrote: From: ShuFan Lee Handle vendor defined behavior in tcpci_init, tcpci_set_vconn, tcpci_start_drp_toggling and export tcpci_irq. More operations can be extended in tcpci_data if needed. According to TCPCI specification, 4.4.5.2

Re: [PATCH v2 06/12] usb: typec: tcpm: Use new Type-C switch/mux and usb-role-switch functions

2018-02-25 Thread Guenter Roeck
Signed-off-by: Hans de Goede <hdego...@redhat.com> Reviewed-by: Guenter Roeck <li...@roeck-us.net> --- Changes in v2: -Added Heikki's Reviewed-by --- drivers/usb/typec/Kconfig | 1 + drivers/usb/typec/fusb302/fusb302.c | 1 - drivers/usb/typec/tcpm

Re: [PATCH v2 02/12] usb: typec: Start using ERR_PTR

2018-02-25 Thread Guenter Roeck
-by: Hans de Goede <hdego...@redhat.com> Reviewed-by: Guenter Roeck <li...@roeck-us.net> --- Changes in v2: -Add IS_ERR_OR_NULL() checks to the unregister functions --- drivers/usb/typec/tcpm.c | 16 +--- drivers/usb/typec/tps6598x.c | 15 --- driv

Re: [PATCH v2 05/12] usb: typec: tcpm: Set USB role switch to device mode when configured as such

2018-02-25 Thread Guenter Roeck
that the mux and switch do _not_ stay in their last mode after a detach. Reviewed-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Signed-off-by: Hans de Goede <hdego...@redhat.com> Reviewed-by: Guenter Roeck <li...@roeck-us.net> --- Changes in v2: -Added Heikki's Reviewed-by

Re: [PATCH] staging: typec: handle vendor defined part and modify drp toggling flow

2018-02-21 Thread Guenter Roeck
On Wed, Feb 21, 2018 at 11:02:23PM +0800, ShuFanLee wrote: > From: ShuFanLee > > Handle vendor defined behavior in tcpci_init, tcpci_set_vconn and export > tcpci_irq. > More operations can be extended in tcpci_data if needed. > According to TCPCI specification, 4.4.5.2

Re: [PATCH v1 13/14] USB: typec: Re-use DEFINE_SHOW_ATTRIBUTE() macro

2018-02-14 Thread Guenter Roeck
On Wed, Feb 14, 2018 at 06:08:29PM +0200, Andy Shevchenko wrote: > ...instead of open coding file operations followed by custom ->open() > callbacks per each attribute. > > Cc: Heikki Krogerus <heikki.kroge...@linux.intel.com> > Cc: Guenter Roeck <li...@roeck-us

Re: [PATCH v2] staging: typec: handle vendor defined part and modify drp toggling flow

2018-02-14 Thread Guenter Roeck
On 02/14/2018 04:45 AM, ShuFanLee wrote: From: ShuFanLee Handle vendor defined behavior in tcpci_init, tcpci_set_vconn and export tcpci_irq. More operations can be extended in tcpci_data if needed. According to TCPCI specification, 4.4.5.2 ROLE_CONTROL, TCPC shall not

Re: [PATCH] USB TYPEC: RT1711H Type-C Chip Driver

2018-01-30 Thread Guenter Roeck
On Tue, Jan 30, 2018 at 01:21:01PM +, shufan_lee(李書帆) wrote: > Hi Guenter, > > For now, it looks like there are two ways to implement vendor data. It > would be nice to hear your suggestion. > > 1. Set vendor data in the data field of of_device_id. > If I understand correctly, this

Re: [PATCH v4 0/7] typec: tcpm: Add sink side support for PPS

2018-01-30 Thread Guenter Roeck
On 01/30/2018 05:25 AM, Heikki Krogerus wrote: On Tue, Jan 02, 2018 at 03:50:48PM +, Adam Thomson wrote: This patch set adds sink side support for the PPS feature introduced in the USB PD 3.0 specification. The source PPS supply is represented using the Power Supply framework to provide

Re: [PATCH] USB TYPEC: RT1711H Type-C Chip Driver

2018-01-29 Thread Guenter Roeck
On Mon, Jan 29, 2018 at 07:19:06AM +, shufan_lee(李書帆) wrote: > Hi Guenter, > > We try to use the TCPCI driver on RT1711H and here are some questions. > > Q1. Is current TCPCI driver written according to TypeC Port Controller > Interface Specification Revision 1.0 & Version 1.2?

Re: [PATCH] USB TYPEC: RT1711H Type-C Chip Driver

2018-01-22 Thread Guenter Roeck
***** > > -Original Message- > From: Guenter Roeck [mailto:groe...@gmail.com] On Behalf Of Guenter Roeck > Sent: Saturday, January 20, 2018 12:03 AM > To: Heikki Krogerus > Cc: shufan_lee(李書帆); 'Jun Li'; ShuFanLee; cy_huang(黃啟原); > linux-ker...@vger.kernel.org

Re: [PATCH v4 0/7] typec: tcpm: Add sink side support for PPS

2018-01-22 Thread Guenter Roeck
On Mon, Jan 22, 2018 at 03:31:29PM +0100, Greg Kroah-Hartman wrote: > On Tue, Jan 02, 2018 at 03:50:48PM +, Adam Thomson wrote: > > This patch set adds sink side support for the PPS feature introduced in the > > USB PD 3.0 specification. > > Heikki and Guenter, any thoughts on this patch

Re: [PATCH] USB TYPEC: RT1711H Type-C Chip Driver

2018-01-19 Thread Guenter Roeck
On Fri, Jan 19, 2018 at 11:24:13AM +0200, Heikki Krogerus wrote: > Hi, > > On Fri, Jan 19, 2018 at 09:01:24AM +, shufan_lee(?|) wrote: > > Hi Heikki, > > > > For example, the flow of tcpci_init is a little bit different. > > In tcpci_init, there are more parameters need to be set for

Re: [PATCH 4/5 v5] i2c: i2c-piix4: Use request_declared_muxed_region()

2017-12-19 Thread Guenter Roeck
On 12/18/2017 12:48 AM, Zoltan Boszormenyi wrote: From: Böszörményi Zoltán Use the new request_declared_muxed_region() macro to synchronize access to the I/O port pair 0xcd6 / 0xcd7. At the same time, remove the long lifetime request_region() call to reserve these I/O ports, so

Re: [PATCH 2/5 v3] Modify behaviour of request_*muxed_region()

2017-12-19 Thread Guenter Roeck
On Tue, Dec 19, 2017 at 07:11:11AM +0100, Boszormenyi Zoltan wrote: > 2017-12-18 20:07 keltezéssel, Guenter Roeck írta: > >On Mon, Dec 18, 2017 at 09:48:38AM +0100, Zoltan Boszormenyi wrote: > >>From: Böszörményi Zoltán <zbos...@pr.hu> > >> > >>In order t

Re: [PATCH 2/5 v3] Modify behaviour of request_*muxed_region()

2017-12-18 Thread Guenter Roeck
On Mon, Dec 18, 2017 at 09:48:38AM +0100, Zoltan Boszormenyi wrote: > From: Böszörményi Zoltán > > In order to make request_*muxed_region() behave more like > mutex_lock(), a possible failure case needs to be eliminated. > When drivers do not properly share the same I/O region,

Re: [PATCH 1/5 v3] Extend the request_region() infrastructure

2017-12-18 Thread Guenter Roeck
On Mon, Dec 18, 2017 at 09:48:37AM +0100, Zoltan Boszormenyi wrote: > From: Böszörményi Zoltán > > Add a new IORESOURCE_ALLOCATED flag that is automatically used > when alloc_resource() is used internally in kernel/resource.c > and free_resource() now takes this flag into account.

Re: [PATCH] usb: pd: fix the offset for SVID specific commands

2017-12-18 Thread Guenter Roeck
h. Bad part is that this originates from https://chromium.googlesource.com/chromiumos/platform/ec, which uses 10 as starting point. Nothing we can do about that. Anyway, Reviewed-by: Guenter Roeck <li...@roeck-us.net> > /* ChromeOS specific commands */ > #define VDO_CMD_VERSION

Re: [PATCH 21/45] usb: typec: remove duplicate includes

2017-12-05 Thread Guenter Roeck
On 12/04/2017 06:04 PM, Pravin Shedge wrote: These duplicate includes have been found with scripts/checkincludes.pl but they have been removed manually to avoid removing false positives. Signed-off-by: Pravin Shedge <pravin.shedge4li...@gmail.com> Reviewed-by: Guenter Roeck <li

Re: [PATCH 2/2] usb: xhci: fix panic in xhci_free_virt_devices_depth_first

2017-12-01 Thread Guenter Roeck
epth_first been > called before the device has been setup and get real_port initialized. > The problem occurred on Hikey960 and was reproduced by Guenter Roeck > on Kevin with chromeos-4.4. > > Cc: Guenter Roeck <gro...@google.com> > Cc: <sta...@vger.kernel.org> # v4.10+

Re: [PATCH 2/2 v7] typec: tcpm: Only request matching pdos

2017-11-27 Thread Guenter Roeck
Jagan Sridharan <bad...@google.com> Acked-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Reviewed-by: Guenter Roeck <li...@roeck-us.net> --- Changelog since v1: - Rebased the patch on top of drivers/usb/type/tcpm.c - Added duplicate pdo check for variable/batt pdo.

Re: [PATCH v2] typec: fusb302: Use dev_err during probe

2017-11-23 Thread Guenter Roeck
On 11/23/2017 03:03 PM, Mats Karrman wrote: If probe fails, fusb302_debugfs_exit is called making it impossible to view any logs so use normal dev_err for any error messages during probe. Signed-off-by: Mats Karrman <mats.dev.l...@gmail.com> Reviewed-by: Guenter Roeck <li...@roe

Re: [PATCH] typec: fusb302: Use dev_err during probe

2017-11-23 Thread Guenter Roeck
On 11/23/2017 01:41 PM, Mats Karrman wrote: If probe fails, fusb302_debugfs_exit is called making it impossible to view any logs so use normal dev_err for any error messages during probe. Signed-off-by: Mats Karrman --- drivers/staging/typec/fusb302/fusb302.c | 21

Re: [PATCH v3] typec: tcpm: fusb302: Resolve out of order messaging events

2017-11-21 Thread Guenter Roeck
> > Signed-off-by: Adam Thomson <adam.thomson.opensou...@diasemi.com> I am not really happy about the code duplication (two calls to fusb302_pd_read_message() and identical error messages), but everything else I came up with was even more messy, so Reviewed-by: Guenter Roeck <li...@roeck-us.ne

Re: [PATCH v2] typec: tcpm: fusb302: Resolve out of order messaging events

2017-11-17 Thread Guenter Roeck
On Thu, Nov 16, 2017 at 04:28:11PM +, Adam Thomson wrote: > The expectation in the FUSB302 driver is that a TX_SUCCESS event > should occur after a message has been sent, but before a GCRCSENT > event is raised to indicate successful receipt of a message from > the partner. However in some

Re: [PATCH 2/2 v6] typec: tcpm: Only request matching pdos

2017-11-15 Thread Guenter Roeck
On 11/15/2017 05:01 PM, Badhri Jagan Sridharan wrote: On Tue, Nov 14, 2017 at 9:05 AM, Guenter Roeck <li...@roeck-us.net> wrote: [ ... ] Reviewed-by: Guenter Roeck <li...@roeck-us.net> /* Though I really dislike this new-world comment style. * It hurts my eyes and distr

Re: [PATCH 2/2 v6] typec: tcpm: Only request matching pdos

2017-11-14 Thread Guenter Roeck
. If the Sink requires a different voltage this > will be indicated by its Sink Capabilities message. > > Signed-off-by: Badhri Jagan Sridharan <bad...@google.com> > Acked-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Reviewed-by: Guenter Roeck <li...@roeck-us.net

Re: [PATCH 1/2 v6] typec: tcpm: Validate source and sink caps

2017-11-14 Thread Guenter Roeck
f partner > device would only log them. > > Signed-off-by: Badhri Jagan Sridharan <bad...@google.com> > Acked-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Reviewed-by: Guenter Roeck <li...@roeck-us.net> > --- > Changelog since v1: > - rebase

Re: [GIT PULL] USB/PHY driver changes for 4.15-rc1

2017-11-14 Thread Guenter Roeck
On Tue, Nov 14, 2017 at 05:02:53PM +0200, Heikki Krogerus wrote: > Hi Guenter, > > On Tue, Nov 14, 2017 at 06:48:21AM -0800, Guenter Roeck wrote: > > On 11/14/2017 05:17 AM, Greg KH wrote: > > > On Mon, Nov 13, 2017 at 09:29:36PM -0800, Linus Torvalds wrote: > > &g

Re: [GIT PULL] USB/PHY driver changes for 4.15-rc1

2017-11-14 Thread Guenter Roeck
On 11/14/2017 05:17 AM, Greg KH wrote: On Mon, Nov 13, 2017 at 09:29:36PM -0800, Linus Torvalds wrote: On Mon, Nov 13, 2017 at 8:19 AM, Greg KH wrote: Other major thing is the typec code that moved out of staging and into the "real" part of the drivers/usb/ tree,

  1   2   3   4   5   >