| 
									
										
										
										
											2008-09-10 14:00:53 -07:00
										 |  |  | /* linux/arch/arm/mach-msm/devices.c
 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Copyright (C) 2008 Google, Inc. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This software is licensed under the terms of the GNU General Public | 
					
						
							|  |  |  |  * License version 2, as published by the Free Software Foundation, and | 
					
						
							|  |  |  |  * may be copied, distributed, and modified under those terms. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  |  * GNU General Public License for more details. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <linux/kernel.h>
 | 
					
						
							|  |  |  | #include <linux/platform_device.h>
 | 
					
						
							| 
									
										
										
										
											2011-02-23 09:37:42 -08:00
										 |  |  | #include <linux/clkdev.h>
 | 
					
						
							| 
									
										
										
										
											2008-09-10 14:00:53 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
											  
											
												[ARM] fix AT91, davinci, h720x, ks8695, msm, mx2, mx3, netx, omap1, omap2, pxa, s3c
arch/arm/mach-at91/at91cap9.c:337: error: 'NR_AIC_IRQS' undeclared here (not in a function)
arch/arm/mach-at91/at91rm9200.c:301: error: 'NR_AIC_IRQS' undeclared here (not in a function)
arch/arm/mach-at91/at91sam9260.c:351: error: 'NR_AIC_IRQS' undeclared here (not in a function)
arch/arm/mach-at91/at91sam9261.c:287: error: 'NR_AIC_IRQS' undeclared here (not in a function)
arch/arm/mach-at91/at91sam9263.c:312: error: 'NR_AIC_IRQS' undeclared here (not in a function)
arch/arm/mach-at91/at91sam9rl.c:304: error: 'NR_AIC_IRQS' undeclared here (not in a function)
arch/arm/mach-h720x/h7202-eval.c:38: error: implicit declaration of function 'IRQ_CHAINED_GPIOB'
arch/arm/mach-ks8695/devices.c:46: error: 'KS8695_IRQ_WAN_RX_STATUS' undeclared here (not in a function)
arch/arm/mach-msm/devices.c:28: error: 'INT_UART1' undeclared here (not in a function)
arch/arm/mach-mx2/devices.c:233: error: 'MXC_GPIO_IRQ_START' undeclared here (not in a function)
arch/arm/mach-mx3/devices.c:128: error: 'MXC_GPIO_IRQ_START' undeclared here (not in a function)
arch/arm/mach-omap1/mcbsp.c:140: error: 'INT_730_McBSP1RX' undeclared here (not in a function)
arch/arm/mach-omap1/mcbsp.c:165: error: 'INT_McBSP1RX' undeclared here (not in a function)
arch/arm/mach-omap1/mcbsp.c:200: error: 'INT_McBSP1RX' undeclared here (not in a function)
arch/arm/mach-omap2/board-apollon.c:286: error: implicit declaration of function 'omap_set_gpio_direction'
arch/arm/mach-omap2/mcbsp.c:154: error: 'INT_24XX_MCBSP1_IRQ_RX' undeclared here (not in a function)
arch/arm/mach-omap2/mcbsp.c:181: error: 'INT_24XX_MCBSP1_IRQ_RX' undeclared here (not in a function)
arch/arm/mach-pxa/e350.c:36: error: 'IRQ_BOARD_START' undeclared here (not in a function)
arch/arm/plat-s3c/dev-i2c0.c:32: error: 'IRQ_IIC' undeclared here (not in a function)
...
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
											
										 
											2009-01-08 10:01:47 +00:00
										 |  |  | #include <mach/irqs.h>
 | 
					
						
							| 
									
										
										
										
											2008-09-10 14:00:53 -07:00
										 |  |  | #include <mach/msm_iomap.h>
 | 
					
						
							|  |  |  | #include "devices.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <asm/mach/flash.h>
 | 
					
						
							|  |  |  | #include <linux/mtd/nand.h>
 | 
					
						
							|  |  |  | #include <linux/mtd/partitions.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-12 13:43:28 -07:00
										 |  |  | #include "clock.h"
 | 
					
						
							| 
									
										
										
										
											2011-01-26 16:20:53 -08:00
										 |  |  | #include "clock-pcom.h"
 | 
					
						
							| 
									
										
										
										
											2012-08-24 15:14:41 +02:00
										 |  |  | #include <linux/platform_data/mmc-msm_sdcc.h>
 | 
					
						
							| 
									
										
										
										
											2008-11-10 16:30:27 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-04 15:08:27 -08:00
										 |  |  | static struct resource msm_gpio_resources[] = { | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= 32 + 0, | 
					
						
							|  |  |  | 		.end	= 32 + 0, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_IRQ, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= 32 + 1, | 
					
						
							|  |  |  | 		.end	= 32 + 1, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_IRQ, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= 0xa9200800, | 
					
						
							|  |  |  | 		.end	= 0xa9200800 + SZ_4K - 1, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_MEM, | 
					
						
							|  |  |  | 		.name  = "gpio1" | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= 0xa9300C00, | 
					
						
							|  |  |  | 		.end	= 0xa9300C00 + SZ_4K - 1, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_MEM, | 
					
						
							|  |  |  | 		.name  = "gpio2" | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct platform_device msm_device_gpio_7201 = { | 
					
						
							|  |  |  | 	.name	= "gpio-msm-7201", | 
					
						
							|  |  |  | 	.num_resources	= ARRAY_SIZE(msm_gpio_resources), | 
					
						
							|  |  |  | 	.resource	= msm_gpio_resources, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-09-10 14:00:53 -07:00
										 |  |  | static struct resource resources_uart1[] = { | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= INT_UART1, | 
					
						
							|  |  |  | 		.end	= INT_UART1, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_IRQ, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= MSM_UART1_PHYS, | 
					
						
							|  |  |  | 		.end	= MSM_UART1_PHYS + MSM_UART1_SIZE - 1, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_MEM, | 
					
						
							| 
									
										
										
										
											2011-01-17 20:33:32 -08:00
										 |  |  | 		.name  = "uart_resource" | 
					
						
							| 
									
										
										
										
											2008-09-10 14:00:53 -07:00
										 |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct resource resources_uart2[] = { | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= INT_UART2, | 
					
						
							|  |  |  | 		.end	= INT_UART2, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_IRQ, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= MSM_UART2_PHYS, | 
					
						
							|  |  |  | 		.end	= MSM_UART2_PHYS + MSM_UART2_SIZE - 1, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_MEM, | 
					
						
							| 
									
										
										
										
											2011-01-17 20:33:32 -08:00
										 |  |  | 		.name  = "uart_resource" | 
					
						
							| 
									
										
										
										
											2008-09-10 14:00:53 -07:00
										 |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct resource resources_uart3[] = { | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= INT_UART3, | 
					
						
							|  |  |  | 		.end	= INT_UART3, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_IRQ, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= MSM_UART3_PHYS, | 
					
						
							|  |  |  | 		.end	= MSM_UART3_PHYS + MSM_UART3_SIZE - 1, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_MEM, | 
					
						
							| 
									
										
										
										
											2011-01-17 20:33:32 -08:00
										 |  |  | 		.name  = "uart_resource" | 
					
						
							| 
									
										
										
										
											2008-09-10 14:00:53 -07:00
										 |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct platform_device msm_device_uart1 = { | 
					
						
							|  |  |  | 	.name	= "msm_serial", | 
					
						
							|  |  |  | 	.id	= 0, | 
					
						
							|  |  |  | 	.num_resources	= ARRAY_SIZE(resources_uart1), | 
					
						
							|  |  |  | 	.resource	= resources_uart1, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct platform_device msm_device_uart2 = { | 
					
						
							|  |  |  | 	.name	= "msm_serial", | 
					
						
							|  |  |  | 	.id	= 1, | 
					
						
							|  |  |  | 	.num_resources	= ARRAY_SIZE(resources_uart2), | 
					
						
							|  |  |  | 	.resource	= resources_uart2, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct platform_device msm_device_uart3 = { | 
					
						
							|  |  |  | 	.name	= "msm_serial", | 
					
						
							|  |  |  | 	.id	= 2, | 
					
						
							|  |  |  | 	.num_resources	= ARRAY_SIZE(resources_uart3), | 
					
						
							|  |  |  | 	.resource	= resources_uart3, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct resource resources_i2c[] = { | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= MSM_I2C_PHYS, | 
					
						
							|  |  |  | 		.end	= MSM_I2C_PHYS + MSM_I2C_SIZE - 1, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_MEM, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= INT_PWB_I2C, | 
					
						
							|  |  |  | 		.end	= INT_PWB_I2C, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_IRQ, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct platform_device msm_device_i2c = { | 
					
						
							|  |  |  | 	.name		= "msm_i2c", | 
					
						
							|  |  |  | 	.id		= 0, | 
					
						
							|  |  |  | 	.num_resources	= ARRAY_SIZE(resources_i2c), | 
					
						
							|  |  |  | 	.resource	= resources_i2c, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct resource resources_hsusb[] = { | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= MSM_HSUSB_PHYS, | 
					
						
							|  |  |  | 		.end	= MSM_HSUSB_PHYS + MSM_HSUSB_SIZE, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_MEM, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= INT_USB_HS, | 
					
						
							|  |  |  | 		.end	= INT_USB_HS, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_IRQ, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct platform_device msm_device_hsusb = { | 
					
						
							|  |  |  | 	.name		= "msm_hsusb", | 
					
						
							|  |  |  | 	.id		= -1, | 
					
						
							|  |  |  | 	.num_resources	= ARRAY_SIZE(resources_hsusb), | 
					
						
							|  |  |  | 	.resource	= resources_hsusb, | 
					
						
							|  |  |  | 	.dev		= { | 
					
						
							|  |  |  | 		.coherent_dma_mask	= 0xffffffff, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct flash_platform_data msm_nand_data = { | 
					
						
							|  |  |  | 	.parts		= NULL, | 
					
						
							|  |  |  | 	.nr_parts	= 0, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct resource resources_nand[] = { | 
					
						
							|  |  |  | 	[0] = { | 
					
						
							|  |  |  | 		.start	= 7, | 
					
						
							|  |  |  | 		.end	= 7, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_DMA, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct platform_device msm_device_nand = { | 
					
						
							|  |  |  | 	.name		= "msm_nand", | 
					
						
							|  |  |  | 	.id		= -1, | 
					
						
							|  |  |  | 	.num_resources	= ARRAY_SIZE(resources_nand), | 
					
						
							|  |  |  | 	.resource	= resources_nand, | 
					
						
							|  |  |  | 	.dev		= { | 
					
						
							|  |  |  | 		.platform_data	= &msm_nand_data, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct platform_device msm_device_smd = { | 
					
						
							|  |  |  | 	.name	= "msm_smd", | 
					
						
							|  |  |  | 	.id	= -1, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct resource resources_sdc1[] = { | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= MSM_SDC1_PHYS, | 
					
						
							|  |  |  | 		.end	= MSM_SDC1_PHYS + MSM_SDC1_SIZE - 1, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_MEM, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= INT_SDC1_0, | 
					
						
							| 
									
										
										
										
											2009-05-22 20:21:50 -07:00
										 |  |  | 		.end	= INT_SDC1_0, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_IRQ, | 
					
						
							|  |  |  | 		.name	= "cmd_irq", | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_IRQ | IORESOURCE_DISABLED, | 
					
						
							|  |  |  | 		.name	= "status_irq" | 
					
						
							| 
									
										
										
										
											2008-09-10 14:00:53 -07:00
										 |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= 8, | 
					
						
							|  |  |  | 		.end	= 8, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_DMA, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct resource resources_sdc2[] = { | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= MSM_SDC2_PHYS, | 
					
						
							|  |  |  | 		.end	= MSM_SDC2_PHYS + MSM_SDC2_SIZE - 1, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_MEM, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= INT_SDC2_0, | 
					
						
							| 
									
										
										
										
											2009-05-22 20:21:50 -07:00
										 |  |  | 		.end	= INT_SDC2_0, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_IRQ, | 
					
						
							|  |  |  | 		.name	= "cmd_irq", | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_IRQ | IORESOURCE_DISABLED, | 
					
						
							|  |  |  | 		.name	= "status_irq" | 
					
						
							| 
									
										
										
										
											2008-09-10 14:00:53 -07:00
										 |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= 8, | 
					
						
							|  |  |  | 		.end	= 8, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_DMA, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct resource resources_sdc3[] = { | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= MSM_SDC3_PHYS, | 
					
						
							|  |  |  | 		.end	= MSM_SDC3_PHYS + MSM_SDC3_SIZE - 1, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_MEM, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= INT_SDC3_0, | 
					
						
							| 
									
										
										
										
											2009-05-22 20:21:50 -07:00
										 |  |  | 		.end	= INT_SDC3_0, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_IRQ, | 
					
						
							|  |  |  | 		.name	= "cmd_irq", | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_IRQ | IORESOURCE_DISABLED, | 
					
						
							|  |  |  | 		.name	= "status_irq" | 
					
						
							| 
									
										
										
										
											2008-09-10 14:00:53 -07:00
										 |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= 8, | 
					
						
							|  |  |  | 		.end	= 8, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_DMA, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct resource resources_sdc4[] = { | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= MSM_SDC4_PHYS, | 
					
						
							|  |  |  | 		.end	= MSM_SDC4_PHYS + MSM_SDC4_SIZE - 1, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_MEM, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= INT_SDC4_0, | 
					
						
							| 
									
										
										
										
											2009-05-22 20:21:50 -07:00
										 |  |  | 		.end	= INT_SDC4_0, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_IRQ, | 
					
						
							|  |  |  | 		.name	= "cmd_irq", | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_IRQ | IORESOURCE_DISABLED, | 
					
						
							|  |  |  | 		.name	= "status_irq" | 
					
						
							| 
									
										
										
										
											2008-09-10 14:00:53 -07:00
										 |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= 8, | 
					
						
							|  |  |  | 		.end	= 8, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_DMA, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct platform_device msm_device_sdc1 = { | 
					
						
							|  |  |  | 	.name		= "msm_sdcc", | 
					
						
							|  |  |  | 	.id		= 1, | 
					
						
							|  |  |  | 	.num_resources	= ARRAY_SIZE(resources_sdc1), | 
					
						
							|  |  |  | 	.resource	= resources_sdc1, | 
					
						
							|  |  |  | 	.dev		= { | 
					
						
							|  |  |  | 		.coherent_dma_mask	= 0xffffffff, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct platform_device msm_device_sdc2 = { | 
					
						
							|  |  |  | 	.name		= "msm_sdcc", | 
					
						
							|  |  |  | 	.id		= 2, | 
					
						
							|  |  |  | 	.num_resources	= ARRAY_SIZE(resources_sdc2), | 
					
						
							|  |  |  | 	.resource	= resources_sdc2, | 
					
						
							|  |  |  | 	.dev		= { | 
					
						
							|  |  |  | 		.coherent_dma_mask	= 0xffffffff, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct platform_device msm_device_sdc3 = { | 
					
						
							|  |  |  | 	.name		= "msm_sdcc", | 
					
						
							|  |  |  | 	.id		= 3, | 
					
						
							|  |  |  | 	.num_resources	= ARRAY_SIZE(resources_sdc3), | 
					
						
							|  |  |  | 	.resource	= resources_sdc3, | 
					
						
							|  |  |  | 	.dev		= { | 
					
						
							|  |  |  | 		.coherent_dma_mask	= 0xffffffff, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct platform_device msm_device_sdc4 = { | 
					
						
							|  |  |  | 	.name		= "msm_sdcc", | 
					
						
							|  |  |  | 	.id		= 4, | 
					
						
							|  |  |  | 	.num_resources	= ARRAY_SIZE(resources_sdc4), | 
					
						
							|  |  |  | 	.resource	= resources_sdc4, | 
					
						
							|  |  |  | 	.dev		= { | 
					
						
							|  |  |  | 		.coherent_dma_mask	= 0xffffffff, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2008-11-10 16:30:27 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | static struct platform_device *msm_sdcc_devices[] __initdata = { | 
					
						
							|  |  |  | 	&msm_device_sdc1, | 
					
						
							|  |  |  | 	&msm_device_sdc2, | 
					
						
							|  |  |  | 	&msm_device_sdc3, | 
					
						
							|  |  |  | 	&msm_device_sdc4, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-29 16:55:34 +05:30
										 |  |  | int __init msm_add_sdcc(unsigned int controller, | 
					
						
							|  |  |  | 			struct msm_mmc_platform_data *plat, | 
					
						
							| 
									
										
										
										
											2009-05-22 20:21:50 -07:00
										 |  |  | 			unsigned int stat_irq, unsigned long stat_irq_flags) | 
					
						
							| 
									
										
										
										
											2008-11-10 16:30:27 -08:00
										 |  |  | { | 
					
						
							|  |  |  | 	struct platform_device	*pdev; | 
					
						
							| 
									
										
										
										
											2009-05-22 20:21:50 -07:00
										 |  |  | 	struct resource *res; | 
					
						
							| 
									
										
										
										
											2008-11-10 16:30:27 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	if (controller < 1 || controller > 4) | 
					
						
							|  |  |  | 		return -EINVAL; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	pdev = msm_sdcc_devices[controller-1]; | 
					
						
							|  |  |  | 	pdev->dev.platform_data = plat; | 
					
						
							| 
									
										
										
										
											2009-05-22 20:21:50 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "status_irq"); | 
					
						
							|  |  |  | 	if (!res) | 
					
						
							|  |  |  | 		return -EINVAL; | 
					
						
							|  |  |  | 	else if (stat_irq) { | 
					
						
							|  |  |  | 		res->start = res->end = stat_irq; | 
					
						
							|  |  |  | 		res->flags &= ~IORESOURCE_DISABLED; | 
					
						
							|  |  |  | 		res->flags |= stat_irq_flags; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-10 16:30:27 -08:00
										 |  |  | 	return platform_device_register(pdev); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-13 14:35:11 -08:00
										 |  |  | static struct resource resources_mddi0[] = { | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= MSM_PMDH_PHYS, | 
					
						
							|  |  |  | 		.end	= MSM_PMDH_PHYS + MSM_PMDH_SIZE - 1, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_MEM, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= INT_MDDI_PRI, | 
					
						
							|  |  |  | 		.end	= INT_MDDI_PRI, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_IRQ, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct resource resources_mddi1[] = { | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= MSM_EMDH_PHYS, | 
					
						
							|  |  |  | 		.end	= MSM_EMDH_PHYS + MSM_EMDH_SIZE - 1, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_MEM, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= INT_MDDI_EXT, | 
					
						
							|  |  |  | 		.end	= INT_MDDI_EXT, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_IRQ, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct platform_device msm_device_mddi0 = { | 
					
						
							|  |  |  | 	.name = "msm_mddi", | 
					
						
							|  |  |  | 	.id = 0, | 
					
						
							|  |  |  | 	.num_resources = ARRAY_SIZE(resources_mddi0), | 
					
						
							|  |  |  | 	.resource = resources_mddi0, | 
					
						
							|  |  |  | 	.dev = { | 
					
						
							|  |  |  | 		.coherent_dma_mask      = 0xffffffff, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct platform_device msm_device_mddi1 = { | 
					
						
							|  |  |  | 	.name = "msm_mddi", | 
					
						
							|  |  |  | 	.id = 1, | 
					
						
							|  |  |  | 	.num_resources = ARRAY_SIZE(resources_mddi1), | 
					
						
							|  |  |  | 	.resource = resources_mddi1, | 
					
						
							|  |  |  | 	.dev = { | 
					
						
							|  |  |  | 		.coherent_dma_mask      = 0xffffffff, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct resource resources_mdp[] = { | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= MSM_MDP_PHYS, | 
					
						
							|  |  |  | 		.end	= MSM_MDP_PHYS + MSM_MDP_SIZE - 1, | 
					
						
							|  |  |  | 		.name	= "mdp", | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_MEM | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		.start	= INT_MDP, | 
					
						
							|  |  |  | 		.end	= INT_MDP, | 
					
						
							|  |  |  | 		.flags	= IORESOURCE_IRQ, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct platform_device msm_device_mdp = { | 
					
						
							|  |  |  | 	.name = "msm_mdp", | 
					
						
							|  |  |  | 	.id = 0, | 
					
						
							|  |  |  | 	.num_resources = ARRAY_SIZE(resources_mdp), | 
					
						
							|  |  |  | 	.resource = resources_mdp, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-17 10:43:19 -07:00
										 |  |  | static struct clk_pcom_desc msm_clocks_7x01a[] = { | 
					
						
							| 
									
										
										
										
											2010-05-12 13:43:28 -07:00
										 |  |  | 	CLK_PCOM("adm_clk",	ADM_CLK,	NULL, 0), | 
					
						
							|  |  |  | 	CLK_PCOM("adsp_clk",	ADSP_CLK,	NULL, 0), | 
					
						
							|  |  |  | 	CLK_PCOM("ebi1_clk",	EBI1_CLK,	NULL, 0), | 
					
						
							|  |  |  | 	CLK_PCOM("ebi2_clk",	EBI2_CLK,	NULL, 0), | 
					
						
							|  |  |  | 	CLK_PCOM("ecodec_clk",	ECODEC_CLK,	NULL, 0), | 
					
						
							|  |  |  | 	CLK_PCOM("emdh_clk",	EMDH_CLK,	NULL, OFF), | 
					
						
							|  |  |  | 	CLK_PCOM("gp_clk",		GP_CLK,		NULL, 0), | 
					
						
							|  |  |  | 	CLK_PCOM("grp_clk",	GRP_3D_CLK,	NULL, OFF), | 
					
						
							| 
									
										
										
										
											2011-02-23 09:37:42 -08:00
										 |  |  | 	CLK_PCOM("i2c_clk",	I2C_CLK,	"msm_i2c.0", 0), | 
					
						
							| 
									
										
										
										
											2010-05-12 13:43:28 -07:00
										 |  |  | 	CLK_PCOM("icodec_rx_clk",	ICODEC_RX_CLK,	NULL, 0), | 
					
						
							|  |  |  | 	CLK_PCOM("icodec_tx_clk",	ICODEC_TX_CLK,	NULL, 0), | 
					
						
							|  |  |  | 	CLK_PCOM("imem_clk",	IMEM_CLK,	NULL, OFF), | 
					
						
							|  |  |  | 	CLK_PCOM("mdc_clk",	MDC_CLK,	NULL, 0), | 
					
						
							|  |  |  | 	CLK_PCOM("mdp_clk",	MDP_CLK,	NULL, OFF), | 
					
						
							|  |  |  | 	CLK_PCOM("pbus_clk",	PBUS_CLK,	NULL, 0), | 
					
						
							|  |  |  | 	CLK_PCOM("pcm_clk",	PCM_CLK,	NULL, 0), | 
					
						
							| 
									
										
										
										
											2010-12-13 14:35:09 -08:00
										 |  |  | 	CLK_PCOM("mddi_clk",	PMDH_CLK,	NULL, OFF | CLK_MINMAX), | 
					
						
							| 
									
										
										
										
											2010-05-12 13:43:28 -07:00
										 |  |  | 	CLK_PCOM("sdac_clk",	SDAC_CLK,	NULL, OFF), | 
					
						
							| 
									
										
										
										
											2011-02-23 09:37:42 -08:00
										 |  |  | 	CLK_PCOM("sdc_clk",	SDC1_CLK,	"msm_sdcc.1", OFF), | 
					
						
							|  |  |  | 	CLK_PCOM("sdc_pclk",	SDC1_P_CLK,	"msm_sdcc.1", OFF), | 
					
						
							|  |  |  | 	CLK_PCOM("sdc_clk",	SDC2_CLK,	"msm_sdcc.2", OFF), | 
					
						
							|  |  |  | 	CLK_PCOM("sdc_pclk",	SDC2_P_CLK,	"msm_sdcc.2", OFF), | 
					
						
							|  |  |  | 	CLK_PCOM("sdc_clk",	SDC3_CLK,	"msm_sdcc.3", OFF), | 
					
						
							|  |  |  | 	CLK_PCOM("sdc_pclk",	SDC3_P_CLK,	"msm_sdcc.3", OFF), | 
					
						
							|  |  |  | 	CLK_PCOM("sdc_clk",	SDC4_CLK,	"msm_sdcc.4", OFF), | 
					
						
							|  |  |  | 	CLK_PCOM("sdc_pclk",	SDC4_P_CLK,	"msm_sdcc.4", OFF), | 
					
						
							| 
									
										
										
										
											2010-05-12 13:43:28 -07:00
										 |  |  | 	CLK_PCOM("tsif_clk",	TSIF_CLK,	NULL, 0), | 
					
						
							|  |  |  | 	CLK_PCOM("tsif_ref_clk",	TSIF_REF_CLK,	NULL, 0), | 
					
						
							|  |  |  | 	CLK_PCOM("tv_dac_clk",	TV_DAC_CLK,	NULL, 0), | 
					
						
							|  |  |  | 	CLK_PCOM("tv_enc_clk",	TV_ENC_CLK,	NULL, 0), | 
					
						
							| 
									
										
										
										
											2013-08-20 23:48:02 -07:00
										 |  |  | 	CLK_PCOM("core",	UART1_CLK,	"msm_serial.0", OFF), | 
					
						
							|  |  |  | 	CLK_PCOM("core",	UART2_CLK,	"msm_serial.1", 0), | 
					
						
							|  |  |  | 	CLK_PCOM("core",	UART3_CLK,	"msm_serial.2", OFF), | 
					
						
							| 
									
										
										
										
											2010-05-12 13:43:28 -07:00
										 |  |  | 	CLK_PCOM("uart1dm_clk",	UART1DM_CLK,	NULL, OFF), | 
					
						
							|  |  |  | 	CLK_PCOM("uart2dm_clk",	UART2DM_CLK,	NULL, 0), | 
					
						
							| 
									
										
										
										
											2011-02-23 09:37:42 -08:00
										 |  |  | 	CLK_PCOM("usb_hs_clk",	USB_HS_CLK,	"msm_hsusb", OFF), | 
					
						
							|  |  |  | 	CLK_PCOM("usb_hs_pclk",	USB_HS_P_CLK,	"msm_hsusb", OFF), | 
					
						
							| 
									
										
										
										
											2010-05-12 13:43:28 -07:00
										 |  |  | 	CLK_PCOM("usb_otg_clk",	USB_OTG_CLK,	NULL, 0), | 
					
						
							|  |  |  | 	CLK_PCOM("vdc_clk",	VDC_CLK,	NULL, OFF ), | 
					
						
							|  |  |  | 	CLK_PCOM("vfe_clk",	VFE_CLK,	NULL, OFF), | 
					
						
							|  |  |  | 	CLK_PCOM("vfe_mdc_clk",	VFE_MDC_CLK,	NULL, OFF), | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-17 10:43:18 -07:00
										 |  |  | static struct pcom_clk_pdata msm_clock_7x01a_pdata = { | 
					
						
							|  |  |  | 	.lookup = msm_clocks_7x01a, | 
					
						
							|  |  |  | 	.num_lookups = ARRAY_SIZE(msm_clocks_7x01a), | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct platform_device msm_clock_7x01a = { | 
					
						
							|  |  |  | 	.name = "msm-clock-pcom", | 
					
						
							|  |  |  | 	.dev.platform_data = &msm_clock_7x01a_pdata, | 
					
						
							|  |  |  | }; |