diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-13 20:34:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-13 20:34:23 -0500 |
commit | f90203e0cf0d5a8b027d511af318bb3db4758fe2 (patch) | |
tree | d2d9157331857b4220198e053e30ce3427c5140e /arch/powerpc/sysdev/fsl_soc.c | |
parent | 33e563c1190c26b6bf61990c505cdcb5cdbba7e4 (diff) | |
parent | 719c91ccadd3ed26570dbb29d54166914832eee9 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc
* master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc: (61 commits)
[POWERPC] Use udbg_early_init() on ppc32
[POWERPC] Open Firmware serial port driver
[POWERPC] Move MPIC smp routines into mpic.c
[POWERPC] Cleanup pseries kexec code
[POWERPC] Cleanup pseries smp initialisation code
[POWERPC] Consolidate pseries platform header files into pseries.h
[POWERPC] 85xx: Drop use of SYNC macro in head_fsl_booke.S
[POWERPC] cell: pm_rtas_activat_signals routine cleanup
[POWERPC] cell: PPU Oprofile cleanup patch
[POWERPC] spufs: avoid accessing kernel memory through mmapped /mem node
[POWERPC] spu sched: static timeslicing for SCHED_RR contexts
[POWERPC] spu sched: use DECLARE_BITMAP
[POWERPC] spu sched: forced preemption at execution
[POWERPC] spu sched: update some comments
[POWERPC] spu sched: simplity spu_remove_from_active_list
[POWERPC] spufs: optimize spu_run
[POWERPC] spufs: runqueue simplification
[POWERPC] spufs: move prio to spu_context
[POWERPC] spufs: state_mutex cleanup
[POWERPC] spufs: simplify state_mutex
...
Diffstat (limited to 'arch/powerpc/sysdev/fsl_soc.c')
-rw-r--r-- | arch/powerpc/sysdev/fsl_soc.c | 78 |
1 files changed, 59 insertions, 19 deletions
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index 9f2a9a444bfb..34161bc5a02f 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c | |||
@@ -441,7 +441,8 @@ static int __init fsl_usb_of_init(void) | |||
441 | { | 441 | { |
442 | struct device_node *np; | 442 | struct device_node *np; |
443 | unsigned int i; | 443 | unsigned int i; |
444 | struct platform_device *usb_dev_mph = NULL, *usb_dev_dr = NULL; | 444 | struct platform_device *usb_dev_mph = NULL, *usb_dev_dr_host = NULL, |
445 | *usb_dev_dr_client = NULL; | ||
445 | int ret; | 446 | int ret; |
446 | 447 | ||
447 | for (np = NULL, i = 0; | 448 | for (np = NULL, i = 0; |
@@ -507,33 +508,72 @@ static int __init fsl_usb_of_init(void) | |||
507 | 508 | ||
508 | of_irq_to_resource(np, 0, &r[1]); | 509 | of_irq_to_resource(np, 0, &r[1]); |
509 | 510 | ||
510 | usb_dev_dr = | 511 | prop = get_property(np, "dr_mode", NULL); |
511 | platform_device_register_simple("fsl-ehci", i, r, 2); | 512 | |
512 | if (IS_ERR(usb_dev_dr)) { | 513 | if (!prop || !strcmp(prop, "host")) { |
513 | ret = PTR_ERR(usb_dev_dr); | 514 | usb_data.operating_mode = FSL_USB2_DR_HOST; |
515 | usb_dev_dr_host = platform_device_register_simple( | ||
516 | "fsl-ehci", i, r, 2); | ||
517 | if (IS_ERR(usb_dev_dr_host)) { | ||
518 | ret = PTR_ERR(usb_dev_dr_host); | ||
519 | goto err; | ||
520 | } | ||
521 | } else if (prop && !strcmp(prop, "peripheral")) { | ||
522 | usb_data.operating_mode = FSL_USB2_DR_DEVICE; | ||
523 | usb_dev_dr_client = platform_device_register_simple( | ||
524 | "fsl-usb2-udc", i, r, 2); | ||
525 | if (IS_ERR(usb_dev_dr_client)) { | ||
526 | ret = PTR_ERR(usb_dev_dr_client); | ||
527 | goto err; | ||
528 | } | ||
529 | } else if (prop && !strcmp(prop, "otg")) { | ||
530 | usb_data.operating_mode = FSL_USB2_DR_OTG; | ||
531 | usb_dev_dr_host = platform_device_register_simple( | ||
532 | "fsl-ehci", i, r, 2); | ||
533 | if (IS_ERR(usb_dev_dr_host)) { | ||
534 | ret = PTR_ERR(usb_dev_dr_host); | ||
535 | goto err; | ||
536 | } | ||
537 | usb_dev_dr_client = platform_device_register_simple( | ||
538 | "fsl-usb2-udc", i, r, 2); | ||
539 | if (IS_ERR(usb_dev_dr_client)) { | ||
540 | ret = PTR_ERR(usb_dev_dr_client); | ||
541 | goto err; | ||
542 | } | ||
543 | } else { | ||
544 | ret = -EINVAL; | ||
514 | goto err; | 545 | goto err; |
515 | } | 546 | } |
516 | 547 | ||
517 | usb_dev_dr->dev.coherent_dma_mask = 0xffffffffUL; | ||
518 | usb_dev_dr->dev.dma_mask = &usb_dev_dr->dev.coherent_dma_mask; | ||
519 | |||
520 | usb_data.operating_mode = FSL_USB2_DR_HOST; | ||
521 | |||
522 | prop = get_property(np, "phy_type", NULL); | 548 | prop = get_property(np, "phy_type", NULL); |
523 | usb_data.phy_mode = determine_usb_phy(prop); | 549 | usb_data.phy_mode = determine_usb_phy(prop); |
524 | 550 | ||
525 | ret = | 551 | if (usb_dev_dr_host) { |
526 | platform_device_add_data(usb_dev_dr, &usb_data, | 552 | usb_dev_dr_host->dev.coherent_dma_mask = 0xffffffffUL; |
527 | sizeof(struct | 553 | usb_dev_dr_host->dev.dma_mask = &usb_dev_dr_host-> |
528 | fsl_usb2_platform_data)); | 554 | dev.coherent_dma_mask; |
529 | if (ret) | 555 | if ((ret = platform_device_add_data(usb_dev_dr_host, |
530 | goto unreg_dr; | 556 | &usb_data, sizeof(struct |
557 | fsl_usb2_platform_data)))) | ||
558 | goto unreg_dr; | ||
559 | } | ||
560 | if (usb_dev_dr_client) { | ||
561 | usb_dev_dr_client->dev.coherent_dma_mask = 0xffffffffUL; | ||
562 | usb_dev_dr_client->dev.dma_mask = &usb_dev_dr_client-> | ||
563 | dev.coherent_dma_mask; | ||
564 | if ((ret = platform_device_add_data(usb_dev_dr_client, | ||
565 | &usb_data, sizeof(struct | ||
566 | fsl_usb2_platform_data)))) | ||
567 | goto unreg_dr; | ||
568 | } | ||
531 | } | 569 | } |
532 | return 0; | 570 | return 0; |
533 | 571 | ||
534 | unreg_dr: | 572 | unreg_dr: |
535 | if (usb_dev_dr) | 573 | if (usb_dev_dr_host) |
536 | platform_device_unregister(usb_dev_dr); | 574 | platform_device_unregister(usb_dev_dr_host); |
575 | if (usb_dev_dr_client) | ||
576 | platform_device_unregister(usb_dev_dr_client); | ||
537 | unreg_mph: | 577 | unreg_mph: |
538 | if (usb_dev_mph) | 578 | if (usb_dev_mph) |
539 | platform_device_unregister(usb_dev_mph); | 579 | platform_device_unregister(usb_dev_mph); |
@@ -699,7 +739,7 @@ static int __init fs_enet_of_init(void) | |||
699 | if (ret) | 739 | if (ret) |
700 | goto unreg; | 740 | goto unreg; |
701 | } | 741 | } |
702 | 742 | ||
703 | of_node_put(phy); | 743 | of_node_put(phy); |
704 | of_node_put(mdio); | 744 | of_node_put(mdio); |
705 | 745 | ||