Re: [PATCH v1] usb: typec: tcpm: Fix error while calculating PPS out values

2021-04-14 Thread Badhri Jagan Sridharan
On Wed, Apr 14, 2021 at 10:01 PM Badhri Jagan Sridharan wrote: > > "usb: typec: tcpm: Address incorrect values of tcpm psy for pps supply" > introduced a regression for req_out_volt and req_op_curr calculation. > > req_out_volt should consider the newly calcu

[PATCH v1] usb: typec: tcpm: Fix error while calculating PPS out values

2021-04-14 Thread Badhri Jagan Sridharan
urr should consider the newly calculated max current instead of previously accepted max current by the port partner. Fixes: e3a072022487 ("usb: typec: tcpm: Address incorrect values of tcpm psy for pps supply") Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.

[PATCH v4 3/3] dt-bindings: connector: Add slow-charger-loop definition

2021-04-14 Thread Badhri Jagan Sridharan
-off-by: Badhri Jagan Sridharan --- Changes since v3: * Removed additional semi-colon in the subject line Changes since V2: To address Rob's comments * Updated commit and the binding description. * Updated subject as well. --- .../devicetree/bindings/connector/usb-connector.yaml | 10 ++ 1

[PATCH v4 2/3] usb: typec: tcpm: Allow slow charging loops to comply to pSnkStby

2021-04-14 Thread Badhri Jagan Sridharan
entering SNK_DISCOVERY(instead of 3A or the 1.5A during SNK_DISCOVERY) and the actual currrent limit after RX of PD_CTRL_PSRDY for PD link or during SNK_READY for non-pd link. Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Heikki Krogerus --- Changes since V3: * Added reviewed-by tag from

[PATCH v4 1/3] usb: typec: tcpm: Honour pSnkStdby requirement during negotiation

2021-04-14 Thread Badhri Jagan Sridharan
169.261570] AMS POWER_NEGOTIATION finished Fixes: f0690a25a140b ("staging: typec: USB Type-C Port Manager (tcpm)") Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Guenter Roeck Reviewed-by: Heikki Krogerus --- Changes since V3: * Added reviewed-by tag from Heikki Changes since V

[PATCH v3 2/3] usb: typec: tcpm: Allow slow charging loops to comply to pSnkStby

2021-04-13 Thread Badhri Jagan Sridharan
entering SNK_DISCOVERY(instead of 3A or the 1.5A during SNK_DISCOVERY) and the actual currrent limit after RX of PD_CTRL_PSRDY for PD link or during SNK_READY for non-pd link. Signed-off-by: Badhri Jagan Sridharan --- Changes since V2: * Refactored code based on Heikki's suggestion --- drivers/usb

[PATCH v3 3/3] dt-bindings:: connector: Add slow-charger-loop definition

2021-04-13 Thread Badhri Jagan Sridharan
-off-by: Badhri Jagan Sridharan --- Changes since V2: To address Rob's comments * Updated commit and the binding description. * Updated subject as well. --- .../devicetree/bindings/connector/usb-connector.yaml | 10 ++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree

[PATCH v3 1/3] usb: typec: tcpm: Honour pSnkStdby requirement during negotiation

2021-04-13 Thread Badhri Jagan Sridharan
169.261570] AMS POWER_NEGOTIATION finished Fixes: f0690a25a140b ("staging: typec: USB Type-C Port Manager (tcpm)") Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Guenter Roeck --- Changes since V2: * Refactored code based on Heikki's suggestion * Added reviewed-by tag from Guen

Re: [PATCH v2 6/6] Documentation: connector: Add slow-charger-loop definition

2021-04-13 Thread Badhri Jagan Sridharan
ink: https://lore.kernel.org/r/20210212073743.665038-1-kyle...@google.com Signed-off-by: Greg Kroah-Hartman Thanks, Badhri On Fri, Apr 9, 2021 at 11:38 AM Rob Herring wrote: > > On Wed, Apr 07, 2021 at 01:07:23PM -0700, Badhri Jagan Sridharan wrote: > > To allow slow charger loops to comp

Re: [PATCH v2 5/6] usb: typec: tcpm: Allow slow charging loops to comply to pSnkStby

