Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Support for Sharp SL-Cxx00 Series of PDAs |
| 3 | * Models: SL-C3000 (Spitz), SL-C1000 (Akita) and SL-C3100 (Borzoi) |
| 4 | * |
| 5 | * Copyright (c) 2005 Richard Purdie |
| 6 | * |
| 7 | * Based on Sharp's 2.4 kernel patches/lubbock.c |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License version 2 as |
| 11 | * published by the Free Software Foundation. |
| 12 | * |
| 13 | */ |
| 14 | |
| 15 | #include <linux/kernel.h> |
| 16 | #include <linux/init.h> |
Russell King | d052d1b | 2005-10-29 19:07:23 +0100 | [diff] [blame] | 17 | #include <linux/platform_device.h> |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 18 | #include <linux/delay.h> |
| 19 | #include <linux/major.h> |
| 20 | #include <linux/fs.h> |
| 21 | #include <linux/interrupt.h> |
Eric Miao | dd5980d | 2008-09-02 17:34:33 +0800 | [diff] [blame] | 22 | #include <linux/gpio.h> |
Eric Miao | 4fe3224 | 2008-09-05 22:38:23 +0800 | [diff] [blame] | 23 | #include <linux/leds.h> |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 24 | #include <linux/mmc/host.h> |
Dmitry Baryshkov | e5d3bf3 | 2008-11-25 00:57:28 +0300 | [diff] [blame^] | 25 | #include <linux/mtd/physmap.h> |
Richard Purdie | 74617fb | 2006-06-19 19:57:12 +0100 | [diff] [blame] | 26 | #include <linux/pm.h> |
Richard Purdie | c3f8f65 | 2007-09-03 00:27:00 +0100 | [diff] [blame] | 27 | #include <linux/backlight.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 28 | #include <linux/io.h> |
Eric Miao | f72de66 | 2008-09-06 08:46:23 +0800 | [diff] [blame] | 29 | #include <linux/i2c.h> |
| 30 | #include <linux/i2c/pca953x.h> |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 31 | #include <linux/spi/spi.h> |
| 32 | #include <linux/spi/ads7846.h> |
| 33 | #include <linux/spi/corgi_lcd.h> |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 34 | |
| 35 | #include <asm/setup.h> |
| 36 | #include <asm/memory.h> |
| 37 | #include <asm/mach-types.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 38 | #include <mach/hardware.h> |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 39 | #include <asm/irq.h> |
Richard Purdie | 74617fb | 2006-06-19 19:57:12 +0100 | [diff] [blame] | 40 | #include <asm/system.h> |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 41 | |
| 42 | #include <asm/mach/arch.h> |
| 43 | #include <asm/mach/map.h> |
| 44 | #include <asm/mach/irq.h> |
| 45 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 46 | #include <mach/pxa-regs.h> |
| 47 | #include <mach/pxa2xx-regs.h> |
Eric Miao | 5e96ade | 2008-09-03 09:47:42 +0800 | [diff] [blame] | 48 | #include <mach/mfp-pxa27x.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 49 | #include <mach/pxa27x-udc.h> |
Russell King | afd2fc0 | 2008-08-07 11:05:25 +0100 | [diff] [blame] | 50 | #include <mach/reset.h> |
Mark Brown | f8787fd | 2008-08-26 13:30:03 +0100 | [diff] [blame] | 51 | #include <mach/i2c.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 52 | #include <mach/irda.h> |
| 53 | #include <mach/mmc.h> |
| 54 | #include <mach/ohci.h> |
| 55 | #include <mach/udc.h> |
| 56 | #include <mach/pxafb.h> |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 57 | #include <mach/pxa2xx_spi.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 58 | #include <mach/spitz.h> |
| 59 | #include <mach/sharpsl.h> |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 60 | |
| 61 | #include <asm/mach/sharpsl_param.h> |
| 62 | #include <asm/hardware/scoop.h> |
| 63 | |
| 64 | #include "generic.h" |
Russell King | 46c41e6 | 2007-05-15 15:39:36 +0100 | [diff] [blame] | 65 | #include "devices.h" |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 66 | #include "sharpsl.h" |
| 67 | |
Eric Miao | 5e96ade | 2008-09-03 09:47:42 +0800 | [diff] [blame] | 68 | static unsigned long spitz_pin_config[] __initdata = { |
| 69 | /* Chip Selects */ |
| 70 | GPIO78_nCS_2, /* SCOOP #2 */ |
Eric Miao | faf2f0a | 2008-11-16 15:56:58 +0800 | [diff] [blame] | 71 | GPIO79_nCS_3, /* NAND */ |
Eric Miao | 5e96ade | 2008-09-03 09:47:42 +0800 | [diff] [blame] | 72 | GPIO80_nCS_4, /* SCOOP #1 */ |
| 73 | |
| 74 | /* LCD - 16bpp Active TFT */ |
| 75 | GPIO58_LCD_LDD_0, |
| 76 | GPIO59_LCD_LDD_1, |
| 77 | GPIO60_LCD_LDD_2, |
| 78 | GPIO61_LCD_LDD_3, |
| 79 | GPIO62_LCD_LDD_4, |
| 80 | GPIO63_LCD_LDD_5, |
| 81 | GPIO64_LCD_LDD_6, |
| 82 | GPIO65_LCD_LDD_7, |
| 83 | GPIO66_LCD_LDD_8, |
| 84 | GPIO67_LCD_LDD_9, |
| 85 | GPIO68_LCD_LDD_10, |
| 86 | GPIO69_LCD_LDD_11, |
| 87 | GPIO70_LCD_LDD_12, |
| 88 | GPIO71_LCD_LDD_13, |
| 89 | GPIO72_LCD_LDD_14, |
| 90 | GPIO73_LCD_LDD_15, |
| 91 | GPIO74_LCD_FCLK, |
| 92 | GPIO75_LCD_LCLK, |
| 93 | GPIO76_LCD_PCLK, |
| 94 | |
| 95 | /* PC Card */ |
| 96 | GPIO48_nPOE, |
| 97 | GPIO49_nPWE, |
| 98 | GPIO50_nPIOR, |
| 99 | GPIO51_nPIOW, |
| 100 | GPIO85_nPCE_1, |
| 101 | GPIO54_nPCE_2, |
Eric Miao | 5e96ade | 2008-09-03 09:47:42 +0800 | [diff] [blame] | 102 | GPIO55_nPREG, |
| 103 | GPIO56_nPWAIT, |
| 104 | GPIO57_nIOIS16, |
Eric Miao | faf2f0a | 2008-11-16 15:56:58 +0800 | [diff] [blame] | 105 | GPIO104_PSKTSEL, |
Eric Miao | 5e96ade | 2008-09-03 09:47:42 +0800 | [diff] [blame] | 106 | |
| 107 | /* MMC */ |
| 108 | GPIO32_MMC_CLK, |
| 109 | GPIO112_MMC_CMD, |
| 110 | GPIO92_MMC_DAT_0, |
| 111 | GPIO109_MMC_DAT_1, |
| 112 | GPIO110_MMC_DAT_2, |
| 113 | GPIO111_MMC_DAT_3, |
| 114 | |
| 115 | /* GPIOs */ |
| 116 | GPIO9_GPIO, /* SPITZ_GPIO_nSD_DETECT */ |
| 117 | GPIO81_GPIO, /* SPITZ_GPIO_nSD_WP */ |
| 118 | GPIO41_GPIO, /* SPITZ_GPIO_USB_CONNECT */ |
| 119 | GPIO37_GPIO, /* SPITZ_GPIO_USB_HOST */ |
| 120 | GPIO35_GPIO, /* SPITZ_GPIO_USB_DEVICE */ |
| 121 | GPIO22_GPIO, /* SPITZ_GPIO_HSYNC */ |
| 122 | GPIO94_GPIO, /* SPITZ_GPIO_CF_CD */ |
| 123 | GPIO105_GPIO, /* SPITZ_GPIO_CF_IRQ */ |
| 124 | GPIO106_GPIO, /* SPITZ_GPIO_CF2_IRQ */ |
| 125 | |
Eric Miao | 6f584cf | 2008-11-28 16:00:24 +0800 | [diff] [blame] | 126 | /* I2C */ |
| 127 | GPIO117_I2C_SCL, |
| 128 | GPIO118_I2C_SDA, |
| 129 | |
Eric Miao | 5e96ade | 2008-09-03 09:47:42 +0800 | [diff] [blame] | 130 | GPIO1_GPIO | WAKEUP_ON_EDGE_RISE, |
| 131 | }; |
| 132 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 133 | /* |
| 134 | * Spitz SCOOP Device #1 |
| 135 | */ |
| 136 | static struct resource spitz_scoop_resources[] = { |
| 137 | [0] = { |
| 138 | .start = 0x10800000, |
| 139 | .end = 0x10800fff, |
| 140 | .flags = IORESOURCE_MEM, |
| 141 | }, |
| 142 | }; |
| 143 | |
| 144 | static struct scoop_config spitz_scoop_setup = { |
Eric Miao | fff1472 | 2008-09-05 22:15:23 +0800 | [diff] [blame] | 145 | .io_dir = SPITZ_SCP_IO_DIR, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 146 | .io_out = SPITZ_SCP_IO_OUT, |
Eric Miao | fff1472 | 2008-09-05 22:15:23 +0800 | [diff] [blame] | 147 | .suspend_clr = SPITZ_SCP_SUS_CLR, |
| 148 | .suspend_set = SPITZ_SCP_SUS_SET, |
| 149 | .gpio_base = SPITZ_SCP_GPIO_BASE, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 150 | }; |
| 151 | |
| 152 | struct platform_device spitzscoop_device = { |
| 153 | .name = "sharp-scoop", |
| 154 | .id = 0, |
| 155 | .dev = { |
| 156 | .platform_data = &spitz_scoop_setup, |
| 157 | }, |
| 158 | .num_resources = ARRAY_SIZE(spitz_scoop_resources), |
| 159 | .resource = spitz_scoop_resources, |
| 160 | }; |
| 161 | |
| 162 | /* |
| 163 | * Spitz SCOOP Device #2 |
| 164 | */ |
| 165 | static struct resource spitz_scoop2_resources[] = { |
| 166 | [0] = { |
| 167 | .start = 0x08800040, |
| 168 | .end = 0x08800fff, |
| 169 | .flags = IORESOURCE_MEM, |
| 170 | }, |
| 171 | }; |
| 172 | |
| 173 | static struct scoop_config spitz_scoop2_setup = { |
Eric Miao | fff1472 | 2008-09-05 22:15:23 +0800 | [diff] [blame] | 174 | .io_dir = SPITZ_SCP2_IO_DIR, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 175 | .io_out = SPITZ_SCP2_IO_OUT, |
Eric Miao | fff1472 | 2008-09-05 22:15:23 +0800 | [diff] [blame] | 176 | .suspend_clr = SPITZ_SCP2_SUS_CLR, |
| 177 | .suspend_set = SPITZ_SCP2_SUS_SET, |
| 178 | .gpio_base = SPITZ_SCP2_GPIO_BASE, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 179 | }; |
| 180 | |
| 181 | struct platform_device spitzscoop2_device = { |
| 182 | .name = "sharp-scoop", |
| 183 | .id = 1, |
| 184 | .dev = { |
| 185 | .platform_data = &spitz_scoop2_setup, |
| 186 | }, |
| 187 | .num_resources = ARRAY_SIZE(spitz_scoop2_resources), |
| 188 | .resource = spitz_scoop2_resources, |
| 189 | }; |
| 190 | |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 191 | #define SPITZ_PWR_SD 0x01 |
| 192 | #define SPITZ_PWR_CF 0x02 |
| 193 | |
| 194 | /* Power control is shared with between one of the CF slots and SD */ |
| 195 | static void spitz_card_pwr_ctrl(int device, unsigned short new_cpr) |
| 196 | { |
| 197 | unsigned short cpr = read_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR); |
| 198 | |
| 199 | if (new_cpr & 0x0007) { |
Eric Miao | fff1472 | 2008-09-05 22:15:23 +0800 | [diff] [blame] | 200 | gpio_set_value(SPITZ_GPIO_CF_POWER, 1); |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 201 | if (!(cpr & 0x0002) && !(cpr & 0x0004)) |
| 202 | mdelay(5); |
| 203 | if (device == SPITZ_PWR_CF) |
| 204 | cpr |= 0x0002; |
| 205 | if (device == SPITZ_PWR_SD) |
| 206 | cpr |= 0x0004; |
| 207 | write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | new_cpr); |
| 208 | } else { |
| 209 | if (device == SPITZ_PWR_CF) |
| 210 | cpr &= ~0x0002; |
| 211 | if (device == SPITZ_PWR_SD) |
| 212 | cpr &= ~0x0004; |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 213 | if (!(cpr & 0x0002) && !(cpr & 0x0004)) { |
Richard Purdie | 945b957 | 2006-01-05 20:44:57 +0000 | [diff] [blame] | 214 | write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, 0x0000); |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 215 | mdelay(1); |
Eric Miao | fff1472 | 2008-09-05 22:15:23 +0800 | [diff] [blame] | 216 | gpio_set_value(SPITZ_GPIO_CF_POWER, 0); |
Richard Purdie | 945b957 | 2006-01-05 20:44:57 +0000 | [diff] [blame] | 217 | } else { |
| 218 | write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | new_cpr); |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 219 | } |
| 220 | } |
| 221 | } |
| 222 | |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 223 | static void spitz_pcmcia_pwr(struct device *scoop, unsigned short cpr, int nr) |
| 224 | { |
| 225 | /* Only need to override behaviour for slot 0 */ |
| 226 | if (nr == 0) |
| 227 | spitz_card_pwr_ctrl(SPITZ_PWR_CF, cpr); |
| 228 | else |
| 229 | write_scoop_reg(scoop, SCOOP_CPR, cpr); |
| 230 | } |
| 231 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 232 | static struct scoop_pcmcia_dev spitz_pcmcia_scoop[] = { |
| 233 | { |
| 234 | .dev = &spitzscoop_device.dev, |
| 235 | .irq = SPITZ_IRQ_GPIO_CF_IRQ, |
| 236 | .cd_irq = SPITZ_IRQ_GPIO_CF_CD, |
| 237 | .cd_irq_str = "PCMCIA0 CD", |
| 238 | },{ |
| 239 | .dev = &spitzscoop2_device.dev, |
| 240 | .irq = SPITZ_IRQ_GPIO_CF2_IRQ, |
| 241 | .cd_irq = -1, |
| 242 | }, |
| 243 | }; |
| 244 | |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 245 | static struct scoop_pcmcia_config spitz_pcmcia_config = { |
| 246 | .devs = &spitz_pcmcia_scoop[0], |
| 247 | .num_devs = 2, |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 248 | .power_ctrl = spitz_pcmcia_pwr, |
| 249 | }; |
| 250 | |
| 251 | EXPORT_SYMBOL(spitzscoop_device); |
| 252 | EXPORT_SYMBOL(spitzscoop2_device); |
| 253 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 254 | /* |
| 255 | * Spitz Keyboard Device |
| 256 | */ |
| 257 | static struct platform_device spitzkbd_device = { |
| 258 | .name = "spitz-keyboard", |
| 259 | .id = -1, |
| 260 | }; |
| 261 | |
| 262 | |
| 263 | /* |
Richard Purdie | 3179108 | 2006-03-31 02:31:09 -0800 | [diff] [blame] | 264 | * Spitz LEDs |
| 265 | */ |
Eric Miao | 4fe3224 | 2008-09-05 22:38:23 +0800 | [diff] [blame] | 266 | static struct gpio_led spitz_gpio_leds[] = { |
| 267 | { |
| 268 | .name = "spitz:amber:charge", |
| 269 | .default_trigger = "sharpsl-charge", |
| 270 | .gpio = SPITZ_GPIO_LED_ORANGE, |
| 271 | }, |
| 272 | { |
| 273 | .name = "spitz:green:hddactivity", |
| 274 | .default_trigger = "ide-disk", |
| 275 | .gpio = SPITZ_GPIO_LED_GREEN, |
| 276 | }, |
| 277 | }; |
| 278 | |
| 279 | static struct gpio_led_platform_data spitz_gpio_leds_info = { |
| 280 | .leds = spitz_gpio_leds, |
| 281 | .num_leds = ARRAY_SIZE(spitz_gpio_leds), |
| 282 | }; |
| 283 | |
Richard Purdie | 3179108 | 2006-03-31 02:31:09 -0800 | [diff] [blame] | 284 | static struct platform_device spitzled_device = { |
Eric Miao | 4fe3224 | 2008-09-05 22:38:23 +0800 | [diff] [blame] | 285 | .name = "leds-gpio", |
Richard Purdie | 3179108 | 2006-03-31 02:31:09 -0800 | [diff] [blame] | 286 | .id = -1, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 287 | .dev = { |
Eric Miao | 4fe3224 | 2008-09-05 22:38:23 +0800 | [diff] [blame] | 288 | .platform_data = &spitz_gpio_leds_info, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 289 | }, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 290 | }; |
| 291 | |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 292 | #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) |
| 293 | static struct pxa2xx_spi_master spitz_spi_info = { |
| 294 | .num_chipselect = 3, |
| 295 | }; |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 296 | |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 297 | static struct ads7846_platform_data spitz_ads7846_info = { |
| 298 | .model = 7846, |
| 299 | .vref_delay_usecs = 100, |
| 300 | .x_plate_ohms = 419, |
| 301 | .y_plate_ohms = 486, |
| 302 | .gpio_pendown = SPITZ_GPIO_TP_INT, |
| 303 | }; |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 304 | |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 305 | static void spitz_ads7846_cs(u32 command) |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 306 | { |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 307 | gpio_set_value(SPITZ_GPIO_ADS7846_CS, !(command == PXA2XX_CS_ASSERT)); |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 308 | } |
| 309 | |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 310 | static struct pxa2xx_spi_chip spitz_ads7846_chip = { |
| 311 | .cs_control = spitz_ads7846_cs, |
| 312 | }; |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 313 | |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 314 | static void spitz_bl_kick_battery(void) |
| 315 | { |
| 316 | void (*kick_batt)(void); |
| 317 | |
| 318 | kick_batt = symbol_get(sharpsl_battery_kick); |
| 319 | if (kick_batt) { |
| 320 | kick_batt(); |
| 321 | symbol_put(sharpsl_battery_kick); |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | static struct corgi_lcd_platform_data spitz_lcdcon_info = { |
| 326 | .init_mode = CORGI_LCD_MODE_VGA, |
| 327 | .max_intensity = 0x2f, |
| 328 | .default_intensity = 0x1f, |
| 329 | .limit_mask = 0x0b, |
Eric Miao | ff7a4c7 | 2008-09-07 11:30:06 +0800 | [diff] [blame] | 330 | .gpio_backlight_cont = SPITZ_GPIO_BACKLIGHT_CONT, |
| 331 | .gpio_backlight_on = SPITZ_GPIO_BACKLIGHT_ON, |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 332 | .kick_battery = spitz_bl_kick_battery, |
| 333 | }; |
| 334 | |
| 335 | static void spitz_lcdcon_cs(u32 command) |
| 336 | { |
| 337 | gpio_set_value(SPITZ_GPIO_LCDCON_CS, !(command == PXA2XX_CS_ASSERT)); |
| 338 | } |
| 339 | |
| 340 | static struct pxa2xx_spi_chip spitz_lcdcon_chip = { |
| 341 | .cs_control = spitz_lcdcon_cs, |
| 342 | }; |
| 343 | |
| 344 | static void spitz_max1111_cs(u32 command) |
| 345 | { |
| 346 | gpio_set_value(SPITZ_GPIO_MAX1111_CS, !(command == PXA2XX_CS_ASSERT)); |
| 347 | } |
| 348 | |
| 349 | static struct pxa2xx_spi_chip spitz_max1111_chip = { |
| 350 | .cs_control = spitz_max1111_cs, |
| 351 | }; |
| 352 | |
| 353 | static struct spi_board_info spitz_spi_devices[] = { |
| 354 | { |
| 355 | .modalias = "ads7846", |
| 356 | .max_speed_hz = 1200000, |
| 357 | .bus_num = 2, |
| 358 | .chip_select = 0, |
| 359 | .platform_data = &spitz_ads7846_info, |
| 360 | .controller_data= &spitz_ads7846_chip, |
| 361 | .irq = gpio_to_irq(SPITZ_GPIO_TP_INT), |
| 362 | }, { |
| 363 | .modalias = "corgi-lcd", |
| 364 | .max_speed_hz = 50000, |
| 365 | .bus_num = 2, |
| 366 | .chip_select = 1, |
| 367 | .platform_data = &spitz_lcdcon_info, |
| 368 | .controller_data= &spitz_lcdcon_chip, |
| 369 | }, { |
| 370 | .modalias = "max1111", |
| 371 | .max_speed_hz = 450000, |
| 372 | .bus_num = 2, |
| 373 | .chip_select = 2, |
| 374 | .controller_data= &spitz_max1111_chip, |
| 375 | }, |
| 376 | }; |
| 377 | |
| 378 | static void __init spitz_init_spi(void) |
| 379 | { |
| 380 | int err; |
| 381 | |
| 382 | err = gpio_request(SPITZ_GPIO_ADS7846_CS, "ADS7846_CS"); |
| 383 | if (err) |
| 384 | return; |
| 385 | |
| 386 | err = gpio_request(SPITZ_GPIO_LCDCON_CS, "LCDCON_CS"); |
| 387 | if (err) |
| 388 | goto err_free_1; |
| 389 | |
| 390 | err = gpio_request(SPITZ_GPIO_MAX1111_CS, "MAX1111_CS"); |
| 391 | if (err) |
| 392 | goto err_free_2; |
| 393 | |
Dmitry Baryshkov | b6e642e | 2008-10-29 11:40:46 +0800 | [diff] [blame] | 394 | err = gpio_direction_output(SPITZ_GPIO_ADS7846_CS, 1); |
| 395 | if (err) |
| 396 | goto err_free_3; |
| 397 | err = gpio_direction_output(SPITZ_GPIO_LCDCON_CS, 1); |
| 398 | if (err) |
| 399 | goto err_free_3; |
| 400 | err = gpio_direction_output(SPITZ_GPIO_MAX1111_CS, 1); |
| 401 | if (err) |
| 402 | goto err_free_3; |
| 403 | |
Eric Miao | ff7a4c7 | 2008-09-07 11:30:06 +0800 | [diff] [blame] | 404 | if (machine_is_akita()) { |
| 405 | spitz_lcdcon_info.gpio_backlight_cont = AKITA_GPIO_BACKLIGHT_CONT; |
| 406 | spitz_lcdcon_info.gpio_backlight_on = AKITA_GPIO_BACKLIGHT_ON; |
| 407 | } |
| 408 | |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 409 | pxa2xx_set_spi_info(2, &spitz_spi_info); |
| 410 | spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices)); |
| 411 | return; |
| 412 | |
Dmitry Baryshkov | b6e642e | 2008-10-29 11:40:46 +0800 | [diff] [blame] | 413 | err_free_3: |
| 414 | gpio_free(SPITZ_GPIO_MAX1111_CS); |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 415 | err_free_2: |
| 416 | gpio_free(SPITZ_GPIO_LCDCON_CS); |
| 417 | err_free_1: |
| 418 | gpio_free(SPITZ_GPIO_ADS7846_CS); |
| 419 | } |
| 420 | #else |
| 421 | static inline void spitz_init_spi(void) {} |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 422 | #endif |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 423 | |
| 424 | /* |
| 425 | * MMC/SD Device |
| 426 | * |
| 427 | * The card detect interrupt isn't debounced so we delay it by 250ms |
| 428 | * to give the card a chance to fully insert/eject. |
| 429 | */ |
| 430 | |
| 431 | static struct pxamci_platform_data spitz_mci_platform_data; |
| 432 | |
David Howells | 40220c1 | 2006-10-09 12:19:47 +0100 | [diff] [blame] | 433 | static int spitz_mci_init(struct device *dev, irq_handler_t spitz_detect_int, void *data) |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 434 | { |
| 435 | int err; |
| 436 | |
Eric Miao | dd5980d | 2008-09-02 17:34:33 +0800 | [diff] [blame] | 437 | err = gpio_request(SPITZ_GPIO_nSD_DETECT, "nSD_DETECT"); |
| 438 | if (err) |
| 439 | goto err_out; |
| 440 | |
| 441 | err = gpio_request(SPITZ_GPIO_nSD_WP, "nSD_WP"); |
| 442 | if (err) |
| 443 | goto err_free_1; |
| 444 | |
| 445 | gpio_direction_input(SPITZ_GPIO_nSD_DETECT); |
| 446 | gpio_direction_input(SPITZ_GPIO_nSD_WP); |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 447 | |
| 448 | spitz_mci_platform_data.detect_delay = msecs_to_jiffies(250); |
| 449 | |
Russell King | 9ded96f | 2006-01-08 01:02:07 -0800 | [diff] [blame] | 450 | err = request_irq(SPITZ_IRQ_GPIO_nSD_DETECT, spitz_detect_int, |
Eric Miao | dd5980d | 2008-09-02 17:34:33 +0800 | [diff] [blame] | 451 | IRQF_DISABLED | IRQF_TRIGGER_RISING | |
| 452 | IRQF_TRIGGER_FALLING, |
Russell King | 9ded96f | 2006-01-08 01:02:07 -0800 | [diff] [blame] | 453 | "MMC card detect", data); |
Eric Miao | dd5980d | 2008-09-02 17:34:33 +0800 | [diff] [blame] | 454 | if (err) { |
| 455 | pr_err("%s: MMC/SD: can't request MMC card detect IRQ\n", |
| 456 | __func__); |
| 457 | goto err_free_2; |
| 458 | } |
| 459 | return 0; |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 460 | |
Eric Miao | dd5980d | 2008-09-02 17:34:33 +0800 | [diff] [blame] | 461 | err_free_2: |
| 462 | gpio_free(SPITZ_GPIO_nSD_WP); |
| 463 | err_free_1: |
| 464 | gpio_free(SPITZ_GPIO_nSD_DETECT); |
| 465 | err_out: |
Russell King | 2687bd3 | 2008-01-23 14:05:58 +0000 | [diff] [blame] | 466 | return err; |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 467 | } |
| 468 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 469 | static void spitz_mci_setpower(struct device *dev, unsigned int vdd) |
| 470 | { |
| 471 | struct pxamci_platform_data* p_d = dev->platform_data; |
| 472 | |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 473 | if (( 1 << vdd) & p_d->ocr_mask) |
| 474 | spitz_card_pwr_ctrl(SPITZ_PWR_SD, 0x0004); |
| 475 | else |
| 476 | spitz_card_pwr_ctrl(SPITZ_PWR_SD, 0x0000); |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 477 | } |
| 478 | |
| 479 | static int spitz_mci_get_ro(struct device *dev) |
| 480 | { |
Eric Miao | dd5980d | 2008-09-02 17:34:33 +0800 | [diff] [blame] | 481 | return gpio_get_value(SPITZ_GPIO_nSD_WP); |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 482 | } |
| 483 | |
| 484 | static void spitz_mci_exit(struct device *dev, void *data) |
| 485 | { |
| 486 | free_irq(SPITZ_IRQ_GPIO_nSD_DETECT, data); |
Eric Miao | dd5980d | 2008-09-02 17:34:33 +0800 | [diff] [blame] | 487 | gpio_free(SPITZ_GPIO_nSD_WP); |
| 488 | gpio_free(SPITZ_GPIO_nSD_DETECT); |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 489 | } |
| 490 | |
| 491 | static struct pxamci_platform_data spitz_mci_platform_data = { |
| 492 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
| 493 | .init = spitz_mci_init, |
| 494 | .get_ro = spitz_mci_get_ro, |
| 495 | .setpower = spitz_mci_setpower, |
| 496 | .exit = spitz_mci_exit, |
| 497 | }; |
| 498 | |
| 499 | |
| 500 | /* |
Richard Purdie | 3125c68 | 2006-01-05 20:44:52 +0000 | [diff] [blame] | 501 | * USB Host (OHCI) |
| 502 | */ |
| 503 | static int spitz_ohci_init(struct device *dev) |
| 504 | { |
Eric Miao | dd5980d | 2008-09-02 17:34:33 +0800 | [diff] [blame] | 505 | int err; |
Richard Purdie | 3125c68 | 2006-01-05 20:44:52 +0000 | [diff] [blame] | 506 | |
Eric Miao | dd5980d | 2008-09-02 17:34:33 +0800 | [diff] [blame] | 507 | err = gpio_request(SPITZ_GPIO_USB_HOST, "USB_HOST"); |
| 508 | if (err) |
| 509 | return err; |
| 510 | |
Eric Miao | 5e96ade | 2008-09-03 09:47:42 +0800 | [diff] [blame] | 511 | /* Only Port 2 is connected |
| 512 | * Setup USB Port 2 Output Control Register |
| 513 | */ |
Richard Purdie | 3125c68 | 2006-01-05 20:44:52 +0000 | [diff] [blame] | 514 | UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE; |
| 515 | |
Eric Miao | 097b533 | 2008-09-27 15:49:57 +0800 | [diff] [blame] | 516 | return gpio_direction_output(SPITZ_GPIO_USB_HOST, 1); |
Richard Purdie | 3125c68 | 2006-01-05 20:44:52 +0000 | [diff] [blame] | 517 | } |
| 518 | |
| 519 | static struct pxaohci_platform_data spitz_ohci_platform_data = { |
| 520 | .port_mode = PMM_NPS_MODE, |
| 521 | .init = spitz_ohci_init, |
Eric Miao | 097b533 | 2008-09-27 15:49:57 +0800 | [diff] [blame] | 522 | .flags = ENABLE_PORT_ALL | NO_OC_PROTECTION, |
Richard Purdie | 0c27c5d | 2006-06-08 22:44:07 +0100 | [diff] [blame] | 523 | .power_budget = 150, |
Richard Purdie | 3125c68 | 2006-01-05 20:44:52 +0000 | [diff] [blame] | 524 | }; |
| 525 | |
| 526 | |
| 527 | /* |
Richard Purdie | dc07845 | 2005-10-30 14:50:25 +0000 | [diff] [blame] | 528 | * Irda |
| 529 | */ |
Eric Miao | fff1472 | 2008-09-05 22:15:23 +0800 | [diff] [blame] | 530 | static int spitz_irda_startup(struct device *dev) |
| 531 | { |
| 532 | int rc; |
| 533 | |
| 534 | rc = gpio_request(SPITZ_GPIO_IR_ON, "IrDA on"); |
| 535 | if (rc) |
| 536 | goto err; |
| 537 | |
| 538 | rc = gpio_direction_output(SPITZ_GPIO_IR_ON, 1); |
| 539 | if (rc) |
| 540 | goto err_dir; |
| 541 | |
| 542 | return 0; |
| 543 | |
| 544 | err_dir: |
| 545 | gpio_free(SPITZ_GPIO_IR_ON); |
| 546 | err: |
| 547 | return rc; |
| 548 | } |
| 549 | |
| 550 | static void spitz_irda_shutdown(struct device *dev) |
| 551 | { |
| 552 | gpio_free(SPITZ_GPIO_IR_ON); |
| 553 | } |
| 554 | |
Richard Purdie | dc07845 | 2005-10-30 14:50:25 +0000 | [diff] [blame] | 555 | static void spitz_irda_transceiver_mode(struct device *dev, int mode) |
| 556 | { |
Eric Miao | fff1472 | 2008-09-05 22:15:23 +0800 | [diff] [blame] | 557 | gpio_set_value(SPITZ_GPIO_IR_ON, mode & IR_OFF); |
Dmitry Baryshkov | 0fc3ff3 | 2008-07-02 13:54:46 +0100 | [diff] [blame] | 558 | pxa2xx_transceiver_mode(dev, mode); |
Richard Purdie | dc07845 | 2005-10-30 14:50:25 +0000 | [diff] [blame] | 559 | } |
| 560 | |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 561 | #ifdef CONFIG_MACH_AKITA |
| 562 | static void akita_irda_transceiver_mode(struct device *dev, int mode) |
| 563 | { |
Eric Miao | f72de66 | 2008-09-06 08:46:23 +0800 | [diff] [blame] | 564 | gpio_set_value(AKITA_GPIO_IR_ON, mode & IR_OFF); |
Dmitry Baryshkov | 0fc3ff3 | 2008-07-02 13:54:46 +0100 | [diff] [blame] | 565 | pxa2xx_transceiver_mode(dev, mode); |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 566 | } |
| 567 | #endif |
| 568 | |
Richard Purdie | dc07845 | 2005-10-30 14:50:25 +0000 | [diff] [blame] | 569 | static struct pxaficp_platform_data spitz_ficp_platform_data = { |
Eric Miao | fff1472 | 2008-09-05 22:15:23 +0800 | [diff] [blame] | 570 | .transceiver_cap = IR_SIRMODE | IR_OFF, |
| 571 | .transceiver_mode = spitz_irda_transceiver_mode, |
| 572 | .startup = spitz_irda_startup, |
| 573 | .shutdown = spitz_irda_shutdown, |
Richard Purdie | dc07845 | 2005-10-30 14:50:25 +0000 | [diff] [blame] | 574 | }; |
| 575 | |
| 576 | |
| 577 | /* |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 578 | * Spitz PXA Framebuffer |
| 579 | */ |
Richard Purdie | d14b272 | 2006-09-20 22:54:21 +0100 | [diff] [blame] | 580 | |
| 581 | static struct pxafb_mode_info spitz_pxafb_modes[] = { |
| 582 | { |
| 583 | .pixclock = 19231, |
| 584 | .xres = 480, |
| 585 | .yres = 640, |
| 586 | .bpp = 16, |
| 587 | .hsync_len = 40, |
| 588 | .left_margin = 46, |
| 589 | .right_margin = 125, |
| 590 | .vsync_len = 3, |
| 591 | .upper_margin = 1, |
| 592 | .lower_margin = 0, |
| 593 | .sync = 0, |
| 594 | },{ |
| 595 | .pixclock = 134617, |
| 596 | .xres = 240, |
| 597 | .yres = 320, |
| 598 | .bpp = 16, |
| 599 | .hsync_len = 20, |
| 600 | .left_margin = 20, |
| 601 | .right_margin = 46, |
| 602 | .vsync_len = 2, |
| 603 | .upper_margin = 1, |
| 604 | .lower_margin = 0, |
| 605 | .sync = 0, |
| 606 | }, |
| 607 | }; |
| 608 | |
| 609 | static struct pxafb_mach_info spitz_pxafb_info = { |
| 610 | .modes = &spitz_pxafb_modes[0], |
| 611 | .num_modes = 2, |
| 612 | .fixed_modes = 1, |
Eric Miao | 79009a0 | 2008-09-03 10:00:38 +0800 | [diff] [blame] | 613 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_ALTERNATE_MAPPING, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 614 | }; |
| 615 | |
| 616 | |
Dmitry Baryshkov | e5d3bf3 | 2008-11-25 00:57:28 +0300 | [diff] [blame^] | 617 | static struct mtd_partition sharpsl_rom_parts[] = { |
| 618 | { |
| 619 | .name ="Boot PROM Filesystem", |
| 620 | .offset = 0x00140000, |
| 621 | .size = MTDPART_SIZ_FULL, |
| 622 | }, |
| 623 | }; |
| 624 | |
| 625 | static struct physmap_flash_data sharpsl_rom_data = { |
| 626 | .width = 2, |
| 627 | .nr_parts = ARRAY_SIZE(sharpsl_rom_parts), |
| 628 | .parts = sharpsl_rom_parts, |
| 629 | }; |
| 630 | |
| 631 | static struct resource sharpsl_rom_resources[] = { |
| 632 | { |
| 633 | .start = 0x00000000, |
| 634 | .end = 0x007fffff, |
| 635 | .flags = IORESOURCE_MEM, |
| 636 | }, |
| 637 | }; |
| 638 | |
| 639 | static struct platform_device sharpsl_rom_device = { |
| 640 | .name = "physmap-flash", |
| 641 | .id = -1, |
| 642 | .resource = sharpsl_rom_resources, |
| 643 | .num_resources = ARRAY_SIZE(sharpsl_rom_resources), |
| 644 | .dev.platform_data = &sharpsl_rom_data, |
| 645 | }; |
| 646 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 647 | static struct platform_device *devices[] __initdata = { |
| 648 | &spitzscoop_device, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 649 | &spitzkbd_device, |
Richard Purdie | 3179108 | 2006-03-31 02:31:09 -0800 | [diff] [blame] | 650 | &spitzled_device, |
Dmitry Baryshkov | e5d3bf3 | 2008-11-25 00:57:28 +0300 | [diff] [blame^] | 651 | &sharpsl_rom_device, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 652 | }; |
| 653 | |
Richard Purdie | 74617fb | 2006-06-19 19:57:12 +0100 | [diff] [blame] | 654 | static void spitz_poweroff(void) |
| 655 | { |
Dmitry Baryshkov | 86159a9 | 2008-05-22 16:21:48 +0100 | [diff] [blame] | 656 | arm_machine_restart('g'); |
Richard Purdie | 74617fb | 2006-06-19 19:57:12 +0100 | [diff] [blame] | 657 | } |
| 658 | |
| 659 | static void spitz_restart(char mode) |
| 660 | { |
| 661 | /* Bootloader magic for a reboot */ |
| 662 | if((MSC0 & 0xffff0000) == 0x7ff00000) |
| 663 | MSC0 = (MSC0 & 0xffff) | 0x7ee00000; |
| 664 | |
| 665 | spitz_poweroff(); |
| 666 | } |
| 667 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 668 | static void __init common_init(void) |
| 669 | { |
Dmitry Baryshkov | 69fc7ee | 2008-10-09 16:58:13 +0100 | [diff] [blame] | 670 | init_gpio_reset(SPITZ_GPIO_ON_RESET, 1); |
Richard Purdie | 74617fb | 2006-06-19 19:57:12 +0100 | [diff] [blame] | 671 | pm_power_off = spitz_poweroff; |
| 672 | arm_pm_restart = spitz_restart; |
| 673 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 674 | PMCR = 0x00; |
| 675 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 676 | /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */ |
| 677 | PCFR |= PCFR_OPDE; |
| 678 | |
Eric Miao | 5e96ade | 2008-09-03 09:47:42 +0800 | [diff] [blame] | 679 | pxa2xx_mfp_config(ARRAY_AND_SIZE(spitz_pin_config)); |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 680 | |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 681 | spitz_init_spi(); |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 682 | |
| 683 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
| 684 | pxa_set_mci_info(&spitz_mci_platform_data); |
Richard Purdie | 3125c68 | 2006-01-05 20:44:52 +0000 | [diff] [blame] | 685 | pxa_set_ohci_info(&spitz_ohci_platform_data); |
Richard Purdie | dc07845 | 2005-10-30 14:50:25 +0000 | [diff] [blame] | 686 | pxa_set_ficp_info(&spitz_ficp_platform_data); |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 687 | set_pxa_fb_info(&spitz_pxafb_info); |
Mark Brown | f8787fd | 2008-08-26 13:30:03 +0100 | [diff] [blame] | 688 | pxa_set_i2c_info(NULL); |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 689 | } |
| 690 | |
Richard Purdie | ca4d6cf | 2008-01-02 01:09:54 +0100 | [diff] [blame] | 691 | #if defined(CONFIG_MACH_SPITZ) || defined(CONFIG_MACH_BORZOI) |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 692 | static void __init spitz_init(void) |
| 693 | { |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 694 | platform_scoop_config = &spitz_pcmcia_config; |
| 695 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 696 | common_init(); |
| 697 | |
| 698 | platform_device_register(&spitzscoop2_device); |
| 699 | } |
Richard Purdie | ca4d6cf | 2008-01-02 01:09:54 +0100 | [diff] [blame] | 700 | #endif |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 701 | |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 702 | #ifdef CONFIG_MACH_AKITA |
| 703 | /* |
| 704 | * Akita IO Expander |
| 705 | */ |
Eric Miao | f72de66 | 2008-09-06 08:46:23 +0800 | [diff] [blame] | 706 | static struct pca953x_platform_data akita_ioexp = { |
| 707 | .gpio_base = AKITA_IOEXP_GPIO_BASE, |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 708 | }; |
| 709 | |
Eric Miao | f72de66 | 2008-09-06 08:46:23 +0800 | [diff] [blame] | 710 | static struct i2c_board_info akita_i2c_board_info[] = { |
| 711 | { |
| 712 | .type = "max7310", |
| 713 | .addr = 0x18, |
| 714 | .platform_data = &akita_ioexp, |
| 715 | }, |
| 716 | }; |
Richard Purdie | ca4d6cf | 2008-01-02 01:09:54 +0100 | [diff] [blame] | 717 | |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 718 | static void __init akita_init(void) |
| 719 | { |
| 720 | spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode; |
| 721 | |
| 722 | /* We just pretend the second element of the array doesn't exist */ |
| 723 | spitz_pcmcia_config.num_devs = 1; |
| 724 | platform_scoop_config = &spitz_pcmcia_config; |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 725 | |
Eric Miao | f72de66 | 2008-09-06 08:46:23 +0800 | [diff] [blame] | 726 | i2c_register_board_info(0, ARRAY_AND_SIZE(akita_i2c_board_info)); |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 727 | |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 728 | common_init(); |
| 729 | } |
| 730 | #endif |
| 731 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 732 | static void __init fixup_spitz(struct machine_desc *desc, |
| 733 | struct tag *tags, char **cmdline, struct meminfo *mi) |
| 734 | { |
| 735 | sharpsl_save_param(); |
| 736 | mi->nr_banks = 1; |
| 737 | mi->bank[0].start = 0xa0000000; |
| 738 | mi->bank[0].node = 0; |
| 739 | mi->bank[0].size = (64*1024*1024); |
| 740 | } |
| 741 | |
| 742 | #ifdef CONFIG_MACH_SPITZ |
| 743 | MACHINE_START(SPITZ, "SHARP Spitz") |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 744 | .phys_io = 0x40000000, |
| 745 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
| 746 | .fixup = fixup_spitz, |
| 747 | .map_io = pxa_map_io, |
Eric Miao | cd49104 | 2007-06-22 04:14:09 +0100 | [diff] [blame] | 748 | .init_irq = pxa27x_init_irq, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 749 | .init_machine = spitz_init, |
| 750 | .timer = &pxa_timer, |
| 751 | MACHINE_END |
| 752 | #endif |
| 753 | |
| 754 | #ifdef CONFIG_MACH_BORZOI |
| 755 | MACHINE_START(BORZOI, "SHARP Borzoi") |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 756 | .phys_io = 0x40000000, |
| 757 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
| 758 | .fixup = fixup_spitz, |
| 759 | .map_io = pxa_map_io, |
Eric Miao | cd49104 | 2007-06-22 04:14:09 +0100 | [diff] [blame] | 760 | .init_irq = pxa27x_init_irq, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 761 | .init_machine = spitz_init, |
| 762 | .timer = &pxa_timer, |
| 763 | MACHINE_END |
| 764 | #endif |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 765 | |
| 766 | #ifdef CONFIG_MACH_AKITA |
| 767 | MACHINE_START(AKITA, "SHARP Akita") |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 768 | .phys_io = 0x40000000, |
| 769 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
| 770 | .fixup = fixup_spitz, |
| 771 | .map_io = pxa_map_io, |
Eric Miao | cd49104 | 2007-06-22 04:14:09 +0100 | [diff] [blame] | 772 | .init_irq = pxa27x_init_irq, |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 773 | .init_machine = akita_init, |
| 774 | .timer = &pxa_timer, |
| 775 | MACHINE_END |
| 776 | #endif |