ezx.c 28 KB

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