Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dwc_otg: don't unconditionally force host mode in dwc_otg_cil_init() #2338

Merged
merged 1 commit into from
Jan 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion drivers/usb/host/dwc_otg/dwc_otg_cil.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
#include "dwc_otg_regs.h"
#include "dwc_otg_cil.h"

extern bool cil_force_host;

static int dwc_otg_setup_params(dwc_otg_core_if_t * core_if);

/**
Expand Down Expand Up @@ -192,7 +194,10 @@ dwc_otg_core_if_t *dwc_otg_cil_init(const uint32_t * reg_base_addr)
core_if->hptxfsiz.d32 =
DWC_READ_REG32(&core_if->core_global_regs->hptxfsiz);
gusbcfg.d32 = DWC_READ_REG32(&core_if->core_global_regs->gusbcfg);
gusbcfg.b.force_host_mode = 1;
if (cil_force_host)
gusbcfg.b.force_host_mode = 1;
else
gusbcfg.b.force_host_mode = 0;
DWC_WRITE_REG32(&core_if->core_global_regs->gusbcfg, gusbcfg.d32);
dwc_mdelay(100);
}
Expand Down
7 changes: 7 additions & 0 deletions drivers/usb/host/dwc_otg/dwc_otg_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ bool fiq_fsm_enable = true;
//Bulk split-transaction NAK holdoff in microframes
uint16_t nak_holdoff = 8;

//Force host mode during CIL re-init
bool cil_force_host = true;

unsigned short fiq_fsm_mask = 0x0F;

unsigned short int_ep_interval_min = 0;
Expand Down Expand Up @@ -1403,6 +1406,10 @@ MODULE_PARM_DESC(int_ep_interval_min, "Clamp high-speed Interrupt endpoints to a
"0..1 = Use endpoint default\n"
"2..n = Minimum interval n microframes. Use powers of 2.\n");

module_param(cil_force_host, bool, 0644);
MODULE_PARM_DESC(cil_force_host, "On a connector-ID status change, "
"force Host Mode regardless of OTG state.");

/** @page "Module Parameters"
*
* The following parameters may be specified when starting the module.
Expand Down