@@ -34,6 +34,14 @@ struct phy_devm {
34
34
struct notifier_block * nb ;
35
35
};
36
36
37
+ static const char * const usb_chger_type [] = {
38
+ [UNKNOWN_TYPE ] = "USB_CHARGER_UNKNOWN_TYPE" ,
39
+ [SDP_TYPE ] = "USB_CHARGER_SDP_TYPE" ,
40
+ [CDP_TYPE ] = "USB_CHARGER_CDP_TYPE" ,
41
+ [DCP_TYPE ] = "USB_CHARGER_DCP_TYPE" ,
42
+ [ACA_TYPE ] = "USB_CHARGER_ACA_TYPE" ,
43
+ };
44
+
37
45
static struct usb_phy * __usb_find_phy (struct list_head * list ,
38
46
enum usb_phy_type type )
39
47
{
@@ -98,7 +106,8 @@ static void usb_phy_notify_charger_work(struct work_struct *work)
98
106
{
99
107
struct usb_phy * usb_phy = container_of (work , struct usb_phy , chg_work );
100
108
char uchger_state [50 ] = { 0 };
101
- char * envp [] = { uchger_state , NULL };
109
+ char uchger_type [50 ] = { 0 };
110
+ char * envp [] = { uchger_state , uchger_type , NULL };
102
111
unsigned int min , max ;
103
112
104
113
switch (usb_phy -> chg_state ) {
@@ -122,6 +131,8 @@ static void usb_phy_notify_charger_work(struct work_struct *work)
122
131
return ;
123
132
}
124
133
134
+ snprintf (uchger_type , ARRAY_SIZE (uchger_type ),
135
+ "USB_CHARGER_TYPE=%s" , usb_chger_type [usb_phy -> chg_type ]);
125
136
kobject_uevent_env (& usb_phy -> dev -> kobj , KOBJ_CHANGE , envp );
126
137
}
127
138
0 commit comments