ezx.c 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267
  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 <linux/platform_data/video-pxafb.h>
  29. #include <linux/platform_data/usb-ohci-pxa27x.h>
  30. #include <mach/hardware.h>
  31. #include <linux/platform_data/keypad-pxa27x.h>
  32. #include <linux/platform_data/camera-pxa.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 const 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 matrix_keymap_data a780_matrix_keymap_data = {
  376. .keymap = a780_key_map,
  377. .keymap_size = ARRAY_SIZE(a780_key_map),
  378. };
  379. static struct pxa27x_keypad_platform_data a780_keypad_platform_data = {
  380. .matrix_key_rows = 5,
  381. .matrix_key_cols = 5,
  382. .matrix_keymap_data = &a780_matrix_keymap_data,
  383. .direct_key_map = { KEY_CAMERA },
  384. .direct_key_num = 1,
  385. .debounce_interval = 30,
  386. };
  387. #endif /* CONFIG_MACH_EZX_A780 */
  388. #ifdef CONFIG_MACH_EZX_E680
  389. static const unsigned int e680_key_map[] = {
  390. KEY(0, 0, KEY_UP),
  391. KEY(0, 1, KEY_RIGHT),
  392. KEY(0, 2, KEY_RESERVED),
  393. KEY(0, 3, KEY_SEND),
  394. KEY(1, 0, KEY_DOWN),
  395. KEY(1, 1, KEY_LEFT),
  396. KEY(1, 2, KEY_PAGEUP),
  397. KEY(1, 3, KEY_PAGEDOWN),
  398. KEY(2, 0, KEY_RESERVED),
  399. KEY(2, 1, KEY_RESERVED),
  400. KEY(2, 2, KEY_RESERVED),
  401. KEY(2, 3, KEY_KPENTER),
  402. };
  403. static struct matrix_keymap_data e680_matrix_keymap_data = {
  404. .keymap = e680_key_map,
  405. .keymap_size = ARRAY_SIZE(e680_key_map),
  406. };
  407. static struct pxa27x_keypad_platform_data e680_keypad_platform_data = {
  408. .matrix_key_rows = 3,
  409. .matrix_key_cols = 4,
  410. .matrix_keymap_data = &e680_matrix_keymap_data,
  411. .direct_key_map = {
  412. KEY_CAMERA,
  413. KEY_RESERVED,
  414. KEY_RESERVED,
  415. KEY_F1,
  416. KEY_CANCEL,
  417. KEY_F2,
  418. },
  419. .direct_key_num = 6,
  420. .debounce_interval = 30,
  421. };
  422. #endif /* CONFIG_MACH_EZX_E680 */
  423. #ifdef CONFIG_MACH_EZX_A1200
  424. static const unsigned int a1200_key_map[] = {
  425. KEY(0, 0, KEY_RESERVED),
  426. KEY(0, 1, KEY_RIGHT),
  427. KEY(0, 2, KEY_PAGEDOWN),
  428. KEY(0, 3, KEY_RESERVED),
  429. KEY(0, 4, KEY_RESERVED),
  430. KEY(0, 5, KEY_RESERVED),
  431. KEY(1, 0, KEY_RESERVED),
  432. KEY(1, 1, KEY_DOWN),
  433. KEY(1, 2, KEY_CAMERA),
  434. KEY(1, 3, KEY_RESERVED),
  435. KEY(1, 4, KEY_RESERVED),
  436. KEY(1, 5, KEY_RESERVED),
  437. KEY(2, 0, KEY_RESERVED),
  438. KEY(2, 1, KEY_KPENTER),
  439. KEY(2, 2, KEY_RECORD),
  440. KEY(2, 3, KEY_RESERVED),
  441. KEY(2, 4, KEY_RESERVED),
  442. KEY(2, 5, KEY_SELECT),
  443. KEY(3, 0, KEY_RESERVED),
  444. KEY(3, 1, KEY_UP),
  445. KEY(3, 2, KEY_SEND),
  446. KEY(3, 3, KEY_RESERVED),
  447. KEY(3, 4, KEY_RESERVED),
  448. KEY(3, 5, KEY_RESERVED),
  449. KEY(4, 0, KEY_RESERVED),
  450. KEY(4, 1, KEY_LEFT),
  451. KEY(4, 2, KEY_PAGEUP),
  452. KEY(4, 3, KEY_RESERVED),
  453. KEY(4, 4, KEY_RESERVED),
  454. KEY(4, 5, KEY_RESERVED),
  455. };
  456. static struct matrix_keymap_data a1200_matrix_keymap_data = {
  457. .keymap = a1200_key_map,
  458. .keymap_size = ARRAY_SIZE(a1200_key_map),
  459. };
  460. static struct pxa27x_keypad_platform_data a1200_keypad_platform_data = {
  461. .matrix_key_rows = 5,
  462. .matrix_key_cols = 6,
  463. .matrix_keymap_data = &a1200_matrix_keymap_data,
  464. .debounce_interval = 30,
  465. };
  466. #endif /* CONFIG_MACH_EZX_A1200 */
  467. #ifdef CONFIG_MACH_EZX_E6
  468. static const unsigned int e6_key_map[] = {
  469. KEY(0, 0, KEY_RESERVED),
  470. KEY(0, 1, KEY_RIGHT),
  471. KEY(0, 2, KEY_PAGEDOWN),
  472. KEY(0, 3, KEY_RESERVED),
  473. KEY(0, 4, KEY_RESERVED),
  474. KEY(0, 5, KEY_NEXTSONG),
  475. KEY(1, 0, KEY_RESERVED),
  476. KEY(1, 1, KEY_DOWN),
  477. KEY(1, 2, KEY_PROG1),
  478. KEY(1, 3, KEY_RESERVED),
  479. KEY(1, 4, KEY_RESERVED),
  480. KEY(1, 5, KEY_RESERVED),
  481. KEY(2, 0, KEY_RESERVED),
  482. KEY(2, 1, KEY_ENTER),
  483. KEY(2, 2, KEY_CAMERA),
  484. KEY(2, 3, KEY_RESERVED),
  485. KEY(2, 4, KEY_RESERVED),
  486. KEY(2, 5, KEY_WWW),
  487. KEY(3, 0, KEY_RESERVED),
  488. KEY(3, 1, KEY_UP),
  489. KEY(3, 2, KEY_SEND),
  490. KEY(3, 3, KEY_RESERVED),
  491. KEY(3, 4, KEY_RESERVED),
  492. KEY(3, 5, KEY_PLAYPAUSE),
  493. KEY(4, 0, KEY_RESERVED),
  494. KEY(4, 1, KEY_LEFT),
  495. KEY(4, 2, KEY_PAGEUP),
  496. KEY(4, 3, KEY_RESERVED),
  497. KEY(4, 4, KEY_RESERVED),
  498. KEY(4, 5, KEY_PREVIOUSSONG),
  499. };
  500. static struct matrix_keymap_data e6_keymap_data = {
  501. .keymap = e6_key_map,
  502. .keymap_size = ARRAY_SIZE(e6_key_map),
  503. };
  504. static struct pxa27x_keypad_platform_data e6_keypad_platform_data = {
  505. .matrix_key_rows = 5,
  506. .matrix_key_cols = 6,
  507. .matrix_keymap_data = &e6_keymap_data,
  508. .debounce_interval = 30,
  509. };
  510. #endif /* CONFIG_MACH_EZX_E6 */
  511. #ifdef CONFIG_MACH_EZX_A910
  512. static const unsigned int a910_key_map[] = {
  513. KEY(0, 0, KEY_NUMERIC_6),
  514. KEY(0, 1, KEY_RIGHT),
  515. KEY(0, 2, KEY_PAGEDOWN),
  516. KEY(0, 3, KEY_KPENTER),
  517. KEY(0, 4, KEY_NUMERIC_5),
  518. KEY(0, 5, KEY_CAMERA),
  519. KEY(1, 0, KEY_NUMERIC_8),
  520. KEY(1, 1, KEY_DOWN),
  521. KEY(1, 2, KEY_RESERVED),
  522. KEY(1, 3, KEY_F1), /* Left SoftKey */
  523. KEY(1, 4, KEY_NUMERIC_STAR),
  524. KEY(1, 5, KEY_RESERVED),
  525. KEY(2, 0, KEY_NUMERIC_7),
  526. KEY(2, 1, KEY_NUMERIC_9),
  527. KEY(2, 2, KEY_RECORD),
  528. KEY(2, 3, KEY_F2), /* Right SoftKey */
  529. KEY(2, 4, KEY_BACK),
  530. KEY(2, 5, KEY_SELECT),
  531. KEY(3, 0, KEY_NUMERIC_2),
  532. KEY(3, 1, KEY_UP),
  533. KEY(3, 2, KEY_SEND),
  534. KEY(3, 3, KEY_NUMERIC_0),
  535. KEY(3, 4, KEY_NUMERIC_1),
  536. KEY(3, 5, KEY_RECORD),
  537. KEY(4, 0, KEY_NUMERIC_4),
  538. KEY(4, 1, KEY_LEFT),
  539. KEY(4, 2, KEY_PAGEUP),
  540. KEY(4, 3, KEY_NUMERIC_POUND),
  541. KEY(4, 4, KEY_NUMERIC_3),
  542. KEY(4, 5, KEY_RESERVED),
  543. };
  544. static struct matrix_keymap_data a910_matrix_keymap_data = {
  545. .keymap = a910_key_map,
  546. .keymap_size = ARRAY_SIZE(a910_key_map),
  547. };
  548. static struct pxa27x_keypad_platform_data a910_keypad_platform_data = {
  549. .matrix_key_rows = 5,
  550. .matrix_key_cols = 6,
  551. .matrix_keymap_data = &a910_matrix_keymap_data,
  552. .debounce_interval = 30,
  553. };
  554. #endif /* CONFIG_MACH_EZX_A910 */
  555. #ifdef CONFIG_MACH_EZX_E2
  556. static const unsigned int e2_key_map[] = {
  557. KEY(0, 0, KEY_NUMERIC_6),
  558. KEY(0, 1, KEY_RIGHT),
  559. KEY(0, 2, KEY_NUMERIC_9),
  560. KEY(0, 3, KEY_NEXTSONG),
  561. KEY(0, 4, KEY_NUMERIC_5),
  562. KEY(0, 5, KEY_F1), /* Left SoftKey */
  563. KEY(1, 0, KEY_NUMERIC_8),
  564. KEY(1, 1, KEY_DOWN),
  565. KEY(1, 2, KEY_RESERVED),
  566. KEY(1, 3, KEY_PAGEUP),
  567. KEY(1, 4, KEY_NUMERIC_STAR),
  568. KEY(1, 5, KEY_F2), /* Right SoftKey */
  569. KEY(2, 0, KEY_NUMERIC_7),
  570. KEY(2, 1, KEY_KPENTER),
  571. KEY(2, 2, KEY_RECORD),
  572. KEY(2, 3, KEY_PAGEDOWN),
  573. KEY(2, 4, KEY_BACK),
  574. KEY(2, 5, KEY_NUMERIC_0),
  575. KEY(3, 0, KEY_NUMERIC_2),
  576. KEY(3, 1, KEY_UP),
  577. KEY(3, 2, KEY_SEND),
  578. KEY(3, 3, KEY_PLAYPAUSE),
  579. KEY(3, 4, KEY_NUMERIC_1),
  580. KEY(3, 5, KEY_SOUND), /* Music SoftKey */
  581. KEY(4, 0, KEY_NUMERIC_4),
  582. KEY(4, 1, KEY_LEFT),
  583. KEY(4, 2, KEY_NUMERIC_POUND),
  584. KEY(4, 3, KEY_PREVIOUSSONG),
  585. KEY(4, 4, KEY_NUMERIC_3),
  586. KEY(4, 5, KEY_RESERVED),
  587. };
  588. static struct matrix_keymap_data e2_matrix_keymap_data = {
  589. .keymap = e2_key_map,
  590. .keymap_size = ARRAY_SIZE(e2_key_map),
  591. };
  592. static struct pxa27x_keypad_platform_data e2_keypad_platform_data = {
  593. .matrix_key_rows = 5,
  594. .matrix_key_cols = 6,
  595. .matrix_keymap_data = &e2_matrix_keymap_data,
  596. .debounce_interval = 30,
  597. };
  598. #endif /* CONFIG_MACH_EZX_E2 */
  599. #ifdef CONFIG_MACH_EZX_A780
  600. /* gpio_keys */
  601. static struct gpio_keys_button a780_buttons[] = {
  602. [0] = {
  603. .code = SW_LID,
  604. .gpio = GPIO12_A780_FLIP_LID,
  605. .active_low = 0,
  606. .desc = "A780 flip lid",
  607. .type = EV_SW,
  608. .wakeup = 1,
  609. },
  610. };
  611. static struct gpio_keys_platform_data a780_gpio_keys_platform_data = {
  612. .buttons = a780_buttons,
  613. .nbuttons = ARRAY_SIZE(a780_buttons),
  614. };
  615. static struct platform_device a780_gpio_keys = {
  616. .name = "gpio-keys",
  617. .id = -1,
  618. .dev = {
  619. .platform_data = &a780_gpio_keys_platform_data,
  620. },
  621. };
  622. /* camera */
  623. static int a780_camera_init(void)
  624. {
  625. int err;
  626. /*
  627. * GPIO50_nCAM_EN is active low
  628. * GPIO19_GEN1_CAM_RST is active on rising edge
  629. */
  630. err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
  631. if (err) {
  632. pr_err("%s: Failed to request nCAM_EN\n", __func__);
  633. goto fail;
  634. }
  635. err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
  636. if (err) {
  637. pr_err("%s: Failed to request CAM_RST\n", __func__);
  638. goto fail_gpio_cam_rst;
  639. }
  640. gpio_direction_output(GPIO50_nCAM_EN, 1);
  641. gpio_direction_output(GPIO19_GEN1_CAM_RST, 0);
  642. return 0;
  643. fail_gpio_cam_rst:
  644. gpio_free(GPIO50_nCAM_EN);
  645. fail:
  646. return err;
  647. }
  648. static int a780_camera_power(struct device *dev, int on)
  649. {
  650. gpio_set_value(GPIO50_nCAM_EN, !on);
  651. return 0;
  652. }
  653. static int a780_camera_reset(struct device *dev)
  654. {
  655. gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
  656. msleep(10);
  657. gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
  658. return 0;
  659. }
  660. struct pxacamera_platform_data a780_pxacamera_platform_data = {
  661. .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
  662. PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
  663. .mclk_10khz = 5000,
  664. };
  665. static struct i2c_board_info a780_camera_i2c_board_info = {
  666. I2C_BOARD_INFO("mt9m111", 0x5d),
  667. };
  668. static struct soc_camera_link a780_iclink = {
  669. .bus_id = 0,
  670. .flags = SOCAM_SENSOR_INVERT_PCLK,
  671. .i2c_adapter_id = 0,
  672. .board_info = &a780_camera_i2c_board_info,
  673. .power = a780_camera_power,
  674. .reset = a780_camera_reset,
  675. };
  676. static struct platform_device a780_camera = {
  677. .name = "soc-camera-pdrv",
  678. .id = 0,
  679. .dev = {
  680. .platform_data = &a780_iclink,
  681. },
  682. };
  683. static struct platform_device *a780_devices[] __initdata = {
  684. &a780_gpio_keys,
  685. };
  686. static void __init a780_init(void)
  687. {
  688. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  689. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
  690. pxa2xx_mfp_config(ARRAY_AND_SIZE(a780_pin_config));
  691. pxa_set_ffuart_info(NULL);
  692. pxa_set_btuart_info(NULL);
  693. pxa_set_stuart_info(NULL);
  694. pxa_set_i2c_info(NULL);
  695. pxa_set_fb_info(NULL, &ezx_fb_info_1);
  696. pxa_set_keypad_info(&a780_keypad_platform_data);
  697. if (a780_camera_init() == 0) {
  698. pxa_set_camera_info(&a780_pxacamera_platform_data);
  699. platform_device_register(&a780_camera);
  700. }
  701. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  702. platform_add_devices(ARRAY_AND_SIZE(a780_devices));
  703. }
  704. MACHINE_START(EZX_A780, "Motorola EZX A780")
  705. .atag_offset = 0x100,
  706. .map_io = pxa27x_map_io,
  707. .nr_irqs = EZX_NR_IRQS,
  708. .init_irq = pxa27x_init_irq,
  709. .handle_irq = pxa27x_handle_irq,
  710. .init_time = pxa_timer_init,
  711. .init_machine = a780_init,
  712. .restart = pxa_restart,
  713. MACHINE_END
  714. #endif
  715. #ifdef CONFIG_MACH_EZX_E680
  716. /* gpio_keys */
  717. static struct gpio_keys_button e680_buttons[] = {
  718. [0] = {
  719. .code = KEY_SCREENLOCK,
  720. .gpio = GPIO12_E680_LOCK_SWITCH,
  721. .active_low = 0,
  722. .desc = "E680 lock switch",
  723. .type = EV_KEY,
  724. .wakeup = 1,
  725. },
  726. };
  727. static struct gpio_keys_platform_data e680_gpio_keys_platform_data = {
  728. .buttons = e680_buttons,
  729. .nbuttons = ARRAY_SIZE(e680_buttons),
  730. };
  731. static struct platform_device e680_gpio_keys = {
  732. .name = "gpio-keys",
  733. .id = -1,
  734. .dev = {
  735. .platform_data = &e680_gpio_keys_platform_data,
  736. },
  737. };
  738. static struct i2c_board_info __initdata e680_i2c_board_info[] = {
  739. { I2C_BOARD_INFO("tea5767", 0x81) },
  740. };
  741. static struct platform_device *e680_devices[] __initdata = {
  742. &e680_gpio_keys,
  743. };
  744. static void __init e680_init(void)
  745. {
  746. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  747. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
  748. pxa2xx_mfp_config(ARRAY_AND_SIZE(e680_pin_config));
  749. pxa_set_ffuart_info(NULL);
  750. pxa_set_btuart_info(NULL);
  751. pxa_set_stuart_info(NULL);
  752. pxa_set_i2c_info(NULL);
  753. i2c_register_board_info(0, ARRAY_AND_SIZE(e680_i2c_board_info));
  754. pxa_set_fb_info(NULL, &ezx_fb_info_1);
  755. pxa_set_keypad_info(&e680_keypad_platform_data);
  756. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  757. platform_add_devices(ARRAY_AND_SIZE(e680_devices));
  758. }
  759. MACHINE_START(EZX_E680, "Motorola EZX E680")
  760. .atag_offset = 0x100,
  761. .map_io = pxa27x_map_io,
  762. .nr_irqs = EZX_NR_IRQS,
  763. .init_irq = pxa27x_init_irq,
  764. .handle_irq = pxa27x_handle_irq,
  765. .init_time = pxa_timer_init,
  766. .init_machine = e680_init,
  767. .restart = pxa_restart,
  768. MACHINE_END
  769. #endif
  770. #ifdef CONFIG_MACH_EZX_A1200
  771. /* gpio_keys */
  772. static struct gpio_keys_button a1200_buttons[] = {
  773. [0] = {
  774. .code = SW_LID,
  775. .gpio = GPIO15_A1200_FLIP_LID,
  776. .active_low = 0,
  777. .desc = "A1200 flip lid",
  778. .type = EV_SW,
  779. .wakeup = 1,
  780. },
  781. };
  782. static struct gpio_keys_platform_data a1200_gpio_keys_platform_data = {
  783. .buttons = a1200_buttons,
  784. .nbuttons = ARRAY_SIZE(a1200_buttons),
  785. };
  786. static struct platform_device a1200_gpio_keys = {
  787. .name = "gpio-keys",
  788. .id = -1,
  789. .dev = {
  790. .platform_data = &a1200_gpio_keys_platform_data,
  791. },
  792. };
  793. static struct i2c_board_info __initdata a1200_i2c_board_info[] = {
  794. { I2C_BOARD_INFO("tea5767", 0x81) },
  795. };
  796. static struct platform_device *a1200_devices[] __initdata = {
  797. &a1200_gpio_keys,
  798. };
  799. static void __init a1200_init(void)
  800. {
  801. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  802. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
  803. pxa2xx_mfp_config(ARRAY_AND_SIZE(a1200_pin_config));
  804. pxa_set_ffuart_info(NULL);
  805. pxa_set_btuart_info(NULL);
  806. pxa_set_stuart_info(NULL);
  807. pxa_set_i2c_info(NULL);
  808. i2c_register_board_info(0, ARRAY_AND_SIZE(a1200_i2c_board_info));
  809. pxa_set_fb_info(NULL, &ezx_fb_info_2);
  810. pxa_set_keypad_info(&a1200_keypad_platform_data);
  811. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  812. platform_add_devices(ARRAY_AND_SIZE(a1200_devices));
  813. }
  814. MACHINE_START(EZX_A1200, "Motorola EZX A1200")
  815. .atag_offset = 0x100,
  816. .map_io = pxa27x_map_io,
  817. .nr_irqs = EZX_NR_IRQS,
  818. .init_irq = pxa27x_init_irq,
  819. .handle_irq = pxa27x_handle_irq,
  820. .init_time = pxa_timer_init,
  821. .init_machine = a1200_init,
  822. .restart = pxa_restart,
  823. MACHINE_END
  824. #endif
  825. #ifdef CONFIG_MACH_EZX_A910
  826. /* gpio_keys */
  827. static struct gpio_keys_button a910_buttons[] = {
  828. [0] = {
  829. .code = SW_LID,
  830. .gpio = GPIO15_A910_FLIP_LID,
  831. .active_low = 0,
  832. .desc = "A910 flip lid",
  833. .type = EV_SW,
  834. .wakeup = 1,
  835. },
  836. };
  837. static struct gpio_keys_platform_data a910_gpio_keys_platform_data = {
  838. .buttons = a910_buttons,
  839. .nbuttons = ARRAY_SIZE(a910_buttons),
  840. };
  841. static struct platform_device a910_gpio_keys = {
  842. .name = "gpio-keys",
  843. .id = -1,
  844. .dev = {
  845. .platform_data = &a910_gpio_keys_platform_data,
  846. },
  847. };
  848. /* camera */
  849. static int a910_camera_init(void)
  850. {
  851. int err;
  852. /*
  853. * GPIO50_nCAM_EN is active low
  854. * GPIO28_GEN2_CAM_RST is active on rising edge
  855. */
  856. err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
  857. if (err) {
  858. pr_err("%s: Failed to request nCAM_EN\n", __func__);
  859. goto fail;
  860. }
  861. err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
  862. if (err) {
  863. pr_err("%s: Failed to request CAM_RST\n", __func__);
  864. goto fail_gpio_cam_rst;
  865. }
  866. gpio_direction_output(GPIO50_nCAM_EN, 1);
  867. gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
  868. return 0;
  869. fail_gpio_cam_rst:
  870. gpio_free(GPIO50_nCAM_EN);
  871. fail:
  872. return err;
  873. }
  874. static int a910_camera_power(struct device *dev, int on)
  875. {
  876. gpio_set_value(GPIO50_nCAM_EN, !on);
  877. return 0;
  878. }
  879. static int a910_camera_reset(struct device *dev)
  880. {
  881. gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
  882. msleep(10);
  883. gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
  884. return 0;
  885. }
  886. struct pxacamera_platform_data a910_pxacamera_platform_data = {
  887. .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
  888. PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
  889. .mclk_10khz = 5000,
  890. };
  891. static struct i2c_board_info a910_camera_i2c_board_info = {
  892. I2C_BOARD_INFO("mt9m111", 0x5d),
  893. };
  894. static struct soc_camera_link a910_iclink = {
  895. .bus_id = 0,
  896. .i2c_adapter_id = 0,
  897. .board_info = &a910_camera_i2c_board_info,
  898. .power = a910_camera_power,
  899. .reset = a910_camera_reset,
  900. };
  901. static struct platform_device a910_camera = {
  902. .name = "soc-camera-pdrv",
  903. .id = 0,
  904. .dev = {
  905. .platform_data = &a910_iclink,
  906. },
  907. };
  908. /* leds-lp3944 */
  909. static struct lp3944_platform_data a910_lp3944_leds = {
  910. .leds_size = LP3944_LEDS_MAX,
  911. .leds = {
  912. [0] = {
  913. .name = "a910:red:",
  914. .status = LP3944_LED_STATUS_OFF,
  915. .type = LP3944_LED_TYPE_LED,
  916. },
  917. [1] = {
  918. .name = "a910:green:",
  919. .status = LP3944_LED_STATUS_OFF,
  920. .type = LP3944_LED_TYPE_LED,
  921. },
  922. [2] {
  923. .name = "a910:blue:",
  924. .status = LP3944_LED_STATUS_OFF,
  925. .type = LP3944_LED_TYPE_LED,
  926. },
  927. /* Leds 3 and 4 are used as display power switches */
  928. [3] = {
  929. .name = "a910::cli_display",
  930. .status = LP3944_LED_STATUS_OFF,
  931. .type = LP3944_LED_TYPE_LED_INVERTED
  932. },
  933. [4] = {
  934. .name = "a910::main_display",
  935. .status = LP3944_LED_STATUS_ON,
  936. .type = LP3944_LED_TYPE_LED_INVERTED
  937. },
  938. [5] = { .type = LP3944_LED_TYPE_NONE },
  939. [6] = {
  940. .name = "a910::torch",
  941. .status = LP3944_LED_STATUS_OFF,
  942. .type = LP3944_LED_TYPE_LED,
  943. },
  944. [7] = {
  945. .name = "a910::flash",
  946. .status = LP3944_LED_STATUS_OFF,
  947. .type = LP3944_LED_TYPE_LED_INVERTED,
  948. },
  949. },
  950. };
  951. static struct i2c_board_info __initdata a910_i2c_board_info[] = {
  952. {
  953. I2C_BOARD_INFO("lp3944", 0x60),
  954. .platform_data = &a910_lp3944_leds,
  955. },
  956. };
  957. static struct platform_device *a910_devices[] __initdata = {
  958. &a910_gpio_keys,
  959. };
  960. static void __init a910_init(void)
  961. {
  962. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  963. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
  964. pxa2xx_mfp_config(ARRAY_AND_SIZE(a910_pin_config));
  965. pxa_set_ffuart_info(NULL);
  966. pxa_set_btuart_info(NULL);
  967. pxa_set_stuart_info(NULL);
  968. pxa_set_i2c_info(NULL);
  969. i2c_register_board_info(0, ARRAY_AND_SIZE(a910_i2c_board_info));
  970. pxa_set_fb_info(NULL, &ezx_fb_info_2);
  971. pxa_set_keypad_info(&a910_keypad_platform_data);
  972. if (a910_camera_init() == 0) {
  973. pxa_set_camera_info(&a910_pxacamera_platform_data);
  974. platform_device_register(&a910_camera);
  975. }
  976. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  977. platform_add_devices(ARRAY_AND_SIZE(a910_devices));
  978. }
  979. MACHINE_START(EZX_A910, "Motorola EZX A910")
  980. .atag_offset = 0x100,
  981. .map_io = pxa27x_map_io,
  982. .nr_irqs = EZX_NR_IRQS,
  983. .init_irq = pxa27x_init_irq,
  984. .handle_irq = pxa27x_handle_irq,
  985. .init_time = pxa_timer_init,
  986. .init_machine = a910_init,
  987. .restart = pxa_restart,
  988. MACHINE_END
  989. #endif
  990. #ifdef CONFIG_MACH_EZX_E6
  991. /* gpio_keys */
  992. static struct gpio_keys_button e6_buttons[] = {
  993. [0] = {
  994. .code = KEY_SCREENLOCK,
  995. .gpio = GPIO15_E6_LOCK_SWITCH,
  996. .active_low = 0,
  997. .desc = "E6 lock switch",
  998. .type = EV_KEY,
  999. .wakeup = 1,
  1000. },
  1001. };
  1002. static struct gpio_keys_platform_data e6_gpio_keys_platform_data = {
  1003. .buttons = e6_buttons,
  1004. .nbuttons = ARRAY_SIZE(e6_buttons),
  1005. };
  1006. static struct platform_device e6_gpio_keys = {
  1007. .name = "gpio-keys",
  1008. .id = -1,
  1009. .dev = {
  1010. .platform_data = &e6_gpio_keys_platform_data,
  1011. },
  1012. };
  1013. static struct i2c_board_info __initdata e6_i2c_board_info[] = {
  1014. { I2C_BOARD_INFO("tea5767", 0x81) },
  1015. };
  1016. static struct platform_device *e6_devices[] __initdata = {
  1017. &e6_gpio_keys,
  1018. };
  1019. static void __init e6_init(void)
  1020. {
  1021. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  1022. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
  1023. pxa2xx_mfp_config(ARRAY_AND_SIZE(e6_pin_config));
  1024. pxa_set_ffuart_info(NULL);
  1025. pxa_set_btuart_info(NULL);
  1026. pxa_set_stuart_info(NULL);
  1027. pxa_set_i2c_info(NULL);
  1028. i2c_register_board_info(0, ARRAY_AND_SIZE(e6_i2c_board_info));
  1029. pxa_set_fb_info(NULL, &ezx_fb_info_2);
  1030. pxa_set_keypad_info(&e6_keypad_platform_data);
  1031. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  1032. platform_add_devices(ARRAY_AND_SIZE(e6_devices));
  1033. }
  1034. MACHINE_START(EZX_E6, "Motorola EZX E6")
  1035. .atag_offset = 0x100,
  1036. .map_io = pxa27x_map_io,
  1037. .nr_irqs = EZX_NR_IRQS,
  1038. .init_irq = pxa27x_init_irq,
  1039. .handle_irq = pxa27x_handle_irq,
  1040. .init_time = pxa_timer_init,
  1041. .init_machine = e6_init,
  1042. .restart = pxa_restart,
  1043. MACHINE_END
  1044. #endif
  1045. #ifdef CONFIG_MACH_EZX_E2
  1046. static struct i2c_board_info __initdata e2_i2c_board_info[] = {
  1047. { I2C_BOARD_INFO("tea5767", 0x81) },
  1048. };
  1049. static struct platform_device *e2_devices[] __initdata = {
  1050. };
  1051. static void __init e2_init(void)
  1052. {
  1053. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  1054. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
  1055. pxa2xx_mfp_config(ARRAY_AND_SIZE(e2_pin_config));
  1056. pxa_set_ffuart_info(NULL);
  1057. pxa_set_btuart_info(NULL);
  1058. pxa_set_stuart_info(NULL);
  1059. pxa_set_i2c_info(NULL);
  1060. i2c_register_board_info(0, ARRAY_AND_SIZE(e2_i2c_board_info));
  1061. pxa_set_fb_info(NULL, &ezx_fb_info_2);
  1062. pxa_set_keypad_info(&e2_keypad_platform_data);
  1063. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  1064. platform_add_devices(ARRAY_AND_SIZE(e2_devices));
  1065. }
  1066. MACHINE_START(EZX_E2, "Motorola EZX E2")
  1067. .atag_offset = 0x100,
  1068. .map_io = pxa27x_map_io,
  1069. .nr_irqs = EZX_NR_IRQS,
  1070. .init_irq = pxa27x_init_irq,
  1071. .handle_irq = pxa27x_handle_irq,
  1072. .init_time = pxa_timer_init,
  1073. .init_machine = e2_init,
  1074. .restart = pxa_restart,
  1075. MACHINE_END
  1076. #endif