2021-04-13 Thread Badhri Jagan Sridharan
On Thu, Apr 8, 2021 at 1:22 AM Heikki Krogerus wrote: > > > > @@ -4047,9 +4053,12 @@ static void run_state_machine(struct tcpm_port > > > *port) > > > break; > > > case SNK_DISCOVERY: > > > if (port->vbus_present) { > > > -

Re: [PATCH v2 4/6] usb: typec: tcpm: Honour pSnkStdby requirement during negotiation

2021-04-13 Thread Badhri Jagan Sridharan
On Thu, Apr 8, 2021 at 12:48 AM Heikki Krogerus wrote: > > On Wed, Apr 07, 2021 at 01:07:21PM -0700, Badhri Jagan Sridharan wrote: > > >From PD Spec: > > The Sink Shall transition to Sink Standby before a positive or > > negative voltage transition of VBUS. During Sink

Re: [PATCH v1 1/6] usb: typec: tcpm: Address incorrect values of tcpm psy for fixed supply

2021-04-07 Thread Badhri Jagan Sridharan
Hi Guenter and Adam, Thanks for the reviews ! Fixed up the typo in V2. Thanks, Badhri On Wed, Apr 7, 2021 at 9:04 AM Adam Thomson wrote: > > On 06 April 2021 02:37, Badhri Jagan Sridharan wrote: > > > tcpm_pd_build_request overwrites current_limit and supply_voltage >

Re: [PATCH v1 2/6] usb: typec: tcpm: Address incorrect values of tcpm psy for pps supply

2021-04-07 Thread Badhri Jagan Sridharan
Hi Greg, Moved to kerneldoc header in V2. Thanks, Badhri On Wed, Apr 7, 2021 at 9:07 AM Adam Thomson wrote: > > On 06 April 2021 02:37, Badhri Jagan Sridharan wrote: > > > tcpm_pd_select_pps_apdo overwrites port->pps_data.min_volt, > > port->pps_data.max_volt, p

Re: [PATCH v1 3/6] usb: typec: tcpm: update power supply once partner accepts

2021-04-07 Thread Badhri Jagan Sridharan
anks, Badhri On Wed, Apr 7, 2021 at 9:08 AM Adam Thomson wrote: > > On 06 April 2021 02:37, Badhri Jagan Sridharan wrote: > > > power_supply_changed needs to be called to notify clients > > after the partner accepts the requested values for the pps > > case. > > >

[PATCH v2 6/6] Documentation: connector: Add slow-charger-loop definition

2021-04-07 Thread Badhri Jagan Sridharan
link or during SNK_READY for non-pd link. Signed-off-by: Badhri Jagan Sridharan --- .../devicetree/bindings/connector/usb-connector.yaml | 7 +++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/connector/usb-connector.yaml b/Documentation/devicetree

[PATCH v2 5/6] usb: typec: tcpm: Allow slow charging loops to comply to pSnkStby

2021-04-07 Thread Badhri Jagan Sridharan
entering SNK_DISCOVERY(instead of 3A or the 1.5A during SNK_DISCOVERY) and the actual currrent limit after RX of PD_CTRL_PSRDY for PD link or during SNK_READY for non-pd link. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 18 +++--- 1 file changed, 15

[PATCH v2 4/6] usb: typec: tcpm: Honour pSnkStdby requirement during negotiation

2021-04-07 Thread Badhri Jagan Sridharan
169.261570] AMS POWER_NEGOTIATION finished Fixes: f0690a25a140b ("staging: typec: USB Type-C Port Manager (tcpm)") Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 17 + include/linux/usb/pd.h| 2 ++ 2 files changed, 19 insertions(+)

[PATCH v2 3/6] usb: typec: tcpm: update power supply once partner accepts

2021-04-07 Thread Badhri Jagan Sridharan
: f2a8aa053c176 ("typec: tcpm: Represent source supply through power_supply") Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Adam Thomson --- Changes since V1: * Updated commit description to clarify Guenter Roeck's concern. * Added Reviewed-by tags --- drivers/usb/typec/tcpm/tcpm.c | 4 +-

[PATCH v2 2/6] usb: typec: tcpm: Address incorrect values of tcpm psy for pps supply

2021-04-07 Thread Badhri Jagan Sridharan
epted current_limit and supply_voltage is enforced. Fixes: f2a8aa053c176 ("typec: tcpm: Represent source supply through power_supply") Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Adam Thomson --- Changes since V1: * Moved to kerneldoc header as suggested by Greg KH. * Added reviewed by

[PATCH v2 1/6] usb: typec: tcpm: Address incorrect values of tcpm psy for fixed supply

2021-04-07 Thread Badhri Jagan Sridharan
ly voltage in req_current_limit and req_supply_voltage. current_limit/supply_voltage gets updated once the port partner accepts the request. Fixes: f2a8aa053c176 ("typec: tcpm: Represent source supply through power_supply") Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Guenter Roec

Re: [PATCH v2] usb: typec: tcpm: Invoke power_supply_changed for tcpm-source-psy-

2021-04-05 Thread Badhri Jagan Sridharan
Hi Adam, Just sent out a patch stack https://patchwork.kernel.org/project/linux-usb/list/?series=461087 to address the issue that you mentioned here. Thanks, Badhri On Mon, Apr 5, 2021 at 6:43 PM Badhri Jagan Sridharan wrote: > > Hi Adam, > > Just sent out a patch st

[PATCH v1 6/6] Documentation: connector: Add slow-charger-loop definition

2021-04-05 Thread Badhri Jagan Sridharan
link or during SNK_READY for non-pd link. Signed-off-by: Badhri Jagan Sridharan --- .../devicetree/bindings/connector/usb-connector.yaml | 7 +++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/connector/usb-connector.yaml b/Documentation/devicetree

[PATCH v1 3/6] usb: typec: tcpm: update power supply once partner accepts

2021-04-05 Thread Badhri Jagan Sridharan
power_supply_changed needs to be called to notify clients after the partner accepts the requested values for the pps case. Fixes: f2a8aa053c176 ("typec: tcpm: Represent source supply through power_supply") Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 4 +-

[PATCH v1 1/6] usb: typec: tcpm: Address incorrect values of tcpm psy for fixed supply

2021-04-05 Thread Badhri Jagan Sridharan
ly voltage in req_current_limit and req_supply_voltage. current_limit/supply_voltage gets updated once the port partner accepts the request. Fixes: f2a8aa053c176 ("typec: tcpm: Represent source supply through power_supply") Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/ty

