ezx.c 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246
  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/i2c/pxa-i2c.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. #ifdef CONFIG_MACH_EZX_A780
  605. /* gpio_keys */
  606. static struct gpio_keys_button a780_buttons[] = {
  607. [0] = {
  608. .code = SW_LID,
  609. .gpio = GPIO12_A780_FLIP_LID,
  610. .active_low = 0,
  611. .desc = "A780 flip lid",
  612. .type = EV_SW,
  613. .wakeup = 1,
  614. },
  615. };
  616. static struct gpio_keys_platform_data a780_gpio_keys_platform_data = {
  617. .buttons = a780_buttons,
  618. .nbuttons = ARRAY_SIZE(a780_buttons),
  619. };
  620. static struct platform_device a780_gpio_keys = {
  621. .name = "gpio-keys",
  622. .id = -1,
  623. .dev = {
  624. .platform_data = &a780_gpio_keys_platform_data,
  625. },
  626. };
  627. /* camera */
  628. static struct regulator_consumer_supply camera_dummy_supplies[] = {
  629. REGULATOR_SUPPLY("vdd", "0-005d"),
  630. };
  631. static struct regulator_init_data camera_dummy_initdata = {
  632. .consumer_supplies = camera_dummy_supplies,
  633. .num_consumer_supplies = ARRAY_SIZE(camera_dummy_supplies),
  634. .constraints = {
  635. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  636. },
  637. };
  638. static struct fixed_voltage_config camera_dummy_config = {
  639. .supply_name = "camera_vdd",
  640. .microvolts = 2800000,
  641. .gpio = GPIO50_nCAM_EN,
  642. .enable_high = 0,
  643. .init_data = &camera_dummy_initdata,
  644. };
  645. static struct platform_device camera_supply_dummy_device = {
  646. .name = "reg-fixed-voltage",
  647. .id = 1,
  648. .dev = {
  649. .platform_data = &camera_dummy_config,
  650. },
  651. };
  652. static int a780_camera_reset(struct device *dev)
  653. {
  654. gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
  655. msleep(10);
  656. gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
  657. return 0;
  658. }
  659. static int a780_camera_init(void)
  660. {
  661. int err;
  662. /*
  663. * GPIO50_nCAM_EN is active low
  664. * GPIO19_GEN1_CAM_RST is active on rising edge
  665. */
  666. err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
  667. if (err) {
  668. pr_err("%s: Failed to request CAM_RST\n", __func__);
  669. return err;
  670. }
  671. gpio_direction_output(GPIO19_GEN1_CAM_RST, 0);
  672. a780_camera_reset(NULL);
  673. return 0;
  674. }
  675. struct pxacamera_platform_data a780_pxacamera_platform_data = {
  676. .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
  677. PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN |
  678. PXA_CAMERA_PCP,
  679. .mclk_10khz = 5000,
  680. .sensor_i2c_adapter_id = 0,
  681. .sensor_i2c_address = 0x5d,
  682. };
  683. static struct i2c_board_info a780_i2c_board_info[] = {
  684. {
  685. I2C_BOARD_INFO("mt9m111", 0x5d),
  686. },
  687. };
  688. static struct platform_device *a780_devices[] __initdata = {
  689. &a780_gpio_keys,
  690. &camera_supply_dummy_device,
  691. };
  692. static void __init a780_init(void)
  693. {
  694. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  695. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
  696. pxa2xx_mfp_config(ARRAY_AND_SIZE(a780_pin_config));
  697. pxa_set_ffuart_info(NULL);
  698. pxa_set_btuart_info(NULL);
  699. pxa_set_stuart_info(NULL);
  700. pxa_set_i2c_info(NULL);
  701. i2c_register_board_info(0, ARRAY_AND_SIZE(a780_i2c_board_info));
  702. pxa_set_fb_info(NULL, &ezx_fb_info_1);
  703. pxa_set_keypad_info(&a780_keypad_platform_data);
  704. if (a780_camera_init() == 0)
  705. pxa_set_camera_info(&a780_pxacamera_platform_data);
  706. pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
  707. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  708. platform_add_devices(ARRAY_AND_SIZE(a780_devices));
  709. regulator_has_full_constraints();
  710. }
  711. MACHINE_START(EZX_A780, "Motorola EZX A780")
  712. .atag_offset = 0x100,
  713. .map_io = pxa27x_map_io,
  714. .nr_irqs = EZX_NR_IRQS,
  715. .init_irq = pxa27x_init_irq,
  716. .handle_irq = pxa27x_handle_irq,
  717. .init_time = pxa_timer_init,
  718. .init_machine = a780_init,
  719. .restart = pxa_restart,
  720. MACHINE_END
  721. #endif
  722. #ifdef CONFIG_MACH_EZX_E680
  723. /* gpio_keys */
  724. static struct gpio_keys_button e680_buttons[] = {
  725. [0] = {
  726. .code = KEY_SCREENLOCK,
  727. .gpio = GPIO12_E680_LOCK_SWITCH,
  728. .active_low = 0,
  729. .desc = "E680 lock switch",
  730. .type = EV_KEY,
  731. .wakeup = 1,
  732. },
  733. };
  734. static struct gpio_keys_platform_data e680_gpio_keys_platform_data = {
  735. .buttons = e680_buttons,
  736. .nbuttons = ARRAY_SIZE(e680_buttons),
  737. };
  738. static struct platform_device e680_gpio_keys = {
  739. .name = "gpio-keys",
  740. .id = -1,
  741. .dev = {
  742. .platform_data = &e680_gpio_keys_platform_data,
  743. },
  744. };
  745. static struct i2c_board_info __initdata e680_i2c_board_info[] = {
  746. { I2C_BOARD_INFO("tea5767", 0x81) },
  747. };
  748. static struct platform_device *e680_devices[] __initdata = {
  749. &e680_gpio_keys,
  750. };
  751. static void __init e680_init(void)
  752. {
  753. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  754. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
  755. pxa2xx_mfp_config(ARRAY_AND_SIZE(e680_pin_config));
  756. pxa_set_ffuart_info(NULL);
  757. pxa_set_btuart_info(NULL);
  758. pxa_set_stuart_info(NULL);
  759. pxa_set_i2c_info(NULL);
  760. i2c_register_board_info(0, ARRAY_AND_SIZE(e680_i2c_board_info));
  761. pxa_set_fb_info(NULL, &ezx_fb_info_1);
  762. pxa_set_keypad_info(&e680_keypad_platform_data);
  763. pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
  764. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  765. platform_add_devices(ARRAY_AND_SIZE(e680_devices));
  766. }
  767. MACHINE_START(EZX_E680, "Motorola EZX E680")
  768. .atag_offset = 0x100,
  769. .map_io = pxa27x_map_io,
  770. .nr_irqs = EZX_NR_IRQS,
  771. .init_irq = pxa27x_init_irq,
  772. .handle_irq = pxa27x_handle_irq,
  773. .init_time = pxa_timer_init,
  774. .init_machine = e680_init,
  775. .restart = pxa_restart,
  776. MACHINE_END
  777. #endif
  778. #ifdef CONFIG_MACH_EZX_A1200
  779. /* gpio_keys */
  780. static struct gpio_keys_button a1200_buttons[] = {
  781. [0] = {
  782. .code = SW_LID,
  783. .gpio = GPIO15_A1200_FLIP_LID,
  784. .active_low = 0,
  785. .desc = "A1200 flip lid",
  786. .type = EV_SW,
  787. .wakeup = 1,
  788. },
  789. };
  790. static struct gpio_keys_platform_data a1200_gpio_keys_platform_data = {
  791. .buttons = a1200_buttons,
  792. .nbuttons = ARRAY_SIZE(a1200_buttons),
  793. };
  794. static struct platform_device a1200_gpio_keys = {
  795. .name = "gpio-keys",
  796. .id = -1,
  797. .dev = {
  798. .platform_data = &a1200_gpio_keys_platform_data,
  799. },
  800. };
  801. static struct i2c_board_info __initdata a1200_i2c_board_info[] = {
  802. { I2C_BOARD_INFO("tea5767", 0x81) },
  803. };
  804. static struct platform_device *a1200_devices[] __initdata = {
  805. &a1200_gpio_keys,
  806. };
  807. static void __init a1200_init(void)
  808. {
  809. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  810. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
  811. pxa2xx_mfp_config(ARRAY_AND_SIZE(a1200_pin_config));
  812. pxa_set_ffuart_info(NULL);
  813. pxa_set_btuart_info(NULL);
  814. pxa_set_stuart_info(NULL);
  815. pxa_set_i2c_info(NULL);
  816. i2c_register_board_info(0, ARRAY_AND_SIZE(a1200_i2c_board_info));
  817. pxa_set_fb_info(NULL, &ezx_fb_info_2);
  818. pxa_set_keypad_info(&a1200_keypad_platform_data);
  819. pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
  820. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  821. platform_add_devices(ARRAY_AND_SIZE(a1200_devices));
  822. }
  823. MACHINE_START(EZX_A1200, "Motorola EZX A1200")
  824. .atag_offset = 0x100,
  825. .map_io = pxa27x_map_io,
  826. .nr_irqs = EZX_NR_IRQS,
  827. .init_irq = pxa27x_init_irq,
  828. .handle_irq = pxa27x_handle_irq,
  829. .init_time = pxa_timer_init,
  830. .init_machine = a1200_init,
  831. .restart = pxa_restart,
  832. MACHINE_END
  833. #endif
  834. #ifdef CONFIG_MACH_EZX_A910
  835. /* gpio_keys */
  836. static struct gpio_keys_button a910_buttons[] = {
  837. [0] = {
  838. .code = SW_LID,
  839. .gpio = GPIO15_A910_FLIP_LID,
  840. .active_low = 0,
  841. .desc = "A910 flip lid",
  842. .type = EV_SW,
  843. .wakeup = 1,
  844. },
  845. };
  846. static struct gpio_keys_platform_data a910_gpio_keys_platform_data = {
  847. .buttons = a910_buttons,
  848. .nbuttons = ARRAY_SIZE(a910_buttons),
  849. };
  850. static struct platform_device a910_gpio_keys = {
  851. .name = "gpio-keys",
  852. .id = -1,
  853. .dev = {
  854. .platform_data = &a910_gpio_keys_platform_data,
  855. },
  856. };
  857. /* camera */
  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. static int a910_camera_init(void)
  866. {
  867. int err;
  868. /*
  869. * GPIO50_nCAM_EN is active low
  870. * GPIO28_GEN2_CAM_RST is active on rising edge
  871. */
  872. err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
  873. if (err) {
  874. pr_err("%s: Failed to request CAM_RST\n", __func__);
  875. return err;
  876. }
  877. gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
  878. a910_camera_reset(NULL);
  879. return 0;
  880. }
  881. struct pxacamera_platform_data a910_pxacamera_platform_data = {
  882. .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
  883. PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN |
  884. PXA_CAMERA_PCP,
  885. .mclk_10khz = 5000,
  886. .sensor_i2c_adapter_id = 0,
  887. .sensor_i2c_address = 0x5d,
  888. };
  889. /* leds-lp3944 */
  890. static struct lp3944_platform_data a910_lp3944_leds = {
  891. .leds_size = LP3944_LEDS_MAX,
  892. .leds = {
  893. [0] = {
  894. .name = "a910:red:",
  895. .status = LP3944_LED_STATUS_OFF,
  896. .type = LP3944_LED_TYPE_LED,
  897. },
  898. [1] = {
  899. .name = "a910:green:",
  900. .status = LP3944_LED_STATUS_OFF,
  901. .type = LP3944_LED_TYPE_LED,
  902. },
  903. [2] {
  904. .name = "a910:blue:",
  905. .status = LP3944_LED_STATUS_OFF,
  906. .type = LP3944_LED_TYPE_LED,
  907. },
  908. /* Leds 3 and 4 are used as display power switches */
  909. [3] = {
  910. .name = "a910::cli_display",
  911. .status = LP3944_LED_STATUS_OFF,
  912. .type = LP3944_LED_TYPE_LED_INVERTED
  913. },
  914. [4] = {
  915. .name = "a910::main_display",
  916. .status = LP3944_LED_STATUS_ON,
  917. .type = LP3944_LED_TYPE_LED_INVERTED
  918. },
  919. [5] = { .type = LP3944_LED_TYPE_NONE },
  920. [6] = {
  921. .name = "a910::torch",
  922. .status = LP3944_LED_STATUS_OFF,
  923. .type = LP3944_LED_TYPE_LED,
  924. },
  925. [7] = {
  926. .name = "a910::flash",
  927. .status = LP3944_LED_STATUS_OFF,
  928. .type = LP3944_LED_TYPE_LED_INVERTED,
  929. },
  930. },
  931. };
  932. static struct i2c_board_info __initdata a910_i2c_board_info[] = {
  933. {
  934. I2C_BOARD_INFO("lp3944", 0x60),
  935. .platform_data = &a910_lp3944_leds,
  936. },
  937. {
  938. I2C_BOARD_INFO("mt9m111", 0x5d),
  939. },
  940. };
  941. static struct platform_device *a910_devices[] __initdata = {
  942. &a910_gpio_keys,
  943. &camera_supply_dummy_device,
  944. };
  945. static void __init a910_init(void)
  946. {
  947. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  948. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
  949. pxa2xx_mfp_config(ARRAY_AND_SIZE(a910_pin_config));
  950. pxa_set_ffuart_info(NULL);
  951. pxa_set_btuart_info(NULL);
  952. pxa_set_stuart_info(NULL);
  953. pxa_set_i2c_info(NULL);
  954. i2c_register_board_info(0, ARRAY_AND_SIZE(a910_i2c_board_info));
  955. pxa_set_fb_info(NULL, &ezx_fb_info_2);
  956. pxa_set_keypad_info(&a910_keypad_platform_data);
  957. if (a910_camera_init() == 0)
  958. pxa_set_camera_info(&a910_pxacamera_platform_data);
  959. pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
  960. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  961. platform_add_devices(ARRAY_AND_SIZE(a910_devices));
  962. regulator_has_full_constraints();
  963. }
  964. MACHINE_START(EZX_A910, "Motorola EZX A910")
  965. .atag_offset = 0x100,
  966. .map_io = pxa27x_map_io,
  967. .nr_irqs = EZX_NR_IRQS,
  968. .init_irq = pxa27x_init_irq,
  969. .handle_irq = pxa27x_handle_irq,
  970. .init_time = pxa_timer_init,
  971. .init_machine = a910_init,
  972. .restart = pxa_restart,
  973. MACHINE_END
  974. #endif
  975. #ifdef CONFIG_MACH_EZX_E6
  976. /* gpio_keys */
  977. static struct gpio_keys_button e6_buttons[] = {
  978. [0] = {
  979. .code = KEY_SCREENLOCK,
  980. .gpio = GPIO15_E6_LOCK_SWITCH,
  981. .active_low = 0,
  982. .desc = "E6 lock switch",
  983. .type = EV_KEY,
  984. .wakeup = 1,
  985. },
  986. };
  987. static struct gpio_keys_platform_data e6_gpio_keys_platform_data = {
  988. .buttons = e6_buttons,
  989. .nbuttons = ARRAY_SIZE(e6_buttons),
  990. };
  991. static struct platform_device e6_gpio_keys = {
  992. .name = "gpio-keys",
  993. .id = -1,
  994. .dev = {
  995. .platform_data = &e6_gpio_keys_platform_data,
  996. },
  997. };
  998. static struct i2c_board_info __initdata e6_i2c_board_info[] = {
  999. { I2C_BOARD_INFO("tea5767", 0x81) },
  1000. };
  1001. static struct platform_device *e6_devices[] __initdata = {
  1002. &e6_gpio_keys,
  1003. };
  1004. static void __init e6_init(void)
  1005. {
  1006. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  1007. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
  1008. pxa2xx_mfp_config(ARRAY_AND_SIZE(e6_pin_config));
  1009. pxa_set_ffuart_info(NULL);
  1010. pxa_set_btuart_info(NULL);
  1011. pxa_set_stuart_info(NULL);
  1012. pxa_set_i2c_info(NULL);
  1013. i2c_register_board_info(0, ARRAY_AND_SIZE(e6_i2c_board_info));
  1014. pxa_set_fb_info(NULL, &ezx_fb_info_2);
  1015. pxa_set_keypad_info(&e6_keypad_platform_data);
  1016. pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
  1017. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  1018. platform_add_devices(ARRAY_AND_SIZE(e6_devices));
  1019. }
  1020. MACHINE_START(EZX_E6, "Motorola EZX E6")
  1021. .atag_offset = 0x100,
  1022. .map_io = pxa27x_map_io,
  1023. .nr_irqs = EZX_NR_IRQS,
  1024. .init_irq = pxa27x_init_irq,
  1025. .handle_irq = pxa27x_handle_irq,
  1026. .init_time = pxa_timer_init,
  1027. .init_machine = e6_init,
  1028. .restart = pxa_restart,
  1029. MACHINE_END
  1030. #endif
  1031. #ifdef CONFIG_MACH_EZX_E2
  1032. static struct i2c_board_info __initdata e2_i2c_board_info[] = {
  1033. { I2C_BOARD_INFO("tea5767", 0x81) },
  1034. };
  1035. static struct platform_device *e2_devices[] __initdata = {
  1036. };
  1037. static void __init e2_init(void)
  1038. {
  1039. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  1040. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
  1041. pxa2xx_mfp_config(ARRAY_AND_SIZE(e2_pin_config));
  1042. pxa_set_ffuart_info(NULL);
  1043. pxa_set_btuart_info(NULL);
  1044. pxa_set_stuart_info(NULL);
  1045. pxa_set_i2c_info(NULL);
  1046. i2c_register_board_info(0, ARRAY_AND_SIZE(e2_i2c_board_info));
  1047. pxa_set_fb_info(NULL, &ezx_fb_info_2);
  1048. pxa_set_keypad_info(&e2_keypad_platform_data);
  1049. pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
  1050. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  1051. platform_add_devices(ARRAY_AND_SIZE(e2_devices));
  1052. }
  1053. MACHINE_START(EZX_E2, "Motorola EZX E2")
  1054. .atag_offset = 0x100,
  1055. .map_io = pxa27x_map_io,
  1056. .nr_irqs = EZX_NR_IRQS,
  1057. .init_irq = pxa27x_init_irq,
  1058. .handle_irq = pxa27x_handle_irq,
  1059. .init_time = pxa_timer_init,
  1060. .init_machine = e2_init,
  1061. .restart = pxa_restart,
  1062. MACHINE_END
  1063. #endif