diff options
Diffstat (limited to 'arch/arm/mach-mx3/mx31lilly.c')
-rw-r--r-- | arch/arm/mach-mx3/mx31lilly.c | 57 |
1 files changed, 54 insertions, 3 deletions
diff --git a/arch/arm/mach-mx3/mx31lilly.c b/arch/arm/mach-mx3/mx31lilly.c index 423025150f6f..9ce029f554b9 100644 --- a/arch/arm/mach-mx3/mx31lilly.c +++ b/arch/arm/mach-mx3/mx31lilly.c | |||
@@ -31,6 +31,8 @@ | |||
31 | #include <linux/interrupt.h> | 31 | #include <linux/interrupt.h> |
32 | #include <linux/smsc911x.h> | 32 | #include <linux/smsc911x.h> |
33 | #include <linux/mtd/physmap.h> | 33 | #include <linux/mtd/physmap.h> |
34 | #include <linux/spi/spi.h> | ||
35 | #include <linux/mfd/mc13783.h> | ||
34 | 36 | ||
35 | #include <asm/mach-types.h> | 37 | #include <asm/mach-types.h> |
36 | #include <asm/mach/arch.h> | 38 | #include <asm/mach/arch.h> |
@@ -41,6 +43,7 @@ | |||
41 | #include <mach/common.h> | 43 | #include <mach/common.h> |
42 | #include <mach/iomux-mx3.h> | 44 | #include <mach/iomux-mx3.h> |
43 | #include <mach/board-mx31lilly.h> | 45 | #include <mach/board-mx31lilly.h> |
46 | #include <mach/spi.h> | ||
44 | 47 | ||
45 | #include "devices.h" | 48 | #include "devices.h" |
46 | 49 | ||
@@ -108,7 +111,36 @@ static struct platform_device physmap_flash_device = { | |||
108 | static struct platform_device *devices[] __initdata = { | 111 | static struct platform_device *devices[] __initdata = { |
109 | &smsc91x_device, | 112 | &smsc91x_device, |
110 | &physmap_flash_device, | 113 | &physmap_flash_device, |
111 | &mxc_i2c_device1, | 114 | }; |
115 | |||
116 | /* SPI */ | ||
117 | |||
118 | static int spi_internal_chipselect[] = { | ||
119 | MXC_SPI_CS(0), | ||
120 | MXC_SPI_CS(1), | ||
121 | MXC_SPI_CS(2), | ||
122 | }; | ||
123 | |||
124 | static struct spi_imx_master spi0_pdata = { | ||
125 | .chipselect = spi_internal_chipselect, | ||
126 | .num_chipselect = ARRAY_SIZE(spi_internal_chipselect), | ||
127 | }; | ||
128 | |||
129 | static struct spi_imx_master spi1_pdata = { | ||
130 | .chipselect = spi_internal_chipselect, | ||
131 | .num_chipselect = ARRAY_SIZE(spi_internal_chipselect), | ||
132 | }; | ||
133 | |||
134 | static struct mc13783_platform_data mc13783_pdata __initdata = { | ||
135 | .flags = MC13783_USE_RTC | MC13783_USE_TOUCHSCREEN, | ||
136 | }; | ||
137 | |||
138 | static struct spi_board_info mc13783_dev __initdata = { | ||
139 | .modalias = "mc13783", | ||
140 | .max_speed_hz = 1000000, | ||
141 | .bus_num = 1, | ||
142 | .chip_select = 0, | ||
143 | .platform_data = &mc13783_pdata, | ||
112 | }; | 144 | }; |
113 | 145 | ||
114 | static int mx31lilly_baseboard; | 146 | static int mx31lilly_baseboard; |
@@ -128,8 +160,27 @@ static void __init mx31lilly_board_init(void) | |||
128 | } | 160 | } |
129 | 161 | ||
130 | mxc_iomux_alloc_pin(MX31_PIN_CS4__CS4, "Ethernet CS"); | 162 | mxc_iomux_alloc_pin(MX31_PIN_CS4__CS4, "Ethernet CS"); |
131 | mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MOSI__SCL, "I2C SCL"); | 163 | |
132 | mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MISO__SDA, "I2C SDA"); | 164 | /* SPI */ |
165 | mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SCLK__SCLK, "SPI1_CLK"); | ||
166 | mxc_iomux_alloc_pin(MX31_PIN_CSPI1_MOSI__MOSI, "SPI1_TX"); | ||
167 | mxc_iomux_alloc_pin(MX31_PIN_CSPI1_MISO__MISO, "SPI1_RX"); | ||
168 | mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SPI_RDY__SPI_RDY, "SPI1_RDY"); | ||
169 | mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SS0__SS0, "SPI1_SS0"); | ||
170 | mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SS1__SS1, "SPI1_SS1"); | ||
171 | mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SS2__SS2, "SPI1_SS2"); | ||
172 | |||
173 | mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SCLK__SCLK, "SPI2_CLK"); | ||
174 | mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MOSI__MOSI, "SPI2_TX"); | ||
175 | mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MISO__MISO, "SPI2_RX"); | ||
176 | mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SPI_RDY__SPI_RDY, "SPI2_RDY"); | ||
177 | mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SS0__SS0, "SPI2_SS0"); | ||
178 | mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SS1__SS1, "SPI2_SS1"); | ||
179 | mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SS2__SS2, "SPI2_SS2"); | ||
180 | |||
181 | mxc_register_device(&mxc_spi_device0, &spi0_pdata); | ||
182 | mxc_register_device(&mxc_spi_device1, &spi1_pdata); | ||
183 | spi_register_board_info(&mc13783_dev, 1); | ||
133 | 184 | ||
134 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 185 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
135 | } | 186 | } |