Thomas Gleixner | d2912cb | 2019-06-04 10:11:33 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 2 | /* |
| 3 | * Hardware definitions for PalmTX |
| 4 | * |
| 5 | * Author: Marek Vasut <marek.vasut@gmail.com> |
| 6 | * |
| 7 | * Based on work of: |
| 8 | * Alex Osborne <ato@meshy.org> |
| 9 | * Cristiano P. <cristianop@users.sourceforge.net> |
| 10 | * Jan Herman <2hp@seznam.cz> |
| 11 | * Michal Hrusecky |
| 12 | * |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 13 | * (find more info at www.hackndev.com) |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #include <linux/platform_device.h> |
| 17 | #include <linux/delay.h> |
| 18 | #include <linux/irq.h> |
| 19 | #include <linux/gpio_keys.h> |
| 20 | #include <linux/input.h> |
Marek Vašut | d4b19c4 | 2008-07-07 17:31:58 +0100 | [diff] [blame] | 21 | #include <linux/pda_power.h> |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 22 | #include <linux/pwm_backlight.h> |
| 23 | #include <linux/gpio.h> |
Marek Vasut | 241cf47 | 2010-06-04 03:07:33 +0200 | [diff] [blame] | 24 | #include <linux/wm97xx.h> |
Marek Vašut | 4e9687d | 2008-09-11 19:37:32 +0100 | [diff] [blame] | 25 | #include <linux/power_supply.h> |
Marek Vasut | 8768dc9 | 2009-04-23 11:12:37 +0200 | [diff] [blame] | 26 | #include <linux/usb/gpio_vbus.h> |
Boris Brezillon | c7921bb | 2018-09-07 00:38:46 +0200 | [diff] [blame] | 27 | #include <linux/mtd/platnand.h> |
Marek Vasut | 91cf6a9 | 2009-07-27 02:07:41 +0200 | [diff] [blame] | 28 | #include <linux/mtd/mtd.h> |
| 29 | #include <linux/mtd/physmap.h> |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 30 | |
| 31 | #include <asm/mach-types.h> |
| 32 | #include <asm/mach/arch.h> |
| 33 | #include <asm/mach/map.h> |
| 34 | |
Arnd Bergmann | 4c25c5d | 2015-01-30 10:45:33 +0100 | [diff] [blame] | 35 | #include "pxa27x.h" |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 36 | #include <mach/audio.h> |
| 37 | #include <mach/palmtx.h> |
Arnd Bergmann | 293b2da | 2012-08-24 15:16:48 +0200 | [diff] [blame] | 38 | #include <linux/platform_data/mmc-pxamci.h> |
| 39 | #include <linux/platform_data/video-pxafb.h> |
| 40 | #include <linux/platform_data/irda-pxaficp.h> |
| 41 | #include <linux/platform_data/keypad-pxa27x.h> |
Arnd Bergmann | 4c25c5d | 2015-01-30 10:45:33 +0100 | [diff] [blame] | 42 | #include "udc.h" |
Arnd Bergmann | 293b2da | 2012-08-24 15:16:48 +0200 | [diff] [blame] | 43 | #include <linux/platform_data/asoc-palm27x.h> |
Arnd Bergmann | 4c25c5d | 2015-01-30 10:45:33 +0100 | [diff] [blame] | 44 | #include "palm27x.h" |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 45 | |
| 46 | #include "generic.h" |
| 47 | #include "devices.h" |
| 48 | |
| 49 | /****************************************************************************** |
| 50 | * Pin configuration |
| 51 | ******************************************************************************/ |
| 52 | static unsigned long palmtx_pin_config[] __initdata = { |
| 53 | /* MMC */ |
| 54 | GPIO32_MMC_CLK, |
| 55 | GPIO92_MMC_DAT_0, |
| 56 | GPIO109_MMC_DAT_1, |
| 57 | GPIO110_MMC_DAT_2, |
| 58 | GPIO111_MMC_DAT_3, |
| 59 | GPIO112_MMC_CMD, |
Marek Vasut | a730b32 | 2008-11-20 17:34:57 +0100 | [diff] [blame] | 60 | GPIO14_GPIO, /* SD detect */ |
| 61 | GPIO114_GPIO, /* SD power */ |
| 62 | GPIO115_GPIO, /* SD r/o switch */ |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 63 | |
| 64 | /* AC97 */ |
| 65 | GPIO28_AC97_BITCLK, |
| 66 | GPIO29_AC97_SDATA_IN_0, |
| 67 | GPIO30_AC97_SDATA_OUT, |
| 68 | GPIO31_AC97_SYNC, |
Marek Vasut | 6ec04f4 | 2009-05-22 01:39:10 +0200 | [diff] [blame] | 69 | GPIO89_AC97_SYSCLK, |
Marek Vasut | efb12cd | 2009-04-12 16:37:23 +0200 | [diff] [blame] | 70 | GPIO95_AC97_nRESET, |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 71 | |
| 72 | /* IrDA */ |
Marek Vasut | a730b32 | 2008-11-20 17:34:57 +0100 | [diff] [blame] | 73 | GPIO40_GPIO, /* ir disable */ |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 74 | GPIO46_FICP_RXD, |
| 75 | GPIO47_FICP_TXD, |
| 76 | |
| 77 | /* PWM */ |
| 78 | GPIO16_PWM0_OUT, |
| 79 | |
| 80 | /* USB */ |
Marek Vasut | a730b32 | 2008-11-20 17:34:57 +0100 | [diff] [blame] | 81 | GPIO13_GPIO, /* usb detect */ |
Marek Vasut | efb12cd | 2009-04-12 16:37:23 +0200 | [diff] [blame] | 82 | GPIO93_GPIO, /* usb power */ |
Marek Vašut | 3597840 | 2008-07-07 17:28:59 +0100 | [diff] [blame] | 83 | |
| 84 | /* PCMCIA */ |
| 85 | GPIO48_nPOE, |
| 86 | GPIO49_nPWE, |
| 87 | GPIO50_nPIOR, |
| 88 | GPIO51_nPIOW, |
| 89 | GPIO85_nPCE_1, |
| 90 | GPIO54_nPCE_2, |
| 91 | GPIO79_PSKTSEL, |
| 92 | GPIO55_nPREG, |
| 93 | GPIO56_nPWAIT, |
| 94 | GPIO57_nIOIS16, |
Marek Vasut | a730b32 | 2008-11-20 17:34:57 +0100 | [diff] [blame] | 95 | GPIO94_GPIO, /* wifi power 1 */ |
| 96 | GPIO108_GPIO, /* wifi power 2 */ |
| 97 | GPIO116_GPIO, /* wifi ready */ |
| 98 | |
| 99 | /* MATRIX KEYPAD */ |
Marek Vasut | 81854f8 | 2009-03-28 12:37:42 +0100 | [diff] [blame] | 100 | GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, |
| 101 | GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH, |
| 102 | GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH, |
| 103 | GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH, |
Marek Vasut | a730b32 | 2008-11-20 17:34:57 +0100 | [diff] [blame] | 104 | GPIO103_KP_MKOUT_0, |
| 105 | GPIO104_KP_MKOUT_1, |
| 106 | GPIO105_KP_MKOUT_2, |
| 107 | |
| 108 | /* LCD */ |
Eric Miao | bedbda9 | 2010-01-04 11:37:14 +0800 | [diff] [blame] | 109 | GPIOxx_LCD_TFT_16BPP, |
Marek Vasut | a730b32 | 2008-11-20 17:34:57 +0100 | [diff] [blame] | 110 | |
Marek Vasut | ecf763c | 2009-07-16 19:37:29 +0200 | [diff] [blame] | 111 | /* FFUART */ |
| 112 | GPIO34_FFUART_RXD, |
| 113 | GPIO39_FFUART_TXD, |
| 114 | |
Marek Vasut | 3eb37ff | 2009-07-18 16:51:41 +0200 | [diff] [blame] | 115 | /* NAND */ |
| 116 | GPIO15_nCS_1, |
| 117 | GPIO18_RDY, |
| 118 | |
Marek Vasut | a730b32 | 2008-11-20 17:34:57 +0100 | [diff] [blame] | 119 | /* MISC. */ |
| 120 | GPIO10_GPIO, /* hotsync button */ |
| 121 | GPIO12_GPIO, /* power detect */ |
| 122 | GPIO107_GPIO, /* earphone detect */ |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 123 | }; |
| 124 | |
| 125 | /****************************************************************************** |
Marek Vasut | 91cf6a9 | 2009-07-27 02:07:41 +0200 | [diff] [blame] | 126 | * NOR Flash |
| 127 | ******************************************************************************/ |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 128 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
Marek Vasut | 91cf6a9 | 2009-07-27 02:07:41 +0200 | [diff] [blame] | 129 | static struct mtd_partition palmtx_partitions[] = { |
| 130 | { |
| 131 | .name = "Flash", |
| 132 | .offset = 0x00000000, |
| 133 | .size = MTDPART_SIZ_FULL, |
| 134 | .mask_flags = 0 |
| 135 | } |
| 136 | }; |
| 137 | |
| 138 | static struct physmap_flash_data palmtx_flash_data[] = { |
| 139 | { |
| 140 | .width = 2, /* bankwidth in bytes */ |
| 141 | .parts = palmtx_partitions, |
| 142 | .nr_parts = ARRAY_SIZE(palmtx_partitions) |
| 143 | } |
| 144 | }; |
| 145 | |
| 146 | static struct resource palmtx_flash_resource = { |
| 147 | .start = PXA_CS0_PHYS, |
| 148 | .end = PXA_CS0_PHYS + SZ_8M - 1, |
| 149 | .flags = IORESOURCE_MEM, |
| 150 | }; |
| 151 | |
| 152 | static struct platform_device palmtx_flash = { |
| 153 | .name = "physmap-flash", |
| 154 | .id = 0, |
| 155 | .resource = &palmtx_flash_resource, |
| 156 | .num_resources = 1, |
| 157 | .dev = { |
| 158 | .platform_data = palmtx_flash_data, |
| 159 | }, |
| 160 | }; |
| 161 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 162 | static void __init palmtx_nor_init(void) |
| 163 | { |
| 164 | platform_device_register(&palmtx_flash); |
| 165 | } |
| 166 | #else |
| 167 | static inline void palmtx_nor_init(void) {} |
| 168 | #endif |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 169 | |
| 170 | /****************************************************************************** |
| 171 | * GPIO keyboard |
| 172 | ******************************************************************************/ |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 173 | #if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE) |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame] | 174 | static const unsigned int palmtx_matrix_keys[] = { |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 175 | KEY(0, 0, KEY_POWER), |
| 176 | KEY(0, 1, KEY_F1), |
| 177 | KEY(0, 2, KEY_ENTER), |
| 178 | |
| 179 | KEY(1, 0, KEY_F2), |
| 180 | KEY(1, 1, KEY_F3), |
| 181 | KEY(1, 2, KEY_F4), |
| 182 | |
| 183 | KEY(2, 0, KEY_UP), |
| 184 | KEY(2, 2, KEY_DOWN), |
| 185 | |
| 186 | KEY(3, 0, KEY_RIGHT), |
| 187 | KEY(3, 2, KEY_LEFT), |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 188 | }; |
| 189 | |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame] | 190 | static struct matrix_keymap_data palmtx_matrix_keymap_data = { |
| 191 | .keymap = palmtx_matrix_keys, |
| 192 | .keymap_size = ARRAY_SIZE(palmtx_matrix_keys), |
| 193 | }; |
| 194 | |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 195 | static struct pxa27x_keypad_platform_data palmtx_keypad_platform_data = { |
| 196 | .matrix_key_rows = 4, |
| 197 | .matrix_key_cols = 3, |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame] | 198 | .matrix_keymap_data = &palmtx_matrix_keymap_data, |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 199 | |
| 200 | .debounce_interval = 30, |
| 201 | }; |
| 202 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 203 | static void __init palmtx_kpc_init(void) |
| 204 | { |
| 205 | pxa_set_keypad_info(&palmtx_keypad_platform_data); |
| 206 | } |
| 207 | #else |
| 208 | static inline void palmtx_kpc_init(void) {} |
| 209 | #endif |
| 210 | |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 211 | /****************************************************************************** |
| 212 | * GPIO keys |
| 213 | ******************************************************************************/ |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 214 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 215 | static struct gpio_keys_button palmtx_pxa_buttons[] = { |
| 216 | {KEY_F8, GPIO_NR_PALMTX_HOTSYNC_BUTTON_N, 1, "HotSync Button" }, |
| 217 | }; |
| 218 | |
| 219 | static struct gpio_keys_platform_data palmtx_pxa_keys_data = { |
| 220 | .buttons = palmtx_pxa_buttons, |
| 221 | .nbuttons = ARRAY_SIZE(palmtx_pxa_buttons), |
| 222 | }; |
| 223 | |
| 224 | static struct platform_device palmtx_pxa_keys = { |
| 225 | .name = "gpio-keys", |
| 226 | .id = -1, |
| 227 | .dev = { |
| 228 | .platform_data = &palmtx_pxa_keys_data, |
| 229 | }, |
| 230 | }; |
| 231 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 232 | static void __init palmtx_keys_init(void) |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 233 | { |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 234 | platform_device_register(&palmtx_pxa_keys); |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 235 | } |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 236 | #else |
| 237 | static inline void palmtx_keys_init(void) {} |
| 238 | #endif |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 239 | |
| 240 | /****************************************************************************** |
Marek Vasut | 3eb37ff | 2009-07-18 16:51:41 +0200 | [diff] [blame] | 241 | * NAND Flash |
| 242 | ******************************************************************************/ |
Marek Vasut | 9f1ee15 | 2010-11-06 23:34:03 +0100 | [diff] [blame] | 243 | #if defined(CONFIG_MTD_NAND_PLATFORM) || \ |
| 244 | defined(CONFIG_MTD_NAND_PLATFORM_MODULE) |
Boris Brezillon | 47bd59e | 2018-09-06 14:05:13 +0200 | [diff] [blame] | 245 | static void palmtx_nand_cmd_ctl(struct nand_chip *this, int cmd, |
| 246 | unsigned int ctrl) |
Marek Vasut | 3eb37ff | 2009-07-18 16:51:41 +0200 | [diff] [blame] | 247 | { |
Boris Brezillon | 82fc509 | 2018-09-07 00:38:34 +0200 | [diff] [blame] | 248 | char __iomem *nandaddr = this->legacy.IO_ADDR_W; |
Marek Vasut | 3eb37ff | 2009-07-18 16:51:41 +0200 | [diff] [blame] | 249 | |
| 250 | if (cmd == NAND_CMD_NONE) |
| 251 | return; |
| 252 | |
| 253 | if (ctrl & NAND_CLE) |
| 254 | writeb(cmd, PALMTX_NAND_CLE_VIRT); |
| 255 | else if (ctrl & NAND_ALE) |
| 256 | writeb(cmd, PALMTX_NAND_ALE_VIRT); |
| 257 | else |
| 258 | writeb(cmd, nandaddr); |
| 259 | } |
| 260 | |
| 261 | static struct mtd_partition palmtx_partition_info[] = { |
| 262 | [0] = { |
| 263 | .name = "palmtx-0", |
| 264 | .offset = 0, |
| 265 | .size = MTDPART_SIZ_FULL |
| 266 | }, |
| 267 | }; |
| 268 | |
Marek Vasut | 3eb37ff | 2009-07-18 16:51:41 +0200 | [diff] [blame] | 269 | struct platform_nand_data palmtx_nand_platdata = { |
| 270 | .chip = { |
| 271 | .nr_chips = 1, |
| 272 | .chip_offset = 0, |
| 273 | .nr_partitions = ARRAY_SIZE(palmtx_partition_info), |
| 274 | .partitions = palmtx_partition_info, |
| 275 | .chip_delay = 20, |
Marek Vasut | 3eb37ff | 2009-07-18 16:51:41 +0200 | [diff] [blame] | 276 | }, |
| 277 | .ctrl = { |
| 278 | .cmd_ctrl = palmtx_nand_cmd_ctl, |
| 279 | }, |
| 280 | }; |
| 281 | |
| 282 | static struct resource palmtx_nand_resource[] = { |
| 283 | [0] = { |
| 284 | .start = PXA_CS1_PHYS, |
| 285 | .end = PXA_CS1_PHYS + SZ_1M - 1, |
| 286 | .flags = IORESOURCE_MEM, |
| 287 | }, |
| 288 | }; |
| 289 | |
| 290 | static struct platform_device palmtx_nand = { |
| 291 | .name = "gen_nand", |
| 292 | .num_resources = ARRAY_SIZE(palmtx_nand_resource), |
| 293 | .resource = palmtx_nand_resource, |
| 294 | .id = -1, |
| 295 | .dev = { |
| 296 | .platform_data = &palmtx_nand_platdata, |
| 297 | } |
| 298 | }; |
| 299 | |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 300 | static void __init palmtx_nand_init(void) |
Marek Vasut | 81854f8 | 2009-03-28 12:37:42 +0100 | [diff] [blame] | 301 | { |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 302 | platform_device_register(&palmtx_nand); |
Marek Vasut | 81854f8 | 2009-03-28 12:37:42 +0100 | [diff] [blame] | 303 | } |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 304 | #else |
| 305 | static inline void palmtx_nand_init(void) {} |
| 306 | #endif |
Marek Vasut | 81854f8 | 2009-03-28 12:37:42 +0100 | [diff] [blame] | 307 | |
Marek Vasut | 81854f8 | 2009-03-28 12:37:42 +0100 | [diff] [blame] | 308 | /****************************************************************************** |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 309 | * Machine init |
| 310 | ******************************************************************************/ |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 311 | static struct map_desc palmtx_io_desc[] __initdata = { |
| 312 | { |
Arnd Bergmann | 97b09da | 2011-10-01 22:03:45 +0200 | [diff] [blame] | 313 | .virtual = (unsigned long)PALMTX_PCMCIA_VIRT, |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 314 | .pfn = __phys_to_pfn(PALMTX_PCMCIA_PHYS), |
| 315 | .length = PALMTX_PCMCIA_SIZE, |
Marek Vasut | 3eb37ff | 2009-07-18 16:51:41 +0200 | [diff] [blame] | 316 | .type = MT_DEVICE, |
| 317 | }, { |
Arnd Bergmann | 97b09da | 2011-10-01 22:03:45 +0200 | [diff] [blame] | 318 | .virtual = (unsigned long)PALMTX_NAND_ALE_VIRT, |
Marek Vasut | 3eb37ff | 2009-07-18 16:51:41 +0200 | [diff] [blame] | 319 | .pfn = __phys_to_pfn(PALMTX_NAND_ALE_PHYS), |
| 320 | .length = SZ_1M, |
| 321 | .type = MT_DEVICE, |
| 322 | }, { |
Arnd Bergmann | 97b09da | 2011-10-01 22:03:45 +0200 | [diff] [blame] | 323 | .virtual = (unsigned long)PALMTX_NAND_CLE_VIRT, |
Marek Vasut | 3eb37ff | 2009-07-18 16:51:41 +0200 | [diff] [blame] | 324 | .pfn = __phys_to_pfn(PALMTX_NAND_CLE_PHYS), |
| 325 | .length = SZ_1M, |
| 326 | .type = MT_DEVICE, |
| 327 | } |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 328 | }; |
| 329 | |
| 330 | static void __init palmtx_map_io(void) |
| 331 | { |
Marek Vasut | 851982c | 2010-10-11 02:20:19 +0200 | [diff] [blame] | 332 | pxa27x_map_io(); |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 333 | iotable_init(palmtx_io_desc, ARRAY_SIZE(palmtx_io_desc)); |
| 334 | } |
| 335 | |
Linus Walleij | 58e2d87 | 2018-12-02 09:43:23 +0100 | [diff] [blame] | 336 | static struct gpiod_lookup_table palmtx_mci_gpio_table = { |
| 337 | .dev_id = "pxa2xx-mci.0", |
| 338 | .table = { |
| 339 | GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMTX_SD_DETECT_N, |
| 340 | "cd", GPIO_ACTIVE_LOW), |
| 341 | GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMTX_SD_READONLY, |
| 342 | "wp", GPIO_ACTIVE_LOW), |
Linus Walleij | f54005b | 2018-12-02 09:43:27 +0100 | [diff] [blame] | 343 | GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMTX_SD_POWER, |
| 344 | "power", GPIO_ACTIVE_HIGH), |
Linus Walleij | 58e2d87 | 2018-12-02 09:43:23 +0100 | [diff] [blame] | 345 | { }, |
| 346 | }, |
| 347 | }; |
| 348 | |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 349 | static void __init palmtx_init(void) |
| 350 | { |
| 351 | pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtx_pin_config)); |
Russell King | cc155c6 | 2009-11-09 13:34:08 +0800 | [diff] [blame] | 352 | pxa_set_ffuart_info(NULL); |
| 353 | pxa_set_btuart_info(NULL); |
| 354 | pxa_set_stuart_info(NULL); |
| 355 | |
Linus Walleij | f54005b | 2018-12-02 09:43:27 +0100 | [diff] [blame] | 356 | palm27x_mmc_init(&palmtx_mci_gpio_table); |
Marek Vasut | 31620e2 | 2010-07-13 08:16:45 +0200 | [diff] [blame] | 357 | palm27x_pm_init(PALMTX_STR_BASE); |
| 358 | palm27x_lcd_init(-1, &palm_320x480_lcd_mode); |
| 359 | palm27x_udc_init(GPIO_NR_PALMTX_USB_DETECT_N, |
| 360 | GPIO_NR_PALMTX_USB_PULLUP, 1); |
| 361 | palm27x_irda_init(GPIO_NR_PALMTX_IR_DISABLE); |
| 362 | palm27x_ac97_init(PALMTX_BAT_MIN_VOLTAGE, PALMTX_BAT_MAX_VOLTAGE, |
| 363 | GPIO_NR_PALMTX_EARPHONE_DETECT, 95); |
| 364 | palm27x_pwm_init(GPIO_NR_PALMTX_BL_POWER, GPIO_NR_PALMTX_LCD_POWER); |
| 365 | palm27x_power_init(GPIO_NR_PALMTX_POWER_DETECT, -1); |
| 366 | palm27x_pmic_init(); |
| 367 | palmtx_kpc_init(); |
| 368 | palmtx_keys_init(); |
| 369 | palmtx_nor_init(); |
| 370 | palmtx_nand_init(); |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 371 | } |
| 372 | |
| 373 | MACHINE_START(PALMTX, "Palm T|X") |
Nicolas Pitre | 7375aba | 2011-07-05 22:38:15 -0400 | [diff] [blame] | 374 | .atag_offset = 0x100, |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 375 | .map_io = palmtx_map_io, |
Rob Herring | 4e61109 | 2012-01-03 16:53:48 -0600 | [diff] [blame] | 376 | .nr_irqs = PXA_NR_IRQS, |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 377 | .init_irq = pxa27x_init_irq, |
Eric Miao | 8a97ae2 | 2011-05-18 21:30:04 +0800 | [diff] [blame] | 378 | .handle_irq = pxa27x_handle_irq, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 379 | .init_time = pxa_timer_init, |
Russell King | 271a74f | 2011-11-04 14:15:53 +0000 | [diff] [blame] | 380 | .init_machine = palmtx_init, |
| 381 | .restart = pxa_restart, |
Marek Vašut | b5e4ad5 | 2008-07-07 17:25:46 +0100 | [diff] [blame] | 382 | MACHINE_END |