linux/drivers/usb/typec
Badhri Jagan Sridharan 57e6f0d7b8 typec: tcpm: Only request matching pdos
At present, TCPM code assumes that local device supports
variable/batt pdos and always selects the pdo with highest
possible power within the board limit. This assumption
might not hold good for all devices. To overcome this,
this patch makes TCPM only accept a source_pdo when there is
a matching sink pdo.

For Fixed pdos: The voltage should match between the
incoming source_cap and the registered snk_pdo
For Variable/Batt pdos: The incoming source_cap voltage
range should fall within the registered snk_pdo's voltage
range.

Also, when the cap_mismatch bit is set, the max_power/current
should be set to the max_current/power of the sink_pdo.
This is according to:

"If the Capability Mismatch bit is set to one
The Maximum Operating Current/Power field may contain a value
larger than the maximum current/power offered in the Source
Capabilities message’s PDO as referenced by the Object position field.
This enables the Sink to indicate that it requires more current/power
than is being offered. If the Sink requires a different voltage this
will be indicated by its Sink Capabilities message.

Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-07 16:03:15 +01:00
..
fusb302 usb: typec: remove duplicate includes 2017-12-06 09:21:17 +01:00
ucsi USB/PHY patches for 4.15-rc1 2017-11-13 21:14:07 -08:00
Kconfig usb: typec: driver for TI TPS6598x USB Power Delivery controllers 2017-10-04 09:57:57 +02:00
Makefile USB: add SPDX identifiers to all remaining Makefiles 2017-11-07 15:53:48 +01:00
tcpm.c typec: tcpm: Only request matching pdos 2017-12-07 16:03:15 +01:00
tps6598x.c USB: typec: Remove remaining redundant license text 2017-11-07 15:53:48 +01:00
typec_wcove.c USB: typec: Remove redundant license text 2017-11-07 15:45:01 +01:00
typec.c USB: typec: Remove redundant license text 2017-11-07 15:45:01 +01:00