Skip to content

Commit

Permalink
Use mass_storage also as fake charging mode with android gadget
Browse files Browse the repository at this point in the history
Seems an empty android gadget only enumerates if some configuration had
been used before. Fix this by using mass_storage to make a similar fake
mass_storage device as used with normal modules.

[usb-moded] Use fake mass_storage for android gadget charging mode. Fixes: JB#8277

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed Aug 22, 2013
1 parent 94f76bd commit b0a76d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/usb_moded-android.c
Expand Up @@ -89,9 +89,9 @@ int set_android_charging_mode(void)
{
int ret = 0;

/* disable, set functions to "null", re-enable */
/* disable, set functions to "mass_storage", re-enable */
write_to_file("/sys/class/android_usb/android0/enable", "0");
write_to_file("/sys/class/android_usb/android0/functions", "null");
write_to_file("/sys/class/android_usb/android0/functions", "mass_storage");
ret = write_to_file("/sys/class/android_usb/android0/enable", "1");
if(ret < 0)
return(1);
Expand Down

0 comments on commit b0a76d0

Please sign in to comment.