Commit 1ab7831a authored by spiiroin's avatar spiiroin

Merge branch 'jb41748_mtp_activation' into 'master'

Enable android usb before starting mtpd

See merge request !38
parents 9ee51c15 171d5820
...@@ -531,7 +531,9 @@ worker_switch_to_mode(const char *mode) ...@@ -531,7 +531,9 @@ worker_switch_to_mode(const char *mode)
* as they will use the worker_get_usb_mode_data function */ * as they will use the worker_get_usb_mode_data function */
worker_set_usb_mode_data(data); worker_set_usb_mode_data(data);
if( worker_mode_is_mtp_mode(mode) ) { /* When dealing with configfs, we can't enable UDC without
* already having mtpd running */
if( worker_mode_is_mtp_mode(mode) && configfs_in_use() ) {
if( !worker_start_mtpd() ) if( !worker_start_mtpd() )
goto FAILED; goto FAILED;
} }
...@@ -542,6 +544,14 @@ worker_switch_to_mode(const char *mode) ...@@ -542,6 +544,14 @@ worker_switch_to_mode(const char *mode)
if( !modesetting_enter_dynamic_mode() ) if( !modesetting_enter_dynamic_mode() )
goto FAILED; goto FAILED;
/* When dealing with android usb, it must be enabled before
* we can start mtpd. Assumption is that the same applies
* when using kernel modules. */
if( worker_mode_is_mtp_mode(mode) && !configfs_in_use() ) {
if( !worker_start_mtpd() )
goto FAILED;
}
goto SUCCESS; goto SUCCESS;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment