ezx.c 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251
  1. /*
  2. * ezx.c - Common code for the EZX platform.
  3. *
  4. * Copyright (C) 2005-2006 Harald Welte <laforge@openezx.org>,
  5. * 2007-2008 Daniel Ribeiro <drwyrm@gmail.com>,
  6. * 2007-2008 Stefan Schmidt <stefan@datenfreihafen.org>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/init.h>
  15. #include <linux/platform_device.h>
  16. #include <linux/delay.h>
  17. #include <linux/pwm.h>
  18. #include <linux/pwm_backlight.h>
  19. #include <linux/regulator/machine.h>
  20. #include <linux/regulator/fixed.h>
  21. #include <linux/input.h>
  22. #include <linux/gpio.h>
  23. #include <linux/gpio_keys.h>
  24. #include <linux/leds-lp3944.h>
  25. #include <linux/platform_data/i2c-pxa.h>
  26. #include <asm/setup.h>
  27. #include <asm/mach-types.h>
  28. #include <asm/mach/arch.h>
  29. #include "pxa27x.h"
  30. #include <linux/platform_data/video-pxafb.h>
  31. #include <linux/platform_data/usb-ohci-pxa27x.h>
  32. #include <mach/hardware.h>
  33. #include <linux/platform_data/keypad-pxa27x.h>
  34. #include <linux/platform_data/media/camera-pxa.h>
  35. #include "devices.h"
  36. #include "generic.h"
  37. #define EZX_NR_IRQS (IRQ_BOARD_START + 24)
  38. #define GPIO12_A780_FLIP_LID 12
  39. #define GPIO15_A1200_FLIP_LID 15
  40. #define GPIO15_A910_FLIP_LID 15
  41. #define GPIO12_E680_LOCK_SWITCH 12
  42. #define GPIO15_E6_LOCK_SWITCH 15
  43. #define GPIO50_nCAM_EN 50
  44. #define GPIO19_GEN1_CAM_RST 19
  45. #define GPIO28_GEN2_CAM_RST 28
  46. static struct pwm_lookup ezx_pwm_lookup[] __maybe_unused = {
  47. PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight.0", NULL, 78700,
  48. PWM_POLARITY_NORMAL),
  49. };
  50. static struct platform_pwm_backlight_data ezx_backlight_data = {
  51. .max_brightness = 1023,
  52. .dft_brightness = 1023,
  53. .enable_gpio = -1,
  54. };
  55. static struct platform_device ezx_backlight_device = {
  56. .name = "pwm-backlight",
  57. .dev = {
  58. .parent = &pxa27x_device_pwm0.dev,
  59. .platform_data = &ezx_backlight_data,
  60. },
  61. };
  62. static struct pxafb_mode_info mode_ezx_old = {
  63. .pixclock = 150000,
  64. .xres = 240,
  65. .yres = 320,
  66. .bpp = 16,
  67. .hsync_len = 10,
  68. .left_margin = 20,
  69. .right_margin = 10,
  70. .vsync_len = 2,
  71. .upper_margin = 3,
  72. .lower_margin = 2,
  73. .sync = 0,
  74. };
  75. static struct pxafb_mach_info ezx_fb_info_1 __maybe_unused = {
  76. .modes = &mode_ezx_old,
  77. .num_modes = 1,
  78. .lcd_conn = LCD_COLOR_TFT_16BPP,
  79. };
  80. static struct pxafb_mode_info mode_72r89803y01 = {
  81. .pixclock = 192308,
  82. .xres = 240,
  83. .yres = 320,
  84. .bpp = 32,
  85. .depth = 18,
  86. .hsync_len = 10,
  87. .left_margin = 20,
  88. .right_margin = 10,
  89. .vsync_len = 2,
  90. .upper_margin = 3,
  91. .lower_margin = 2,
  92. .sync = 0,
  93. };
  94. static struct pxafb_mach_info ezx_fb_info_2 __maybe_unused = {
  95. .modes = &mode_72r89803y01,
  96. .num_modes = 1,
  97. .lcd_conn = LCD_COLOR_TFT_18BPP,
  98. };
  99. static struct platform_device *ezx_devices[] __initdata __maybe_unused = {
  100. &ezx_backlight_device,
  101. };
  102. static unsigned long ezx_pin_config[] __initdata __maybe_unused = {
  103. /* PWM backlight */
  104. GPIO16_PWM0_OUT,
  105. /* BTUART */
  106. GPIO42_BTUART_RXD,
  107. GPIO43_BTUART_TXD,
  108. GPIO44_BTUART_CTS,
  109. GPIO45_BTUART_RTS,
  110. /* I2C */
  111. GPIO117_I2C_SCL,
  112. GPIO118_I2C_SDA,
  113. /* PCAP SSP */
  114. GPIO29_SSP1_SCLK,
  115. GPIO25_SSP1_TXD,
  116. GPIO26_SSP1_RXD,
  117. GPIO24_GPIO, /* pcap chip select */
  118. GPIO1_GPIO | WAKEUP_ON_EDGE_RISE, /* pcap interrupt */
  119. GPIO4_GPIO | MFP_LPM_DRIVE_HIGH, /* WDI_AP */
  120. GPIO55_GPIO | MFP_LPM_DRIVE_HIGH, /* SYS_RESTART */
  121. /* MMC */
  122. GPIO32_MMC_CLK,
  123. GPIO92_MMC_DAT_0,
  124. GPIO109_MMC_DAT_1,
  125. GPIO110_MMC_DAT_2,
  126. GPIO111_MMC_DAT_3,
  127. GPIO112_MMC_CMD,
  128. GPIO11_GPIO, /* mmc detect */
  129. /* usb to external transceiver */
  130. GPIO34_USB_P2_2,
  131. GPIO35_USB_P2_1,
  132. GPIO36_USB_P2_4,
  133. GPIO39_USB_P2_6,
  134. GPIO40_USB_P2_5,
  135. GPIO53_USB_P2_3,
  136. /* usb to Neptune GSM chip */
  137. GPIO30_USB_P3_2,
  138. GPIO31_USB_P3_6,
  139. GPIO90_USB_P3_5,
  140. GPIO91_USB_P3_1,
  141. GPIO56_USB_P3_4,
  142. GPIO113_USB_P3_3,
  143. };
  144. #if defined(CONFIG_MACH_EZX_A780) || defined(CONFIG_MACH_EZX_E680)
  145. static unsigned long gen1_pin_config[] __initdata = {
  146. /* flip / lockswitch */
  147. GPIO12_GPIO | WAKEUP_ON_EDGE_BOTH,
  148. /* bluetooth (bcm2035) */
  149. GPIO14_GPIO | WAKEUP_ON_EDGE_RISE, /* HOSTWAKE */
  150. GPIO48_GPIO, /* RESET */
  151. GPIO28_GPIO, /* WAKEUP */
  152. /* Neptune handshake */
  153. GPIO0_GPIO | WAKEUP_ON_EDGE_FALL, /* BP_RDY */
  154. GPIO57_GPIO | MFP_LPM_DRIVE_HIGH, /* AP_RDY */
  155. GPIO13_GPIO | WAKEUP_ON_EDGE_BOTH, /* WDI */
  156. GPIO3_GPIO | WAKEUP_ON_EDGE_BOTH, /* WDI2 */
  157. GPIO82_GPIO | MFP_LPM_DRIVE_HIGH, /* RESET */
  158. GPIO99_GPIO | MFP_LPM_DRIVE_HIGH, /* TC_MM_EN */
  159. /* sound */
  160. GPIO52_SSP3_SCLK,
  161. GPIO83_SSP3_SFRM,
  162. GPIO81_SSP3_TXD,
  163. GPIO89_SSP3_RXD,
  164. /* ssp2 pins to in */
  165. GPIO22_GPIO, /* SSP2_SCLK */
  166. GPIO37_GPIO, /* SSP2_SFRM */
  167. GPIO38_GPIO, /* SSP2_TXD */
  168. GPIO88_GPIO, /* SSP2_RXD */
  169. /* camera */
  170. GPIO23_CIF_MCLK,
  171. GPIO54_CIF_PCLK,
  172. GPIO85_CIF_LV,
  173. GPIO84_CIF_FV,
  174. GPIO27_CIF_DD_0,
  175. GPIO114_CIF_DD_1,
  176. GPIO51_CIF_DD_2,
  177. GPIO115_CIF_DD_3,
  178. GPIO95_CIF_DD_4,
  179. GPIO94_CIF_DD_5,
  180. GPIO17_CIF_DD_6,
  181. GPIO108_CIF_DD_7,
  182. GPIO50_GPIO | MFP_LPM_DRIVE_HIGH, /* CAM_EN */
  183. GPIO19_GPIO | MFP_LPM_DRIVE_HIGH, /* CAM_RST */
  184. /* EMU */
  185. GPIO120_GPIO, /* EMU_MUX1 */
  186. GPIO119_GPIO, /* EMU_MUX2 */
  187. GPIO86_GPIO, /* SNP_INT_CTL */
  188. GPIO87_GPIO, /* SNP_INT_IN */
  189. };
  190. #endif
  191. #if defined(CONFIG_MACH_EZX_A1200) || defined(CONFIG_MACH_EZX_A910) || \
  192. defined(CONFIG_MACH_EZX_E2) || defined(CONFIG_MACH_EZX_E6)
  193. static unsigned long gen2_pin_config[] __initdata = {
  194. /* flip / lockswitch */
  195. GPIO15_GPIO | WAKEUP_ON_EDGE_BOTH,
  196. /* EOC */
  197. GPIO10_GPIO | WAKEUP_ON_EDGE_RISE,
  198. /* bluetooth (bcm2045) */
  199. GPIO13_GPIO | WAKEUP_ON_EDGE_RISE, /* HOSTWAKE */
  200. GPIO37_GPIO, /* RESET */
  201. GPIO57_GPIO, /* WAKEUP */
  202. /* Neptune handshake */
  203. GPIO0_GPIO | WAKEUP_ON_EDGE_FALL, /* BP_RDY */
  204. GPIO96_GPIO | MFP_LPM_DRIVE_HIGH, /* AP_RDY */
  205. GPIO3_GPIO | WAKEUP_ON_EDGE_FALL, /* WDI */
  206. GPIO116_GPIO | MFP_LPM_DRIVE_HIGH, /* RESET */
  207. GPIO41_GPIO, /* BP_FLASH */
  208. /* sound */
  209. GPIO52_SSP3_SCLK,
  210. GPIO83_SSP3_SFRM,
  211. GPIO81_SSP3_TXD,
  212. GPIO82_SSP3_RXD,
  213. /* ssp2 pins to in */
  214. GPIO22_GPIO, /* SSP2_SCLK */
  215. GPIO14_GPIO, /* SSP2_SFRM */
  216. GPIO38_GPIO, /* SSP2_TXD */
  217. GPIO88_GPIO, /* SSP2_RXD */
  218. /* camera */
  219. GPIO23_CIF_MCLK,
  220. GPIO54_CIF_PCLK,
  221. GPIO85_CIF_LV,
  222. GPIO84_CIF_FV,
  223. GPIO27_CIF_DD_0,
  224. GPIO114_CIF_DD_1,
  225. GPIO51_CIF_DD_2,
  226. GPIO115_CIF_DD_3,
  227. GPIO95_CIF_DD_4,
  228. GPIO48_CIF_DD_5,
  229. GPIO93_CIF_DD_6,
  230. GPIO12_CIF_DD_7,
  231. GPIO50_GPIO | MFP_LPM_DRIVE_HIGH, /* CAM_EN */
  232. GPIO28_GPIO | MFP_LPM_DRIVE_HIGH, /* CAM_RST */
  233. GPIO17_GPIO, /* CAM_FLASH */
  234. };
  235. #endif
  236. #ifdef CONFIG_MACH_EZX_A780
  237. static unsigned long a780_pin_config[] __initdata = {
  238. /* keypad */
  239. GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH,
  240. GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
  241. GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
  242. GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
  243. GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
  244. GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
  245. GPIO103_KP_MKOUT_0,
  246. GPIO104_KP_MKOUT_1,
  247. GPIO105_KP_MKOUT_2,
  248. GPIO106_KP_MKOUT_3,
  249. GPIO107_KP_MKOUT_4,
  250. /* attenuate sound */
  251. GPIO96_GPIO,
  252. };
  253. #endif
  254. #ifdef CONFIG_MACH_EZX_E680
  255. static unsigned long e680_pin_config[] __initdata = {
  256. /* keypad */
  257. GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH,
  258. GPIO96_KP_DKIN_3 | WAKEUP_ON_LEVEL_HIGH,
  259. GPIO97_KP_DKIN_4 | WAKEUP_ON_LEVEL_HIGH,
  260. GPIO98_KP_DKIN_5 | WAKEUP_ON_LEVEL_HIGH,
  261. GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
  262. GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
  263. GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
  264. GPIO103_KP_MKOUT_0,
  265. GPIO104_KP_MKOUT_1,
  266. GPIO105_KP_MKOUT_2,
  267. GPIO106_KP_MKOUT_3,
  268. /* MIDI */
  269. GPIO79_GPIO, /* VA_SEL_BUL */
  270. GPIO80_GPIO, /* FLT_SEL_BUL */
  271. GPIO78_GPIO, /* MIDI_RESET */
  272. GPIO33_GPIO, /* MIDI_CS */
  273. GPIO15_GPIO, /* MIDI_IRQ */
  274. GPIO49_GPIO, /* MIDI_NPWE */
  275. GPIO18_GPIO, /* MIDI_RDY */
  276. /* leds */
  277. GPIO46_GPIO,
  278. GPIO47_GPIO,
  279. };
  280. #endif
  281. #ifdef CONFIG_MACH_EZX_A1200
  282. static unsigned long a1200_pin_config[] __initdata = {
  283. /* keypad */
  284. GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
  285. GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
  286. GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
  287. GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
  288. GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
  289. GPIO103_KP_MKOUT_0,
  290. GPIO104_KP_MKOUT_1,
  291. GPIO105_KP_MKOUT_2,
  292. GPIO106_KP_MKOUT_3,
  293. GPIO107_KP_MKOUT_4,
  294. GPIO108_KP_MKOUT_5,
  295. };
  296. #endif
  297. #ifdef CONFIG_MACH_EZX_A910
  298. static unsigned long a910_pin_config[] __initdata = {
  299. /* keypad */
  300. GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
  301. GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
  302. GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
  303. GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
  304. GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
  305. GPIO103_KP_MKOUT_0,
  306. GPIO104_KP_MKOUT_1,
  307. GPIO105_KP_MKOUT_2,
  308. GPIO106_KP_MKOUT_3,
  309. GPIO107_KP_MKOUT_4,
  310. GPIO108_KP_MKOUT_5,
  311. /* WLAN */
  312. GPIO89_GPIO, /* RESET */
  313. GPIO33_GPIO, /* WAKEUP */
  314. GPIO94_GPIO | WAKEUP_ON_LEVEL_HIGH, /* HOSTWAKE */
  315. /* MMC CS */
  316. GPIO20_GPIO,
  317. };
  318. #endif
  319. #ifdef CONFIG_MACH_EZX_E2
  320. static unsigned long e2_pin_config[] __initdata = {
  321. /* keypad */
  322. GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
  323. GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
  324. GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
  325. GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
  326. GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
  327. GPIO103_KP_MKOUT_0,
  328. GPIO104_KP_MKOUT_1,
  329. GPIO105_KP_MKOUT_2,
  330. GPIO106_KP_MKOUT_3,
  331. GPIO107_KP_MKOUT_4,
  332. GPIO108_KP_MKOUT_5,
  333. };
  334. #endif
  335. #ifdef CONFIG_MACH_EZX_E6
  336. static unsigned long e6_pin_config[] __initdata = {
  337. /* keypad */
  338. GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
  339. GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
  340. GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
  341. GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
  342. GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
  343. GPIO103_KP_MKOUT_0,
  344. GPIO104_KP_MKOUT_1,
  345. GPIO105_KP_MKOUT_2,
  346. GPIO106_KP_MKOUT_3,
  347. GPIO107_KP_MKOUT_4,
  348. GPIO108_KP_MKOUT_5,
  349. };
  350. #endif
  351. /* KEYPAD */
  352. #ifdef CONFIG_MACH_EZX_A780
  353. static const unsigned int a780_key_map[] = {
  354. KEY(0, 0, KEY_SEND),
  355. KEY(0, 1, KEY_BACK),
  356. KEY(0, 2, KEY_END),
  357. KEY(0, 3, KEY_PAGEUP),
  358. KEY(0, 4, KEY_UP),
  359. KEY(1, 0, KEY_NUMERIC_1),
  360. KEY(1, 1, KEY_NUMERIC_2),
  361. KEY(1, 2, KEY_NUMERIC_3),
  362. KEY(1, 3, KEY_SELECT),
  363. KEY(1, 4, KEY_KPENTER),
  364. KEY(2, 0, KEY_NUMERIC_4),
  365. KEY(2, 1, KEY_NUMERIC_5),
  366. KEY(2, 2, KEY_NUMERIC_6),
  367. KEY(2, 3, KEY_RECORD),
  368. KEY(2, 4, KEY_LEFT),
  369. KEY(3, 0, KEY_NUMERIC_7),
  370. KEY(3, 1, KEY_NUMERIC_8),
  371. KEY(3, 2, KEY_NUMERIC_9),
  372. KEY(3, 3, KEY_HOME),
  373. KEY(3, 4, KEY_RIGHT),
  374. KEY(4, 0, KEY_NUMERIC_STAR),
  375. KEY(4, 1, KEY_NUMERIC_0),
  376. KEY(4, 2, KEY_NUMERIC_POUND),
  377. KEY(4, 3, KEY_PAGEDOWN),
  378. KEY(4, 4, KEY_DOWN),
  379. };
  380. static struct matrix_keymap_data a780_matrix_keymap_data = {
  381. .keymap = a780_key_map,
  382. .keymap_size = ARRAY_SIZE(a780_key_map),
  383. };
  384. static struct pxa27x_keypad_platform_data a780_keypad_platform_data = {
  385. .matrix_key_rows = 5,
  386. .matrix_key_cols = 5,
  387. .matrix_keymap_data = &a780_matrix_keymap_data,
  388. .direct_key_map = { KEY_CAMERA },
  389. .direct_key_num = 1,
  390. .debounce_interval = 30,
  391. };
  392. #endif /* CONFIG_MACH_EZX_A780 */
  393. #ifdef CONFIG_MACH_EZX_E680
  394. static const unsigned int e680_key_map[] = {
  395. KEY(0, 0, KEY_UP),
  396. KEY(0, 1, KEY_RIGHT),
  397. KEY(0, 2, KEY_RESERVED),
  398. KEY(0, 3, KEY_SEND),
  399. KEY(1, 0, KEY_DOWN),
  400. KEY(1, 1, KEY_LEFT),
  401. KEY(1, 2, KEY_PAGEUP),
  402. KEY(1, 3, KEY_PAGEDOWN),
  403. KEY(2, 0, KEY_RESERVED),
  404. KEY(2, 1, KEY_RESERVED),
  405. KEY(2, 2, KEY_RESERVED),
  406. KEY(2, 3, KEY_KPENTER),
  407. };
  408. static struct matrix_keymap_data e680_matrix_keymap_data = {
  409. .keymap = e680_key_map,
  410. .keymap_size = ARRAY_SIZE(e680_key_map),
  411. };
  412. static struct pxa27x_keypad_platform_data e680_keypad_platform_data = {
  413. .matrix_key_rows = 3,
  414. .matrix_key_cols = 4,
  415. .matrix_keymap_data = &e680_matrix_keymap_data,
  416. .direct_key_map = {
  417. KEY_CAMERA,
  418. KEY_RESERVED,
  419. KEY_RESERVED,
  420. KEY_F1,
  421. KEY_CANCEL,
  422. KEY_F2,
  423. },
  424. .direct_key_num = 6,
  425. .debounce_interval = 30,
  426. };
  427. #endif /* CONFIG_MACH_EZX_E680 */
  428. #ifdef CONFIG_MACH_EZX_A1200
  429. static const unsigned int a1200_key_map[] = {
  430. KEY(0, 0, KEY_RESERVED),
  431. KEY(0, 1, KEY_RIGHT),
  432. KEY(0, 2, KEY_PAGEDOWN),
  433. KEY(0, 3, KEY_RESERVED),
  434. KEY(0, 4, KEY_RESERVED),
  435. KEY(0, 5, KEY_RESERVED),
  436. KEY(1, 0, KEY_RESERVED),
  437. KEY(1, 1, KEY_DOWN),
  438. KEY(1, 2, KEY_CAMERA),
  439. KEY(1, 3, KEY_RESERVED),
  440. KEY(1, 4, KEY_RESERVED),
  441. KEY(1, 5, KEY_RESERVED),
  442. KEY(2, 0, KEY_RESERVED),
  443. KEY(2, 1, KEY_KPENTER),
  444. KEY(2, 2, KEY_RECORD),
  445. KEY(2, 3, KEY_RESERVED),
  446. KEY(2, 4, KEY_RESERVED),
  447. KEY(2, 5, KEY_SELECT),
  448. KEY(3, 0, KEY_RESERVED),
  449. KEY(3, 1, KEY_UP),
  450. KEY(3, 2, KEY_SEND),
  451. KEY(3, 3, KEY_RESERVED),
  452. KEY(3, 4, KEY_RESERVED),
  453. KEY(3, 5, KEY_RESERVED),
  454. KEY(4, 0, KEY_RESERVED),
  455. KEY(4, 1, KEY_LEFT),
  456. KEY(4, 2, KEY_PAGEUP),
  457. KEY(4, 3, KEY_RESERVED),
  458. KEY(4, 4, KEY_RESERVED),
  459. KEY(4, 5, KEY_RESERVED),
  460. };
  461. static struct matrix_keymap_data a1200_matrix_keymap_data = {
  462. .keymap = a1200_key_map,
  463. .keymap_size = ARRAY_SIZE(a1200_key_map),
  464. };
  465. static struct pxa27x_keypad_platform_data a1200_keypad_platform_data = {
  466. .matrix_key_rows = 5,
  467. .matrix_key_cols = 6,
  468. .matrix_keymap_data = &a1200_matrix_keymap_data,
  469. .debounce_interval = 30,
  470. };
  471. #endif /* CONFIG_MACH_EZX_A1200 */
  472. #ifdef CONFIG_MACH_EZX_E6
  473. static const unsigned int e6_key_map[] = {
  474. KEY(0, 0, KEY_RESERVED),
  475. KEY(0, 1, KEY_RIGHT),
  476. KEY(0, 2, KEY_PAGEDOWN),
  477. KEY(0, 3, KEY_RESERVED),
  478. KEY(0, 4, KEY_RESERVED),
  479. KEY(0, 5, KEY_NEXTSONG),
  480. KEY(1, 0, KEY_RESERVED),
  481. KEY(1, 1, KEY_DOWN),
  482. KEY(1, 2, KEY_PROG1),
  483. KEY(1, 3, KEY_RESERVED),
  484. KEY(1, 4, KEY_RESERVED),
  485. KEY(1, 5, KEY_RESERVED),
  486. KEY(2, 0, KEY_RESERVED),
  487. KEY(2, 1, KEY_ENTER),
  488. KEY(2, 2, KEY_CAMERA),
  489. KEY(2, 3, KEY_RESERVED),
  490. KEY(2, 4, KEY_RESERVED),
  491. KEY(2, 5, KEY_WWW),
  492. KEY(3, 0, KEY_RESERVED),
  493. KEY(3, 1, KEY_UP),
  494. KEY(3, 2, KEY_SEND),
  495. KEY(3, 3, KEY_RESERVED),
  496. KEY(3, 4, KEY_RESERVED),
  497. KEY(3, 5, KEY_PLAYPAUSE),
  498. KEY(4, 0, KEY_RESERVED),
  499. KEY(4, 1, KEY_LEFT),
  500. KEY(4, 2, KEY_PAGEUP),
  501. KEY(4, 3, KEY_RESERVED),
  502. KEY(4, 4, KEY_RESERVED),
  503. KEY(4, 5, KEY_PREVIOUSSONG),
  504. };
  505. static struct matrix_keymap_data e6_keymap_data = {
  506. .keymap = e6_key_map,
  507. .keymap_size = ARRAY_SIZE(e6_key_map),
  508. };
  509. static struct pxa27x_keypad_platform_data e6_keypad_platform_data = {
  510. .matrix_key_rows = 5,
  511. .matrix_key_cols = 6,
  512. .matrix_keymap_data = &e6_keymap_data,
  513. .debounce_interval = 30,
  514. };
  515. #endif /* CONFIG_MACH_EZX_E6 */
  516. #ifdef CONFIG_MACH_EZX_A910
  517. static const unsigned int a910_key_map[] = {
  518. KEY(0, 0, KEY_NUMERIC_6),
  519. KEY(0, 1, KEY_RIGHT),
  520. KEY(0, 2, KEY_PAGEDOWN),
  521. KEY(0, 3, KEY_KPENTER),
  522. KEY(0, 4, KEY_NUMERIC_5),
  523. KEY(0, 5, KEY_CAMERA),
  524. KEY(1, 0, KEY_NUMERIC_8),
  525. KEY(1, 1, KEY_DOWN),
  526. KEY(1, 2, KEY_RESERVED),
  527. KEY(1, 3, KEY_F1), /* Left SoftKey */
  528. KEY(1, 4, KEY_NUMERIC_STAR),
  529. KEY(1, 5, KEY_RESERVED),
  530. KEY(2, 0, KEY_NUMERIC_7),
  531. KEY(2, 1, KEY_NUMERIC_9),
  532. KEY(2, 2, KEY_RECORD),
  533. KEY(2, 3, KEY_F2), /* Right SoftKey */
  534. KEY(2, 4, KEY_BACK),
  535. KEY(2, 5, KEY_SELECT),
  536. KEY(3, 0, KEY_NUMERIC_2),
  537. KEY(3, 1, KEY_UP),
  538. KEY(3, 2, KEY_SEND),
  539. KEY(3, 3, KEY_NUMERIC_0),
  540. KEY(3, 4, KEY_NUMERIC_1),
  541. KEY(3, 5, KEY_RECORD),
  542. KEY(4, 0, KEY_NUMERIC_4),
  543. KEY(4, 1, KEY_LEFT),
  544. KEY(4, 2, KEY_PAGEUP),
  545. KEY(4, 3, KEY_NUMERIC_POUND),
  546. KEY(4, 4, KEY_NUMERIC_3),
  547. KEY(4, 5, KEY_RESERVED),
  548. };
  549. static struct matrix_keymap_data a910_matrix_keymap_data = {
  550. .keymap = a910_key_map,
  551. .keymap_size = ARRAY_SIZE(a910_key_map),
  552. };
  553. static struct pxa27x_keypad_platform_data a910_keypad_platform_data = {
  554. .matrix_key_rows = 5,
  555. .matrix_key_cols = 6,
  556. .matrix_keymap_data = &a910_matrix_keymap_data,
  557. .debounce_interval = 30,
  558. };
  559. #endif /* CONFIG_MACH_EZX_A910 */
  560. #ifdef CONFIG_MACH_EZX_E2
  561. static const unsigned int e2_key_map[] = {
  562. KEY(0, 0, KEY_NUMERIC_6),
  563. KEY(0, 1, KEY_RIGHT),
  564. KEY(0, 2, KEY_NUMERIC_9),
  565. KEY(0, 3, KEY_NEXTSONG),
  566. KEY(0, 4, KEY_NUMERIC_5),
  567. KEY(0, 5, KEY_F1), /* Left SoftKey */
  568. KEY(1, 0, KEY_NUMERIC_8),
  569. KEY(1, 1, KEY_DOWN),
  570. KEY(1, 2, KEY_RESERVED),
  571. KEY(1, 3, KEY_PAGEUP),
  572. KEY(1, 4, KEY_NUMERIC_STAR),
  573. KEY(1, 5, KEY_F2), /* Right SoftKey */
  574. KEY(2, 0, KEY_NUMERIC_7),
  575. KEY(2, 1, KEY_KPENTER),
  576. KEY(2, 2, KEY_RECORD),
  577. KEY(2, 3, KEY_PAGEDOWN),
  578. KEY(2, 4, KEY_BACK),
  579. KEY(2, 5, KEY_NUMERIC_0),
  580. KEY(3, 0, KEY_NUMERIC_2),
  581. KEY(3, 1, KEY_UP),
  582. KEY(3, 2, KEY_SEND),
  583. KEY(3, 3, KEY_PLAYPAUSE),
  584. KEY(3, 4, KEY_NUMERIC_1),
  585. KEY(3, 5, KEY_SOUND), /* Music SoftKey */
  586. KEY(4, 0, KEY_NUMERIC_4),
  587. KEY(4, 1, KEY_LEFT),
  588. KEY(4, 2, KEY_NUMERIC_POUND),
  589. KEY(4, 3, KEY_PREVIOUSSONG),
  590. KEY(4, 4, KEY_NUMERIC_3),
  591. KEY(4, 5, KEY_RESERVED),
  592. };
  593. static struct matrix_keymap_data e2_matrix_keymap_data = {
  594. .keymap = e2_key_map,
  595. .keymap_size = ARRAY_SIZE(e2_key_map),
  596. };
  597. static struct pxa27x_keypad_platform_data e2_keypad_platform_data = {
  598. .matrix_key_rows = 5,
  599. .matrix_key_cols = 6,
  600. .matrix_keymap_data = &e2_matrix_keymap_data,
  601. .debounce_interval = 30,
  602. };
  603. #endif /* CONFIG_MACH_EZX_E2 */
  604. #if defined(CONFIG_MACH_EZX_A780) || defined(CONFIG_MACH_EZX_A910)
  605. /* camera */
  606. static struct regulator_consumer_supply camera_dummy_supplies[] = {
  607. REGULATOR_SUPPLY("vdd", "0-005d"),
  608. };
  609. static struct regulator_init_data camera_dummy_initdata = {
  610. .consumer_supplies = camera_dummy_supplies,
  611. .num_consumer_supplies = ARRAY_SIZE(camera_dummy_supplies),
  612. .constraints = {
  613. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  614. },
  615. };
  616. static struct fixed_voltage_config camera_dummy_config = {
  617. .supply_name = "camera_vdd",
  618. .microvolts = 2800000,
  619. .gpio = GPIO50_nCAM_EN,
  620. .enable_high = 0,
  621. .init_data = &camera_dummy_initdata,
  622. };
  623. static struct platform_device camera_supply_dummy_device = {
  624. .name = "reg-fixed-voltage",
  625. .id = 1,
  626. .dev = {
  627. .platform_data = &camera_dummy_config,
  628. },
  629. };
  630. #endif
  631. #ifdef CONFIG_MACH_EZX_A780
  632. /* gpio_keys */
  633. static struct gpio_keys_button a780_buttons[] = {
  634. [0] = {
  635. .code = SW_LID,
  636. .gpio = GPIO12_A780_FLIP_LID,
  637. .active_low = 0,
  638. .desc = "A780 flip lid",
  639. .type = EV_SW,
  640. .wakeup = 1,
  641. },
  642. };
  643. static struct gpio_keys_platform_data a780_gpio_keys_platform_data = {
  644. .buttons = a780_buttons,
  645. .nbuttons = ARRAY_SIZE(a780_buttons),
  646. };
  647. static struct platform_device a780_gpio_keys = {
  648. .name = "gpio-keys",
  649. .id = -1,
  650. .dev = {
  651. .platform_data = &a780_gpio_keys_platform_data,
  652. },
  653. };
  654. /* camera */
  655. static int a780_camera_reset(struct device *dev)
  656. {
  657. gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
  658. msleep(10);
  659. gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
  660. return 0;
  661. }
  662. static int a780_camera_init(void)
  663. {
  664. int err;
  665. /*
  666. * GPIO50_nCAM_EN is active low
  667. * GPIO19_GEN1_CAM_RST is active on rising edge
  668. */
  669. err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
  670. if (err) {
  671. pr_err("%s: Failed to request CAM_RST\n", __func__);
  672. return err;
  673. }
  674. gpio_direction_output(GPIO19_GEN1_CAM_RST, 0);
  675. a780_camera_reset(NULL);
  676. return 0;
  677. }
  678. struct pxacamera_platform_data a780_pxacamera_platform_data = {
  679. .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
  680. PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN |
  681. PXA_CAMERA_PCP,
  682. .mclk_10khz = 5000,
  683. .sensor_i2c_adapter_id = 0,
  684. .sensor_i2c_address = 0x5d,
  685. };
  686. static struct i2c_board_info a780_i2c_board_info[] = {
  687. {
  688. I2C_BOARD_INFO("mt9m111", 0x5d),
  689. },
  690. };
  691. static struct platform_device *a780_devices[] __initdata = {
  692. &a780_gpio_keys,
  693. &camera_supply_dummy_device,
  694. };
  695. static void __init a780_init(void)
  696. {
  697. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  698. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
  699. pxa2xx_mfp_config(ARRAY_AND_SIZE(a780_pin_config));
  700. pxa_set_ffuart_info(NULL);
  701. pxa_set_btuart_info(NULL);
  702. pxa_set_stuart_info(NULL);
  703. pxa_set_i2c_info(NULL);
  704. i2c_register_board_info(0, ARRAY_AND_SIZE(a780_i2c_board_info));
  705. pxa_set_fb_info(NULL, &ezx_fb_info_1);
  706. pxa_set_keypad_info(&a780_keypad_platform_data);
  707. if (a780_camera_init() == 0)
  708. pxa_set_camera_info(&a780_pxacamera_platform_data);
  709. pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
  710. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  711. platform_add_devices(ARRAY_AND_SIZE(a780_devices));
  712. regulator_has_full_constraints();
  713. }
  714. MACHINE_START(EZX_A780, "Motorola EZX A780")
  715. .atag_offset = 0x100,
  716. .map_io = pxa27x_map_io,
  717. .nr_irqs = EZX_NR_IRQS,
  718. .init_irq = pxa27x_init_irq,
  719. .handle_irq = pxa27x_handle_irq,
  720. .init_time = pxa_timer_init,
  721. .init_machine = a780_init,
  722. .restart = pxa_restart,
  723. MACHINE_END
  724. #endif
  725. #ifdef CONFIG_MACH_EZX_E680
  726. /* gpio_keys */
  727. static struct gpio_keys_button e680_buttons[] = {
  728. [0] = {
  729. .code = KEY_SCREENLOCK,
  730. .gpio = GPIO12_E680_LOCK_SWITCH,
  731. .active_low = 0,
  732. .desc = "E680 lock switch",
  733. .type = EV_KEY,
  734. .wakeup = 1,
  735. },
  736. };
  737. static struct gpio_keys_platform_data e680_gpio_keys_platform_data = {
  738. .buttons = e680_buttons,
  739. .nbuttons = ARRAY_SIZE(e680_buttons),
  740. };
  741. static struct platform_device e680_gpio_keys = {
  742. .name = "gpio-keys",
  743. .id = -1,
  744. .dev = {
  745. .platform_data = &e680_gpio_keys_platform_data,
  746. },
  747. };
  748. static struct i2c_board_info __initdata e680_i2c_board_info[] = {
  749. { I2C_BOARD_INFO("tea5767", 0x81) },
  750. };
  751. static struct platform_device *e680_devices[] __initdata = {
  752. &e680_gpio_keys,
  753. };
  754. static void __init e680_init(void)
  755. {
  756. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  757. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
  758. pxa2xx_mfp_config(ARRAY_AND_SIZE(e680_pin_config));
  759. pxa_set_ffuart_info(NULL);
  760. pxa_set_btuart_info(NULL);
  761. pxa_set_stuart_info(NULL);
  762. pxa_set_i2c_info(NULL);
  763. i2c_register_board_info(0, ARRAY_AND_SIZE(e680_i2c_board_info));
  764. pxa_set_fb_info(NULL, &ezx_fb_info_1);
  765. pxa_set_keypad_info(&e680_keypad_platform_data);
  766. pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
  767. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  768. platform_add_devices(ARRAY_AND_SIZE(e680_devices));
  769. }
  770. MACHINE_START(EZX_E680, "Motorola EZX E680")
  771. .atag_offset = 0x100,
  772. .map_io = pxa27x_map_io,
  773. .nr_irqs = EZX_NR_IRQS,
  774. .init_irq = pxa27x_init_irq,
  775. .handle_irq = pxa27x_handle_irq,
  776. .init_time = pxa_timer_init,
  777. .init_machine = e680_init,
  778. .restart = pxa_restart,
  779. MACHINE_END
  780. #endif
  781. #ifdef CONFIG_MACH_EZX_A1200
  782. /* gpio_keys */
  783. static struct gpio_keys_button a1200_buttons[] = {
  784. [0] = {
  785. .code = SW_LID,
  786. .gpio = GPIO15_A1200_FLIP_LID,
  787. .active_low = 0,
  788. .desc = "A1200 flip lid",
  789. .type = EV_SW,
  790. .wakeup = 1,
  791. },
  792. };
  793. static struct gpio_keys_platform_data a1200_gpio_keys_platform_data = {
  794. .buttons = a1200_buttons,
  795. .nbuttons = ARRAY_SIZE(a1200_buttons),
  796. };
  797. static struct platform_device a1200_gpio_keys = {
  798. .name = "gpio-keys",
  799. .id = -1,
  800. .dev = {
  801. .platform_data = &a1200_gpio_keys_platform_data,
  802. },
  803. };
  804. static struct i2c_board_info __initdata a1200_i2c_board_info[] = {
  805. { I2C_BOARD_INFO("tea5767", 0x81) },
  806. };
  807. static struct platform_device *a1200_devices[] __initdata = {
  808. &a1200_gpio_keys,
  809. };
  810. static void __init a1200_init(void)
  811. {
  812. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  813. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
  814. pxa2xx_mfp_config(ARRAY_AND_SIZE(a1200_pin_config));
  815. pxa_set_ffuart_info(NULL);
  816. pxa_set_btuart_info(NULL);
  817. pxa_set_stuart_info(NULL);
  818. pxa_set_i2c_info(NULL);
  819. i2c_register_board_info(0, ARRAY_AND_SIZE(a1200_i2c_board_info));
  820. pxa_set_fb_info(NULL, &ezx_fb_info_2);
  821. pxa_set_keypad_info(&a1200_keypad_platform_data);
  822. pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
  823. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  824. platform_add_devices(ARRAY_AND_SIZE(a1200_devices));
  825. }
  826. MACHINE_START(EZX_A1200, "Motorola EZX A1200")
  827. .atag_offset = 0x100,
  828. .map_io = pxa27x_map_io,
  829. .nr_irqs = EZX_NR_IRQS,
  830. .init_irq = pxa27x_init_irq,
  831. .handle_irq = pxa27x_handle_irq,
  832. .init_time = pxa_timer_init,
  833. .init_machine = a1200_init,
  834. .restart = pxa_restart,
  835. MACHINE_END
  836. #endif
  837. #ifdef CONFIG_MACH_EZX_A910
  838. /* gpio_keys */
  839. static struct gpio_keys_button a910_buttons[] = {
  840. [0] = {
  841. .code = SW_LID,
  842. .gpio = GPIO15_A910_FLIP_LID,
  843. .active_low = 0,
  844. .desc = "A910 flip lid",
  845. .type = EV_SW,
  846. .wakeup = 1,
  847. },
  848. };
  849. static struct gpio_keys_platform_data a910_gpio_keys_platform_data = {
  850. .buttons = a910_buttons,
  851. .nbuttons = ARRAY_SIZE(a910_buttons),
  852. };
  853. static struct platform_device a910_gpio_keys = {
  854. .name = "gpio-keys",
  855. .id = -1,
  856. .dev = {
  857. .platform_data = &a910_gpio_keys_platform_data,
  858. },
  859. };
  860. /* camera */
  861. static int a910_camera_reset(struct device *dev)
  862. {
  863. gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
  864. msleep(10);
  865. gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
  866. return 0;
  867. }
  868. static int a910_camera_init(void)
  869. {
  870. int err;
  871. /*
  872. * GPIO50_nCAM_EN is active low
  873. * GPIO28_GEN2_CAM_RST is active on rising edge
  874. */
  875. err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
  876. if (err) {
  877. pr_err("%s: Failed to request CAM_RST\n", __func__);
  878. return err;
  879. }
  880. gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
  881. a910_camera_reset(NULL);
  882. return 0;
  883. }
  884. struct pxacamera_platform_data a910_pxacamera_platform_data = {
  885. .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
  886. PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN |
  887. PXA_CAMERA_PCP,
  888. .mclk_10khz = 5000,
  889. .sensor_i2c_adapter_id = 0,
  890. .sensor_i2c_address = 0x5d,
  891. };
  892. /* leds-lp3944 */
  893. static struct lp3944_platform_data a910_lp3944_leds = {
  894. .leds_size = LP3944_LEDS_MAX,
  895. .leds = {
  896. [0] = {
  897. .name = "a910:red:",
  898. .status = LP3944_LED_STATUS_OFF,
  899. .type = LP3944_LED_TYPE_LED,
  900. },
  901. [1] = {
  902. .name = "a910:green:",
  903. .status = LP3944_LED_STATUS_OFF,
  904. .type = LP3944_LED_TYPE_LED,
  905. },
  906. [2] {
  907. .name = "a910:blue:",
  908. .status = LP3944_LED_STATUS_OFF,
  909. .type = LP3944_LED_TYPE_LED,
  910. },
  911. /* Leds 3 and 4 are used as display power switches */
  912. [3] = {
  913. .name = "a910::cli_display",
  914. .status = LP3944_LED_STATUS_OFF,
  915. .type = LP3944_LED_TYPE_LED_INVERTED
  916. },
  917. [4] = {
  918. .name = "a910::main_display",
  919. .status = LP3944_LED_STATUS_ON,
  920. .type = LP3944_LED_TYPE_LED_INVERTED
  921. },
  922. [5] = { .type = LP3944_LED_TYPE_NONE },
  923. [6] = {
  924. .name = "a910::torch",
  925. .status = LP3944_LED_STATUS_OFF,
  926. .type = LP3944_LED_TYPE_LED,
  927. },
  928. [7] = {
  929. .name = "a910::flash",
  930. .status = LP3944_LED_STATUS_OFF,
  931. .type = LP3944_LED_TYPE_LED_INVERTED,
  932. },
  933. },
  934. };
  935. static struct i2c_board_info __initdata a910_i2c_board_info[] = {
  936. {
  937. I2C_BOARD_INFO("lp3944", 0x60),
  938. .platform_data = &a910_lp3944_leds,
  939. },
  940. {
  941. I2C_BOARD_INFO("mt9m111", 0x5d),
  942. },
  943. };
  944. static struct platform_device *a910_devices[] __initdata = {
  945. &a910_gpio_keys,
  946. &camera_supply_dummy_device,
  947. };
  948. static void __init a910_init(void)
  949. {
  950. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  951. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
  952. pxa2xx_mfp_config(ARRAY_AND_SIZE(a910_pin_config));
  953. pxa_set_ffuart_info(NULL);
  954. pxa_set_btuart_info(NULL);
  955. pxa_set_stuart_info(NULL);
  956. pxa_set_i2c_info(NULL);
  957. i2c_register_board_info(0, ARRAY_AND_SIZE(a910_i2c_board_info));
  958. pxa_set_fb_info(NULL, &ezx_fb_info_2);
  959. pxa_set_keypad_info(&a910_keypad_platform_data);
  960. if (a910_camera_init() == 0)
  961. pxa_set_camera_info(&a910_pxacamera_platform_data);
  962. pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
  963. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  964. platform_add_devices(ARRAY_AND_SIZE(a910_devices));
  965. regulator_has_full_constraints();
  966. }
  967. MACHINE_START(EZX_A910, "Motorola EZX A910")
  968. .atag_offset = 0x100,
  969. .map_io = pxa27x_map_io,
  970. .nr_irqs = EZX_NR_IRQS,
  971. .init_irq = pxa27x_init_irq,
  972. .handle_irq = pxa27x_handle_irq,
  973. .init_time = pxa_timer_init,
  974. .init_machine = a910_init,
  975. .restart = pxa_restart,
  976. MACHINE_END
  977. #endif
  978. #ifdef CONFIG_MACH_EZX_E6
  979. /* gpio_keys */
  980. static struct gpio_keys_button e6_buttons[] = {
  981. [0] = {
  982. .code = KEY_SCREENLOCK,
  983. .gpio = GPIO15_E6_LOCK_SWITCH,
  984. .active_low = 0,
  985. .desc = "E6 lock switch",
  986. .type = EV_KEY,
  987. .wakeup = 1,
  988. },
  989. };
  990. static struct gpio_keys_platform_data e6_gpio_keys_platform_data = {
  991. .buttons = e6_buttons,
  992. .nbuttons = ARRAY_SIZE(e6_buttons),
  993. };
  994. static struct platform_device e6_gpio_keys = {
  995. .name = "gpio-keys",
  996. .id = -1,
  997. .dev = {
  998. .platform_data = &e6_gpio_keys_platform_data,
  999. },
  1000. };
  1001. static struct i2c_board_info __initdata e6_i2c_board_info[] = {
  1002. { I2C_BOARD_INFO("tea5767", 0x81) },
  1003. };
  1004. static struct platform_device *e6_devices[] __initdata = {
  1005. &e6_gpio_keys,
  1006. };
  1007. static void __init e6_init(void)
  1008. {
  1009. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  1010. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
  1011. pxa2xx_mfp_config(ARRAY_AND_SIZE(e6_pin_config));
  1012. pxa_set_ffuart_info(NULL);
  1013. pxa_set_btuart_info(NULL);
  1014. pxa_set_stuart_info(NULL);
  1015. pxa_set_i2c_info(NULL);
  1016. i2c_register_board_info(0, ARRAY_AND_SIZE(e6_i2c_board_info));
  1017. pxa_set_fb_info(NULL, &ezx_fb_info_2);
  1018. pxa_set_keypad_info(&e6_keypad_platform_data);
  1019. pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
  1020. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  1021. platform_add_devices(ARRAY_AND_SIZE(e6_devices));
  1022. }
  1023. MACHINE_START(EZX_E6, "Motorola EZX E6")
  1024. .atag_offset = 0x100,
  1025. .map_io = pxa27x_map_io,
  1026. .nr_irqs = EZX_NR_IRQS,
  1027. .init_irq = pxa27x_init_irq,
  1028. .handle_irq = pxa27x_handle_irq,
  1029. .init_time = pxa_timer_init,
  1030. .init_machine = e6_init,
  1031. .restart = pxa_restart,
  1032. MACHINE_END
  1033. #endif
  1034. #ifdef CONFIG_MACH_EZX_E2
  1035. static struct i2c_board_info __initdata e2_i2c_board_info[] = {
  1036. { I2C_BOARD_INFO("tea5767", 0x81) },
  1037. };
  1038. static struct platform_device *e2_devices[] __initdata = {
  1039. };
  1040. static void __init e2_init(void)
  1041. {
  1042. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  1043. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
  1044. pxa2xx_mfp_config(ARRAY_AND_SIZE(e2_pin_config));
  1045. pxa_set_ffuart_info(NULL);
  1046. pxa_set_btuart_info(NULL);
  1047. pxa_set_stuart_info(NULL);
  1048. pxa_set_i2c_info(NULL);
  1049. i2c_register_board_info(0, ARRAY_AND_SIZE(e2_i2c_board_info));
  1050. pxa_set_fb_info(NULL, &ezx_fb_info_2);
  1051. pxa_set_keypad_info(&e2_keypad_platform_data);
  1052. pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
  1053. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  1054. platform_add_devices(ARRAY_AND_SIZE(e2_devices));
  1055. }
  1056. MACHINE_START(EZX_E2, "Motorola EZX E2")
  1057. .atag_offset = 0x100,
  1058. .map_io = pxa27x_map_io,
  1059. .nr_irqs = EZX_NR_IRQS,
  1060. .init_irq = pxa27x_init_irq,
  1061. .handle_irq = pxa27x_handle_irq,
  1062. .init_time = pxa_timer_init,
  1063. .init_machine = e2_init,
  1064. .restart = pxa_restart,
  1065. MACHINE_END
  1066. #endif