musb_dsps.c (c2fb7916927e989ea424e61ce5fe617e54878827) musb_dsps.c (ca749b2a2e72b39b3a46d1e4d096e338bf714a3c)
1/*
2 * Texas Instruments DSPS platforms "glue layer"
3 *
4 * Copyright (C) 2012, by Texas Instruments
5 *
6 * Based on the am35x "glue layer" code.
7 *
8 * This file is part of the Inventra Controller Driver for Linux.

--- 444 unchanged lines hidden (view full) ---

453 struct device *dev = glue->dev;
454 struct platform_device *pdev = to_platform_device(dev);
455 struct musb_hdrc_platform_data *pdata = dev->platform_data;
456 struct device_node *np = pdev->dev.of_node;
457 struct musb_hdrc_config *config;
458 struct platform_device *musb;
459 struct resource *res;
460 struct resource resources[2];
1/*
2 * Texas Instruments DSPS platforms "glue layer"
3 *
4 * Copyright (C) 2012, by Texas Instruments
5 *
6 * Based on the am35x "glue layer" code.
7 *
8 * This file is part of the Inventra Controller Driver for Linux.

--- 444 unchanged lines hidden (view full) ---

453 struct device *dev = glue->dev;
454 struct platform_device *pdev = to_platform_device(dev);
455 struct musb_hdrc_platform_data *pdata = dev->platform_data;
456 struct device_node *np = pdev->dev.of_node;
457 struct musb_hdrc_config *config;
458 struct platform_device *musb;
459 struct resource *res;
460 struct resource resources[2];
461 char res_name[10];
461 char res_name[11];
462 int ret, musbid;
463
464 /* get memory resource */
462 int ret, musbid;
463
464 /* get memory resource */
465 sprintf(res_name, "musb%d", id);
465 snprintf(res_name, sizeof(res_name), "musb%d", id);
466 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, res_name);
467 if (!res) {
468 dev_err(dev, "%s get mem resource failed\n", res_name);
469 ret = -ENODEV;
470 goto err0;
471 }
472 res->parent = NULL;
473 resources[0] = *res;
474
475 /* get irq resource */
466 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, res_name);
467 if (!res) {
468 dev_err(dev, "%s get mem resource failed\n", res_name);
469 ret = -ENODEV;
470 goto err0;
471 }
472 res->parent = NULL;
473 resources[0] = *res;
474
475 /* get irq resource */
476 sprintf(res_name, "musb%d-irq", id);
476 snprintf(res_name, sizeof(res_name), "musb%d-irq", id);
477 res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, res_name);
478 if (!res) {
479 dev_err(dev, "%s get irq resource failed\n", res_name);
480 ret = -ENODEV;
481 goto err0;
482 }
483 res->parent = NULL;
484 resources[1] = *res;

--- 40 unchanged lines hidden (view full) ---

525 if (!config) {
526 dev_err(&pdev->dev,
527 "failed to allocate musb hdrc config\n");
528 goto err2;
529 }
530
531 of_property_read_u32(np, "num-eps", (u32 *)&config->num_eps);
532 of_property_read_u32(np, "ram-bits", (u32 *)&config->ram_bits);
477 res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, res_name);
478 if (!res) {
479 dev_err(dev, "%s get irq resource failed\n", res_name);
480 ret = -ENODEV;
481 goto err0;
482 }
483 res->parent = NULL;
484 resources[1] = *res;

--- 40 unchanged lines hidden (view full) ---

525 if (!config) {
526 dev_err(&pdev->dev,
527 "failed to allocate musb hdrc config\n");
528 goto err2;
529 }
530
531 of_property_read_u32(np, "num-eps", (u32 *)&config->num_eps);
532 of_property_read_u32(np, "ram-bits", (u32 *)&config->ram_bits);
533 sprintf(res_name, "port%d-mode", id);
533 snprintf(res_name, sizeof(res_name), "port%d-mode", id);
534 of_property_read_u32(np, res_name, (u32 *)&pdata->mode);
535 of_property_read_u32(np, "power", (u32 *)&pdata->power);
536 config->multipoint = of_property_read_bool(np, "multipoint");
537
538 pdata->config = config;
539 }
540
541 pdata->platform_ops = &dsps_ops;

--- 228 unchanged lines hidden ---
534 of_property_read_u32(np, res_name, (u32 *)&pdata->mode);
535 of_property_read_u32(np, "power", (u32 *)&pdata->power);
536 config->multipoint = of_property_read_bool(np, "multipoint");
537
538 pdata->config = config;
539 }
540
541 pdata->platform_ops = &dsps_ops;

--- 228 unchanged lines hidden ---