linux/drivers/usb/typec
Kyle Tso c710d0bb76 usb: typec: tcpm: Extend the matching rules on PPS APDO selection
Current matching rules ensure that the voltage range of selected Source
Capability is entirely within the range defined in one of the Sink
Capabilities. This is reasonable but not practical because Sink may not
support wide range of voltage when sinking power while Source could
advertise its capabilities in relatively wider range. For example, a
Source PDO advertising 3.3V-11V@3A (9V Prog of Fixed Nominal Voltage)
will not be selected if the Sink requires 5V-12V@3A PPS power. However,
the Sink could work well if the requested voltage range in RDOs is
5V-11V@3A.

Currently accepted:
		|--------- source -----|
	|----------- sink ---------------|

Currently not accepted:
			|--------- source -----|
	|----------- sink ---------------|

	|--------- source -----|
		|----------- sink ---------------|

	|--------- source -----------------|
		|------ sink -------|

To improve the usability, change the matching rules to what listed
below:
a. The Source PDO is selectable if any portion of the voltage range
   overlaps one of the Sink PDO's voltage range.
b. The maximum operational voltage will be 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 <kyletso@google.com>
Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:13:26 +01:00
..
altmodes usb: typec: unlock dp->lock on error exit path, and also zero ret if successful 2018-07-06 16:36:19 +02:00
mux usb: typec: pi3usb30532: Start using generic state values 2018-07-02 17:42:36 +02:00
tcpm usb: typec: tcpm: Extend the matching rules on PPS APDO selection 2018-12-19 08:13:26 +01:00
ucsi usb: typec: ucsi: add support for Cypress CCGx 2018-11-09 18:49:59 +01:00
bus.c usb/typec: fix kernel-doc notation warning for typec_match_altmode 2018-09-05 14:36:53 +02:00
bus.h usb: typec: avoid format-overflow warning 2018-07-06 16:36:19 +02:00
class.c usb: typec: Fix copy/paste on typec_set_vconn_role() kerneldoc 2018-10-09 16:05:41 +02:00
Kconfig usb: typec: Group all TCPCI/TCPM code together 2018-09-20 13:37:29 +02:00
Makefile usb: typec: Group all TCPCI/TCPM code together 2018-09-20 13:37:29 +02:00
mux.c usb: typec: mux: Take care of driver module reference counting 2018-09-20 13:35:01 +02:00
tps6598x.c usb: typec: tps6598x: Remove VLA usage 2018-06-28 19:49:46 +09:00