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

2021-02-14 Thread Kyle Tso
Export a function for other drivers to get the partner Source Capabilities. Signed-off-by: Kyle Tso --- Changes since v1: - add a put function to free the memory Changes since v2: - bring back the function tcpm_copy_pdos drivers/usb/typec/tcpm/tcpm.c | 47

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

2021-02-13 Thread Kyle Tso
Export a function for other drivers to get the partner Source Capabilities. Signed-off-by: Kyle Tso --- Changes since v1: - add a put function to free the memory drivers/usb/typec/tcpm/tcpm.c | 34 ++ include/linux/usb/tcpm.h | 2 ++ 2 files changed, 36

[PATCH] Documentation: connector: Update the description of sink-vdos

2021-02-11 Thread Kyle Tso
Remove the acronym "VDM" and replace it with the full name "Vendor Defined Message". Signed-off-by: Kyle Tso --- .../devicetree/bindings/connector/usb-connector.yaml | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bi

Re: [PATCH v6 6/7] dt-bindings: connector: Add SVDM VDO properties

2021-02-11 Thread Kyle Tso
On Fri, Feb 12, 2021 at 12:21 PM Guenter Roeck wrote: > > On Fri, Feb 05, 2021 at 11:34:14AM +0800, Kyle Tso wrote: > > Add bindings of VDO properties of USB PD SVDM so that they can be > > used in device tree. > > > > Signed-off-by: Kyle Tso > > Reviewe

Re: [PATCH v6 3/7] usb: typec: tcpm: Determine common SVDM Version

2021-02-11 Thread Kyle Tso
On Fri, Feb 12, 2021 at 3:10 PM Kyle Tso wrote: > > On Fri, Feb 12, 2021 at 12:17 PM Guenter Roeck wrote: > > > > On Fri, Feb 05, 2021 at 11:34:11AM +0800, Kyle Tso wrote: > > > PD Spec Revision 3.0 Version 2.0 + ECNs 2020-12-10 > > > 6.4.4.2.3 Structured

Re: [PATCH v6 3/7] usb: typec: tcpm: Determine common SVDM Version

2021-02-11 Thread Kyle Tso
On Fri, Feb 12, 2021 at 12:17 PM Guenter Roeck wrote: > > On Fri, Feb 05, 2021 at 11:34:11AM +0800, Kyle Tso wrote: > > PD Spec Revision 3.0 Version 2.0 + ECNs 2020-12-10 > > 6.4.4.2.3 Structured VDM Version > > "The Structured VDM Version field of the Discover Id

Re: [PATCH v6 6/7] dt-bindings: connector: Add SVDM VDO properties

2021-02-05 Thread Kyle Tso
On Sat, Feb 6, 2021 at 5:30 AM Rob Herring wrote: > > On Fri, Feb 05, 2021 at 11:34:14AM +0800, Kyle Tso wrote: > > Add bindings of VDO properties of USB PD SVDM so that they can be > > used in device tree. > > > > Signed-off-by: Kyle Tso > > --- &

[PATCH v6 6/7] dt-bindings: connector: Add SVDM VDO properties

2021-02-04 Thread Kyle Tso
Add bindings of VDO properties of USB PD SVDM so that they can be used in device tree. Signed-off-by: Kyle Tso --- Changes since v5: - no change .../bindings/connector/usb-connector.yaml | 11 + include/dt-bindings/usb/pd.h | 311 +- 2 files changed, 321

[PATCH v6 7/7] usb: typec: tcpm: Get Sink VDO from fwnode

2021-02-04 Thread Kyle Tso
Commit a079973f462a ("usb: typec: tcpm: Remove tcpc_config configuration mechanism") removed the tcpc_config which includes the Sink VDO and it is not yet added back with fwnode. Add it now. Signed-off-by: Kyle Tso --- Changes since v5: - no change drivers/usb/typec/tcpm/t

[PATCH v6 5/7] usb: typec: displayport: Fill the negotiated SVDM Version in the header

2021-02-04 Thread Kyle Tso
VDM header now requires SVDM Version. Get it from typec_partner. Signed-off-by: Kyle Tso --- Changes since v5: - follow the changes of "usb: typec: Manage SVDM version" drivers/usb/typec/altmodes/displayport.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-)

[PATCH v6 3/7] usb: typec: tcpm: Determine common SVDM Version

2021-02-04 Thread Kyle Tso
tners or Cable Plug and Shall continue to operate using this Specification Revision until they are Detached." Also clear the fields newly defined in SVDM version 2.0 if the negotiated SVDM version is 1.0. Signed-off-by: Kyle Tso --- Changes since v5: - follow the changes of "usb: typ

[PATCH v6 2/7] usb: pd: Make SVDM Version configurable in VDM header

