blob: 16b399e88035d2d6f152edf7b78574c14a37542f [file] [log] [blame]
Jagan Teki67685942018-05-07 13:03:26 +05301/*
2 * Allwinner sun4i USB PHY driver
3 *
4 * Copyright (C) 2017 Jagan Teki <jagan@amarulasolutions.com>
5 * Copyright (C) 2015 Hans de Goede <hdegoede@redhat.com>
6 * Copyright (C) 2014 Roman Byshko <rbyshko@gmail.com>
7 *
8 * Modelled arch/arm/mach-sunxi/usb_phy.c to compatible with generic-phy.
9 *
10 * SPDX-License-Identifier: GPL-2.0+
11 */
12
13#include <common.h>
14#include <dm.h>
15#include <dm/device.h>
16#include <generic-phy.h>
Jagan Teki129c45c2018-05-07 13:03:27 +053017#include <phy-sun4i-usb.h>
Jagan Teki67685942018-05-07 13:03:26 +053018#include <asm/gpio.h>
19#include <asm/io.h>
20#include <asm/arch/clock.h>
21#include <asm/arch/cpu.h>
22
23#define REG_ISCR 0x00
24#define REG_PHYCTL_A10 0x04
25#define REG_PHYBIST 0x08
26#define REG_PHYTUNE 0x0c
27#define REG_PHYCTL_A33 0x10
28#define REG_PHY_OTGCTL 0x20
29#define REG_PMU_UNK1 0x10
30
31/* Common Control Bits for Both PHYs */
32#define PHY_PLL_BW 0x03
33#define PHY_RES45_CAL_EN 0x0c
34
35/* Private Control Bits for Each PHY */
36#define PHY_TX_AMPLITUDE_TUNE 0x20
37#define PHY_TX_SLEWRATE_TUNE 0x22
38#define PHY_DISCON_TH_SEL 0x2a
39
40#define PHYCTL_DATA BIT(7)
41#define OTGCTL_ROUTE_MUSB BIT(0)
42
43#define PHY_TX_RATE BIT(4)
44#define PHY_TX_MAGNITUDE BIT(2)
45#define PHY_TX_AMPLITUDE_LEN 5
46
47#define PHY_RES45_CAL_DATA BIT(0)
48#define PHY_RES45_CAL_LEN 1
49#define PHY_DISCON_TH_LEN 2
50
51#define SUNXI_AHB_ICHR8_EN BIT(10)
52#define SUNXI_AHB_INCR4_BURST_EN BIT(9)
53#define SUNXI_AHB_INCRX_ALIGN_EN BIT(8)
54#define SUNXI_ULPI_BYPASS_EN BIT(0)
55
Jagan Teki5f646bf2018-05-07 13:03:30 +053056/* A83T specific control bits for PHY0 */
57#define PHY_CTL_VBUSVLDEXT BIT(5)
58#define PHY_CTL_SIDDQ BIT(3)
59
60/* A83T specific control bits for PHY2 HSIC */
61#define SUNXI_EHCI_HS_FORCE BIT(20)
62#define SUNXI_HSIC_CONNECT_INT BIT(16)
63#define SUNXI_HSIC BIT(1)
64
Jagan Teki67685942018-05-07 13:03:26 +053065#define MAX_PHYS 4
66
67enum sun4i_usb_phy_type {
Jagan Teki7f90b552018-05-07 13:03:31 +053068 sun4i_a10_phy,
Jagan Tekibf986d12018-05-07 13:03:32 +053069 sun6i_a31_phy,
Jagan Teki5f646bf2018-05-07 13:03:30 +053070 sun8i_a83t_phy,
Jagan Teki43519c42018-05-07 13:03:28 +053071 sun8i_h3_phy,
Jagan Tekibafe5e32018-05-07 13:03:29 +053072 sun8i_v3s_phy,
Jagan Teki67685942018-05-07 13:03:26 +053073 sun50i_a64_phy,
74};
75
76struct sun4i_usb_phy_cfg {
77 int num_phys;
78 enum sun4i_usb_phy_type type;
79 u32 disc_thresh;
80 u8 phyctl_offset;
81 bool enable_pmu_unk1;
82 bool phy0_dual_route;
83};
84
85struct sun4i_usb_phy_info {
86 const char *gpio_vbus;
87 const char *gpio_vbus_det;
88 const char *gpio_id_det;
89 int rst_mask;
90} phy_info[] = {
91 {
92 .gpio_vbus = CONFIG_USB0_VBUS_PIN,
93 .gpio_vbus_det = CONFIG_USB0_VBUS_DET,
94 .gpio_id_det = CONFIG_USB0_ID_DET,
95 .rst_mask = (CCM_USB_CTRL_PHY0_RST | CCM_USB_CTRL_PHY0_CLK),
96 },
97 {
98 .gpio_vbus = CONFIG_USB1_VBUS_PIN,
99 .gpio_vbus_det = NULL,
100 .gpio_id_det = NULL,
101 .rst_mask = (CCM_USB_CTRL_PHY1_RST | CCM_USB_CTRL_PHY1_CLK),
102 },
103 {
104 .gpio_vbus = CONFIG_USB2_VBUS_PIN,
105 .gpio_vbus_det = NULL,
106 .gpio_id_det = NULL,
Jagan Teki5f646bf2018-05-07 13:03:30 +0530107#ifdef CONFIG_MACH_SUN8I_A83T
108 .rst_mask = (CCM_USB_CTRL_HSIC_RST | CCM_USB_CTRL_HSIC_CLK |
109 CCM_USB_CTRL_12M_CLK),
110#else
Jagan Teki67685942018-05-07 13:03:26 +0530111 .rst_mask = (CCM_USB_CTRL_PHY2_RST | CCM_USB_CTRL_PHY2_CLK),
Jagan Teki5f646bf2018-05-07 13:03:30 +0530112#endif
Jagan Teki67685942018-05-07 13:03:26 +0530113 },
114 {
115 .gpio_vbus = CONFIG_USB3_VBUS_PIN,
116 .gpio_vbus_det = NULL,
117 .gpio_id_det = NULL,
Jagan Teki5f646bf2018-05-07 13:03:30 +0530118#ifdef CONFIG_MACH_SUN6I
Jagan Teki67685942018-05-07 13:03:26 +0530119 .rst_mask = (CCM_USB_CTRL_PHY3_RST | CCM_USB_CTRL_PHY3_CLK),
Jagan Teki5f646bf2018-05-07 13:03:30 +0530120#endif
Jagan Teki67685942018-05-07 13:03:26 +0530121 },
122};
123
124struct sun4i_usb_phy_plat {
125 void __iomem *pmu;
126 int power_on_count;
127 int gpio_vbus;
128 int gpio_vbus_det;
129 int gpio_id_det;
130 int rst_mask;
131 int id;
132};
133
134struct sun4i_usb_phy_data {
135 void __iomem *base;
136 struct sunxi_ccm_reg *ccm;
137 const struct sun4i_usb_phy_cfg *cfg;
138 struct sun4i_usb_phy_plat *usb_phy;
139};
140
141static int initial_usb_scan_delay = CONFIG_INITIAL_USB_SCAN_DELAY;
142
143static void sun4i_usb_phy_write(struct phy *phy, u32 addr, u32 data, int len)
144{
145 struct sun4i_usb_phy_data *phy_data = dev_get_priv(phy->dev);
146 struct sun4i_usb_phy_plat *usb_phy = &phy_data->usb_phy[phy->id];
147 u32 temp, usbc_bit = BIT(usb_phy->id * 2);
148 void __iomem *phyctl = phy_data->base + phy_data->cfg->phyctl_offset;
149 int i;
150
151 if (phy_data->cfg->phyctl_offset == REG_PHYCTL_A33) {
152 /* SoCs newer than A33 need us to set phyctl to 0 explicitly */
153 writel(0, phyctl);
154 }
155
156 for (i = 0; i < len; i++) {
157 temp = readl(phyctl);
158
159 /* clear the address portion */
160 temp &= ~(0xff << 8);
161
162 /* set the address */
163 temp |= ((addr + i) << 8);
164 writel(temp, phyctl);
165
166 /* set the data bit and clear usbc bit*/
167 temp = readb(phyctl);
168 if (data & 0x1)
169 temp |= PHYCTL_DATA;
170 else
171 temp &= ~PHYCTL_DATA;
172 temp &= ~usbc_bit;
173 writeb(temp, phyctl);
174
175 /* pulse usbc_bit */
176 temp = readb(phyctl);
177 temp |= usbc_bit;
178 writeb(temp, phyctl);
179
180 temp = readb(phyctl);
181 temp &= ~usbc_bit;
182 writeb(temp, phyctl);
183
184 data >>= 1;
185 }
186}
187
Jagan Teki5f646bf2018-05-07 13:03:30 +0530188static void sun4i_usb_phy_passby(struct phy *phy, bool enable)
Jagan Teki67685942018-05-07 13:03:26 +0530189{
Jagan Teki5f646bf2018-05-07 13:03:30 +0530190 struct sun4i_usb_phy_data *data = dev_get_priv(phy->dev);
191 struct sun4i_usb_phy_plat *usb_phy = &data->usb_phy[phy->id];
Jagan Teki67685942018-05-07 13:03:26 +0530192 u32 bits, reg_value;
193
194 if (!usb_phy->pmu)
195 return;
196
197 bits = SUNXI_AHB_ICHR8_EN | SUNXI_AHB_INCR4_BURST_EN |
198 SUNXI_AHB_INCRX_ALIGN_EN | SUNXI_ULPI_BYPASS_EN;
Jagan Teki5f646bf2018-05-07 13:03:30 +0530199
200 /* A83T USB2 is HSIC */
201 if (data->cfg->type == sun8i_a83t_phy && usb_phy->id == 2)
202 bits |= SUNXI_EHCI_HS_FORCE | SUNXI_HSIC_CONNECT_INT |
203 SUNXI_HSIC;
204
Jagan Teki67685942018-05-07 13:03:26 +0530205 reg_value = readl(usb_phy->pmu);
206
207 if (enable)
208 reg_value |= bits;
209 else
210 reg_value &= ~bits;
211
212 writel(reg_value, usb_phy->pmu);
213}
214
215static int sun4i_usb_phy_power_on(struct phy *phy)
216{
217 struct sun4i_usb_phy_data *data = dev_get_priv(phy->dev);
218 struct sun4i_usb_phy_plat *usb_phy = &data->usb_phy[phy->id];
219
220 if (initial_usb_scan_delay) {
221 mdelay(initial_usb_scan_delay);
222 initial_usb_scan_delay = 0;
223 }
224
225 usb_phy->power_on_count++;
226 if (usb_phy->power_on_count != 1)
227 return 0;
228
229 if (usb_phy->gpio_vbus >= 0)
230 gpio_set_value(usb_phy->gpio_vbus, SUNXI_GPIO_PULL_UP);
231
232 return 0;
233}
234
235static int sun4i_usb_phy_power_off(struct phy *phy)
236{
237 struct sun4i_usb_phy_data *data = dev_get_priv(phy->dev);
238 struct sun4i_usb_phy_plat *usb_phy = &data->usb_phy[phy->id];
239
240 usb_phy->power_on_count--;
241 if (usb_phy->power_on_count != 0)
242 return 0;
243
244 if (usb_phy->gpio_vbus >= 0)
245 gpio_set_value(usb_phy->gpio_vbus, SUNXI_GPIO_PULL_DISABLE);
246
247 return 0;
248}
249
250static void sun4i_usb_phy0_reroute(struct sun4i_usb_phy_data *data, bool id_det)
251{
252 u32 regval;
253
254 regval = readl(data->base + REG_PHY_OTGCTL);
255 if (!id_det) {
256 /* Host mode. Route phy0 to EHCI/OHCI */
257 regval &= ~OTGCTL_ROUTE_MUSB;
258 } else {
259 /* Peripheral mode. Route phy0 to MUSB */
260 regval |= OTGCTL_ROUTE_MUSB;
261 }
262 writel(regval, data->base + REG_PHY_OTGCTL);
263}
264
265static int sun4i_usb_phy_init(struct phy *phy)
266{
267 struct sun4i_usb_phy_data *data = dev_get_priv(phy->dev);
268 struct sun4i_usb_phy_plat *usb_phy = &data->usb_phy[phy->id];
269 u32 val;
270
271 setbits_le32(&data->ccm->usb_clk_cfg, usb_phy->rst_mask);
272
Jagan Teki5f646bf2018-05-07 13:03:30 +0530273 if (data->cfg->type == sun8i_a83t_phy) {
274 if (phy->id == 0) {
275 val = readl(data->base + data->cfg->phyctl_offset);
276 val |= PHY_CTL_VBUSVLDEXT;
277 val &= ~PHY_CTL_SIDDQ;
278 writel(val, data->base + data->cfg->phyctl_offset);
279 }
280 } else {
281 if (usb_phy->pmu && data->cfg->enable_pmu_unk1) {
282 val = readl(usb_phy->pmu + REG_PMU_UNK1);
283 writel(val & ~2, usb_phy->pmu + REG_PMU_UNK1);
284 }
285
286 if (usb_phy->id == 0)
287 sun4i_usb_phy_write(phy, PHY_RES45_CAL_EN,
288 PHY_RES45_CAL_DATA,
289 PHY_RES45_CAL_LEN);
290
291 /* Adjust PHY's magnitude and rate */
292 sun4i_usb_phy_write(phy, PHY_TX_AMPLITUDE_TUNE,
293 PHY_TX_MAGNITUDE | PHY_TX_RATE,
294 PHY_TX_AMPLITUDE_LEN);
295
296 /* Disconnect threshold adjustment */
297 sun4i_usb_phy_write(phy, PHY_DISCON_TH_SEL,
298 data->cfg->disc_thresh, PHY_DISCON_TH_LEN);
Jagan Teki67685942018-05-07 13:03:26 +0530299 }
300
Jagan Teki67685942018-05-07 13:03:26 +0530301 if (usb_phy->id != 0)
Jagan Teki5f646bf2018-05-07 13:03:30 +0530302 sun4i_usb_phy_passby(phy, true);
Jagan Teki67685942018-05-07 13:03:26 +0530303
304 sun4i_usb_phy0_reroute(data, true);
305
306 return 0;
307}
308
309static int sun4i_usb_phy_exit(struct phy *phy)
310{
311 struct sun4i_usb_phy_data *data = dev_get_priv(phy->dev);
312 struct sun4i_usb_phy_plat *usb_phy = &data->usb_phy[phy->id];
313
Jagan Teki5f646bf2018-05-07 13:03:30 +0530314 if (phy->id == 0) {
315 if (data->cfg->type == sun8i_a83t_phy) {
316 void __iomem *phyctl = data->base +
317 data->cfg->phyctl_offset;
318
319 writel(readl(phyctl) | PHY_CTL_SIDDQ, phyctl);
320 }
321 }
322
323 sun4i_usb_phy_passby(phy, false);
Jagan Teki67685942018-05-07 13:03:26 +0530324
325 clrbits_le32(&data->ccm->usb_clk_cfg, usb_phy->rst_mask);
326
327 return 0;
328}
329
330static int sun4i_usb_phy_xlate(struct phy *phy,
331 struct ofnode_phandle_args *args)
332{
333 struct sun4i_usb_phy_data *data = dev_get_priv(phy->dev);
334
335 if (args->args_count >= data->cfg->num_phys)
336 return -EINVAL;
337
338 if (args->args_count)
339 phy->id = args->args[0];
340 else
341 phy->id = 0;
342
343 debug("%s: phy_id = %ld\n", __func__, phy->id);
344 return 0;
345}
346
Jagan Teki129c45c2018-05-07 13:03:27 +0530347int sun4i_usb_phy_vbus_detect(struct phy *phy)
348{
349 struct sun4i_usb_phy_data *data = dev_get_priv(phy->dev);
350 struct sun4i_usb_phy_plat *usb_phy = &data->usb_phy[phy->id];
351 int err, retries = 3;
352
353 debug("%s: id_det = %d\n", __func__, usb_phy->gpio_id_det);
354
355 if (usb_phy->gpio_vbus_det < 0)
356 return usb_phy->gpio_vbus_det;
357
358 err = gpio_get_value(usb_phy->gpio_vbus_det);
359 /*
360 * Vbus may have been provided by the board and just been turned of
361 * some milliseconds ago on reset, what we're measuring then is a
362 * residual charge on Vbus, sleep a bit and try again.
363 */
364 while (err > 0 && retries--) {
365 mdelay(100);
366 err = gpio_get_value(usb_phy->gpio_vbus_det);
367 }
368
369 return err;
370}
371
372int sun4i_usb_phy_id_detect(struct phy *phy)
373{
374 struct sun4i_usb_phy_data *data = dev_get_priv(phy->dev);
375 struct sun4i_usb_phy_plat *usb_phy = &data->usb_phy[phy->id];
376
377 debug("%s: id_det = %d\n", __func__, usb_phy->gpio_id_det);
378
379 if (usb_phy->gpio_id_det < 0)
380 return usb_phy->gpio_id_det;
381
382 return gpio_get_value(usb_phy->gpio_id_det);
383}
384
Jagan Teki67685942018-05-07 13:03:26 +0530385static struct phy_ops sun4i_usb_phy_ops = {
386 .of_xlate = sun4i_usb_phy_xlate,
387 .init = sun4i_usb_phy_init,
388 .power_on = sun4i_usb_phy_power_on,
389 .power_off = sun4i_usb_phy_power_off,
390 .exit = sun4i_usb_phy_exit,
391};
392
393static int sun4i_usb_phy_probe(struct udevice *dev)
394{
395 struct sun4i_usb_phy_plat *plat = dev_get_platdata(dev);
396 struct sun4i_usb_phy_data *data = dev_get_priv(dev);
397 int i, ret;
398
399 data->cfg = (const struct sun4i_usb_phy_cfg *)dev_get_driver_data(dev);
400 if (!data->cfg)
401 return -EINVAL;
402
403 data->base = (void __iomem *)devfdt_get_addr_name(dev, "phy_ctrl");
404 if (IS_ERR(data->base))
405 return PTR_ERR(data->base);
406
407 data->ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
408 if (IS_ERR(data->ccm))
409 return PTR_ERR(data->ccm);
410
411 data->usb_phy = plat;
412 for (i = 0; i < data->cfg->num_phys; i++) {
413 struct sun4i_usb_phy_plat *phy = &plat[i];
414 struct sun4i_usb_phy_info *info = &phy_info[i];
415 char name[16];
416
417 phy->gpio_vbus = sunxi_name_to_gpio(info->gpio_vbus);
418 if (phy->gpio_vbus >= 0) {
419 ret = gpio_request(phy->gpio_vbus, "usb_vbus");
420 if (ret)
421 return ret;
422 ret = gpio_direction_output(phy->gpio_vbus, 0);
423 if (ret)
424 return ret;
425 }
426
427 phy->gpio_vbus_det = sunxi_name_to_gpio(info->gpio_vbus_det);
428 if (phy->gpio_vbus_det >= 0) {
429 ret = gpio_request(phy->gpio_vbus_det, "usb_vbus_det");
430 if (ret)
431 return ret;
432 ret = gpio_direction_input(phy->gpio_vbus_det);
433 if (ret)
434 return ret;
435 }
436
437 phy->gpio_id_det = sunxi_name_to_gpio(info->gpio_id_det);
438 if (phy->gpio_id_det >= 0) {
439 ret = gpio_request(phy->gpio_id_det, "usb_id_det");
440 if (ret)
441 return ret;
442 ret = gpio_direction_input(phy->gpio_id_det);
443 if (ret)
444 return ret;
445 sunxi_gpio_set_pull(phy->gpio_id_det, SUNXI_GPIO_PULL_UP);
446 }
447
448 if (i || data->cfg->phy0_dual_route) {
449 snprintf(name, sizeof(name), "pmu%d", i);
450 phy->pmu = (void __iomem *)devfdt_get_addr_name(dev, name);
451 if (IS_ERR(phy->pmu))
452 return PTR_ERR(phy->pmu);
453 }
454
455 phy->id = i;
456 phy->rst_mask = info->rst_mask;
457 };
458
459 setbits_le32(&data->ccm->usb_clk_cfg, CCM_USB_CTRL_PHYGATE);
460
461 debug("Allwinner Sun4I USB PHY driver loaded\n");
462 return 0;
463}
464
Jagan Teki7f90b552018-05-07 13:03:31 +0530465static const struct sun4i_usb_phy_cfg sun4i_a10_cfg = {
466 .num_phys = 3,
467 .type = sun4i_a10_phy,
468 .disc_thresh = 3,
469 .phyctl_offset = REG_PHYCTL_A10,
470 .enable_pmu_unk1 = false,
471};
472
473static const struct sun4i_usb_phy_cfg sun5i_a13_cfg = {
474 .num_phys = 2,
475 .type = sun4i_a10_phy,
476 .disc_thresh = 2,
477 .phyctl_offset = REG_PHYCTL_A10,
478 .enable_pmu_unk1 = false,
479};
480
Jagan Tekibf986d12018-05-07 13:03:32 +0530481static const struct sun4i_usb_phy_cfg sun6i_a31_cfg = {
482 .num_phys = 3,
483 .type = sun6i_a31_phy,
484 .disc_thresh = 3,
485 .phyctl_offset = REG_PHYCTL_A10,
486 .enable_pmu_unk1 = false,
487};
488
Jagan Teki7f90b552018-05-07 13:03:31 +0530489static const struct sun4i_usb_phy_cfg sun7i_a20_cfg = {
490 .num_phys = 3,
491 .type = sun4i_a10_phy,
492 .disc_thresh = 2,
493 .phyctl_offset = REG_PHYCTL_A10,
494 .enable_pmu_unk1 = false,
495};
496
Jagan Teki5f646bf2018-05-07 13:03:30 +0530497static const struct sun4i_usb_phy_cfg sun8i_a83t_cfg = {
498 .num_phys = 3,
499 .type = sun8i_a83t_phy,
500 .phyctl_offset = REG_PHYCTL_A33,
501};
502
Jagan Teki43519c42018-05-07 13:03:28 +0530503static const struct sun4i_usb_phy_cfg sun8i_h3_cfg = {
504 .num_phys = 4,
505 .type = sun8i_h3_phy,
506 .disc_thresh = 3,
507 .phyctl_offset = REG_PHYCTL_A33,
508 .enable_pmu_unk1 = true,
509 .phy0_dual_route = true,
510};
511
Jagan Tekibafe5e32018-05-07 13:03:29 +0530512static const struct sun4i_usb_phy_cfg sun8i_v3s_cfg = {
513 .num_phys = 1,
514 .type = sun8i_v3s_phy,
515 .disc_thresh = 3,
516 .phyctl_offset = REG_PHYCTL_A33,
517 .enable_pmu_unk1 = true,
518 .phy0_dual_route = true,
519};
520
Jagan Teki67685942018-05-07 13:03:26 +0530521static const struct sun4i_usb_phy_cfg sun50i_a64_cfg = {
522 .num_phys = 2,
523 .type = sun50i_a64_phy,
524 .disc_thresh = 3,
525 .phyctl_offset = REG_PHYCTL_A33,
526 .enable_pmu_unk1 = true,
527 .phy0_dual_route = true,
528};
529
530static const struct udevice_id sun4i_usb_phy_ids[] = {
Jagan Teki7f90b552018-05-07 13:03:31 +0530531 { .compatible = "allwinner,sun4i-a10-usb-phy", .data = (ulong)&sun4i_a10_cfg },
532 { .compatible = "allwinner,sun5i-a13-usb-phy", .data = (ulong)&sun5i_a13_cfg },
Jagan Tekibf986d12018-05-07 13:03:32 +0530533 { .compatible = "allwinner,sun6i-a31-usb-phy", .data = (ulong)&sun6i_a31_cfg },
Jagan Teki7f90b552018-05-07 13:03:31 +0530534 { .compatible = "allwinner,sun7i-a20-usb-phy", .data = (ulong)&sun7i_a20_cfg },
Jagan Teki5f646bf2018-05-07 13:03:30 +0530535 { .compatible = "allwinner,sun8i-a83t-usb-phy", .data = (ulong)&sun8i_a83t_cfg },
Jagan Teki43519c42018-05-07 13:03:28 +0530536 { .compatible = "allwinner,sun8i-h3-usb-phy", .data = (ulong)&sun8i_h3_cfg },
Jagan Tekibafe5e32018-05-07 13:03:29 +0530537 { .compatible = "allwinner,sun8i-v3s-usb-phy", .data = (ulong)&sun8i_v3s_cfg },
Jagan Teki67685942018-05-07 13:03:26 +0530538 { .compatible = "allwinner,sun50i-a64-usb-phy", .data = (ulong)&sun50i_a64_cfg},
539 { }
540};
541
542U_BOOT_DRIVER(sun4i_usb_phy) = {
543 .name = "sun4i_usb_phy",
544 .id = UCLASS_PHY,
545 .of_match = sun4i_usb_phy_ids,
546 .ops = &sun4i_usb_phy_ops,
547 .probe = sun4i_usb_phy_probe,
548 .platdata_auto_alloc_size = sizeof(struct sun4i_usb_phy_plat[MAX_PHYS]),
549 .priv_auto_alloc_size = sizeof(struct sun4i_usb_phy_data),
550};