| Rabin Vincent | 9e4e7fe | 2010-05-03 08:03:52 +0100 | [diff] [blame] | 1 | /* | 
 | 2 |  * Copyright (C) ST-Ericsson SA 2010 | 
 | 3 |  * | 
 | 4 |  * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | 
 | 5 |  * License terms: GNU General Public License (GPL) version 2 | 
 | 6 |  */ | 
 | 7 |  | 
 | 8 | #include <linux/kernel.h> | 
 | 9 | #include <linux/platform_device.h> | 
 | 10 | #include <linux/interrupt.h> | 
 | 11 | #include <linux/io.h> | 
| Rabin Vincent | 5b1f7dd | 2010-05-03 08:25:52 +0100 | [diff] [blame] | 12 | #include <linux/gpio.h> | 
| Rabin Vincent | 9e4e7fe | 2010-05-03 08:03:52 +0100 | [diff] [blame] | 13 | #include <linux/amba/bus.h> | 
 | 14 |  | 
 | 15 | #include <mach/hardware.h> | 
 | 16 | #include <mach/setup.h> | 
 | 17 |  | 
| Rabin Vincent | 5b1f7dd | 2010-05-03 08:25:52 +0100 | [diff] [blame] | 18 | static struct nmk_gpio_platform_data u8500_gpio_data[] = { | 
 | 19 | 	GPIO_DATA("GPIO-0-31", 0), | 
 | 20 | 	GPIO_DATA("GPIO-32-63", 32), /* 37..63 not routed to pin */ | 
 | 21 | 	GPIO_DATA("GPIO-64-95", 64), | 
 | 22 | 	GPIO_DATA("GPIO-96-127", 96), /* 98..127 not routed to pin */ | 
 | 23 | 	GPIO_DATA("GPIO-128-159", 128), | 
 | 24 | 	GPIO_DATA("GPIO-160-191", 160), /* 172..191 not routed to pin */ | 
 | 25 | 	GPIO_DATA("GPIO-192-223", 192), | 
 | 26 | 	GPIO_DATA("GPIO-224-255", 224), /* 231..255 not routed to pin */ | 
 | 27 | 	GPIO_DATA("GPIO-256-288", 256), /* 268..288 not routed to pin */ | 
 | 28 | }; | 
 | 29 |  | 
 | 30 | static struct resource u8500_gpio_resources[] = { | 
 | 31 | 	GPIO_RESOURCE(0), | 
 | 32 | 	GPIO_RESOURCE(1), | 
 | 33 | 	GPIO_RESOURCE(2), | 
 | 34 | 	GPIO_RESOURCE(3), | 
 | 35 | 	GPIO_RESOURCE(4), | 
 | 36 | 	GPIO_RESOURCE(5), | 
 | 37 | 	GPIO_RESOURCE(6), | 
 | 38 | 	GPIO_RESOURCE(7), | 
 | 39 | 	GPIO_RESOURCE(8), | 
 | 40 | }; | 
 | 41 |  | 
 | 42 | struct platform_device u8500_gpio_devs[] = { | 
 | 43 | 	GPIO_DEVICE(0), | 
 | 44 | 	GPIO_DEVICE(1), | 
 | 45 | 	GPIO_DEVICE(2), | 
 | 46 | 	GPIO_DEVICE(3), | 
 | 47 | 	GPIO_DEVICE(4), | 
 | 48 | 	GPIO_DEVICE(5), | 
 | 49 | 	GPIO_DEVICE(6), | 
 | 50 | 	GPIO_DEVICE(7), | 
 | 51 | 	GPIO_DEVICE(8), | 
 | 52 | }; | 
 | 53 |  | 
| Rabin Vincent | 9e4e7fe | 2010-05-03 08:03:52 +0100 | [diff] [blame] | 54 | struct amba_device u8500_ssp0_device = { | 
 | 55 | 	.dev = { | 
 | 56 | 		.coherent_dma_mask = ~0, | 
 | 57 | 		.init_name = "ssp0", | 
 | 58 | 	}, | 
 | 59 | 	.res = { | 
 | 60 | 		.start = U8500_SSP0_BASE, | 
 | 61 | 		.end   = U8500_SSP0_BASE + SZ_4K - 1, | 
 | 62 | 		.flags = IORESOURCE_MEM, | 
 | 63 | 	}, | 
 | 64 | 	.irq = {IRQ_SSP0, NO_IRQ }, | 
 | 65 | 	/* ST-Ericsson modified id */ | 
 | 66 | 	.periphid = SSP_PER_ID, | 
 | 67 | }; | 
| Rabin Vincent | f9faf23 | 2010-05-03 08:24:37 +0100 | [diff] [blame] | 68 |  | 
 | 69 | static struct resource u8500_i2c0_resources[] = { | 
 | 70 | 	[0] = { | 
 | 71 | 		.start	= U8500_I2C0_BASE, | 
 | 72 | 		.end	= U8500_I2C0_BASE + SZ_4K - 1, | 
 | 73 | 		.flags	= IORESOURCE_MEM, | 
 | 74 | 	}, | 
 | 75 | 	[1] = { | 
 | 76 | 		.start	= IRQ_I2C0, | 
 | 77 | 		.end	= IRQ_I2C0, | 
 | 78 | 		.flags	= IORESOURCE_IRQ, | 
 | 79 | 	} | 
 | 80 | }; | 
 | 81 |  | 
 | 82 | struct platform_device u8500_i2c0_device = { | 
 | 83 | 	.name		= "nmk-i2c", | 
 | 84 | 	.id		= 0, | 
 | 85 | 	.resource	= u8500_i2c0_resources, | 
 | 86 | 	.num_resources	= ARRAY_SIZE(u8500_i2c0_resources), | 
 | 87 | }; | 
 | 88 |  | 
 | 89 | static struct resource u8500_i2c4_resources[] = { | 
 | 90 | 	[0] = { | 
 | 91 | 		.start	= U8500_I2C4_BASE, | 
 | 92 | 		.end	= U8500_I2C4_BASE + SZ_4K - 1, | 
 | 93 | 		.flags	= IORESOURCE_MEM, | 
 | 94 | 	}, | 
 | 95 | 	[1] = { | 
 | 96 | 		.start	= IRQ_I2C4, | 
 | 97 | 		.end	= IRQ_I2C4, | 
 | 98 | 		.flags	= IORESOURCE_IRQ, | 
 | 99 | 	} | 
 | 100 | }; | 
 | 101 |  | 
 | 102 | struct platform_device u8500_i2c4_device = { | 
 | 103 | 	.name		= "nmk-i2c", | 
 | 104 | 	.id		= 4, | 
 | 105 | 	.resource	= u8500_i2c4_resources, | 
 | 106 | 	.num_resources	= ARRAY_SIZE(u8500_i2c4_resources), | 
 | 107 | }; |