2021-02-04 Thread Kyle Tso
PD Rev 3.0 introduces SVDM Version 2.0. This patch makes the field configuable in the header in order to be able to be compatible with older SVDM version. Signed-off-by: Kyle Tso --- Changes since v5: - no change drivers/usb/typec/altmodes/displayport.c | 2 +- drivers/usb/typec/tcpm/tcpm.c

[PATCHi v6 1/7] usb: typec: Manage SVDM version

2021-02-04 Thread Kyle Tso
rt and the partner. Also add setter/getter functions for the negotiated SVDM version. Signed-off-by: Kyle Tso --- Changes since v5 - !! most changes are from Heikki - location of the negotiated SVDM version is changed. Now the variable resides in typec_partner - The setter and getter func

[PATCH v6 4/7] usb: typec: ucsi: Determine common SVDM Version

2021-02-04 Thread Kyle Tso
owest common Structured VDM Version supported by the Port Partners or Cable Plug and Shall continue to operate using this Specification Revision until they are Detached." Signed-off-by: Kyle Tso --- Changes since v5: - follow the changes of "usb: typec: Manage SVDM version" -

[PATCH v6 0/7] common SVDM version and VDO from dt

2021-02-04 Thread Kyle Tso
VDO properties - no change usb: typec: tcpm: Get Sink VDO from fwnode - no change Kyle Tso (7): usb: typec: Manage SVDM version usb: pd: Make SVDM Version configurable in VDM header usb: typec: tcpm: Determine common SVDM Version usb: typec: ucsi: Determine common SVDM Version usb: typec

Re: [PATCH] usb: pd: Reland VDO definitions of PD2.0

2021-02-03 Thread Kyle Tso
On Thu, Feb 4, 2021 at 8:55 AM Kyle Tso wrote: > > Hi, Benson and Prashant, > > On Thu, Feb 4, 2021 at 8:50 AM Kyle Tso wrote: > > > > Reland VDO definitions of PD Revision 2.0 as they are still used in > > PD2.0 products. > > > > Fixes: 0e1d

Re: [PATCH v5 2/8] usb: pd: Update VDO definitions

2021-02-03 Thread Kyle Tso
On Thu, Feb 4, 2021 at 12:55 AM Benson Leung wrote: > > Hey Kyle, > > On Tue, Feb 2, 2021 at 8:23 AM Kyle Tso wrote: > > > > "PD Spec Revision 3.0 Version 2.0 + ECNs 2020-12-10" introduces several > > changes regarding the ID Header VDO and the Product Ty

Re: [PATCH] usb: pd: Reland VDO definitions of PD2.0

2021-02-03 Thread Kyle Tso
Hi, Benson and Prashant, On Thu, Feb 4, 2021 at 8:50 AM Kyle Tso wrote: > > Reland VDO definitions of PD Revision 2.0 as they are still used in > PD2.0 products. > > Fixes: 0e1d6f55a12e ("usb: pd: Update VDO definitions") > Signed-off-by: Kyle Tso > --- >

[PATCH] usb: pd: Reland VDO definitions of PD2.0

2021-02-03 Thread Kyle Tso
Reland VDO definitions of PD Revision 2.0 as they are still used in PD2.0 products. Fixes: 0e1d6f55a12e ("usb: pd: Update VDO definitions") Signed-off-by: Kyle Tso --- include/linux/usb/pd_vdo.h | 69 -- 1 file changed, 66 insertions(+), 3 deletion

Re: [PATCH v5 1/8] usb: typec: Manage SVDM version

2021-02-03 Thread Kyle Tso
Thank you Heikki and Guenter for these valuable reviews. I will update it in the next version. thanks, Kyle On Wed, Feb 3, 2021 at 11:04 PM Heikki Krogerus wrote: > > On Wed, Feb 03, 2021 at 05:01:26PM +0200, Heikki Krogerus wrote: > > On Wed, Feb 03, 2021 at 06:51:43AM -0800, Guenter Roeck wrot

[PATCH v5 5/8] usb: typec: ucsi: Detemine common SVDM Version

2021-02-02 Thread Kyle Tso
owest common Structured VDM Version supported by the Port Partners or Cable Plug and Shall continue to operate using this Specification Revision until they are Detached." Signed-off-by: Kyle Tso --- drivers/usb/typec/ucsi/displayport.c | 12 +--- drivers/usb/typec/ucsi/ucsi.c

[PATCH v5 3/8] usb: pd: Make SVDM Version configurable in VDM header

2021-02-02 Thread Kyle Tso
PD Rev 3.0 introduces SVDM Version 2.0. This patch makes the field configuable in the header in order to be able to be compatible with older SVDM version. Signed-off-by: Kyle Tso --- drivers/usb/typec/altmodes/displayport.c | 2 +- drivers/usb/typec/tcpm/tcpm.c| 16

