ACPI / LPSS: Make acpi_lpss_find_device() also find PCI devices
[linux/fpc-iii.git] / arch / arm / mach-pxa / icontrol.c
blobcbaf4f6edcda74964d5c0a6210df1838cb7d699f
1 /*
2 * linux/arch/arm/mach-pxa/icontrol.c
4 * Support for the iControl and SafeTcam platforms from TMT Services
5 * using the Embedian MXM-8x10 Computer on Module
7 * Copyright (C) 2009 TMT Services & Supplies (Pty) Ltd.
9 * 2010-01-21 Hennie van der Merve <hvdmerwe@tmtservies.co.za>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
16 #include <linux/irq.h>
17 #include <linux/platform_device.h>
18 #include <linux/gpio.h>
20 #include <asm/mach-types.h>
21 #include <asm/mach/arch.h>
23 #include "pxa320.h"
24 #include "mxm8x10.h"
26 #include <linux/spi/spi.h>
27 #include <linux/spi/pxa2xx_spi.h>
28 #include <linux/can/platform/mcp251x.h>
29 #include <linux/regulator/machine.h>
31 #include "generic.h"
33 #define ICONTROL_MCP251x_nCS1 (15)
34 #define ICONTROL_MCP251x_nCS2 (16)
35 #define ICONTROL_MCP251x_nCS3 (17)
36 #define ICONTROL_MCP251x_nCS4 (24)
38 #define ICONTROL_MCP251x_nIRQ1 (74)
39 #define ICONTROL_MCP251x_nIRQ2 (75)
40 #define ICONTROL_MCP251x_nIRQ3 (76)
41 #define ICONTROL_MCP251x_nIRQ4 (77)
43 static struct pxa2xx_spi_chip mcp251x_chip_info1 = {
44 .tx_threshold = 8,
45 .rx_threshold = 128,
46 .dma_burst_size = 8,
47 .timeout = 235,
48 .gpio_cs = ICONTROL_MCP251x_nCS1
51 static struct pxa2xx_spi_chip mcp251x_chip_info2 = {
52 .tx_threshold = 8,
53 .rx_threshold = 128,
54 .dma_burst_size = 8,
55 .timeout = 235,
56 .gpio_cs = ICONTROL_MCP251x_nCS2
59 static struct pxa2xx_spi_chip mcp251x_chip_info3 = {
60 .tx_threshold = 8,
61 .rx_threshold = 128,
62 .dma_burst_size = 8,
63 .timeout = 235,
64 .gpio_cs = ICONTROL_MCP251x_nCS3
67 static struct pxa2xx_spi_chip mcp251x_chip_info4 = {
68 .tx_threshold = 8,
69 .rx_threshold = 128,
70 .dma_burst_size = 8,
71 .timeout = 235,
72 .gpio_cs = ICONTROL_MCP251x_nCS4
75 static struct mcp251x_platform_data mcp251x_info = {
76 .oscillator_frequency = 16E6,
79 static struct spi_board_info mcp251x_board_info[] = {
81 .modalias = "mcp2515",
82 .max_speed_hz = 6500000,
83 .bus_num = 3,
84 .chip_select = 0,
85 .platform_data = &mcp251x_info,
86 .controller_data = &mcp251x_chip_info1,
87 .irq = PXA_GPIO_TO_IRQ(ICONTROL_MCP251x_nIRQ1)
90 .modalias = "mcp2515",
91 .max_speed_hz = 6500000,
92 .bus_num = 3,
93 .chip_select = 1,
94 .platform_data = &mcp251x_info,
95 .controller_data = &mcp251x_chip_info2,
96 .irq = PXA_GPIO_TO_IRQ(ICONTROL_MCP251x_nIRQ2)
99 .modalias = "mcp2515",
100 .max_speed_hz = 6500000,
101 .bus_num = 4,
102 .chip_select = 0,
103 .platform_data = &mcp251x_info,
104 .controller_data = &mcp251x_chip_info3,
105 .irq = PXA_GPIO_TO_IRQ(ICONTROL_MCP251x_nIRQ3)
108 .modalias = "mcp2515",
109 .max_speed_hz = 6500000,
110 .bus_num = 4,
111 .chip_select = 1,
112 .platform_data = &mcp251x_info,
113 .controller_data = &mcp251x_chip_info4,
114 .irq = PXA_GPIO_TO_IRQ(ICONTROL_MCP251x_nIRQ4)
118 static struct pxa2xx_spi_master pxa_ssp3_spi_master_info = {
119 .num_chipselect = 2,
120 .enable_dma = 1
123 static struct pxa2xx_spi_master pxa_ssp4_spi_master_info = {
124 .num_chipselect = 2,
125 .enable_dma = 1
128 struct platform_device pxa_spi_ssp3 = {
129 .name = "pxa2xx-spi",
130 .id = 3,
131 .dev = {
132 .platform_data = &pxa_ssp3_spi_master_info,
136 struct platform_device pxa_spi_ssp4 = {
137 .name = "pxa2xx-spi",
138 .id = 4,
139 .dev = {
140 .platform_data = &pxa_ssp4_spi_master_info,
144 static struct platform_device *icontrol_spi_devices[] __initdata = {
145 &pxa_spi_ssp3,
146 &pxa_spi_ssp4,
149 static mfp_cfg_t mfp_can_cfg[] __initdata = {
150 /* CAN CS lines */
151 GPIO15_GPIO,
152 GPIO16_GPIO,
153 GPIO17_GPIO,
154 GPIO24_GPIO,
156 /* SPI (SSP3) lines */
157 GPIO89_SSP3_SCLK,
158 GPIO91_SSP3_TXD,
159 GPIO92_SSP3_RXD,
161 /* SPI (SSP4) lines */
162 GPIO93_SSP4_SCLK,
163 GPIO95_SSP4_TXD,
164 GPIO96_SSP4_RXD,
166 /* CAN nIRQ lines */
167 GPIO74_GPIO | MFP_LPM_EDGE_RISE,
168 GPIO75_GPIO | MFP_LPM_EDGE_RISE,
169 GPIO76_GPIO | MFP_LPM_EDGE_RISE,
170 GPIO77_GPIO | MFP_LPM_EDGE_RISE
173 static void __init icontrol_can_init(void)
175 pxa3xx_mfp_config(ARRAY_AND_SIZE(mfp_can_cfg));
176 platform_add_devices(ARRAY_AND_SIZE(icontrol_spi_devices));
177 spi_register_board_info(ARRAY_AND_SIZE(mcp251x_board_info));
180 static void __init icontrol_init(void)
182 mxm_8x10_barebones_init();
183 mxm_8x10_usb_host_init();
184 mxm_8x10_mmc_init();
186 icontrol_can_init();
188 regulator_has_full_constraints();
191 MACHINE_START(ICONTROL, "iControl/SafeTcam boards using Embedian MXM-8x10 CoM")
192 .atag_offset = 0x100,
193 .map_io = pxa3xx_map_io,
194 .nr_irqs = PXA_NR_IRQS,
195 .init_irq = pxa3xx_init_irq,
196 .handle_irq = pxa3xx_handle_irq,
197 .init_time = pxa_timer_init,
198 .init_machine = icontrol_init,
199 .restart = pxa_restart,
200 MACHINE_END