devices.c (8990c1bc4be46473ad19bf2fa612ca57286f3df4) | devices.c (a4553358d94b4a1f3e6f24aacfd076022ac14855) |
---|---|
1#include <linux/module.h> 2#include <linux/kernel.h> 3#include <linux/init.h> 4#include <linux/platform_device.h> 5#include <linux/dma-mapping.h> 6 7#include <asm/pmu.h> 8#include <mach/udc.h> --- 328 unchanged lines hidden (view full) --- 337struct platform_device pxa27x_device_i2c_power = { 338 .name = "pxa2xx-i2c", 339 .id = 1, 340 .resource = pxa27x_resources_i2c_power, 341 .num_resources = ARRAY_SIZE(pxa27x_resources_i2c_power), 342}; 343#endif 344 | 1#include <linux/module.h> 2#include <linux/kernel.h> 3#include <linux/init.h> 4#include <linux/platform_device.h> 5#include <linux/dma-mapping.h> 6 7#include <asm/pmu.h> 8#include <mach/udc.h> --- 328 unchanged lines hidden (view full) --- 337struct platform_device pxa27x_device_i2c_power = { 338 .name = "pxa2xx-i2c", 339 .id = 1, 340 .resource = pxa27x_resources_i2c_power, 341 .num_resources = ARRAY_SIZE(pxa27x_resources_i2c_power), 342}; 343#endif 344 |
345#ifdef CONFIG_PXA3xx 346static struct resource pxa3xx_resources_i2c_power[] = { 347 { 348 .start = 0x40f500c0, 349 .end = 0x40f500d3, 350 .flags = IORESOURCE_MEM, 351 }, { 352 .start = IRQ_PWRI2C, 353 .end = IRQ_PWRI2C, 354 .flags = IORESOURCE_IRQ, 355 }, 356}; 357 358struct platform_device pxa3xx_device_i2c_power = { 359 .name = "pxa3xx-pwri2c", 360 .id = 1, 361 .resource = pxa3xx_resources_i2c_power, 362 .num_resources = ARRAY_SIZE(pxa3xx_resources_i2c_power), 363}; 364#endif 365 | |
366static struct resource pxai2s_resources[] = { 367 { 368 .start = 0x40400000, 369 .end = 0x40400083, 370 .flags = IORESOURCE_MEM, 371 }, { 372 .start = IRQ_I2S, 373 .end = IRQ_I2S, --- 254 unchanged lines hidden (view full) --- 628 .coherent_dma_mask = DMA_BIT_MASK(32), 629 }, 630 .resource = pxa25x_resource_assp, 631 .num_resources = ARRAY_SIZE(pxa25x_resource_assp), 632}; 633#endif /* CONFIG_PXA25x */ 634 635#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) | 345static struct resource pxai2s_resources[] = { 346 { 347 .start = 0x40400000, 348 .end = 0x40400083, 349 .flags = IORESOURCE_MEM, 350 }, { 351 .start = IRQ_I2S, 352 .end = IRQ_I2S, --- 254 unchanged lines hidden (view full) --- 607 .coherent_dma_mask = DMA_BIT_MASK(32), 608 }, 609 .resource = pxa25x_resource_assp, 610 .num_resources = ARRAY_SIZE(pxa25x_resource_assp), 611}; 612#endif /* CONFIG_PXA25x */ 613 614#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) |
636 637static struct resource pxa27x_resource_keypad[] = { | 615static struct resource pxa27x_resource_camera[] = { |
638 [0] = { | 616 [0] = { |
639 .start = 0x41500000, 640 .end = 0x4150004c, | 617 .start = 0x50000000, 618 .end = 0x50000fff, |
641 .flags = IORESOURCE_MEM, 642 }, 643 [1] = { | 619 .flags = IORESOURCE_MEM, 620 }, 621 [1] = { |
644 .start = IRQ_KEYPAD, 645 .end = IRQ_KEYPAD, | 622 .start = IRQ_CAMERA, 623 .end = IRQ_CAMERA, |
646 .flags = IORESOURCE_IRQ, 647 }, 648}; 649 | 624 .flags = IORESOURCE_IRQ, 625 }, 626}; 627 |
650struct platform_device pxa27x_device_keypad = { 651 .name = "pxa27x-keypad", 652 .id = -1, 653 .resource = pxa27x_resource_keypad, 654 .num_resources = ARRAY_SIZE(pxa27x_resource_keypad), | 628static u64 pxa27x_dma_mask_camera = DMA_BIT_MASK(32); 629 630static struct platform_device pxa27x_device_camera = { 631 .name = "pxa27x-camera", 632 .id = 0, /* This is used to put cameras on this interface */ 633 .dev = { 634 .dma_mask = &pxa27x_dma_mask_camera, 635 .coherent_dma_mask = 0xffffffff, 636 }, 637 .num_resources = ARRAY_SIZE(pxa27x_resource_camera), 638 .resource = pxa27x_resource_camera, |
655}; 656 | 639}; 640 |
657void __init pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info) | 641void __init pxa_set_camera_info(struct pxacamera_platform_data *info) |
658{ | 642{ |
659 pxa_register_device(&pxa27x_device_keypad, info); | 643 pxa_register_device(&pxa27x_device_camera, info); |
660} 661 662static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32); 663 664static struct resource pxa27x_resource_ohci[] = { 665 [0] = { 666 .start = 0x4C000000, 667 .end = 0x4C00ff6f, --- 16 unchanged lines hidden (view full) --- 684 .num_resources = ARRAY_SIZE(pxa27x_resource_ohci), 685 .resource = pxa27x_resource_ohci, 686}; 687 688void __init pxa_set_ohci_info(struct pxaohci_platform_data *info) 689{ 690 pxa_register_device(&pxa27x_device_ohci, info); 691} | 644} 645 646static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32); 647 648static struct resource pxa27x_resource_ohci[] = { 649 [0] = { 650 .start = 0x4C000000, 651 .end = 0x4C00ff6f, --- 16 unchanged lines hidden (view full) --- 668 .num_resources = ARRAY_SIZE(pxa27x_resource_ohci), 669 .resource = pxa27x_resource_ohci, 670}; 671 672void __init pxa_set_ohci_info(struct pxaohci_platform_data *info) 673{ 674 pxa_register_device(&pxa27x_device_ohci, info); 675} |
676#endif /* CONFIG_PXA27x || CONFIG_PXA3xx */ |
|
692 | 677 |
678#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x) 679static struct resource pxa27x_resource_keypad[] = { 680 [0] = { 681 .start = 0x41500000, 682 .end = 0x4150004c, 683 .flags = IORESOURCE_MEM, 684 }, 685 [1] = { 686 .start = IRQ_KEYPAD, 687 .end = IRQ_KEYPAD, 688 .flags = IORESOURCE_IRQ, 689 }, 690}; 691 692struct platform_device pxa27x_device_keypad = { 693 .name = "pxa27x-keypad", 694 .id = -1, 695 .resource = pxa27x_resource_keypad, 696 .num_resources = ARRAY_SIZE(pxa27x_resource_keypad), 697}; 698 699void __init pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info) 700{ 701 pxa_register_device(&pxa27x_device_keypad, info); 702} 703 |
|
693static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32); 694 695static struct resource pxa27x_resource_ssp1[] = { 696 [0] = { 697 .start = 0x41000000, 698 .end = 0x4100003f, 699 .flags = IORESOURCE_MEM, 700 }, --- 127 unchanged lines hidden (view full) --- 828}; 829 830struct platform_device pxa27x_device_pwm1 = { 831 .name = "pxa27x-pwm", 832 .id = 1, 833 .resource = pxa27x_resource_pwm1, 834 .num_resources = ARRAY_SIZE(pxa27x_resource_pwm1), 835}; | 704static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32); 705 706static struct resource pxa27x_resource_ssp1[] = { 707 [0] = { 708 .start = 0x41000000, 709 .end = 0x4100003f, 710 .flags = IORESOURCE_MEM, 711 }, --- 127 unchanged lines hidden (view full) --- 839}; 840 841struct platform_device pxa27x_device_pwm1 = { 842 .name = "pxa27x-pwm", 843 .id = 1, 844 .resource = pxa27x_resource_pwm1, 845 .num_resources = ARRAY_SIZE(pxa27x_resource_pwm1), 846}; |
847#endif /* CONFIG_PXA27x || CONFIG_PXA3xx || CONFIG_PXA95x*/ |
|
836 | 848 |
837static struct resource pxa27x_resource_camera[] = { 838 [0] = { 839 .start = 0x50000000, 840 .end = 0x50000fff, 841 .flags = IORESOURCE_MEM, 842 }, 843 [1] = { 844 .start = IRQ_CAMERA, 845 .end = IRQ_CAMERA, 846 .flags = IORESOURCE_IRQ, 847 }, 848}; 849 850static u64 pxa27x_dma_mask_camera = DMA_BIT_MASK(32); 851 852static struct platform_device pxa27x_device_camera = { 853 .name = "pxa27x-camera", 854 .id = 0, /* This is used to put cameras on this interface */ 855 .dev = { 856 .dma_mask = &pxa27x_dma_mask_camera, 857 .coherent_dma_mask = 0xffffffff, 858 }, 859 .num_resources = ARRAY_SIZE(pxa27x_resource_camera), 860 .resource = pxa27x_resource_camera, 861}; 862 863void __init pxa_set_camera_info(struct pxacamera_platform_data *info) 864{ 865 pxa_register_device(&pxa27x_device_camera, info); 866} 867#endif /* CONFIG_PXA27x || CONFIG_PXA3xx */ 868 | |
869#ifdef CONFIG_PXA3xx | 849#ifdef CONFIG_PXA3xx |
870static u64 pxa3xx_ssp4_dma_mask = DMA_BIT_MASK(32); 871 872static struct resource pxa3xx_resource_ssp4[] = { 873 [0] = { 874 .start = 0x41a00000, 875 .end = 0x41a0003f, 876 .flags = IORESOURCE_MEM, 877 }, 878 [1] = { 879 .start = IRQ_SSP4, 880 .end = IRQ_SSP4, 881 .flags = IORESOURCE_IRQ, 882 }, 883 [2] = { 884 /* DRCMR for RX */ 885 .start = 2, 886 .end = 2, 887 .flags = IORESOURCE_DMA, 888 }, 889 [3] = { 890 /* DRCMR for TX */ 891 .start = 3, 892 .end = 3, 893 .flags = IORESOURCE_DMA, 894 }, 895}; 896 897struct platform_device pxa3xx_device_ssp4 = { 898 /* PXA3xx SSP is basically equivalent to PXA27x */ 899 .name = "pxa27x-ssp", 900 .id = 3, 901 .dev = { 902 .dma_mask = &pxa3xx_ssp4_dma_mask, 903 .coherent_dma_mask = DMA_BIT_MASK(32), 904 }, 905 .resource = pxa3xx_resource_ssp4, 906 .num_resources = ARRAY_SIZE(pxa3xx_resource_ssp4), 907}; 908 | |
909static struct resource pxa3xx_resources_mci2[] = { 910 [0] = { 911 .start = 0x42000000, 912 .end = 0x42000fff, 913 .flags = IORESOURCE_MEM, 914 }, 915 [1] = { 916 .start = IRQ_MMC2, --- 62 unchanged lines hidden (view full) --- 979 .resource = pxa3xx_resources_mci3, 980}; 981 982void __init pxa3xx_set_mci3_info(struct pxamci_platform_data *info) 983{ 984 pxa_register_device(&pxa3xx_device_mci3, info); 985} 986 | 850static struct resource pxa3xx_resources_mci2[] = { 851 [0] = { 852 .start = 0x42000000, 853 .end = 0x42000fff, 854 .flags = IORESOURCE_MEM, 855 }, 856 [1] = { 857 .start = IRQ_MMC2, --- 62 unchanged lines hidden (view full) --- 920 .resource = pxa3xx_resources_mci3, 921}; 922 923void __init pxa3xx_set_mci3_info(struct pxamci_platform_data *info) 924{ 925 pxa_register_device(&pxa3xx_device_mci3, info); 926} 927 |
928static struct resource pxa3xx_resources_gcu[] = { 929 { 930 .start = 0x54000000, 931 .end = 0x54000fff, 932 .flags = IORESOURCE_MEM, 933 }, 934 { 935 .start = IRQ_GCU, 936 .end = IRQ_GCU, 937 .flags = IORESOURCE_IRQ, 938 }, 939}; 940 941static u64 pxa3xx_gcu_dmamask = DMA_BIT_MASK(32); 942 943struct platform_device pxa3xx_device_gcu = { 944 .name = "pxa3xx-gcu", 945 .id = -1, 946 .num_resources = ARRAY_SIZE(pxa3xx_resources_gcu), 947 .resource = pxa3xx_resources_gcu, 948 .dev = { 949 .dma_mask = &pxa3xx_gcu_dmamask, 950 .coherent_dma_mask = 0xffffffff, 951 }, 952}; 953 954#endif /* CONFIG_PXA3xx */ 955 956#if defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x) 957static struct resource pxa3xx_resources_i2c_power[] = { 958 { 959 .start = 0x40f500c0, 960 .end = 0x40f500d3, 961 .flags = IORESOURCE_MEM, 962 }, { 963 .start = IRQ_PWRI2C, 964 .end = IRQ_PWRI2C, 965 .flags = IORESOURCE_IRQ, 966 }, 967}; 968 969struct platform_device pxa3xx_device_i2c_power = { 970 .name = "pxa3xx-pwri2c", 971 .id = 1, 972 .resource = pxa3xx_resources_i2c_power, 973 .num_resources = ARRAY_SIZE(pxa3xx_resources_i2c_power), 974}; 975 |
|
987static struct resource pxa3xx_resources_nand[] = { 988 [0] = { 989 .start = 0x43100000, 990 .end = 0x43100053, 991 .flags = IORESOURCE_MEM, 992 }, 993 [1] = { 994 .start = IRQ_NAND, --- 27 unchanged lines hidden (view full) --- 1022 .resource = pxa3xx_resources_nand, 1023}; 1024 1025void __init pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info) 1026{ 1027 pxa_register_device(&pxa3xx_device_nand, info); 1028} 1029 | 976static struct resource pxa3xx_resources_nand[] = { 977 [0] = { 978 .start = 0x43100000, 979 .end = 0x43100053, 980 .flags = IORESOURCE_MEM, 981 }, 982 [1] = { 983 .start = IRQ_NAND, --- 27 unchanged lines hidden (view full) --- 1011 .resource = pxa3xx_resources_nand, 1012}; 1013 1014void __init pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info) 1015{ 1016 pxa_register_device(&pxa3xx_device_nand, info); 1017} 1018 |
1030static struct resource pxa3xx_resources_gcu[] = { 1031 { 1032 .start = 0x54000000, 1033 .end = 0x54000fff, | 1019static u64 pxa3xx_ssp4_dma_mask = DMA_BIT_MASK(32); 1020 1021static struct resource pxa3xx_resource_ssp4[] = { 1022 [0] = { 1023 .start = 0x41a00000, 1024 .end = 0x41a0003f, |
1034 .flags = IORESOURCE_MEM, 1035 }, | 1025 .flags = IORESOURCE_MEM, 1026 }, |
1036 { 1037 .start = IRQ_GCU, 1038 .end = IRQ_GCU, | 1027 [1] = { 1028 .start = IRQ_SSP4, 1029 .end = IRQ_SSP4, |
1039 .flags = IORESOURCE_IRQ, 1040 }, | 1030 .flags = IORESOURCE_IRQ, 1031 }, |
1032 [2] = { 1033 /* DRCMR for RX */ 1034 .start = 2, 1035 .end = 2, 1036 .flags = IORESOURCE_DMA, 1037 }, 1038 [3] = { 1039 /* DRCMR for TX */ 1040 .start = 3, 1041 .end = 3, 1042 .flags = IORESOURCE_DMA, 1043 }, |
|
1041}; 1042 | 1044}; 1045 |
1043static u64 pxa3xx_gcu_dmamask = DMA_BIT_MASK(32); 1044 1045struct platform_device pxa3xx_device_gcu = { 1046 .name = "pxa3xx-gcu", 1047 .id = -1, 1048 .num_resources = ARRAY_SIZE(pxa3xx_resources_gcu), 1049 .resource = pxa3xx_resources_gcu, | 1046struct platform_device pxa3xx_device_ssp4 = { 1047 /* PXA3xx SSP is basically equivalent to PXA27x */ 1048 .name = "pxa27x-ssp", 1049 .id = 3, |
1050 .dev = { | 1050 .dev = { |
1051 .dma_mask = &pxa3xx_gcu_dmamask, 1052 .coherent_dma_mask = 0xffffffff, | 1051 .dma_mask = &pxa3xx_ssp4_dma_mask, 1052 .coherent_dma_mask = DMA_BIT_MASK(32), |
1053 }, | 1053 }, |
1054 .resource = pxa3xx_resource_ssp4, 1055 .num_resources = ARRAY_SIZE(pxa3xx_resource_ssp4), |
|
1054}; | 1056}; |
1057#endif /* CONFIG_PXA3xx || CONFIG_PXA95x */ |
|
1055 | 1058 |
1056#endif /* CONFIG_PXA3xx */ 1057 | |
1058/* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1. 1059 * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */ 1060void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info) 1061{ 1062 struct platform_device *pd; 1063 1064 pd = platform_device_alloc("pxa2xx-spi", id); 1065 if (pd == NULL) { 1066 printk(KERN_ERR "pxa2xx-spi: failed to allocate device id %d\n", 1067 id); 1068 return; 1069 } 1070 1071 pd->dev.platform_data = info; 1072 platform_device_add(pd); 1073} | 1059/* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1. 1060 * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */ 1061void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info) 1062{ 1063 struct platform_device *pd; 1064 1065 pd = platform_device_alloc("pxa2xx-spi", id); 1066 if (pd == NULL) { 1067 printk(KERN_ERR "pxa2xx-spi: failed to allocate device id %d\n", 1068 id); 1069 return; 1070 } 1071 1072 pd->dev.platform_data = info; 1073 platform_device_add(pd); 1074} |