[PATCH v5 4/8] usb: typec: tcpm: Detemine common SVDM Version

2021-02-02 Thread Kyle Tso
tners or Cable Plug and Shall continue to operate using this Specification Revision until they are Detached." Also clear the fields newly defined in SVDM version 2.0 for compatibilities. Signed-off-by: Kyle Tso --- drivers/usb/typec/tcpm/tcpm.c | 49 -

[PATCH v5 6/8] usb: typec: displayport: Fill the negotiated SVDM Version in the header

2021-02-02 Thread Kyle Tso
VDM header now requires SVDM Version. Get it from typec_port. Signed-off-by: Kyle Tso --- drivers/usb/typec/altmodes/displayport.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c

[PATCH v5 8/8] usb: typec: tcpm: Get Sink VDO from fwnode

2021-02-02 Thread Kyle Tso
Commit a079973f462a ("usb: typec: tcpm: Remove tcpc_config configuration mechanism") removed the tcpc_config which includes the Sink VDO and it is not yet added back with fwnode. Add it now. Signed-off-by: Kyle Tso --- drivers/usb/typec/tcpm/tcpm.c | 14 ++ 1 file c

[PATCH v5 7/8] dt-bindings: connector: Add SVDM VDO properties

2021-02-02 Thread Kyle Tso
Add bindings of VDO properties of USB PD SVDM so that they can be used in device tree. Signed-off-by: Kyle Tso --- .../bindings/connector/usb-connector.yaml | 11 + include/dt-bindings/usb/pd.h | 311 +- 2 files changed, 321 insertions(+), 1 deletion

[PATCH v5 2/8] usb: pd: Update VDO definitions

2021-02-02 Thread Kyle Tso
"PD Spec Revision 3.0 Version 2.0 + ECNs 2020-12-10" introduces several changes regarding the ID Header VDO and the Product Type VDOs. Signed-off-by: Kyle Tso --- drivers/usb/typec/class.c | 8 +- include/linux/usb/pd_vdo.h | 308 - 2 files ch

[PATCH v5 0/8] common SVDM version and VDO from dt

2021-02-02 Thread Kyle Tso
v4 is here: https://patchwork.kernel.org/project/linux-usb/cover/20210202093342.738691-1-kyle...@google.com/ Changes since v4: = usb: pd: Make SVDM Version configurable in VDM header - modified the code who uses VDO(), set the ver field to SVDM_VER_1_0 Kyle Tso (8): usb: typec

[PATCH v5 1/8] usb: typec: Manage SVDM version

2021-02-02 Thread Kyle Tso
t partners. Also add setter/getter functions for the negotiated SVDM version. Signed-off-by: Kyle Tso --- drivers/usb/typec/class.c | 13 + include/linux/usb/typec.h | 10 ++ 2 files changed, 23 insertions(+) diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/cla

Re: [PATCH v4 3/8] usb: pd: Make SVDM Version configurable in VDM header

2021-02-02 Thread Kyle Tso
On Tue, Feb 2, 2021 at 10:50 PM Guenter Roeck wrote: > > On 2/2/21 1:33 AM, Kyle Tso wrote: > > PD Rev 3.0 introduces SVDM Version 2.0. This patch makes the field > > configuable in the header in order to be able to be compatible with > > older SVDM version. > &g

[PATCH] usb: typec: Return void in typec_partner_set_pd_revision

2021-02-02 Thread Kyle Tso
typec_partner_set_pd_revision doesn't need any return value. Fixes: 29b01295a829 ("usb: typec: Add typec_partner_set_pd_revision") Signed-off-by: Kyle Tso --- drivers/usb/typec/class.c | 10 ++ include/linux/usb/typec.h | 2 +- 2 files changed, 3 insertions(+), 9 del

[PATCH v4 7/8] dt-bindings: connector: Add SVDM VDO properties

2021-02-02 Thread Kyle Tso
Add bindings of VDO properties of USB PD SVDM so that they can be used in device tree. Signed-off-by: Kyle Tso --- .../bindings/connector/usb-connector.yaml | 11 + include/dt-bindings/usb/pd.h | 311 +- 2 files changed, 321 insertions(+), 1 deletion

[PATCH v4 8/8] usb: typec: tcpm: Get Sink VDO from fwnode

2021-02-02 Thread Kyle Tso
Commit a079973f462a ("usb: typec: tcpm: Remove tcpc_config configuration mechanism") removed the tcpc_config which includes the Sink VDO and it is not yet added back with fwnode. Add it now. Signed-off-by: Kyle Tso --- drivers/usb/typec/tcpm/tcpm.c | 14 ++ 1 file c

