Date:2013-12-17 09:55:25 (9 years 9 months ago)
Author:Lars C.
Commit:65b33a24c1039156c0f4c0f0dbe043a41ce5a177
Message:usb: musb-jz4740: Move musb_hdrc_config to the glue driver

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Files: arch/mips/jz4740/platform.c (2 diffs)
drivers/usb/musb/jz4740.c (2 diffs)

Change Details

arch/mips/jz4740/platform.c
6464    .id = 0,
6565};
6666
67static struct musb_hdrc_config jz4740_udc_config = {
68    /* Silicon does not implement USB OTG. */
69    .multipoint = 0,
70    /* Max EPs scanned, driver will decide which EP can be used. */
71    .num_eps = 4,
72    /* RAMbits needed to configure EPs from table */
73    .ram_bits = 9,
74};
75
76static struct musb_hdrc_platform_data jz4740_udc_platform_data = {
77    .mode = MUSB_PERIPHERAL,
78    .config = &jz4740_udc_config,
79};
80
8167static struct resource jz4740_udc_resources[] = {
8268    [0] = {
8369        .start = JZ4740_UDC_BASE_ADDR,
...... 
9884    .dev = {
9985        .dma_mask = &jz4740_udc_device.dev.coherent_dma_mask,
10086        .coherent_dma_mask = DMA_BIT_MASK(32),
101        .platform_data = &jz4740_udc_platform_data,
10287    },
10388    .num_resources = ARRAY_SIZE(jz4740_udc_resources),
10489    .resource = jz4740_udc_resources,
drivers/usb/musb/jz4740.c
8585    return retval;
8686}
8787
88static struct musb_hdrc_config jz4740_musb_config = {
89    /* Silicon does not implement USB OTG. */
90    .multipoint = 0,
91    /* Max EPs scanned, driver will decide which EP can be used. */
92    .num_eps = 4,
93    /* RAMbits needed to configure EPs from table */
94    .ram_bits = 9,
95};
96
97static struct musb_hdrc_platform_data jz4740_musb_platform_data = {
98    .mode = MUSB_PERIPHERAL,
99    .config = &jz4740_musb_config,
100};
101
88102static int jz4740_musb_init(struct musb *musb)
89103{
90104    musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
...... 
119133
120134static int jz4740_probe(struct platform_device *pdev)
121135{
122    struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
136    struct musb_hdrc_platform_data *pdata = &jz4740_musb_platform_data;
123137    struct platform_device *musb;
124138    struct jz4740_glue *glue;
125139    struct clk *clk;
126140    int ret;
127141
128    if (!pdata) {
129        dev_err(&pdev->dev, "failed to allocate platform data\n");
130        return -EINVAL;
131    }
132
133142    glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
134143    if (!glue)
135144        return -ENOMEM;

Archive Download the corresponding diff file



interactive