Commit 2ffcdb3bdadaf8260986e96384df26c94a6ad42c
Committed by
Greg Kroah-Hartman
1 parent
c20b15fde5
Exists in
master
and in
7 other branches
USB: musb: use new platform data interface of musb to replace old one
Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 1 changed file with 5 additions and 0 deletions Inline Diff
include/linux/usb/musb.h
1 | /* | 1 | /* |
2 | * This is used to for host and peripheral modes of the driver for | 2 | * This is used to for host and peripheral modes of the driver for |
3 | * Inventra (Multidrop) Highspeed Dual-Role Controllers: (M)HDRC. | 3 | * Inventra (Multidrop) Highspeed Dual-Role Controllers: (M)HDRC. |
4 | * | 4 | * |
5 | * Board initialization should put one of these into dev->platform_data, | 5 | * Board initialization should put one of these into dev->platform_data, |
6 | * probably on some platform_device named "musb_hdrc". It encapsulates | 6 | * probably on some platform_device named "musb_hdrc". It encapsulates |
7 | * key configuration differences between boards. | 7 | * key configuration differences between boards. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | /* The USB role is defined by the connector used on the board, so long as | 10 | /* The USB role is defined by the connector used on the board, so long as |
11 | * standards are being followed. (Developer boards sometimes won't.) | 11 | * standards are being followed. (Developer boards sometimes won't.) |
12 | */ | 12 | */ |
13 | enum musb_mode { | 13 | enum musb_mode { |
14 | MUSB_UNDEFINED = 0, | 14 | MUSB_UNDEFINED = 0, |
15 | MUSB_HOST, /* A or Mini-A connector */ | 15 | MUSB_HOST, /* A or Mini-A connector */ |
16 | MUSB_PERIPHERAL, /* B or Mini-B connector */ | 16 | MUSB_PERIPHERAL, /* B or Mini-B connector */ |
17 | MUSB_OTG /* Mini-AB connector */ | 17 | MUSB_OTG /* Mini-AB connector */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct clk; | 20 | struct clk; |
21 | 21 | ||
22 | struct musb_hdrc_eps_bits { | 22 | struct musb_hdrc_eps_bits { |
23 | const char name[16]; | 23 | const char name[16]; |
24 | u8 bits; | 24 | u8 bits; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | struct musb_hdrc_config { | 27 | struct musb_hdrc_config { |
28 | /* MUSB configuration-specific details */ | 28 | /* MUSB configuration-specific details */ |
29 | unsigned multipoint:1; /* multipoint device */ | 29 | unsigned multipoint:1; /* multipoint device */ |
30 | unsigned dyn_fifo:1; /* supports dynamic fifo sizing */ | 30 | unsigned dyn_fifo:1; /* supports dynamic fifo sizing */ |
31 | unsigned soft_con:1; /* soft connect required */ | 31 | unsigned soft_con:1; /* soft connect required */ |
32 | unsigned utm_16:1; /* utm data witdh is 16 bits */ | 32 | unsigned utm_16:1; /* utm data witdh is 16 bits */ |
33 | unsigned big_endian:1; /* true if CPU uses big-endian */ | 33 | unsigned big_endian:1; /* true if CPU uses big-endian */ |
34 | unsigned mult_bulk_tx:1; /* Tx ep required for multbulk pkts */ | 34 | unsigned mult_bulk_tx:1; /* Tx ep required for multbulk pkts */ |
35 | unsigned mult_bulk_rx:1; /* Rx ep required for multbulk pkts */ | 35 | unsigned mult_bulk_rx:1; /* Rx ep required for multbulk pkts */ |
36 | unsigned high_iso_tx:1; /* Tx ep required for HB iso */ | 36 | unsigned high_iso_tx:1; /* Tx ep required for HB iso */ |
37 | unsigned high_iso_rx:1; /* Rx ep required for HD iso */ | 37 | unsigned high_iso_rx:1; /* Rx ep required for HD iso */ |
38 | unsigned dma:1; /* supports DMA */ | 38 | unsigned dma:1; /* supports DMA */ |
39 | unsigned vendor_req:1; /* vendor registers required */ | 39 | unsigned vendor_req:1; /* vendor registers required */ |
40 | 40 | ||
41 | u8 num_eps; /* number of endpoints _with_ ep0 */ | 41 | u8 num_eps; /* number of endpoints _with_ ep0 */ |
42 | u8 dma_channels; /* number of dma channels */ | 42 | u8 dma_channels; /* number of dma channels */ |
43 | u8 dyn_fifo_size; /* dynamic size in bytes */ | 43 | u8 dyn_fifo_size; /* dynamic size in bytes */ |
44 | u8 vendor_ctrl; /* vendor control reg width */ | 44 | u8 vendor_ctrl; /* vendor control reg width */ |
45 | u8 vendor_stat; /* vendor status reg witdh */ | 45 | u8 vendor_stat; /* vendor status reg witdh */ |
46 | u8 dma_req_chan; /* bitmask for required dma channels */ | 46 | u8 dma_req_chan; /* bitmask for required dma channels */ |
47 | u8 ram_bits; /* ram address size */ | 47 | u8 ram_bits; /* ram address size */ |
48 | 48 | ||
49 | struct musb_hdrc_eps_bits *eps_bits; | 49 | struct musb_hdrc_eps_bits *eps_bits; |
50 | #ifdef CONFIG_BLACKFIN | ||
51 | /* A GPIO controlling VRSEL in Blackfin */ | ||
52 | unsigned int gpio_vrsel; | ||
53 | #endif | ||
54 | |||
50 | }; | 55 | }; |
51 | 56 | ||
52 | struct musb_hdrc_platform_data { | 57 | struct musb_hdrc_platform_data { |
53 | /* MUSB_HOST, MUSB_PERIPHERAL, or MUSB_OTG */ | 58 | /* MUSB_HOST, MUSB_PERIPHERAL, or MUSB_OTG */ |
54 | u8 mode; | 59 | u8 mode; |
55 | 60 | ||
56 | /* for clk_get() */ | 61 | /* for clk_get() */ |
57 | const char *clock; | 62 | const char *clock; |
58 | 63 | ||
59 | /* (HOST or OTG) switch VBUS on/off */ | 64 | /* (HOST or OTG) switch VBUS on/off */ |
60 | int (*set_vbus)(struct device *dev, int is_on); | 65 | int (*set_vbus)(struct device *dev, int is_on); |
61 | 66 | ||
62 | /* (HOST or OTG) mA/2 power supplied on (default = 8mA) */ | 67 | /* (HOST or OTG) mA/2 power supplied on (default = 8mA) */ |
63 | u8 power; | 68 | u8 power; |
64 | 69 | ||
65 | /* (PERIPHERAL) mA/2 max power consumed (default = 100mA) */ | 70 | /* (PERIPHERAL) mA/2 max power consumed (default = 100mA) */ |
66 | u8 min_power; | 71 | u8 min_power; |
67 | 72 | ||
68 | /* (HOST or OTG) msec/2 after VBUS on till power good */ | 73 | /* (HOST or OTG) msec/2 after VBUS on till power good */ |
69 | u8 potpgt; | 74 | u8 potpgt; |
70 | 75 | ||
71 | /* Power the device on or off */ | 76 | /* Power the device on or off */ |
72 | int (*set_power)(int state); | 77 | int (*set_power)(int state); |
73 | 78 | ||
74 | /* Turn device clock on or off */ | 79 | /* Turn device clock on or off */ |
75 | int (*set_clock)(struct clk *clock, int is_on); | 80 | int (*set_clock)(struct clk *clock, int is_on); |
76 | 81 | ||
77 | /* MUSB configuration-specific details */ | 82 | /* MUSB configuration-specific details */ |
78 | struct musb_hdrc_config *config; | 83 | struct musb_hdrc_config *config; |
79 | }; | 84 | }; |
80 | 85 | ||
81 | 86 | ||
82 | /* TUSB 6010 support */ | 87 | /* TUSB 6010 support */ |
83 | 88 | ||
84 | #define TUSB6010_OSCCLK_60 16667 /* psec/clk @ 60.0 MHz */ | 89 | #define TUSB6010_OSCCLK_60 16667 /* psec/clk @ 60.0 MHz */ |
85 | #define TUSB6010_REFCLK_24 41667 /* psec/clk @ 24.0 MHz XI */ | 90 | #define TUSB6010_REFCLK_24 41667 /* psec/clk @ 24.0 MHz XI */ |
86 | #define TUSB6010_REFCLK_19 52083 /* psec/clk @ 19.2 MHz CLKIN */ | 91 | #define TUSB6010_REFCLK_19 52083 /* psec/clk @ 19.2 MHz CLKIN */ |
87 | 92 | ||
88 | #ifdef CONFIG_ARCH_OMAP2 | 93 | #ifdef CONFIG_ARCH_OMAP2 |
89 | 94 | ||
90 | extern int __init tusb6010_setup_interface( | 95 | extern int __init tusb6010_setup_interface( |
91 | struct musb_hdrc_platform_data *data, | 96 | struct musb_hdrc_platform_data *data, |
92 | unsigned ps_refclk, unsigned waitpin, | 97 | unsigned ps_refclk, unsigned waitpin, |
93 | unsigned async_cs, unsigned sync_cs, | 98 | unsigned async_cs, unsigned sync_cs, |
94 | unsigned irq, unsigned dmachan); | 99 | unsigned irq, unsigned dmachan); |
95 | 100 | ||
96 | extern int tusb6010_platform_retime(unsigned is_refclk); | 101 | extern int tusb6010_platform_retime(unsigned is_refclk); |
97 | 102 | ||
98 | #endif /* OMAP2 */ | 103 | #endif /* OMAP2 */ |
99 | 104 |