[PATCH v4 5/8] usb: typec: ucsi: Detemine common SVDM Version

2021-02-02 Thread Kyle Tso
owest common Structured VDM Version supported by the Port Partners or Cable Plug and Shall continue to operate using this Specification Revision until they are Detached." Signed-off-by: Kyle Tso --- drivers/usb/typec/ucsi/displayport.c | 12 +--- drivers/usb/typec/ucsi/ucsi.c

[PATCH v4 4/8] usb: typec: tcpm: Detemine common SVDM Version

2021-02-02 Thread Kyle Tso
tners or Cable Plug and Shall continue to operate using this Specification Revision until they are Detached." Also clear the fields newly defined in SVDM version 2.0 for compatibilities. Signed-off-by: Kyle Tso --- drivers/usb/typec/tcpm/tcpm.c | 47 +

[PATCH v4 3/8] usb: pd: Make SVDM Version configurable in VDM header

2021-02-02 Thread Kyle Tso
PD Rev 3.0 introduces SVDM Version 2.0. This patch makes the field configuable in the header in order to be able to be compatible with older SVDM version. Signed-off-by: Kyle Tso --- include/linux/usb/pd_vdo.h | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include

[PATCH v4 6/8] usb: typec: displayport: Fill the negotiated SVDM Version in the header

2021-02-02 Thread Kyle Tso
VDM header now requires SVDM Version. Get it from typec_port. Signed-off-by: Kyle Tso --- drivers/usb/typec/altmodes/displayport.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c

[PATCH v4 2/8] usb: pd: Update VDO definitions

2021-02-02 Thread Kyle Tso
"PD Spec Revision 3.0 Version 2.0 + ECNs 2020-12-10" introduces several changes regarding the ID Header VDO and the Product Type VDOs. Signed-off-by: Kyle Tso --- drivers/usb/typec/class.c | 8 +- include/linux/usb/pd_vdo.h | 308 - 2 files ch

[PATCH v4 1/8] usb: typec: Manage SVDM version

2021-02-02 Thread Kyle Tso
t partners. Also add setter/getter functions for the negotiated SVDM version. Signed-off-by: Kyle Tso --- drivers/usb/typec/class.c | 13 + include/linux/usb/typec.h | 10 ++ 2 files changed, 23 insertions(+) diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/cla

[PATCH v4 0/8] common SVDM version and VDO from dt

2021-02-02 Thread Kyle Tso
v3 is here: https://patchwork.kernel.org/project/linux-usb/cover/20210201133421.408508-1-kyle...@google.com/ no changes except for separating the patch "[v3,1/3] usb: typec: Determine common SVDM Versions" into the first 6 patches in this patch set. Kyle Tso (8): usb: typec: M

Re: [PATCH v3 1/3] usb: typec: Determine common SVDM Versions

2021-02-02 Thread Kyle Tso
On Mon, Feb 1, 2021 at 11:35 PM Heikki Krogerus wrote: > > On Mon, Feb 01, 2021 at 09:34:19PM +0800, Kyle Tso wrote: > > PD Spec Revision 3.0 Version 2.0 + ECNs 2020-12-10 > > 6.4.4.2.3 Structured VDM Version > > "The Structured VDM Version field of the Discove

[PATCH v3 3/3] usb: typec: tcpm: Get Sink VDO from fwnode

2021-02-01 Thread Kyle Tso
Commit a079973f462a ("usb: typec: tcpm: Remove tcpc_config configuration mechanism") removed the tcpc_config which includes the Sink VDO and it is not yet added back with fwnode. Add it now. Signed-off-by: Kyle Tso --- Changes since v2: - use fwnode_property_count_u32 instead to get

[PATCH v3 2/3] dt-bindings: connector: Add SVDM VDO properties

2021-02-01 Thread Kyle Tso
Add bindings of VDO properties of USB PD SVDM so that they can be used in device tree. Signed-off-by: Kyle Tso --- Changes since v2: - no change .../bindings/connector/usb-connector.yaml | 11 + include/dt-bindings/usb/pd.h | 311 +- 2 files changed, 321

[PATCH v3 1/3] usb: typec: Determine common SVDM Versions

2021-02-01 Thread Kyle Tso
tners or Cable Plug and Shall continue to operate using this Specification Revision until they are Detached." Also clear the fields newly defined in SVDM version 2.0 for compatibilities. And fix some VDO definitions changed in the Spec. Signed-off-by: Kyle Tso --- Changes since v2: -

[PATCH v3 0/3] common SVDM version and VDO from dt

2021-02-01 Thread Kyle Tso
d SVDM VDO properties - no change usb: typec: tcpm: Get Sink VDO from fwnode - use fwnode_property_count_u32 instead to get the count - revise the error handling Kyle Tso (3): usb: typec: Determine common SVDM Versions dt-bindings: connector: Add SVDM VDO properties usb: typec: tcpm: Get Sin