[PATCH v1 5/6] usb: typec: tcpm: Allow slow charging loops to comply to pSnkStby

2021-04-05 Thread Badhri Jagan Sridharan
entering SNK_DISCOVERY(instead of 3A or the 1.5A during SNK_DISCOVERY) and the actual currrent limit after RX of PD_CTRL_PSRDY for PD link or during SNK_READY for non-pd link. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 18 +++--- 1 file changed, 15

[PATCH v1 4/6] usb: typec: tcpm: Honour pSnkStdby requirement during negotiation

2021-04-05 Thread Badhri Jagan Sridharan
169.261570] AMS POWER_NEGOTIATION finished Fixes: f0690a25a140b ("staging: typec: USB Type-C Port Manager (tcpm)") Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 17 + include/linux/usb/pd.h| 2 ++ 2 files changed, 19 insertions(+)

[PATCH v1 2/6] usb: typec: tcpm: Address incorrect values of tcpm psy for pps supply

2021-04-05 Thread Badhri Jagan Sridharan
epted current_limit and supply_voltage is enforced. Fixes: f2a8aa053c176 ("typec: tcpm: Represent source supply through power_supply") Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 84 --- 1 file changed, 49 insertions(+), 35 deletions

[PATCH v1 0/6] Fixes for tcpm-source-psy- and pSnkStby

2021-04-05 Thread Badhri Jagan Sridharan
) makes TCPM comply pSnkStby requirement for both fast and slow charging loops. This was also previously sent as part of https://lore.kernel.org/patchwork/patch/1283928/ Since the patches were dependent on each other sending them this way. Badhri Jagan Sridharan (6): usb: typec: tcpm: Address

Re: [PATCH 4/4] dt-bindings: usb: Add chg-psy-name property Maxim 33359 binding

2021-03-24 Thread Badhri Jagan Sridharan
ing validated, will resurface this patch if I identify any drawbacks of the alternate approach. Regards, Badhri On Wed, Mar 24, 2021 at 7:50 AM Rob Herring wrote: > > On Thu, Mar 11, 2021 at 02:03:13AM -0800, Badhri Jagan Sridharan wrote: > > chg-psy-name is an optional strin

Re: [PATCH v2] usb: typec: tcpm: Invoke power_supply_changed for tcpm-source-psy-

2021-03-18 Thread Badhri Jagan Sridharan
On Thu, Mar 18, 2021 at 8:26 AM Adam Thomson wrote: > > On 17 March 2021 18:13, Badhri Jagan Sridharan wrote: > > > tcpm-source-psy- does not invoke power_supply_changed API when > > one of the published power supply properties is changed. > > power_supply_changed n

[PATCH v1] usb: typec: tcpm: PD3.0 sinks can send Discover Identity even in device mode

2021-03-18 Thread Badhri Jagan Sridharan
once PD negotiation is done. This allows discovering identity for PD3.0 UFP ports as well. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm

[PATCH v1] usb: typec: tcpm: Skip sink_cap query only when VDM sm is busy

2021-03-18 Thread Badhri Jagan Sridharan
sb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)") Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 11d0c40bc47d.

[PATCH v2] usb: typec: tcpm: Invoke power_supply_changed for tcpm-source-psy-

2021-03-17 Thread Badhri Jagan Sridharan
upply") Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Guenter Roeck Reviewed-by: Heikki Krogerus --- Changes since V1: - Fixed commit message as per Guenter's suggestion - Added Reviewed-by tags - cc'ed stable --- drivers/usb/typec/tcpm/tcpm.c | 9 - 1 file changed, 8 insert

[PATCH v1] usb: typec: tcpci: Added few missing TCPCI register definitions

2021-03-16 Thread Badhri Jagan Sridharan
This change adds some of the register bit definitions from the TCPCI spec: https://www.usb.org/sites/default/files/documents/ usb-port_controller_specification_rev2.0_v1.0_0.pdf Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpci.h | 16 1 file changed, 16

Re: [PATCH 3/4] usb: typec: tcpci_maxim: configure charging & data paths

2021-03-16 Thread Badhri Jagan Sridharan
On Thu, Mar 11, 2021 at 9:08 PM Badhri Jagan Sridharan wrote: > > On Thu, Mar 11, 2021 at 5:33 AM Heikki Krogerus > wrote: > > > > Hi, > > > > On Thu, Mar 11, 2021 at 02:03:12AM -0800, Badhri Jagan Sridharan wrote: > > > This change allows the

[PATCH] usb: typec: tcpm: Invoke power_supply_changed for tcpm-source-psy-

2021-03-16 Thread Badhri Jagan Sridharan
upply") Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 11d0c40bc47d..e8936ea17f80 100644 --- a/drivers/usb/typec/tcpm/tc

Re: [PATCH v2 1/2] usb: typec: tcpci: Add tcpc chip level callbacks

2021-03-11 Thread Badhri Jagan Sridharan
On Thu, Mar 11, 2021 at 10:34 PM Greg Kroah-Hartman wrote: > > On Fri, Mar 12, 2021 at 07:33:45AM +0100, Greg Kroah-Hartman wrote: > > On Thu, Mar 11, 2021 at 09:24:42PM -0800, Badhri Jagan Sridharan wrote: > > > This change adds chip callbacks for the following operation

