.. | .. |
---|
3 | 3 | * Renesas USB driver RZ/A initialization and power control |
---|
4 | 4 | * |
---|
5 | 5 | * Copyright (C) 2018 Chris Brandt |
---|
6 | | - * Copyright (C) 2018 Renesas Electronics Corporation |
---|
| 6 | + * Copyright (C) 2018-2019 Renesas Electronics Corporation |
---|
7 | 7 | */ |
---|
8 | 8 | |
---|
9 | 9 | #include <linux/delay.h> |
---|
.. | .. |
---|
23 | 23 | extal_clk = of_find_node_by_name(NULL, "extal"); |
---|
24 | 24 | of_property_read_u32(usb_x1_clk, "clock-frequency", &freq_usb); |
---|
25 | 25 | of_property_read_u32(extal_clk, "clock-frequency", &freq_extal); |
---|
| 26 | + |
---|
| 27 | + of_node_put(usb_x1_clk); |
---|
| 28 | + of_node_put(extal_clk); |
---|
| 29 | + |
---|
26 | 30 | if (freq_usb == 0) { |
---|
27 | 31 | if (freq_extal == 12000000) { |
---|
28 | 32 | /* Select 12MHz XTAL */ |
---|
.. | .. |
---|
35 | 39 | |
---|
36 | 40 | /* Enable USB PLL (NOTE: ch0 controls both ch0 and ch1) */ |
---|
37 | 41 | usbhs_bset(priv, SYSCFG, UPLLE, UPLLE); |
---|
38 | | - udelay(1000); |
---|
| 42 | + usleep_range(1000, 2000); |
---|
39 | 43 | usbhs_bset(priv, SUSPMODE, SUSPM, SUSPM); |
---|
40 | 44 | |
---|
41 | 45 | return 0; |
---|
42 | 46 | } |
---|
43 | 47 | |
---|
44 | | -static int usbhs_rza_get_id(struct platform_device *pdev) |
---|
45 | | -{ |
---|
46 | | - return USBHS_GADGET; |
---|
47 | | -} |
---|
48 | | - |
---|
49 | | -const struct renesas_usbhs_platform_callback usbhs_rza1_ops = { |
---|
50 | | - .hardware_init = usbhs_rza1_hardware_init, |
---|
51 | | - .get_id = usbhs_rza_get_id, |
---|
| 48 | +const struct renesas_usbhs_platform_info usbhs_rza1_plat_info = { |
---|
| 49 | + .platform_callback = { |
---|
| 50 | + .hardware_init = usbhs_rza1_hardware_init, |
---|
| 51 | + .get_id = usbhs_get_id_as_gadget, |
---|
| 52 | + }, |
---|
| 53 | + .driver_param = { |
---|
| 54 | + .has_new_pipe_configs = 1, |
---|
| 55 | + }, |
---|
52 | 56 | }; |
---|