Re: [PATCH v2 1/3] usb: typec: Determine common SVDM Versions

2021-01-31 Thread Kyle Tso
On Mon, Feb 1, 2021 at 12:21 AM Guenter Roeck wrote: > > On 1/31/21 7:18 AM, Kyle Tso wrote: > > Changes since v1: > > - removed the "local" variables (svdm_version) in tcpm.c and > > (altmodes/ucsi)/displayport.c > > - added a member "svdm_ver

Re: [PATCH v2 3/3] usb: typec: tcpm: Get Sink VDO from fwnode

2021-01-31 Thread Kyle Tso
On Mon, Feb 1, 2021 at 12:02 AM Guenter Roeck wrote: > > On 1/31/21 7:18 AM, Kyle Tso wrote: > > Commit a079973f462a ("usb: typec: tcpm: Remove tcpc_config > > configuration mechanism") removed the tcpc_config which includes the > > Sink VDO and it is not yet

[PATCH v2 1/3] usb: typec: Determine common SVDM Versions

2021-01-31 Thread Kyle Tso
tners or Cable Plug and Shall continue to operate using this Specification Revision until they are Detached." Also clear the fields newly defined in SVDM version 2.0 for compatibilities. And fix some VDO definitions changed in the Spec. Signed-off-by: Kyle Tso --- Changes since v1: - r

[PATCH v2 2/3] dt-bindings: connector: Add SVDM VDO properties

2021-01-31 Thread Kyle Tso
Add bindings of VDO properties of USB PD SVDM so that they can be used in device tree. Signed-off-by: Kyle Tso --- Changes since v1: dt-bindings: connector: Add SVDM VDO properties - updated the dt-bindings documentations - added more definitions of Product Type VDOs .../bindings/connector/usb

[PATCH v2 3/3] usb: typec: tcpm: Get Sink VDO from fwnode

2021-01-31 Thread Kyle Tso
Commit a079973f462a ("usb: typec: tcpm: Remove tcpc_config configuration mechanism") removed the tcpc_config which includes the Sink VDO and it is not yet added back with fwnode. Add it now. Signed-off-by: Kyle Tso --- Changes since v1: - updated the commit message drivers/usb/

[PATCH v2 0/3] common SVDM version and VDO from dt

2021-01-31 Thread Kyle Tso
ed more definitions of Product Type VDOs usb: typec: tcpm: Get Sink VDO from fwnode - updated the commit message Kyle Tso (3): usb: typec: Deter

[PATCH 3/3] usb: typec: tcpm: Get Sink VDO from fwnode

2021-01-26 Thread Kyle Tso
Current design only allows TCPM to get the Sink VDO from TCPC configs. Add an additional way from fwnode. Signed-off-by: Kyle Tso --- drivers/usb/typec/tcpm/tcpm.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c

[PATCH 0/3] common SVDM version and VDO from dt

2021-01-26 Thread Kyle Tso
The other two patches are about to get the VDO from fwnode so as to give more flexibility. Kyle Tso (3): usb: typec: Determine common SVDM Versions dt-bindings: connector: Add SVDM VDO properties usb: typec: tcpm: Get Sink VDO from fwnode drivers/usb/typec/altmodes/displayp

[PATCH 1/3] usb: typec: Determine common SVDM Versions

2021-01-26 Thread Kyle Tso
tners or Cable Plug and Shall continue to operate using this Specification Revision until they are Detached." Also clear the fields newly defined in SVDM version 2.0 for compatibilities. And fix some ID Header fields changed in the Spec. Signed-off-by: Kyle Tso --- drivers/usb/type

[PATCH 2/3] dt-bindings: connector: Add SVDM VDO properties

2021-01-26 Thread Kyle Tso
Add bindings of VDO properties of USB PD SVDM so that they can be defined in device tree. Signed-off-by: Kyle Tso --- include/dt-bindings/usb/pd.h | 53 +++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/include/dt-bindings/usb/pd.h b/include/dt

Re: [PATCH] usb: typec: tcpm: Create legacy PDOs for PD2 connection

2021-01-21 Thread Kyle Tso
On Thu, Jan 21, 2021 at 4:41 PM Heikki Krogerus wrote: > > Hi Kyle, > > On Sat, Jan 16, 2021 at 12:33:11AM +0800, Kyle Tso wrote: > > If the port partner is PD2, the PDOs of the local port should follow the > > format defined in PD2 Spec. Dynamically modify the pre-

[PATCH] usb: typec: tcpm: Create legacy PDOs for PD2 connection

