power: supply: charger-manager: Update extcon functions

In commit 830ae44220 ("extcon: Remove the deprecated extcon functions")
the function extcon_register_interest became a no-op returning an error,
leading to non-functional behaviour in charger-manager.

Additionally, a translation table is needed between the text representation
of the extcon cable names and their IDs is needed.  In order to retain DT
compatibility, TA and CHARGE-DOWNSTREAM are added as they were present up
until commit 11eecf910b ("extcon: Modify the id and name of external
connector")

Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
Jonathan Bakker
2020-05-14 16:04:33 -07:00
committed by Sebastian Reichel
parent 9434e4530d
commit c1f73028f7
2 changed files with 64 additions and 25 deletions

View File

@@ -40,7 +40,7 @@ enum cm_batt_temp {
/**
* struct charger_cable
* @extcon_name: the name of extcon device.
* @name: the name of charger cable(external connector).
* @name: the name of the cable connector
* @extcon_dev: the extcon device.
* @wq: the workqueue to control charger according to the state of
* charger cable. If charger cable is attached, enable charger.
@@ -56,9 +56,10 @@ enum cm_batt_temp {
struct charger_cable {
const char *extcon_name;
const char *name;
struct extcon_dev *extcon_dev;
u64 extcon_type;
/* The charger-manager use Extcon framework */
struct extcon_specific_cable_nb extcon_dev;
struct work_struct wq;
struct notifier_block nb;