ezx.c 29 KB

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