2021-01-15 Thread Kyle Tso
If the port partner is PD2, the PDOs of the local port should follow the format defined in PD2 Spec. Dynamically modify the pre-defined PD3 PDOs and transform them into PD2 format before sending them to the PD2 port partner. Signed-off-by: Kyle Tso --- drivers/usb/typec/tcpm/tcpm.c | 62

[PATCH v6 2/3] usb: typec: tcpm: Protocol Error handling

2021-01-14 Thread Kyle Tso
ORTED message after receiving a chunked message. Signed-off-by: Kyle Tso --- changelog since v5: - removed the signed-off - modified the coding style suggested from Heikki - modified more coding style problems (line wrapping limit) drivers/usb/typec/tcpm/tcpm.c

[PATCH v6 3/3] usb: typec: tcpm: Respond Wait if VDM state machine is running

2021-01-14 Thread Kyle Tso
machine stops. Signed-off-by: Kyle Tso --- Changelog since v5: - no change drivers/usb/typec/tcpm/tcpm.c | 80 --- 1 file changed, 73 insertions(+), 7 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 70922723da4b

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

2021-01-14 Thread Kyle Tso
SinkTxOk otherwise. Meanwhile, any AMS initiated by a Sink port will be denied in TCPM if the port partner (Source) sets SinkTxNG except for HARD_RESET and SOFT_RESET. Signed-off-by: Kyle Tso --- Changelog since v5: - removed the signed-off

[PATCH v6 0/3] AMS, Collision Avoidance, and Protocol Error

2021-01-14 Thread Kyle Tso
- removed the signed-off - modified the coding style suggested from Heikki - modified more coding style problems (line wrapping limit) "usb: typec: tcpm: Respond Wait if VDM state machine is running" - no change ------- Kyle Ts

Re: [PATCH v5 2/3] usb: typec: tcpm: Protocol Error handling

2021-01-13 Thread Kyle Tso
On Tue, Jan 12, 2021 at 9:56 PM Heikki Krogerus wrote: > > On Wed, Jan 06, 2021 at 12:39:26AM +0800, Kyle Tso wrote: > > PD3.0 Spec 6.8.1 describes how to handle Protocol Error. There are > > general rules defined in Table 6-61 which regulate incoming Message > > handling.

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

2021-01-13 Thread Kyle Tso
On Wed, Jan 13, 2021 at 2:11 PM Badhri Jagan Sridharan wrote: > > Hi Kyle, > > Do you want to handle the FAST_ROLE_SWAP case as well ? > I forgot this part Thanks for catching this. I will fix it. > You would have to fix up in two places: > > #1 > - if (port->state == S

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

2021-01-13 Thread Kyle Tso
On Tue, Jan 12, 2021 at 9:29 PM Heikki Krogerus wrote: > > On Wed, Jan 06, 2021 at 12:39:25AM +0800, Kyle Tso wrote: > > This patch provides the implementation of Collision Avoidance introduced > > in PD3.0. The start of each Atomic Message Sequence (AMS) initiated by > >

[PATCH v5 3/3] usb: typec: tcpm: Respond Wait if VDM state machine is running

2021-01-05 Thread Kyle Tso
machine stops. Signed-off-by: Kyle Tso Signed-off-by: Will McVicker --- drivers/usb/typec/tcpm/tcpm.c | 80 --- 1 file changed, 73 insertions(+), 7 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index a951307d669d

[PATCH v5 2/3] usb: typec: tcpm: Protocol Error handling

2021-01-05 Thread Kyle Tso
ORTED message after receiving a chunked message. Signed-off-by: Kyle Tso Signed-off-by: Will McVicker --- drivers/usb/typec/tcpm/tcpm.c | 346 +- include/linux/usb/pd.h| 1 + 2 files changed, 257 insertions(+), 90 deletions(-) diff --git a/drivers/usb/

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

2021-01-05 Thread Kyle Tso
SinkTxOk otherwise. Meanwhile, any AMS initiated by a Sink port will be denied in TCPM if the port partner (Source) sets SinkTxNG except for HARD_RESET and SOFT_RESET. Signed-off-by: Kyle Tso Signed-off-by: Will McVicker --- Changelog since v4: - rebased to ToT drivers/usb/typec/tcpm/tcpm.c | 533

[PATCH v5 0/3] AMS, Collision Avoidance, and Protocol Error

2021-01-05 Thread Kyle Tso
v5] is the same as the one in [v4] (only rebased to ToT). The patch "Protocol Error handling" is based on PD3 6.8.1 to fix the wrong handling. The patch "Respond Wait if..." is to fix a conflict when DR/PR/VCONN_SWAP occurs just after the state machine enters Ready State. K

[PATCH v4] usb: typec: tcpm: AMS and Collision Avoidance

