ezx.c 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244
  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. .atag_offset = 0x100,
  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. .restart = pxa_restart,
  695. MACHINE_END
  696. #endif
  697. #ifdef CONFIG_MACH_EZX_E680
  698. /* gpio_keys */
  699. static struct gpio_keys_button e680_buttons[] = {
  700. [0] = {
  701. .code = KEY_SCREENLOCK,
  702. .gpio = GPIO12_E680_LOCK_SWITCH,
  703. .active_low = 0,
  704. .desc = "E680 lock switch",
  705. .type = EV_KEY,
  706. .wakeup = 1,
  707. },
  708. };
  709. static struct gpio_keys_platform_data e680_gpio_keys_platform_data = {
  710. .buttons = e680_buttons,
  711. .nbuttons = ARRAY_SIZE(e680_buttons),
  712. };
  713. static struct platform_device e680_gpio_keys = {
  714. .name = "gpio-keys",
  715. .id = -1,
  716. .dev = {
  717. .platform_data = &e680_gpio_keys_platform_data,
  718. },
  719. };
  720. static struct i2c_board_info __initdata e680_i2c_board_info[] = {
  721. { I2C_BOARD_INFO("tea5767", 0x81) },
  722. };
  723. static struct platform_device *e680_devices[] __initdata = {
  724. &e680_gpio_keys,
  725. };
  726. static void __init e680_init(void)
  727. {
  728. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  729. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
  730. pxa2xx_mfp_config(ARRAY_AND_SIZE(e680_pin_config));
  731. pxa_set_ffuart_info(NULL);
  732. pxa_set_btuart_info(NULL);
  733. pxa_set_stuart_info(NULL);
  734. pxa_set_i2c_info(NULL);
  735. i2c_register_board_info(0, ARRAY_AND_SIZE(e680_i2c_board_info));
  736. pxa_set_fb_info(NULL, &ezx_fb_info_1);
  737. pxa_set_keypad_info(&e680_keypad_platform_data);
  738. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  739. platform_add_devices(ARRAY_AND_SIZE(e680_devices));
  740. }
  741. MACHINE_START(EZX_E680, "Motorola EZX E680")
  742. .atag_offset = 0x100,
  743. .map_io = pxa27x_map_io,
  744. .nr_irqs = EZX_NR_IRQS,
  745. .init_irq = pxa27x_init_irq,
  746. .handle_irq = pxa27x_handle_irq,
  747. .timer = &pxa_timer,
  748. .init_machine = e680_init,
  749. .restart = pxa_restart,
  750. MACHINE_END
  751. #endif
  752. #ifdef CONFIG_MACH_EZX_A1200
  753. /* gpio_keys */
  754. static struct gpio_keys_button a1200_buttons[] = {
  755. [0] = {
  756. .code = SW_LID,
  757. .gpio = GPIO15_A1200_FLIP_LID,
  758. .active_low = 0,
  759. .desc = "A1200 flip lid",
  760. .type = EV_SW,
  761. .wakeup = 1,
  762. },
  763. };
  764. static struct gpio_keys_platform_data a1200_gpio_keys_platform_data = {
  765. .buttons = a1200_buttons,
  766. .nbuttons = ARRAY_SIZE(a1200_buttons),
  767. };
  768. static struct platform_device a1200_gpio_keys = {
  769. .name = "gpio-keys",
  770. .id = -1,
  771. .dev = {
  772. .platform_data = &a1200_gpio_keys_platform_data,
  773. },
  774. };
  775. static struct i2c_board_info __initdata a1200_i2c_board_info[] = {
  776. { I2C_BOARD_INFO("tea5767", 0x81) },
  777. };
  778. static struct platform_device *a1200_devices[] __initdata = {
  779. &a1200_gpio_keys,
  780. };
  781. static void __init a1200_init(void)
  782. {
  783. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  784. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
  785. pxa2xx_mfp_config(ARRAY_AND_SIZE(a1200_pin_config));
  786. pxa_set_ffuart_info(NULL);
  787. pxa_set_btuart_info(NULL);
  788. pxa_set_stuart_info(NULL);
  789. pxa_set_i2c_info(NULL);
  790. i2c_register_board_info(0, ARRAY_AND_SIZE(a1200_i2c_board_info));
  791. pxa_set_fb_info(NULL, &ezx_fb_info_2);
  792. pxa_set_keypad_info(&a1200_keypad_platform_data);
  793. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  794. platform_add_devices(ARRAY_AND_SIZE(a1200_devices));
  795. }
  796. MACHINE_START(EZX_A1200, "Motorola EZX A1200")
  797. .atag_offset = 0x100,
  798. .map_io = pxa27x_map_io,
  799. .nr_irqs = EZX_NR_IRQS,
  800. .init_irq = pxa27x_init_irq,
  801. .handle_irq = pxa27x_handle_irq,
  802. .timer = &pxa_timer,
  803. .init_machine = a1200_init,
  804. .restart = pxa_restart,
  805. MACHINE_END
  806. #endif
  807. #ifdef CONFIG_MACH_EZX_A910
  808. /* gpio_keys */
  809. static struct gpio_keys_button a910_buttons[] = {
  810. [0] = {
  811. .code = SW_LID,
  812. .gpio = GPIO15_A910_FLIP_LID,
  813. .active_low = 0,
  814. .desc = "A910 flip lid",
  815. .type = EV_SW,
  816. .wakeup = 1,
  817. },
  818. };
  819. static struct gpio_keys_platform_data a910_gpio_keys_platform_data = {
  820. .buttons = a910_buttons,
  821. .nbuttons = ARRAY_SIZE(a910_buttons),
  822. };
  823. static struct platform_device a910_gpio_keys = {
  824. .name = "gpio-keys",
  825. .id = -1,
  826. .dev = {
  827. .platform_data = &a910_gpio_keys_platform_data,
  828. },
  829. };
  830. /* camera */
  831. static int a910_camera_init(void)
  832. {
  833. int err;
  834. /*
  835. * GPIO50_nCAM_EN is active low
  836. * GPIO28_GEN2_CAM_RST is active on rising edge
  837. */
  838. err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
  839. if (err) {
  840. pr_err("%s: Failed to request nCAM_EN\n", __func__);
  841. goto fail;
  842. }
  843. err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
  844. if (err) {
  845. pr_err("%s: Failed to request CAM_RST\n", __func__);
  846. goto fail_gpio_cam_rst;
  847. }
  848. gpio_direction_output(GPIO50_nCAM_EN, 1);
  849. gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
  850. return 0;
  851. fail_gpio_cam_rst:
  852. gpio_free(GPIO50_nCAM_EN);
  853. fail:
  854. return err;
  855. }
  856. static int a910_camera_power(struct device *dev, int on)
  857. {
  858. gpio_set_value(GPIO50_nCAM_EN, !on);
  859. return 0;
  860. }
  861. static int a910_camera_reset(struct device *dev)
  862. {
  863. gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
  864. msleep(10);
  865. gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
  866. return 0;
  867. }
  868. struct pxacamera_platform_data a910_pxacamera_platform_data = {
  869. .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
  870. PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
  871. .mclk_10khz = 5000,
  872. };
  873. static struct i2c_board_info a910_camera_i2c_board_info = {
  874. I2C_BOARD_INFO("mt9m111", 0x5d),
  875. };
  876. static struct soc_camera_link a910_iclink = {
  877. .bus_id = 0,
  878. .i2c_adapter_id = 0,
  879. .board_info = &a910_camera_i2c_board_info,
  880. .power = a910_camera_power,
  881. .reset = a910_camera_reset,
  882. };
  883. static struct platform_device a910_camera = {
  884. .name = "soc-camera-pdrv",
  885. .id = 0,
  886. .dev = {
  887. .platform_data = &a910_iclink,
  888. },
  889. };
  890. /* leds-lp3944 */
  891. static struct lp3944_platform_data a910_lp3944_leds = {
  892. .leds_size = LP3944_LEDS_MAX,
  893. .leds = {
  894. [0] = {
  895. .name = "a910:red:",
  896. .status = LP3944_LED_STATUS_OFF,
  897. .type = LP3944_LED_TYPE_LED,
  898. },
  899. [1] = {
  900. .name = "a910:green:",
  901. .status = LP3944_LED_STATUS_OFF,
  902. .type = LP3944_LED_TYPE_LED,
  903. },
  904. [2] {
  905. .name = "a910:blue:",
  906. .status = LP3944_LED_STATUS_OFF,
  907. .type = LP3944_LED_TYPE_LED,
  908. },
  909. /* Leds 3 and 4 are used as display power switches */
  910. [3] = {
  911. .name = "a910::cli_display",
  912. .status = LP3944_LED_STATUS_OFF,
  913. .type = LP3944_LED_TYPE_LED_INVERTED
  914. },
  915. [4] = {
  916. .name = "a910::main_display",
  917. .status = LP3944_LED_STATUS_ON,
  918. .type = LP3944_LED_TYPE_LED_INVERTED
  919. },
  920. [5] = { .type = LP3944_LED_TYPE_NONE },
  921. [6] = {
  922. .name = "a910::torch",
  923. .status = LP3944_LED_STATUS_OFF,
  924. .type = LP3944_LED_TYPE_LED,
  925. },
  926. [7] = {
  927. .name = "a910::flash",
  928. .status = LP3944_LED_STATUS_OFF,
  929. .type = LP3944_LED_TYPE_LED_INVERTED,
  930. },
  931. },
  932. };
  933. static struct i2c_board_info __initdata a910_i2c_board_info[] = {
  934. {
  935. I2C_BOARD_INFO("lp3944", 0x60),
  936. .platform_data = &a910_lp3944_leds,
  937. },
  938. };
  939. static struct platform_device *a910_devices[] __initdata = {
  940. &a910_gpio_keys,
  941. };
  942. static void __init a910_init(void)
  943. {
  944. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  945. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
  946. pxa2xx_mfp_config(ARRAY_AND_SIZE(a910_pin_config));
  947. pxa_set_ffuart_info(NULL);
  948. pxa_set_btuart_info(NULL);
  949. pxa_set_stuart_info(NULL);
  950. pxa_set_i2c_info(NULL);
  951. i2c_register_board_info(0, ARRAY_AND_SIZE(a910_i2c_board_info));
  952. pxa_set_fb_info(NULL, &ezx_fb_info_2);
  953. pxa_set_keypad_info(&a910_keypad_platform_data);
  954. if (a910_camera_init() == 0) {
  955. pxa_set_camera_info(&a910_pxacamera_platform_data);
  956. platform_device_register(&a910_camera);
  957. }
  958. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  959. platform_add_devices(ARRAY_AND_SIZE(a910_devices));
  960. }
  961. MACHINE_START(EZX_A910, "Motorola EZX A910")
  962. .atag_offset = 0x100,
  963. .map_io = pxa27x_map_io,
  964. .nr_irqs = EZX_NR_IRQS,
  965. .init_irq = pxa27x_init_irq,
  966. .handle_irq = pxa27x_handle_irq,
  967. .timer = &pxa_timer,
  968. .init_machine = a910_init,
  969. .restart = pxa_restart,
  970. MACHINE_END
  971. #endif
  972. #ifdef CONFIG_MACH_EZX_E6
  973. /* gpio_keys */
  974. static struct gpio_keys_button e6_buttons[] = {
  975. [0] = {
  976. .code = KEY_SCREENLOCK,
  977. .gpio = GPIO15_E6_LOCK_SWITCH,
  978. .active_low = 0,
  979. .desc = "E6 lock switch",
  980. .type = EV_KEY,
  981. .wakeup = 1,
  982. },
  983. };
  984. static struct gpio_keys_platform_data e6_gpio_keys_platform_data = {
  985. .buttons = e6_buttons,
  986. .nbuttons = ARRAY_SIZE(e6_buttons),
  987. };
  988. static struct platform_device e6_gpio_keys = {
  989. .name = "gpio-keys",
  990. .id = -1,
  991. .dev = {
  992. .platform_data = &e6_gpio_keys_platform_data,
  993. },
  994. };
  995. static struct i2c_board_info __initdata e6_i2c_board_info[] = {
  996. { I2C_BOARD_INFO("tea5767", 0x81) },
  997. };
  998. static struct platform_device *e6_devices[] __initdata = {
  999. &e6_gpio_keys,
  1000. };
  1001. static void __init e6_init(void)
  1002. {
  1003. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  1004. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
  1005. pxa2xx_mfp_config(ARRAY_AND_SIZE(e6_pin_config));
  1006. pxa_set_ffuart_info(NULL);
  1007. pxa_set_btuart_info(NULL);
  1008. pxa_set_stuart_info(NULL);
  1009. pxa_set_i2c_info(NULL);
  1010. i2c_register_board_info(0, ARRAY_AND_SIZE(e6_i2c_board_info));
  1011. pxa_set_fb_info(NULL, &ezx_fb_info_2);
  1012. pxa_set_keypad_info(&e6_keypad_platform_data);
  1013. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  1014. platform_add_devices(ARRAY_AND_SIZE(e6_devices));
  1015. }
  1016. MACHINE_START(EZX_E6, "Motorola EZX E6")
  1017. .atag_offset = 0x100,
  1018. .map_io = pxa27x_map_io,
  1019. .nr_irqs = EZX_NR_IRQS,
  1020. .init_irq = pxa27x_init_irq,
  1021. .handle_irq = pxa27x_handle_irq,
  1022. .timer = &pxa_timer,
  1023. .init_machine = e6_init,
  1024. .restart = pxa_restart,
  1025. MACHINE_END
  1026. #endif
  1027. #ifdef CONFIG_MACH_EZX_E2
  1028. static struct i2c_board_info __initdata e2_i2c_board_info[] = {
  1029. { I2C_BOARD_INFO("tea5767", 0x81) },
  1030. };
  1031. static struct platform_device *e2_devices[] __initdata = {
  1032. };
  1033. static void __init e2_init(void)
  1034. {
  1035. pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
  1036. pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
  1037. pxa2xx_mfp_config(ARRAY_AND_SIZE(e2_pin_config));
  1038. pxa_set_ffuart_info(NULL);
  1039. pxa_set_btuart_info(NULL);
  1040. pxa_set_stuart_info(NULL);
  1041. pxa_set_i2c_info(NULL);
  1042. i2c_register_board_info(0, ARRAY_AND_SIZE(e2_i2c_board_info));
  1043. pxa_set_fb_info(NULL, &ezx_fb_info_2);
  1044. pxa_set_keypad_info(&e2_keypad_platform_data);
  1045. platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
  1046. platform_add_devices(ARRAY_AND_SIZE(e2_devices));
  1047. }
  1048. MACHINE_START(EZX_E2, "Motorola EZX E2")
  1049. .atag_offset = 0x100,
  1050. .map_io = pxa27x_map_io,
  1051. .nr_irqs = EZX_NR_IRQS,
  1052. .init_irq = pxa27x_init_irq,
  1053. .handle_irq = pxa27x_handle_irq,
  1054. .timer = &pxa_timer,
  1055. .init_machine = e2_init,
  1056. .restart = pxa_restart,
  1057. MACHINE_END
  1058. #endif