aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Yan <leo.yan@linaro.org>2017-01-09 16:09:55 -0500
committerFelipe Balbi <felipe.balbi@linux.intel.com>2017-01-12 03:02:20 -0500
commitb2f92f0ff0a26a6d758ce85167a77d7d1268ca36 (patch)
tree428966bc786ea57241afb17edd6501b43c2f9d13
parent08f37148b6a915a6996c7dbef87769b9efee2dba (diff)
usb: dwc2: use u32 for DT binding parameters
Commit 05ee799f2021 ("usb: dwc2: Move gadget settings into core_params") changes to type u16 for DT binding "g-rx-fifo-size" and "g-np-tx-fifo-size" but use type u32 for "g-tx-fifo-size". Finally the the first two parameters cannot be passed successfully with wrong data format. This is found the data transferring broken on 96boards Hikey. This patch is to change all parameters to u32 type, and verified on Hikey board the DT parameters can pass successfully. [johnyoun: minor rebase] Signed-off-by: Leo Yan <leo.yan@linaro.org> Signed-off-by: John Youn <johnyoun@synopsys.com> Tested-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-rw-r--r--drivers/usb/dwc2/core.h4
-rw-r--r--drivers/usb/dwc2/params.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
index 9548d3e03453..302b8f5f7d27 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -513,8 +513,8 @@ struct dwc2_core_params {
513 /* Gadget parameters */ 513 /* Gadget parameters */
514 bool g_dma; 514 bool g_dma;
515 bool g_dma_desc; 515 bool g_dma_desc;
516 u16 g_rx_fifo_size; 516 u32 g_rx_fifo_size;
517 u16 g_np_tx_fifo_size; 517 u32 g_np_tx_fifo_size;
518 u32 g_tx_fifo_size[MAX_EPS_CHANNELS]; 518 u32 g_tx_fifo_size[MAX_EPS_CHANNELS];
519}; 519};
520 520
diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index 11fe68a4627b..bcd1e19b4076 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -385,16 +385,16 @@ static void dwc2_set_param(struct dwc2_hsotg *hsotg, void *param,
385} 385}
386 386
387/** 387/**
388 * dwc2_set_param_u16() - Set a u16 parameter 388 * dwc2_set_param_u32() - Set a u32 parameter
389 * 389 *
390 * See dwc2_set_param(). 390 * See dwc2_set_param().
391 */ 391 */
392static void dwc2_set_param_u16(struct dwc2_hsotg *hsotg, u16 *param, 392static void dwc2_set_param_u32(struct dwc2_hsotg *hsotg, u32 *param,
393 bool lookup, char *property, u16 legacy, 393 bool lookup, char *property, u16 legacy,
394 u16 def, u16 min, u16 max) 394 u16 def, u16 min, u16 max)
395{ 395{
396 dwc2_set_param(hsotg, param, lookup, property, 396 dwc2_set_param(hsotg, param, lookup, property,
397 legacy, def, min, max, 2); 397 legacy, def, min, max, 4);
398} 398}
399 399
400/** 400/**
@@ -1178,12 +1178,12 @@ static void dwc2_set_parameters(struct dwc2_hsotg *hsotg,
1178 * auto-detect if the hardware does not support the 1178 * auto-detect if the hardware does not support the
1179 * default. 1179 * default.
1180 */ 1180 */
1181 dwc2_set_param_u16(hsotg, &p->g_rx_fifo_size, 1181 dwc2_set_param_u32(hsotg, &p->g_rx_fifo_size,
1182 true, "g-rx-fifo-size", 2048, 1182 true, "g-rx-fifo-size", 2048,
1183 hw->rx_fifo_size, 1183 hw->rx_fifo_size,
1184 16, hw->rx_fifo_size); 1184 16, hw->rx_fifo_size);
1185 1185
1186 dwc2_set_param_u16(hsotg, &p->g_np_tx_fifo_size, 1186 dwc2_set_param_u32(hsotg, &p->g_np_tx_fifo_size,
1187 true, "g-np-tx-fifo-size", 1024, 1187 true, "g-np-tx-fifo-size", 1024,
1188 hw->dev_nperio_tx_fifo_size, 1188 hw->dev_nperio_tx_fifo_size,
1189 16, hw->dev_nperio_tx_fifo_size); 1189 16, hw->dev_nperio_tx_fifo_size);