2020-12-16 Thread Kyle Tso
SinkTxOk otherwise. Meanwhile, any AMS initiated by a Sink port will be denied in TCPM if the port partner (Source) sets SinkTxNG except for HARD_RESET and SOFT_RESET. Signed-off-by: Kyle Tso Signed-off-by: Will McVicker --- Changelog since v3: - rebased to ToT and fixed the conflicts - merged the two

[PATCH 1/2] usb: typec: Comment correction for typec_partner_register_altmode

2020-07-13 Thread Kyle Tso
typec_register_altmode returns ERR_PTR on failure. Signed-off-by: Kyle Tso --- drivers/usb/typec/class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c index c9234748537a..02655694f200 100644 --- a/drivers/usb/typec

[PATCH 2/2] usb: typec: tcpm: Error handling for tcpm_register_partner_altmodes

2020-07-13 Thread Kyle Tso
typec_partner_register_altmode returns ERR_PTR. Reset the pointer altmode to NULL on failure. Signed-off-by: Kyle Tso --- drivers/usb/typec/tcpm/tcpm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index

[PATCH 0/2] tcpm: Error handling for tcpm_register_partner_altmodes

2020-07-13 Thread Kyle Tso
*** BLURB HERE *** Kyle Tso (2): usb: typec: Comment correction for typec_partner_register_altmode usb: typec: tcpm: Error handling for tcpm_register_partner_altmodes drivers/usb/typec/class.c | 2 +- drivers/usb/typec/tcpm/tcpm.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions

Re: [PATCH v3 0/2] tcpm: AMS and Collision Avoidance

2019-10-04 Thread Kyle Tso
Hi Hans, It seems that there is a bug in the patch. Thank you for catching this! I will revise the patch and upload it again. On Thu, Oct 3, 2019 at 6:38 PM Hans de Goede wrote: > > Hi, > > On 03-10-2019 12:04, Kyle Tso wrote: > > Hi Hans > > > > Could you

Re: [PATCH v3 0/2] tcpm: AMS and Collision Avoidance

2019-10-03 Thread Kyle Tso
Hi Hans Could you append the TCPM log? On Thu, Oct 3, 2019 at 5:47 PM Hans de Goede wrote: > > Hi Kyle, > > On 20-09-2019 05:24, Kyle Tso wrote: > > *** BLURB HERE *** > > > > Kyle Tso (2): > >usb: typec: tcpm: AMS and Collision Avoidance > >

Re: [PATCH v3 0/2] tcpm: AMS and Collision Avoidance

2019-09-20 Thread Kyle Tso
On Fri, Sep 20, 2019 at 4:25 PM Hans de Goede wrote: > > Hi Kyle, > > On 20-09-2019 10:19, Kyle Tso wrote: > > Hi Hans, > > > > I have tested these on an Android device (ARM64). > > All the swap operations work fine (Power Role/Data Role/Vconn Swap). > >

Re: [PATCH v3 0/2] tcpm: AMS and Collision Avoidance

2019-09-20 Thread Kyle Tso
Hi Hans, I have tested these on an Android device (ARM64). All the swap operations work fine (Power Role/Data Role/Vconn Swap). (except for Fast Role Swap because it is still not supported in TCPM) Regards, Kyle Tso On Fri, Sep 20, 2019 at 4:02 PM Hans de Goede wrote: > > Hi Kyle, >

[PATCH v3 0/2] tcpm: AMS and Collision Avoidance

2019-09-19 Thread Kyle Tso
*** BLURB HERE *** Kyle Tso (2): usb: typec: tcpm: AMS and Collision Avoidance usb: typec: tcpm: AMS for PD2.0 drivers/usb/typec/tcpm/tcpm.c | 523 ++ include/linux/usb/pd.h| 1 + include/linux/usb/tcpm.h | 4 + 3 files changed, 468

[PATCH v3 2/2] usb: typec: tcpm: AMS for PD2.0

2019-09-19 Thread Kyle Tso
AMS is defined in PD2.0 as well. Remove the filter in tcpm_ams_start and change the CC for Collision Avoidance only if the negotiated revision is higher than PD2.0. Signed-off-by: Kyle Tso --- Changelog since v2: - N/A; This is the first version. drivers/usb/typec/tcpm/tcpm.c | 129

[PATCH v3 1/2] usb: typec: tcpm: AMS and Collision Avoidance

2019-09-19 Thread Kyle Tso
SinkTxOk otherwise. Meanwhile, any AMS initiated by a Sink port will be denied in TCPM if the port partner (Source) sets SinkTxNG except for HARD_RESET and SOFT_RESET. Signed-off-by: Kyle Tso --- Changelog since v2: - (nit) changed some return values from constant 0 to variable "ret" in

Re: [PATCH v2] usb: typec: tcpm: collision avoidance

