* parameters define how the DWC_otg controller should be configured.
*/
struct dwc2_core_params {
+ /*
+ * Don't add any non-int members here, this will break
+ * dwc2_set_all_params!
+ */
int otg_cap;
int otg_ver;
int dma_enable;
dwc2_hcd_free(hsotg);
}
-static void dwc2_set_uninitialized(int *p, int size)
+/*
+ * Sets all parameters to the given value.
+ *
+ * Assumes that the dwc2_core_params struct contains only integers.
+ */
+void dwc2_set_all_params(struct dwc2_core_params *params, int value)
{
+ int *p = (int *)params;
+ size_t size = sizeof(*params) / sizeof(*p);
int i;
for (i = 0; i < size; i++)
if (!hsotg->core_params)
goto error1;
- dwc2_set_uninitialized((int *)hsotg->core_params,
- sizeof(*hsotg->core_params) / sizeof(int));
+ dwc2_set_all_params(hsotg->core_params, -1);
/* Validate parameter values */
dwc2_set_parameters(hsotg, params);
extern void dwc2_hcd_remove(struct dwc2_hsotg *hsotg);
extern int dwc2_set_parameters(struct dwc2_hsotg *hsotg,
struct dwc2_core_params *params);
+extern void dwc2_set_all_params(struct dwc2_core_params *params, int value);
/* Transaction Execution Functions */
extern enum dwc2_transaction_type dwc2_hcd_select_transactions(