diff options
-rw-r--r-- | arch/arm/mach-spear3xx/clock.c | 111 | ||||
-rw-r--r-- | arch/arm/mach-spear6xx/clock.c | 80 |
2 files changed, 96 insertions, 95 deletions
diff --git a/arch/arm/mach-spear3xx/clock.c b/arch/arm/mach-spear3xx/clock.c index 6c4841f55223..6b2cd9ba4fd9 100644 --- a/arch/arm/mach-spear3xx/clock.c +++ b/arch/arm/mach-spear3xx/clock.c | |||
@@ -11,6 +11,7 @@ | |||
11 | * warranty of any kind, whether express or implied. | 11 | * warranty of any kind, whether express or implied. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/clkdev.h> | ||
14 | #include <linux/init.h> | 15 | #include <linux/init.h> |
15 | #include <linux/io.h> | 16 | #include <linux/io.h> |
16 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
@@ -652,85 +653,85 @@ static struct clk pwm_clk = { | |||
652 | 653 | ||
653 | /* array of all spear 3xx clock lookups */ | 654 | /* array of all spear 3xx clock lookups */ |
654 | static struct clk_lookup spear_clk_lookups[] = { | 655 | static struct clk_lookup spear_clk_lookups[] = { |
655 | { .con_id = "apb_pclk", .clk = &dummy_apb_pclk}, | 656 | CLKDEV_INIT(NULL, "apb_pclk", &dummy_apb_pclk), |
656 | /* root clks */ | 657 | /* root clks */ |
657 | { .con_id = "osc_32k_clk", .clk = &osc_32k_clk}, | 658 | CLKDEV_INIT(NULL, "osc_32k_clk", &osc_32k_clk), |
658 | { .con_id = "osc_24m_clk", .clk = &osc_24m_clk}, | 659 | CLKDEV_INIT(NULL, "osc_24m_clk", &osc_24m_clk), |
659 | /* clock derived from 32 KHz osc clk */ | 660 | /* clock derived from 32 KHz osc clk */ |
660 | { .dev_id = "rtc-spear", .clk = &rtc_clk}, | 661 | CLKDEV_INIT("rtc-spear", NULL, &rtc_clk), |
661 | /* clock derived from 24 MHz osc clk */ | 662 | /* clock derived from 24 MHz osc clk */ |
662 | { .con_id = "pll1_clk", .clk = &pll1_clk}, | 663 | CLKDEV_INIT(NULL, "pll1_clk", &pll1_clk), |
663 | { .con_id = "pll3_48m_clk", .clk = &pll3_48m_clk}, | 664 | CLKDEV_INIT(NULL, "pll3_48m_clk", &pll3_48m_clk), |
664 | { .dev_id = "wdt", .clk = &wdt_clk}, | 665 | CLKDEV_INIT("wdt", NULL, &wdt_clk), |
665 | /* clock derived from pll1 clk */ | 666 | /* clock derived from pll1 clk */ |
666 | { .con_id = "cpu_clk", .clk = &cpu_clk}, | 667 | CLKDEV_INIT(NULL, "cpu_clk", &cpu_clk), |
667 | { .con_id = "ahb_clk", .clk = &ahb_clk}, | 668 | CLKDEV_INIT(NULL, "ahb_clk", &ahb_clk), |
668 | { .con_id = "uart_synth_clk", .clk = &uart_synth_clk}, | 669 | CLKDEV_INIT(NULL, "uart_synth_clk", &uart_synth_clk), |
669 | { .con_id = "firda_synth_clk", .clk = &firda_synth_clk}, | 670 | CLKDEV_INIT(NULL, "firda_synth_clk", &firda_synth_clk), |
670 | { .con_id = "gpt0_synth_clk", .clk = &gpt0_synth_clk}, | 671 | CLKDEV_INIT(NULL, "gpt0_synth_clk", &gpt0_synth_clk), |
671 | { .con_id = "gpt1_synth_clk", .clk = &gpt1_synth_clk}, | 672 | CLKDEV_INIT(NULL, "gpt1_synth_clk", &gpt1_synth_clk), |
672 | { .con_id = "gpt2_synth_clk", .clk = &gpt2_synth_clk}, | 673 | CLKDEV_INIT(NULL, "gpt2_synth_clk", &gpt2_synth_clk), |
673 | { .dev_id = "uart", .clk = &uart_clk}, | 674 | CLKDEV_INIT("uart", NULL, &uart_clk), |
674 | { .dev_id = "firda", .clk = &firda_clk}, | 675 | CLKDEV_INIT("firda", NULL, &firda_clk), |
675 | { .dev_id = "gpt0", .clk = &gpt0_clk}, | 676 | CLKDEV_INIT("gpt0", NULL, &gpt0_clk), |
676 | { .dev_id = "gpt1", .clk = &gpt1_clk}, | 677 | CLKDEV_INIT("gpt1", NULL, &gpt1_clk), |
677 | { .dev_id = "gpt2", .clk = &gpt2_clk}, | 678 | CLKDEV_INIT("gpt2", NULL, &gpt2_clk), |
678 | /* clock derived from pll3 clk */ | 679 | /* clock derived from pll3 clk */ |
679 | { .dev_id = "designware_udc", .clk = &usbd_clk}, | 680 | CLKDEV_INIT("designware_udc", NULL, &usbd_clk), |
680 | { .con_id = "usbh_clk", .clk = &usbh_clk}, | 681 | CLKDEV_INIT(NULL, "usbh_clk", &usbh_clk), |
681 | /* clock derived from ahb clk */ | 682 | /* clock derived from ahb clk */ |
682 | { .con_id = "apb_clk", .clk = &apb_clk}, | 683 | CLKDEV_INIT(NULL, "apb_clk", &apb_clk), |
683 | { .dev_id = "i2c_designware.0", .clk = &i2c_clk}, | 684 | CLKDEV_INIT("i2c_designware.0", NULL, &i2c_clk), |
684 | { .dev_id = "dma", .clk = &dma_clk}, | 685 | CLKDEV_INIT("dma", NULL, &dma_clk), |
685 | { .dev_id = "jpeg", .clk = &jpeg_clk}, | 686 | CLKDEV_INIT("jpeg", NULL, &jpeg_clk), |
686 | { .dev_id = "gmac", .clk = &gmac_clk}, | 687 | CLKDEV_INIT("gmac", NULL, &gmac_clk), |
687 | { .dev_id = "smi", .clk = &smi_clk}, | 688 | CLKDEV_INIT("smi", NULL, &smi_clk), |
688 | { .dev_id = "c3", .clk = &c3_clk}, | 689 | CLKDEV_INIT("c3", NULL, &c3_clk), |
689 | /* clock derived from apb clk */ | 690 | /* clock derived from apb clk */ |
690 | { .dev_id = "adc", .clk = &adc_clk}, | 691 | CLKDEV_INIT("adc", NULL, &adc_clk), |
691 | { .dev_id = "ssp-pl022.0", .clk = &ssp0_clk}, | 692 | CLKDEV_INIT("ssp-pl022.0", NULL, &ssp0_clk), |
692 | { .dev_id = "gpio", .clk = &gpio_clk}, | 693 | CLKDEV_INIT("gpio", NULL, &gpio_clk), |
693 | }; | 694 | }; |
694 | 695 | ||
695 | /* array of all spear 300 clock lookups */ | 696 | /* array of all spear 300 clock lookups */ |
696 | #ifdef CONFIG_MACH_SPEAR300 | 697 | #ifdef CONFIG_MACH_SPEAR300 |
697 | static struct clk_lookup spear300_clk_lookups[] = { | 698 | static struct clk_lookup spear300_clk_lookups[] = { |
698 | { .dev_id = "clcd", .clk = &clcd_clk}, | 699 | CLKDEV_INIT("clcd", NULL, &clcd_clk), |
699 | { .con_id = "fsmc", .clk = &fsmc_clk}, | 700 | CLKDEV_INIT("fsmc", NULL, &fsmc_clk), |
700 | { .dev_id = "gpio1", .clk = &gpio1_clk}, | 701 | CLKDEV_INIT("gpio1", NULL, &gpio1_clk), |
701 | { .dev_id = "keyboard", .clk = &kbd_clk}, | 702 | CLKDEV_INIT("keyboard", NULL, &kbd_clk), |
702 | { .dev_id = "sdhci", .clk = &sdhci_clk}, | 703 | CLKDEV_INIT("sdhci", NULL, &sdhci_clk), |
703 | }; | 704 | }; |
704 | #endif | 705 | #endif |
705 | 706 | ||
706 | /* array of all spear 310 clock lookups */ | 707 | /* array of all spear 310 clock lookups */ |
707 | #ifdef CONFIG_MACH_SPEAR310 | 708 | #ifdef CONFIG_MACH_SPEAR310 |
708 | static struct clk_lookup spear310_clk_lookups[] = { | 709 | static struct clk_lookup spear310_clk_lookups[] = { |
709 | { .con_id = "fsmc", .clk = &fsmc_clk}, | 710 | CLKDEV_INIT("fsmc", NULL, &fsmc_clk), |
710 | { .con_id = "emi", .clk = &emi_clk}, | 711 | CLKDEV_INIT(NULL, "emi", &emi_clk), |
711 | { .dev_id = "uart1", .clk = &uart1_clk}, | 712 | CLKDEV_INIT("uart1", NULL, &uart1_clk), |
712 | { .dev_id = "uart2", .clk = &uart2_clk}, | 713 | CLKDEV_INIT("uart2", NULL, &uart2_clk), |
713 | { .dev_id = "uart3", .clk = &uart3_clk}, | 714 | CLKDEV_INIT("uart3", NULL, &uart3_clk), |
714 | { .dev_id = "uart4", .clk = &uart4_clk}, | 715 | CLKDEV_INIT("uart4", NULL, &uart4_clk), |
715 | { .dev_id = "uart5", .clk = &uart5_clk}, | 716 | CLKDEV_INIT("uart5", NULL, &uart5_clk), |
716 | }; | 717 | }; |
717 | #endif | 718 | #endif |
718 | 719 | ||
719 | /* array of all spear 320 clock lookups */ | 720 | /* array of all spear 320 clock lookups */ |
720 | #ifdef CONFIG_MACH_SPEAR320 | 721 | #ifdef CONFIG_MACH_SPEAR320 |
721 | static struct clk_lookup spear320_clk_lookups[] = { | 722 | static struct clk_lookup spear320_clk_lookups[] = { |
722 | { .dev_id = "clcd", .clk = &clcd_clk}, | 723 | CLKDEV_INIT("clcd", NULL, &clcd_clk), |
723 | { .con_id = "fsmc", .clk = &fsmc_clk}, | 724 | CLKDEV_INIT("fsmc", NULL, &fsmc_clk), |
724 | { .dev_id = "i2c_designware.1", .clk = &i2c1_clk}, | 725 | CLKDEV_INIT("i2c_designware.1", NULL, &i2c1_clk), |
725 | { .con_id = "emi", .clk = &emi_clk}, | 726 | CLKDEV_INIT(NULL, "emi", &emi_clk), |
726 | { .dev_id = "pwm", .clk = &pwm_clk}, | 727 | CLKDEV_INIT("pwm", NULL, &pwm_clk), |
727 | { .dev_id = "sdhci", .clk = &sdhci_clk}, | 728 | CLKDEV_INIT("sdhci", NULL, &sdhci_clk), |
728 | { .dev_id = "c_can_platform.0", .clk = &can0_clk}, | 729 | CLKDEV_INIT("c_can_platform.0", NULL, &can0_clk), |
729 | { .dev_id = "c_can_platform.1", .clk = &can1_clk}, | 730 | CLKDEV_INIT("c_can_platform.1", NULL, &can1_clk), |
730 | { .dev_id = "ssp-pl022.1", .clk = &ssp1_clk}, | 731 | CLKDEV_INIT("ssp-pl022.1", NULL, &ssp1_clk), |
731 | { .dev_id = "ssp-pl022.2", .clk = &ssp2_clk}, | 732 | CLKDEV_INIT("ssp-pl022.2", NULL, &ssp2_clk), |
732 | { .dev_id = "uart1", .clk = &uart1_clk}, | 733 | CLKDEV_INIT("uart1", NULL, &uart1_clk), |
733 | { .dev_id = "uart2", .clk = &uart2_clk}, | 734 | CLKDEV_INIT("uart2", NULL, &uart2_clk), |
734 | }; | 735 | }; |
735 | #endif | 736 | #endif |
736 | 737 | ||
diff --git a/arch/arm/mach-spear6xx/clock.c b/arch/arm/mach-spear6xx/clock.c index f0518049c12e..5a469800b142 100644 --- a/arch/arm/mach-spear6xx/clock.c +++ b/arch/arm/mach-spear6xx/clock.c | |||
@@ -623,53 +623,53 @@ static struct clk dummy_apb_pclk; | |||
623 | 623 | ||
624 | /* array of all spear 6xx clock lookups */ | 624 | /* array of all spear 6xx clock lookups */ |
625 | static struct clk_lookup spear_clk_lookups[] = { | 625 | static struct clk_lookup spear_clk_lookups[] = { |
626 | { .con_id = "apb_pclk", .clk = &dummy_apb_pclk}, | 626 | CLKDEV_INIT(NULL, "apb_pclk", &dummy_apb_pclk), |
627 | /* root clks */ | 627 | /* root clks */ |
628 | { .con_id = "osc_32k_clk", .clk = &osc_32k_clk}, | 628 | CLKDEV_INIT(NULL, "osc_32k_clk", &osc_32k_clk), |
629 | { .con_id = "osc_30m_clk", .clk = &osc_30m_clk}, | 629 | CLKDEV_INIT(NULL, "osc_30m_clk", &osc_30m_clk), |
630 | /* clock derived from 32 KHz os clk */ | 630 | /* clock derived from 32 KHz os clk */ |
631 | { .dev_id = "rtc-spear", .clk = &rtc_clk}, | 631 | CLKDEV_INIT("rtc-spear", NULL, &rtc_clk), |
632 | /* clock derived from 30 MHz os clk */ | 632 | /* clock derived from 30 MHz os clk */ |
633 | { .con_id = "pll1_clk", .clk = &pll1_clk}, | 633 | CLKDEV_INIT(NULL, "pll1_clk", &pll1_clk), |
634 | { .con_id = "pll3_48m_clk", .clk = &pll3_48m_clk}, | 634 | CLKDEV_INIT(NULL, "pll3_48m_clk", &pll3_48m_clk), |
635 | { .dev_id = "wdt", .clk = &wdt_clk}, | 635 | CLKDEV_INIT("wdt", NULL, &wdt_clk), |
636 | /* clock derived from pll1 clk */ | 636 | /* clock derived from pll1 clk */ |
637 | { .con_id = "cpu_clk", .clk = &cpu_clk}, | 637 | CLKDEV_INIT(NULL, "cpu_clk", &cpu_clk), |
638 | { .con_id = "ahb_clk", .clk = &ahb_clk}, | 638 | CLKDEV_INIT(NULL, "ahb_clk", &ahb_clk), |
639 | { .con_id = "uart_synth_clk", .clk = &uart_synth_clk}, | 639 | CLKDEV_INIT(NULL, "uart_synth_clk", &uart_synth_clk), |
640 | { .con_id = "firda_synth_clk", .clk = &firda_synth_clk}, | 640 | CLKDEV_INIT(NULL, "firda_synth_clk", &firda_synth_clk), |
641 | { .con_id = "clcd_synth_clk", .clk = &clcd_synth_clk}, | 641 | CLKDEV_INIT(NULL, "clcd_synth_clk", &clcd_synth_clk), |
642 | { .con_id = "gpt0_synth_clk", .clk = &gpt0_synth_clk}, | 642 | CLKDEV_INIT(NULL, "gpt0_synth_clk", &gpt0_synth_clk), |
643 | { .con_id = "gpt2_synth_clk", .clk = &gpt2_synth_clk}, | 643 | CLKDEV_INIT(NULL, "gpt2_synth_clk", &gpt2_synth_clk), |
644 | { .con_id = "gpt3_synth_clk", .clk = &gpt3_synth_clk}, | 644 | CLKDEV_INIT(NULL, "gpt3_synth_clk", &gpt3_synth_clk), |
645 | { .dev_id = "d0000000.serial", .clk = &uart0_clk}, | 645 | CLKDEV_INIT("d0000000.serial", NULL, &uart0_clk), |
646 | { .dev_id = "d0080000.serial", .clk = &uart1_clk}, | 646 | CLKDEV_INIT("d0080000.serial", NULL, &uart1_clk), |
647 | { .dev_id = "firda", .clk = &firda_clk}, | 647 | CLKDEV_INIT("firda", NULL, &firda_clk), |
648 | { .dev_id = "clcd", .clk = &clcd_clk}, | 648 | CLKDEV_INIT("clcd", NULL, &clcd_clk), |
649 | { .dev_id = "gpt0", .clk = &gpt0_clk}, | 649 | CLKDEV_INIT("gpt0", NULL, &gpt0_clk), |
650 | { .dev_id = "gpt1", .clk = &gpt1_clk}, | 650 | CLKDEV_INIT("gpt1", NULL, &gpt1_clk), |
651 | { .dev_id = "gpt2", .clk = &gpt2_clk}, | 651 | CLKDEV_INIT("gpt2", NULL, &gpt2_clk), |
652 | { .dev_id = "gpt3", .clk = &gpt3_clk}, | 652 | CLKDEV_INIT("gpt3", NULL, &gpt3_clk), |
653 | /* clock derived from pll3 clk */ | 653 | /* clock derived from pll3 clk */ |
654 | { .dev_id = "designware_udc", .clk = &usbd_clk}, | 654 | CLKDEV_INIT("designware_udc", NULL, &usbd_clk), |
655 | { .con_id = "usbh.0_clk", .clk = &usbh0_clk}, | 655 | CLKDEV_INIT(NULL, "usbh.0_clk", &usbh0_clk), |
656 | { .con_id = "usbh.1_clk", .clk = &usbh1_clk}, | 656 | CLKDEV_INIT(NULL, "usbh.1_clk", &usbh1_clk), |
657 | /* clock derived from ahb clk */ | 657 | /* clock derived from ahb clk */ |
658 | { .con_id = "apb_clk", .clk = &apb_clk}, | 658 | CLKDEV_INIT(NULL, "apb_clk", &apb_clk), |
659 | { .dev_id = "d0200000.i2c", .clk = &i2c_clk}, | 659 | CLKDEV_INIT("d0200000.i2c", NULL, &i2c_clk), |
660 | { .dev_id = "dma", .clk = &dma_clk}, | 660 | CLKDEV_INIT("dma", NULL, &dma_clk), |
661 | { .dev_id = "jpeg", .clk = &jpeg_clk}, | 661 | CLKDEV_INIT("jpeg", NULL, &jpeg_clk), |
662 | { .dev_id = "gmac", .clk = &gmac_clk}, | 662 | CLKDEV_INIT("gmac", NULL, &gmac_clk), |
663 | { .dev_id = "fc000000.flash", .clk = &smi_clk}, | 663 | CLKDEV_INIT("fc000000.flash", NULL, &smi_clk), |
664 | { .dev_id = "d1800000.flash", .clk = &fsmc_clk}, | 664 | CLKDEV_INIT("d1800000.flash", NULL, &fsmc_clk), |
665 | /* clock derived from apb clk */ | 665 | /* clock derived from apb clk */ |
666 | { .dev_id = "adc", .clk = &adc_clk}, | 666 | CLKDEV_INIT("adc", NULL, &adc_clk), |
667 | { .dev_id = "ssp-pl022.0", .clk = &ssp0_clk}, | 667 | CLKDEV_INIT("ssp-pl022.0", NULL, &ssp0_clk), |
668 | { .dev_id = "ssp-pl022.1", .clk = &ssp1_clk}, | 668 | CLKDEV_INIT("ssp-pl022.1", NULL, &ssp1_clk), |
669 | { .dev_id = "ssp-pl022.2", .clk = &ssp2_clk}, | 669 | CLKDEV_INIT("ssp-pl022.2", NULL, &ssp2_clk), |
670 | { .dev_id = "f0100000.gpio", .clk = &gpio0_clk}, | 670 | CLKDEV_INIT("f0100000.gpio", NULL, &gpio0_clk), |
671 | { .dev_id = "fc980000.gpio", .clk = &gpio1_clk}, | 671 | CLKDEV_INIT("fc980000.gpio", NULL, &gpio1_clk), |
672 | { .dev_id = "d8100000.gpio", .clk = &gpio2_clk}, | 672 | CLKDEV_INIT("d8100000.gpio", NULL, &gpio2_clk), |
673 | }; | 673 | }; |
674 | 674 | ||
675 | void __init spear6xx_clk_init(void) | 675 | void __init spear6xx_clk_init(void) |