Commit 00c704cc authored by Leo Yan's avatar Leo Yan Committed by Felipe Balbi

usb: dwc2: use u32 for DT binding parameters

Commit 05ee799f ("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: default avatarLeo Yan <leo.yan@linaro.org>
Signed-off-by: default avatarJohn Youn <johnyoun@synopsys.com>
Tested-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent ff86110e
...@@ -513,8 +513,8 @@ struct dwc2_core_params { ...@@ -513,8 +513,8 @@ struct dwc2_core_params {
/* Gadget parameters */ /* Gadget parameters */
bool g_dma; bool g_dma;
bool g_dma_desc; bool g_dma_desc;
u16 g_rx_fifo_size; u32 g_rx_fifo_size;
u16 g_np_tx_fifo_size; u32 g_np_tx_fifo_size;
u32 g_tx_fifo_size[MAX_EPS_CHANNELS]; u32 g_tx_fifo_size[MAX_EPS_CHANNELS];
}; };
......
...@@ -385,16 +385,16 @@ static void dwc2_set_param(struct dwc2_hsotg *hsotg, void *param, ...@@ -385,16 +385,16 @@ static void dwc2_set_param(struct dwc2_hsotg *hsotg, void *param,
} }
/** /**
* dwc2_set_param_u16() - Set a u16 parameter * dwc2_set_param_u32() - Set a u32 parameter
* *
* See dwc2_set_param(). * See dwc2_set_param().
*/ */
static void dwc2_set_param_u16(struct dwc2_hsotg *hsotg, u16 *param, static void dwc2_set_param_u32(struct dwc2_hsotg *hsotg, u32 *param,
bool lookup, char *property, u16 legacy, bool lookup, char *property, u16 legacy,
u16 def, u16 min, u16 max) u16 def, u16 min, u16 max)
{ {
dwc2_set_param(hsotg, param, lookup, property, dwc2_set_param(hsotg, param, lookup, property,
legacy, def, min, max, 2); legacy, def, min, max, 4);
} }
/** /**
...@@ -1178,12 +1178,12 @@ static void dwc2_set_parameters(struct dwc2_hsotg *hsotg, ...@@ -1178,12 +1178,12 @@ static void dwc2_set_parameters(struct dwc2_hsotg *hsotg,
* auto-detect if the hardware does not support the * auto-detect if the hardware does not support the
* default. * default.
*/ */
dwc2_set_param_u16(hsotg, &p->g_rx_fifo_size, dwc2_set_param_u32(hsotg, &p->g_rx_fifo_size,
true, "g-rx-fifo-size", 2048, true, "g-rx-fifo-size", 2048,
hw->rx_fifo_size, hw->rx_fifo_size,
16, hw->rx_fifo_size); 16, hw->rx_fifo_size);
dwc2_set_param_u16(hsotg, &p->g_np_tx_fifo_size, dwc2_set_param_u32(hsotg, &p->g_np_tx_fifo_size,
true, "g-np-tx-fifo-size", 1024, true, "g-np-tx-fifo-size", 1024,
hw->dev_nperio_tx_fifo_size, hw->dev_nperio_tx_fifo_size,
16, hw->dev_nperio_tx_fifo_size); 16, hw->dev_nperio_tx_fifo_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment