staging: typec: fusb302: Add support for USB2 charger detection through extcon
authorHans de Goede <hdegoede@redhat.com>
Wed, 30 Aug 2017 09:48:09 +0000 (11:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Aug 2017 16:23:12 +0000 (18:23 +0200)
commit382099d6bcffa13ea729ad5c8f0ae67fafbe563f
treeb5b9c9ee1c7d53b18089f4bbf28d2d3dd7b3b87a
parent4660e4aeb9d74895eb6478932bf5cabeb0db723e
staging: typec: fusb302: Add support for USB2 charger detection through extcon

The fusb302 port-controller relies on an external device doing USB2
charger-type detection.

The Intel Whiskey Cove PMIC with which the fusb302 is combined on some
X86/ACPI platforms already has a charger-type detection driver which
uses extcon to communicate the detected charger-type.

Rather then inventing a new API for USB2 charger-type detection
specifically for use with the tcpm code, this commit simply re-uses the
existing extcon API and uses that do USB2 charger detection.

Note that the "fcs,extcon-name" property name is only for kernel internal
use by X86/ACPI platform code and as such is NOT documented in
the fusb302 devicetree bindings.

Cc: "Yueyao (Nathan) Zhu" <yueyao@google.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/typec/fusb302/fusb302.c