Re: [PATCH v2 2/2] usb: typec: tcpci_maxim: configure charging & data paths

2021-03-11 Thread Badhri Jagan Sridharan
On Thu, Mar 11, 2021 at 10:39 PM Guenter Roeck wrote: > > On 3/11/21 9:24 PM, Badhri Jagan Sridharan wrote: > > The change exposes the data_role and the orientation as a extcon > > interface for configuring the USB data controller. > > > > Signed-

[PATCH v2 2/2] usb: typec: tcpci_maxim: configure charging & data paths

2021-03-11 Thread Badhri Jagan Sridharan
The change exposes the data_role and the orientation as a extcon interface for configuring the USB data controller. Signed-off-by: Badhri Jagan Sridharan --- Changes since V1: - Dropped changes related to get_/set_current_limit and pd_capable callback. Will send them in as separate patches

[PATCH v2 1/2] usb: typec: tcpci: Add tcpc chip level callbacks

2021-03-11 Thread Badhri Jagan Sridharan
This change adds chip callbacks for the following operations: 1. Notifying port role 2. Notifying orientation Signed-off-by: Badhri Jagan Sridharan --- Changes since V1: - Dropped changes related to get_/set_current_limit and pd_capable callback. Will send them in as separate patches

Re: [PATCH 3/4] usb: typec: tcpci_maxim: configure charging & data paths

2021-03-11 Thread Badhri Jagan Sridharan
On Thu, Mar 11, 2021 at 5:33 AM Heikki Krogerus wrote: > > Hi, > > On Thu, Mar 11, 2021 at 02:03:12AM -0800, Badhri Jagan Sridharan wrote: > > This change allows the driver to configure input current/voltage > > limit for the charging path. The driver sets current_max an

[PATCH 4/4] dt-bindings: usb: Add chg-psy-name property Maxim 33359 binding

2021-03-11 Thread Badhri Jagan Sridharan
chg-psy-name is an optional string property used to indicate the power supply object for which the current/voltage_max limits have to be set. Signed-off-by: Badhri Jagan Sridharan --- Documentation/devicetree/bindings/usb/maxim,max33359.yaml | 7 ++- 1 file changed, 6 insertions(+), 1

[PATCH 2/4] usb: typec: tcpci: Add tcpc chip level callbacks

2021-03-11 Thread Badhri Jagan Sridharan
This change adds chip callbacks for the following operations: 1. Setting/getting vbus voltage and current limits. 2. Notifying presence of PD capable partner 3. Notifying port role 4. Notifying orientation Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpci.c | 45

[PATCH 3/4] usb: typec: tcpci_maxim: configure charging & data paths

2021-03-11 Thread Badhri Jagan Sridharan
the USB data controller. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpci_maxim.c | 126 ++- 1 file changed, 125 insertions(+), 1 deletion(-) diff --git a/drivers/usb/typec/tcpm/tcpci_maxim.c b/drivers/usb/typec/tcpm/tcpci_maxim.c index 041a1c393594

[PATCH 1/4] usb: typec: tcpm: Add callback to notify pd_capable partner

2021-03-11 Thread Badhri Jagan Sridharan
This change informs lower level tcpc drivers of pd_capable partner. This is useful while setting current limit for the charging path. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 20 +++- include/linux/usb/tcpm.h | 3 +++ 2 files changed, 18

[PATCH v1] usb: typec: tcpci: Refactor tcpc_presenting_cc1_rd macro

2021-03-10 Thread Badhri Jagan Sridharan
Defining one macro instead of two for tcpc_presenting_*_rd. This is a follow up of the comment left by Heikki Krogerus. https://patchwork.kernel.org/project/linux-usb/patch/ 20210304070931.1947316-1-bad...@google.com/ Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpci.c

[PATCH v1] usb: typec: tcpci: Check ROLE_CONTROL while interpreting CC_STATUS

2021-03-03 Thread Badhri Jagan Sridharan
xes: 74e656d6b0551 ("staging: typec: Type-C Port Controller Interface driver (tcpci)") Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpci.c | 21 ++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec

Re: [PATCH v2] usb: typec: tcpm: Wait for vbus discharge to VSAFE0V before toggling

2021-02-25 Thread Badhri Jagan Sridharan
On Wed, Feb 24, 2021 at 9:46 PM Badhri Jagan Sridharan wrote: > > On Fri, Feb 19, 2021 at 7:56 AM Guenter Roeck wrote: > > > > On 2/19/21 1:04 AM, Badhri Jagan Sridharan wrote: > > > When vbus auto discharge is enabled, TCPM can sometimes be faster than > >

[PATCH v3] usb: typec: tcpm: Wait for vbus discharge to VSAFE0V before toggling

2021-02-25 Thread Badhri Jagan Sridharan
e disconnect support") Signed-off-by: Badhri Jagan Sridharan --- Changes since V1: - Add Fixes tag Changes since V2: - Remove VBUS_DISCHARGE state as preferred by Guenter Roeck --- drivers/usb/typec/tcpm/tcpm.c | 75 ++- 1 file changed, 65 insertions(+), 10

Re: [PATCH v2] usb: typec: tcpm: Wait for vbus discharge to VSAFE0V before toggling

