summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-04 02:55:18 +0300
committerSimon Glass <sjg@chromium.org>2020-12-14 02:51:08 +0300
commitcaa4daa2ae3dc0a3e516addea5772c9af76abcb0 (patch)
tree0abbc5b538894532f4db28d56e4645d3be230d27 /drivers/usb/gadget
parent41575d8e4c334df148c4cdd7c40cc825dc0fcaa1 (diff)
downloadu-boot-caa4daa2ae3dc0a3e516addea5772c9af76abcb0.tar.xz
dm: treewide: Rename 'platdata' variables to just 'plat'
We use 'priv' for private data but often use 'platdata' for platform data. We can't really use 'pdata' since that is ambiguous (it could mean private or platform data). Rename some of the latter variables to end with 'plat' for consistency. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/dwc2_udc_otg.c53
-rw-r--r--drivers/usb/gadget/ether.c2
-rw-r--r--drivers/usb/gadget/max3420_udc.c2
3 files changed, 28 insertions, 29 deletions
diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c
index a662d500d3..93b1c60830 100644
--- a/drivers/usb/gadget/dwc2_udc_otg.c
+++ b/drivers/usb/gadget/dwc2_udc_otg.c
@@ -982,7 +982,7 @@ static void dwc2_phy_shutdown(struct udevice *dev, struct phy_bulk *phys)
static int dwc2_udc_otg_ofdata_to_platdata(struct udevice *dev)
{
- struct dwc2_plat_otg_data *platdata = dev_get_platdata(dev);
+ struct dwc2_plat_otg_data *plat = dev_get_platdata(dev);
ulong drvdata;
void (*set_params)(struct dwc2_plat_otg_data *data);
int ret;
@@ -993,35 +993,34 @@ static int dwc2_udc_otg_ofdata_to_platdata(struct udevice *dev)
return -ENODEV;
}
- platdata->regs_otg = dev_read_addr(dev);
+ plat->regs_otg = dev_read_addr(dev);
- platdata->rx_fifo_sz = dev_read_u32_default(dev, "g-rx-fifo-size", 0);
- platdata->np_tx_fifo_sz = dev_read_u32_default(dev,
- "g-np-tx-fifo-size", 0);
+ plat->rx_fifo_sz = dev_read_u32_default(dev, "g-rx-fifo-size", 0);
+ plat->np_tx_fifo_sz = dev_read_u32_default(dev, "g-np-tx-fifo-size", 0);
- platdata->tx_fifo_sz_nb =
+ plat->tx_fifo_sz_nb =
dev_read_size(dev, "g-tx-fifo-size") / sizeof(u32);
- if (platdata->tx_fifo_sz_nb > DWC2_MAX_HW_ENDPOINTS)
- platdata->tx_fifo_sz_nb = DWC2_MAX_HW_ENDPOINTS;
- if (platdata->tx_fifo_sz_nb) {
+ if (plat->tx_fifo_sz_nb > DWC2_MAX_HW_ENDPOINTS)
+ plat->tx_fifo_sz_nb = DWC2_MAX_HW_ENDPOINTS;
+ if (plat->tx_fifo_sz_nb) {
ret = dev_read_u32_array(dev, "g-tx-fifo-size",
- platdata->tx_fifo_sz_array,
- platdata->tx_fifo_sz_nb);
+ plat->tx_fifo_sz_array,
+ plat->tx_fifo_sz_nb);
if (ret)
return ret;
}
- platdata->force_b_session_valid =
+ plat->force_b_session_valid =
dev_read_bool(dev, "u-boot,force-b-session-valid");
- platdata->force_vbus_detection =
+ plat->force_vbus_detection =
dev_read_bool(dev, "u-boot,force-vbus-detection");
- /* force platdata according compatible */
+ /* force plat according compatible */
drvdata = dev_get_driver_data(dev);
if (drvdata) {
set_params = (void *)drvdata;
- set_params(platdata);
+ set_params(plat);
}
return 0;
@@ -1091,10 +1090,10 @@ static int dwc2_udc_otg_clk_init(struct udevice *dev,
static int dwc2_udc_otg_probe(struct udevice *dev)
{
- struct dwc2_plat_otg_data *platdata = dev_get_platdata(dev);
+ struct dwc2_plat_otg_data *plat = dev_get_platdata(dev);
struct dwc2_priv_data *priv = dev_get_priv(dev);
struct dwc2_usbotg_reg *usbotg_reg =
- (struct dwc2_usbotg_reg *)platdata->regs_otg;
+ (struct dwc2_usbotg_reg *)plat->regs_otg;
int ret;
ret = dwc2_udc_otg_clk_init(dev, &priv->clks);
@@ -1109,10 +1108,10 @@ static int dwc2_udc_otg_probe(struct udevice *dev)
if (ret)
return ret;
- if (platdata->activate_stm_id_vb_detection) {
+ if (plat->activate_stm_id_vb_detection) {
if (CONFIG_IS_ENABLED(DM_REGULATOR) &&
- (!platdata->force_b_session_valid ||
- platdata->force_vbus_detection)) {
+ (!plat->force_b_session_valid ||
+ plat->force_vbus_detection)) {
ret = device_get_supply_regulator(dev, "usb33d-supply",
&priv->usb33d_supply);
if (ret) {
@@ -1126,8 +1125,8 @@ static int dwc2_udc_otg_probe(struct udevice *dev)
}
}
- if (platdata->force_b_session_valid &&
- !platdata->force_vbus_detection) {
+ if (plat->force_b_session_valid &&
+ !plat->force_vbus_detection) {
/* Override VBUS detection: enable then value*/
setbits_le32(&usbotg_reg->gotgctl, VB_VALOEN);
setbits_le32(&usbotg_reg->gotgctl, VB_VALOVAL);
@@ -1136,7 +1135,7 @@ static int dwc2_udc_otg_probe(struct udevice *dev)
setbits_le32(&usbotg_reg->ggpio,
GGPIO_STM32_OTG_GCCFG_VBDEN);
}
- if (platdata->force_b_session_valid) {
+ if (plat->force_b_session_valid) {
/* Override B session bits: enable then value */
setbits_le32(&usbotg_reg->gotgctl, A_VALOEN | B_VALOEN);
setbits_le32(&usbotg_reg->gotgctl,
@@ -1148,7 +1147,7 @@ static int dwc2_udc_otg_probe(struct udevice *dev)
}
}
- ret = dwc2_udc_probe(platdata);
+ ret = dwc2_udc_probe(plat);
if (ret)
return ret;
@@ -1189,15 +1188,15 @@ U_BOOT_DRIVER(dwc2_udc_otg) = {
.ofdata_to_platdata = dwc2_udc_otg_ofdata_to_platdata,
.probe = dwc2_udc_otg_probe,
.remove = dwc2_udc_otg_remove,
- .platdata_auto = sizeof(struct dwc2_plat_otg_data),
+ .plat_auto = sizeof(struct dwc2_plat_otg_data),
.priv_auto = sizeof(struct dwc2_priv_data),
};
int dwc2_udc_B_session_valid(struct udevice *dev)
{
- struct dwc2_plat_otg_data *platdata = dev_get_platdata(dev);
+ struct dwc2_plat_otg_data *plat = dev_get_platdata(dev);
struct dwc2_usbotg_reg *usbotg_reg =
- (struct dwc2_usbotg_reg *)platdata->regs_otg;
+ (struct dwc2_usbotg_reg *)plat->regs_otg;
return readl(&usbotg_reg->gotgctl) & B_SESSION_VALID;
}
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 0cce8e24c5..9d4bb9dfac 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -2692,7 +2692,7 @@ U_BOOT_DRIVER(eth_usb) = {
.probe = usb_eth_probe,
.ops = &usb_eth_ops,
.priv_auto = sizeof(struct ether_priv),
- .platdata_auto = sizeof(struct eth_pdata),
+ .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
#endif /* CONFIG_DM_ETH */
diff --git a/drivers/usb/gadget/max3420_udc.c b/drivers/usb/gadget/max3420_udc.c
index 775754a037..36f3eb54d8 100644
--- a/drivers/usb/gadget/max3420_udc.c
+++ b/drivers/usb/gadget/max3420_udc.c
@@ -826,7 +826,7 @@ static int max3420_udc_probe(struct udevice *dev)
uint speed, mode;
struct udevice *spid;
- slave_pdata = dev_get_parent_platdata(dev);
+ slave_pdata = dev_get_parent_plat(dev);
cs = slave_pdata->cs;
speed = slave_pdata->max_hz;
mode = slave_pdata->mode;