2019-09-19 Thread Kyle Tso
Ping! Anyone still reviewing this patch? I have another change related to AMS. I will group them as a set and re-send it. Regards, Kyle Tso On Mon, Apr 15, 2019 at 6:03 PM Adam Thomson wrote: > > On 13 April 2019 21:39, Hans de Goede wrote: > > > On 10-04-19 18:38, Hans

Re: [PATCH] usb: typec: tcpm: collision avoidance

2019-03-22 Thread Kyle Tso
On Fri, Mar 22, 2019 at 12:51 AM Kyle Tso wrote: > > On Wed, Mar 20, 2019 at 1:38 AM Guenter Roeck wrote: > > > > > static enum tcpm_state tcpm_default_state(struct tcpm_port *port) > > > { > > > if (port->port_type == TYPEC_PORT_DR

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

2019-02-12 Thread Kyle Tso
y even > work, or ever did. Lets remove them. > > Reported-by: Kyle Tso > Cc: Kyle Tso > Signed-off-by: Guenter Roeck Acked-by: Kyle Tso > --- > drivers/usb/typec/tcpm/tcpm.c | 60 > --- > include/linux/usb/tcpm.h | 6 -

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

2019-02-12 Thread Kyle Tso
On Fri, Feb 1, 2019 at 2:22 AM Guenter Roeck wrote: > > 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. > > >

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

2019-02-12 Thread Kyle Tso
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 > > --- > > drivers/usb/typec/tcpm/tcpm.c | 23 ++

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

2019-01-30 Thread Kyle Tso
Provide a function to get the partner Source Capabilities. Signed-off-by: Kyle Tso --- drivers/usb/typec/tcpm/tcpm.c | 23 +++ include/linux/usb/tcpm.h | 1 + 2 files changed, 24 insertions(+) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c

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

2019-01-29 Thread Kyle Tso
. 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 --- drivers/usb/typec/tcpm/tcpm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb

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

2018-12-17 Thread Kyle Tso
e the lower one between the selected Source PDO and the matching Sink PDO. c. The maximum power will be the maximum operational voltage times the maximum current defined in the selected Source PDO d. Select the Source PDO with the highest maximum power Signed-off-by: Kyle Tso --- Changelog

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

2018-12-17 Thread Kyle Tso
On Mon, Dec 17, 2018 at 8:45 PM Kyle Tso wrote: > > On Mon, Dec 17, 2018 at 8:23 PM Adam Thomson > wrote: > > > > On 17 December 2018 02:48, Kyle Tso wrote: > > > > > Current matching rules ensure that the voltage range of selected Source > > > Capab

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

2018-12-17 Thread Kyle Tso
On Mon, Dec 17, 2018 at 8:23 PM Adam Thomson wrote: > > On 17 December 2018 02:48, Kyle Tso wrote: > > > Current matching rules ensure that the voltage range of selected Source > > Capability is entirely within the range defined in one of the Sink > > Capabilities. Thi

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

2018-12-17 Thread Kyle Tso
On Mon, Dec 17, 2018 at 7:36 PM Heikki Krogerus wrote: > > On Mon, Dec 17, 2018 at 10:48:05AM +0800, Kyle Tso wrote: > > Current matching rules ensure that the voltage range of selected Source > > Capability is entirely within the range defined in one of the Sink > &g

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

2018-12-16 Thread Kyle Tso
e the lower one between the selected Source PDO and the matching Sink PDO. c. The maximum power will be the maximum operational voltage times the maximum current defined in the selected Source PDO d. Select the Source PDO with the highest maximum power Signed-off-by: Kyle Tso --- Changelog

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

2018-12-13 Thread Kyle Tso
On Wed, Dec 12, 2018 at 6:15 PM Adam Thomson wrote: > > On 12 December 2018 02:47, Kyle Tso wrote: > > > On Mon, Dec 10, 2018 at 7:36 PM Adam Thomson > > wrote: > > > > > > On 10 December 2018 09:01, Adam Thomson wrote: > > > &

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

2018-12-11 Thread Kyle Tso
On Mon, Dec 10, 2018 at 7:36 PM Adam Thomson wrote: > > On 10 December 2018 09:01, Adam Thomson wrote: > > > On 06 December 2018 03:02, Kyle Tso wrote: > > > > > Current matching rules ensure that the voltage range of selected > > > Source Capability is enti

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

2018-12-11 Thread Kyle Tso
On Fri, Dec 7, 2018 at 1:56 AM Guenter Roeck wrote: > > On Thu, Dec 06, 2018 at 11:02:27AM +0800, Kyle Tso wrote: > > Current matching rules ensure that the voltage range of selected Source > > Capability is entirely within the range defined in one of the Sink > > Capabili