2021-02-24 Thread Badhri Jagan Sridharan
On Fri, Feb 19, 2021 at 7:56 AM Guenter Roeck wrote: > > On 2/19/21 1:04 AM, Badhri Jagan Sridharan wrote: > > When vbus auto discharge is enabled, TCPM can sometimes be faster than > > the TCPC i.e. TCPM can go ahead and move the port to unattached state > > (invo

Re: [PATCH v1] usb: typec: tcpm: Wait for vbus discharge to VSAFE0V before toggling

2021-02-19 Thread Badhri Jagan Sridharan
Jagan Sridharan wrote: > > Hi Greg, > > > > This patch is a bug fix for the following patch which was introduced in > > 5.11. > > > > commit f321a02caebdd0c56e167610cda2fa148cd96e8b > > Author: Badhri Jagan Sridharan > > Date: Wed Oct 28 23:31

[PATCH v2] usb: typec: tcpm: Wait for vbus discharge to VSAFE0V before toggling

2021-02-19 Thread Badhri Jagan Sridharan
tcpm: Implement enabling Auto Discharge disconnect support") Signed-off-by: Badhri Jagan Sridharan --- Changes since V1: - Add Fixes tag --- drivers/usb/typec/tcpm/tcpm.c | 60 +++ 1 file changed, 53 insertions(+), 7 deletions(-) diff --git a/drivers/usb/typec/tcp

Re: [PATCH v1] usb: typec: tcpm: Wait for vbus discharge to VSAFE0V before toggling

2021-02-18 Thread Badhri Jagan Sridharan
Hi Greg, This patch is a bug fix for the following patch which was introduced in 5.11. commit f321a02caebdd0c56e167610cda2fa148cd96e8b Author: Badhri Jagan Sridharan Date: Wed Oct 28 23:31:35 2020 -0700 usb: typec: tcpm: Implement enabling Auto Discharge disconnect support TCPCI

[PATCH v1] usb: typec: tcpm: Wait for vbus discharge to VSAFE0V before toggling

2021-02-18 Thread Badhri Jagan Sridharan
to unattached state happens right away. Also, while in SNK_READY, when auto discharge is enabled, drive disconnect based on vbus turning off instead of Rp disappearing on CC pins. Rp disappearing on CC pins is almost instanteous compared to vbus decay. Signed-off-by: Badhri Jagan Sridharan

Re: [PATCH v2 1/3] usb: typec: tcpm: Add Callback to Usb Communication capable partner

2021-02-01 Thread Badhri Jagan Sridharan
issue as well. I am pinging here to make sure that the patch isn't missed. Thanks, Badhri On Mon, Feb 1, 2021 at 4:31 PM Badhri Jagan Sridharan wrote: > > The USB Communications Capable bit indicates if port > partner is capable of communication over the USB data lines > (e.g. D+/-

[PATCH v1] usb: typec: tcpm: Set in_ams flag when Source caps have been received

2021-02-01 Thread Badhri Jagan Sridharan
30 ms after the GoodCRC EOP corresponding to Source Capabilities message was received, the test fails. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c in

Re: [PATCH v1 1/3] usb: typec: tcpm: Add Callback to Usb Communication capable partner

2021-02-01 Thread Badhri Jagan Sridharan
On Mon, Feb 1, 2021 at 6:59 AM Guenter Roeck wrote: > > On 2/1/21 1:53 AM, Badhri Jagan Sridharan wrote: > > The USB Communications Capable bit indicates if port > > partner is capable of communication over the USB data lines > > (e.g. D+/- or SS Tx/Rx). Notify the

[PATCH v2 3/3] usb: typec: tcpci_maxim: Enable data path when partner is USB Comm capable

2021-02-01 Thread Badhri Jagan Sridharan
Configure USB switches when partner is USB Communication capable. The is enabled USB data communication over D+/D- pins. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpci_maxim.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers/usb/typec/tcpm

[PATCH v2 2/3] usb: typec: tcpci: Add Callback to Usb Communication capable partner

2021-02-01 Thread Badhri Jagan Sridharan
The USB Communications Capable bit indicates if port partner is capable of communication over the USB data lines (e.g. D+/- or SS Tx/Rx). TCPM passes this information for chip specific operations. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpci.c | 9 + drivers

[PATCH v2 1/3] usb: typec: tcpm: Add Callback to Usb Communication capable partner

2021-02-01 Thread Badhri Jagan Sridharan
up data path when the bit is set. Refactored from patch initially authored by Kyle Tso Signed-off-by: Badhri Jagan Sridharan --- Changes since V1: - Removed partner_usb_comm_capable flag. - Fixed capable flag for SNK_NEGOTIATE_CAPABILITIES. --- drivers/usb/typec/tcpm/tcpm.c | 13

[PATCH v1] usb: typec: tcpm: Handle vbus shutoff when in source mode

2021-02-01 Thread Badhri Jagan Sridharan
While in source mode, vbus could be shutoff by protections circuits. TCPM does not move back to toggling state to re-initiate connection. Fix this by moving to SRC_UNATTACHED state when vbus shuts off while in source mode. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c

[PATCH v1 3/3] usb: typec: tcpci_maxim: Enable data path when partner is USB Comm capable

2021-02-01 Thread Badhri Jagan Sridharan
Configure USB switches when partner is USB Communication capable. The is enabled USB data communication over D+/D- pins. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpci_maxim.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers/usb/typec/tcpm

[PATCH v1 1/3] usb: typec: tcpm: Add Callback to Usb Communication capable partner

2021-02-01 Thread Badhri Jagan Sridharan
up data path when the bit is set. Refactored from patch initially authored by Kyle Tso Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 16 include/linux/usb/tcpm.h | 5 + 2 files changed, 21 insertions(+) diff --git a/drivers/usb/typec/tcpm

[PATCH v1 2/3] usb: typec: tcpci: Add Callback to Usb Communication capable partner

2021-02-01 Thread Badhri Jagan Sridharan
The USB Communications Capable bit indicates if port partner is capable of communication over the USB data lines (e.g. D+/- or SS Tx/Rx). TCPM passes this information for chip specific operations. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpci.c | 9 + drivers

Re: [PATCH v5 1/3] usb: typec: tcpm: AMS and Collision Avoidance

2021-01-12 Thread Badhri Jagan Sridharan
Hi Kyle, Do you want to handle the FAST_ROLE_SWAP case as well ? You would have to fix up in two places: #1 - if (port->state == SNK_READY) - tcpm_set_state(port, FR_SWAP_SEND, 0); - else + if

[PATCH v1] usb: typec: tcpm: Update vbus_vsafe0v on init

2020-12-10 Thread Badhri Jagan Sridharan
ng vbus_vsafe0v based on vbus_present status on boot. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index cedc6cf82d61..58a6302c549f 100644 --

[PATCH] usb: typec: tcpci: Enable bleed discharge when auto discharge is enabled

2020-12-10 Thread Badhri Jagan Sridharan
Auto discharge circuits kick in only when vbus decays and reaches VBUS_SINK_DISCONNECT_THRESHOLD threshold. Enable bleed discharge to discharge vbus to VBUS_SINK_DISCONNECT_THRESHOLD upon disconnect. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpci.c | 2 ++ 1 file changed

Re: [PATCH 5/5] USB: typec: tcpci: Add Bleed discharge to POWER_CONTROL definition

2020-12-10 Thread Badhri Jagan Sridharan
Hi Greg, I have a patch ready to enable BLEED_DISCHARGE in tcpci code. I will send that in once you merge this patch to usb-next. Thanks, Badhri On Thu, Dec 10, 2020 at 10:56 AM Badhri Jagan Sridharan wrote: > > Hi Guenter, > > Yes I will send a follow up patch to update t

Re: [PATCH 1/5] USB: typec: tcpm: Prevent log overflow by removing old entries

2020-12-10 Thread Badhri Jagan Sridharan
wrote: > > From: Badhri Jagan Sridharan > > > > TCPM logs overflow once the logbuffer is full. Clear old entries and > > allow logging the newer ones as the newer would be more relevant to the > > issue being debugged. > > > > Also, do not reset the logbuff

Re: [PATCH 5/5] USB: typec: tcpci: Add Bleed discharge to POWER_CONTROL definition

2020-12-10 Thread Badhri Jagan Sridharan
Hi Guenter, Yes I will send a follow up patch to update tcpci_maxim.c. Thanks, Badhri On Thu, Dec 10, 2020 at 9:45 AM Guenter Roeck wrote: > > On Thu, Dec 10, 2020 at 05:05:21PM +0100, Greg Kroah-Hartman wrote: > > From: Badhri Jagan Sridharan > > > > "Table

[PATCH v1] usb: typec: tcpm: Clear send_discover in tcpm_check_send_discover

2020-12-02 Thread Badhri Jagan Sridharan
clear the send_discover flag here to prevent tcpm_enable_frs_work from rescheduling indefinetly. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm

Re: [PATCH v1 3/3] usb: typec: tcpci_maxim: Enable VSAFE0V signalling

2020-12-01 Thread Badhri Jagan Sridharan
On Tue, Dec 1, 2020 at 5:16 AM Guenter Roeck wrote: > > On Mon, Nov 30, 2020 at 05:32:46PM -0800, Badhri Jagan Sridharan wrote: > > Unmask EXTENDED_STATUS_MASK.vSafe0V, ALERT.Extended_Status > > and set vbus_vsafe0v to enable VSAFE0V signalling. > > > > Signed-

[PATCH v2 1/3] usb: typec: tcpm: Introduce vsafe0v for vbus

2020-12-01 Thread Badhri Jagan Sridharan
the compliance tester intentionally maintains vbus at greater than vSafe0V and expects the Product under test to stay in AttachWait.SRC till vbus drops to vSafe0V. Signed-off-by: Badhri Jagan Sridharan --- Changes since v1: - Changed return type to bool instead of int for is_vbus_vsafe0v as suggest

Re: [PATCH v1 1/3] usb: typec: tcpm: Introduce vsafe0v for vbus

2020-12-01 Thread Badhri Jagan Sridharan
On Tue, Dec 1, 2020 at 5:15 AM Guenter Roeck wrote: > > On Mon, Nov 30, 2020 at 05:32:44PM -0800, Badhri Jagan Sridharan wrote: > > TCPM at present lacks the notion of VSAFE0V. There > > are three vbus threshold levels that are critical to track: > > a. vSafe5V - V

[PATCH v2 3/3] usb: typec: tcpci_maxim: Enable VSAFE0V signalling

2020-12-01 Thread Badhri Jagan Sridharan
Unmask EXTENDED_STATUS_MASK.vSafe0V, ALERT.Extended_Status and set vbus_vsafe0v to enable VSAFE0V signalling. Signed-off-by: Badhri Jagan Sridharan --- Changes since v1: - Setting auto_discharge_disconnect to true instead of 1 as suggested by Guenter. --- drivers/usb/typec/tcpm/tcpci_maxim.c

[PATCH v2 2/3] usb: typec: tcpci: Add support to report vSafe0V

2020-12-01 Thread Badhri Jagan Sridharan
otherwise. Signed-off-by: Badhri Jagan Sridharan --- Changes since v1: - Removed logic for checking TCPC_POWER_STATUS_MASK reg read in the irq handler. Sending that as a separate patch. --- drivers/usb/typec/tcpm/tcpci.c | 39 +- drivers/usb/typec/tcpm/tcpci.h | 6

Re: [PATCH v1 2/3] usb: typec: tcpci: Add support to report vSafe0V

2020-12-01 Thread Badhri Jagan Sridharan
On Tue, Dec 1, 2020 at 5:27 AM Guenter Roeck wrote: > > On Mon, Nov 30, 2020 at 05:32:45PM -0800, Badhri Jagan Sridharan wrote: > > This change adds vbus_vsafe0v which when set, makes TCPM > > query for VSAFE0V by assigning the tcpc.is_vbus_vsafe0v callback. > > Also enab

Re: [PATCH v1 1/4] usb: typec: tcpm: Pass down negotiated rev to update retry count

2020-12-01 Thread Badhri Jagan Sridharan
Sure. Done ! Just sent out v2 version of the patch. Thanks, Badhri. On Tue, Dec 1, 2020 at 2:32 AM Heikki Krogerus wrote: > > On Mon, Nov 30, 2020 at 08:22:34PM -0800, Badhri Jagan Sridharan wrote: > > nRetryCount was updated from 3 to 2 between PD2.0 and PD3.0 spec. > > nRe

[PATCH v2] usb: typec: tcpm: Pass down negotiated rev to update retry count

2020-12-01 Thread Badhri Jagan Sridharan
usb302 & tcpci drivers, by default the driver sets the retry count to 3 (Default for PD 2.0). Update this to 2, if the negotiated rev is PD 3.0. In wcove, since the retry count is intentionally set to max, leaving it as is. Signed-off-by: Badhri Jagan Sridharan --- Changes since V1: -Squashed

[PATCH v1 3/4] usb: typec: tcpci: Update retry count based on the negotiated rev

2020-11-30 Thread Badhri Jagan Sridharan
By default the driver sets the retry count to 3 (Default for PD 2.0). Update this to 2, if the negotiated rev is PD 3.0. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpci.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/usb/typec

[PATCH v1 4/4] usb: typec: wcove: Update wcove_pd_transmit to include negoitated rev

2020-11-30 Thread Badhri Jagan Sridharan
pd_transmit callback now passes down negotiated_rev to set retry count accordingly if needed. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/wcove.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/typec/tcpm/wcove.c b/drivers/usb/typec/tcpm

[PATCH v1 1/4] usb: typec: tcpm: Pass down negotiated rev to update retry count

2020-11-30 Thread Badhri Jagan Sridharan
p drivers can update the retry count accordingly before attempting packet transmission. This helps in passing "TEST.PD.PORT.ALL.02" of the "Power Delivery Merged" test suite which was initially failing with "The UUT did not retransmit the message nReryCount times" Signe

[PATCH v1 2/4] usb: typec: fusb302: Update retry count based on the negotiated rev

2020-11-30 Thread Badhri Jagan Sridharan
By default the driver sets the retry count to 3 (Default for PD 2.0). Update this to 2, if the negotiated rev is PD 3.0. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/fusb302.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/usb

[PATCH v1 3/3] usb: typec: tcpci_maxim: Enable VSAFE0V signalling

2020-11-30 Thread Badhri Jagan Sridharan
Unmask EXTENDED_STATUS_MASK.vSafe0V, ALERT.Extended_Status and set vbus_vsafe0v to enable VSAFE0V signalling. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpci_maxim.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/usb/typec

[PATCH v1 2/3] usb: typec: tcpci: Add support to report vSafe0V

2020-11-30 Thread Badhri Jagan Sridharan
otherwise. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpci.c | 55 ++ drivers/usb/typec/tcpm/tcpci.h | 6 2 files changed, 49 insertions(+), 12 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c index

[PATCH v1 1/3] usb: typec: tcpm: Introduce vsafe0v for vbus

2020-11-30 Thread Badhri Jagan Sridharan
the compliance tester intentionally maintains vbus at greater than vSafe0V and expects the Product under test to stay in AttachWait.SRC till vbus drops to vSafe0V. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 63 +-- include/linux/usb/tcpm.h

[PATCH v1] usb: typec: tcpm: Disregard vbus off while in PR_SWAP_SNK_SRC_SOURCE_ON

2020-11-24 Thread Badhri Jagan Sridharan
while in PR_SWAP_SNK_SRC_SOURCE_ON and the vbus source has PD_T_NEWSRC to ramp up. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 4aac0efdb720

[PATCH] usb: typec: tcpm: Stay in SNK_TRY_WAIT_DEBOUNCE_CHECK_VBUS till Rp is seen

2020-11-24 Thread Badhri Jagan Sridharan
.Rp state is not detected for tTryCCDebounce. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 18 +- include/linux/usb/pd.h| 1 + 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/t

Re: [RESEND PATCH v3 1/4] dt-bindings: connector: add power-opmode optional property to usb-connector

2020-11-05 Thread Badhri Jagan Sridharan
Hi Rob and Amelie, With regards to discussions in this thread, For https://lore.kernel.org/r/20201020093627.256885-2-bad...@google.com, I can send in a patch to update the new-source-frs-typec-current property. Amelie, If you are already planning to send that I am fine with that as well. Let me

Re: [PATCH v12 01/10] dt-bindings: usb: Maxim type-c controller device tree binding document

2020-10-29 Thread Badhri Jagan Sridharan
description? This patch depends on patch "dt-bindings: connector: Add property to set initial current cap for FRS". Or is there something else that I should do ? Thanks, Badhri On Thu, Oct 29, 2020 at 8:33 AM Rob Herring wrote: > > On Wed, 28 Oct 2020 23:31:29 -0700, Badhri Jagan

[PATCH v12 09/10] usb: typec: tcpci_maxim: Enable auto discharge disconnect

2020-10-29 Thread Badhri Jagan Sridharan
Enable auto discharge disconnect for Maxim TCPC. Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Heikki Krogerus --- Changes since v1: - Changing patch version to v6 to fix version number confusion. Changes since v6: - Rebase on usb-next. Changes since v7: - Heikki's suggestion: Moved

[PATCH v12 07/10] usb: typec: tcpm: Implement enabling Auto Discharge disconnect support

2020-10-29 Thread Badhri Jagan Sridharan
Interface Specification. In such TCPC implementations, setting AutoDischargeDisconnect would prevent TCPC into entering "Connection_Invalid" state as well. Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Heikki Krogerus --- Changes since v1: - Changing patch version to v6 to fix vers

[PATCH v12 08/10] usb: typec: tcpci: Implement Auto discharge disconnect callbacks

2020-10-29 Thread Badhri Jagan Sridharan
to tdata to allow TCPC chip level drivers enable AutoDischargeDisconnect. Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Heikki Krogerus --- Changes since v1: - Changing patch version to v6 to fix version number confusion. Changes since v6: - Rebase on usb-next. Changes since v7: Heikki's

[PATCH v12 04/10] usb: typec: tcpm: frs sourcing vbus callback

2020-10-29 Thread Badhri Jagan Sridharan
During FRS hardware autonomously starts to source vbus. Provide callback to perform chip specific operations. Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Heikki Krogerus --- Introduced in v9. Changes since v10: Added Reviewed-by: Heikki Krogerus Changes since v11: none --- drivers/usb

[PATCH v12 05/10] usb: typec: tcpci: frs sourcing vbus callback

2020-10-29 Thread Badhri Jagan Sridharan
During FRS hardware autonomously starts to source vbus. Provide callback to perform chip specific operations. Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Heikki Krogerus --- v9 is the first version of this patch in the series. Added to fix occasional bug of vbus turning back on when

[PATCH v12 06/10] usb: typec: tcpci_maxim: Fix vbus stuck on upon diconnecting sink

2020-10-29 Thread Badhri Jagan Sridharan
whenever POWER_STATUS.sourcing_vbus is set. Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Heikki Krogerus --- v9 is the first version of this patch. Added to fix occasional bug of vbus turning back on when disconnecting the FRS accessory after disconnect. No changes since v9. Changes since v10

[PATCH v12 10/10] usb: typec: tcpci_maxim: Fix uninitialized return variable

2020-10-29 Thread Badhri Jagan Sridharan
IS_ERR_OR_NULL with IS_ERR. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Badhri Jagan Sridharan --- v12 is the first version of the patch in this series. --- drivers/usb/typec/tcpm/tcpci_maxim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH v12 01/10] dt-bindings: usb: Maxim type-c controller device tree binding document

2020-10-29 Thread Badhri Jagan Sridharan
Add device tree binding document for Maxim 33359 Type-C chip driver Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Rob Herring --- Changes since v1: - Changing patch version to v6 to fix version number confusion. Changes since v6: - Migrated to yaml format. Changes since v7: - Rebase

[PATCH v12 02/10] usb: typec: tcpci_maxim: Fix the compatible string

2020-10-29 Thread Badhri Jagan Sridharan
Changing compatible string to include the part number. Signed-off-by: Badhri Jagan Sridharan --- V11 is the first version of the patch. Introduced to add chip number to the compatible property to address Rob Herring's comment on dt-binding patch. Change since v11: Changed compatible property

[PATCH v12 03/10] usb: typec: tcpm: Refactor logic for new-source-frs-typec-current

2020-10-29 Thread Badhri Jagan Sridharan
New source's current capability is now defined as string based device tree property through new-source-frs-typec-current. Refactor tcpm code to parse new-source-frs-typec-current and infer local port's new source current capability during frs. Signed-off-by: Badhri Jagan Sridharan --- v9

  1   2   3   4   5   >