diff options
author | Mian Yousaf Kaukab <yousaf.kaukab@intel.com> | 2015-04-29 22:09:05 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-04-29 15:19:02 -0500 |
commit | ecb176c63ac49ddcea83b0171ead1372bb78c165 (patch) | |
tree | b37ddff592892a69994624fbf5cd6023c409c2b7 /drivers/usb/dwc2/core.c | |
parent | a6d249d8373343749f9ae55f5581f3b21e178471 (diff) |
usb: dwc2: set parameter values in probe function
So the parameters can be used in both host and gadget modes.
Also consolidate param functions in the core.h
Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc2/core.c')
-rw-r--r-- | drivers/usb/dwc2/core.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c index 8c3bc84e6e76..6acbe90a78cc 100644 --- a/drivers/usb/dwc2/core.c +++ b/drivers/usb/dwc2/core.c @@ -3044,6 +3044,7 @@ void dwc2_set_parameters(struct dwc2_hsotg *hsotg, dwc2_set_param_uframe_sched(hsotg, params->uframe_sched); dwc2_set_param_external_id_pin_ctl(hsotg, params->external_id_pin_ctl); } +EXPORT_SYMBOL_GPL(dwc2_set_parameters); /** * During device initialization, read various hardware configuration @@ -3210,6 +3211,24 @@ int dwc2_get_hwparams(struct dwc2_hsotg *hsotg) return 0; } +EXPORT_SYMBOL_GPL(dwc2_get_hwparams); + +/* + * 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++) + p[i] = value; +} +EXPORT_SYMBOL_GPL(dwc2_set_all_params); + u16 dwc2_get_otg_version(struct dwc2_hsotg *hsotg) { |