Skip to content

Commit

Permalink
Allow disabling audio interface (testing)
Browse files Browse the repository at this point in the history
  • Loading branch information
oandrew committed Mar 4, 2020
1 parent 5986675 commit 731a471
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions gadget/ipod_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ static bool only_ipod = false;
module_param(only_ipod, bool, 0);
MODULE_PARM_DESC(only_ipod, "Only ipod config");

static bool disable_audio = false;
module_param(disable_audio, bool, 0);
MODULE_PARM_DESC(disable_audio, "No audio intf");

static bool swap_configs = false;
module_param(swap_configs, bool, 0);
MODULE_PARM_DESC(swap_configs, "Present iPod USB config as #1");
Expand Down Expand Up @@ -78,7 +82,9 @@ int ipod_config_bind(struct usb_configuration *conf)
{

DBG(conf->cdev, " = %s() \n", __FUNCTION__);
usb_add_function(conf, ipod_audio_f);
if (!disable_audio) {
usb_add_function(conf, ipod_audio_f);
}
usb_add_function(conf, ipod_hid_f);
return 0;
}
Expand Down Expand Up @@ -115,9 +121,9 @@ static int ipod_bind(struct usb_composite_dev *cdev)
return PTR_ERR(fi_ms);
}

if(!only_ipod) {
usb_add_config(cdev, &ipod_fake_ptp, ipod_config_ptp_bind);
}
if(!only_ipod) {
usb_add_config(cdev, &ipod_fake_ptp, ipod_config_ptp_bind);
}


ipod_audio_fi = usb_get_function_instance("ipod_audio");
Expand Down

0 comments on commit 731a471

Please sign in to comment.