spitz.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703
  1. /*
  2. * Support for Sharp SL-Cxx00 Series of PDAs
  3. * Models: SL-C3000 (Spitz), SL-C1000 (Akita) and SL-C3100 (Borzoi)
  4. *
  5. * Copyright (c) 2005 Richard Purdie
  6. *
  7. * Based on Sharp's 2.4 kernel patches/lubbock.c
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. *
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/init.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/delay.h>
  18. #include <linux/major.h>
  19. #include <linux/fs.h>
  20. #include <linux/interrupt.h>
  21. #include <linux/mmc/host.h>
  22. #include <linux/pm.h>
  23. #include <linux/backlight.h>
  24. #include <asm/setup.h>
  25. #include <asm/memory.h>
  26. #include <asm/mach-types.h>
  27. #include <mach/hardware.h>
  28. #include <asm/irq.h>
  29. #include <asm/io.h>
  30. #include <asm/system.h>
  31. #include <asm/mach/arch.h>
  32. #include <asm/mach/map.h>
  33. #include <asm/mach/irq.h>
  34. #include <mach/pxa-regs.h>
  35. #include <mach/pxa2xx-regs.h>
  36. #include <mach/pxa2xx-gpio.h>
  37. #include <mach/pxa27x-udc.h>
  38. #include <mach/reset.h>
  39. #include <mach/irda.h>
  40. #include <mach/mmc.h>
  41. #include <mach/ohci.h>
  42. #include <mach/udc.h>
  43. #include <mach/pxafb.h>
  44. #include <mach/akita.h>
  45. #include <mach/spitz.h>
  46. #include <mach/sharpsl.h>
  47. #include <asm/mach/sharpsl_param.h>
  48. #include <asm/hardware/scoop.h>
  49. #include "generic.h"
  50. #include "devices.h"
  51. #include "sharpsl.h"
  52. /*
  53. * Spitz SCOOP Device #1
  54. */
  55. static struct resource spitz_scoop_resources[] = {
  56. [0] = {
  57. .start = 0x10800000,
  58. .end = 0x10800fff,
  59. .flags = IORESOURCE_MEM,
  60. },
  61. };
  62. static struct scoop_config spitz_scoop_setup = {
  63. .io_dir = SPITZ_SCP_IO_DIR,
  64. .io_out = SPITZ_SCP_IO_OUT,
  65. .suspend_clr = SPITZ_SCP_SUS_CLR,
  66. .suspend_set = SPITZ_SCP_SUS_SET,
  67. };
  68. struct platform_device spitzscoop_device = {
  69. .name = "sharp-scoop",
  70. .id = 0,
  71. .dev = {
  72. .platform_data = &spitz_scoop_setup,
  73. },
  74. .num_resources = ARRAY_SIZE(spitz_scoop_resources),
  75. .resource = spitz_scoop_resources,
  76. };
  77. /*
  78. * Spitz SCOOP Device #2
  79. */
  80. static struct resource spitz_scoop2_resources[] = {
  81. [0] = {
  82. .start = 0x08800040,
  83. .end = 0x08800fff,
  84. .flags = IORESOURCE_MEM,
  85. },
  86. };
  87. static struct scoop_config spitz_scoop2_setup = {
  88. .io_dir = SPITZ_SCP2_IO_DIR,
  89. .io_out = SPITZ_SCP2_IO_OUT,
  90. .suspend_clr = SPITZ_SCP2_SUS_CLR,
  91. .suspend_set = SPITZ_SCP2_SUS_SET,
  92. };
  93. struct platform_device spitzscoop2_device = {
  94. .name = "sharp-scoop",
  95. .id = 1,
  96. .dev = {
  97. .platform_data = &spitz_scoop2_setup,
  98. },
  99. .num_resources = ARRAY_SIZE(spitz_scoop2_resources),
  100. .resource = spitz_scoop2_resources,
  101. };
  102. #define SPITZ_PWR_SD 0x01
  103. #define SPITZ_PWR_CF 0x02
  104. /* Power control is shared with between one of the CF slots and SD */
  105. static void spitz_card_pwr_ctrl(int device, unsigned short new_cpr)
  106. {
  107. unsigned short cpr = read_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR);
  108. if (new_cpr & 0x0007) {
  109. set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_CF_POWER);
  110. if (!(cpr & 0x0002) && !(cpr & 0x0004))
  111. mdelay(5);
  112. if (device == SPITZ_PWR_CF)
  113. cpr |= 0x0002;
  114. if (device == SPITZ_PWR_SD)
  115. cpr |= 0x0004;
  116. write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | new_cpr);
  117. } else {
  118. if (device == SPITZ_PWR_CF)
  119. cpr &= ~0x0002;
  120. if (device == SPITZ_PWR_SD)
  121. cpr &= ~0x0004;
  122. if (!(cpr & 0x0002) && !(cpr & 0x0004)) {
  123. write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, 0x0000);
  124. mdelay(1);
  125. reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_CF_POWER);
  126. } else {
  127. write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | new_cpr);
  128. }
  129. }
  130. }
  131. static void spitz_pcmcia_init(void)
  132. {
  133. /* Setup default state of GPIO outputs
  134. before we enable them as outputs. */
  135. GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
  136. GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) |
  137. GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO54_nPCE_2);
  138. GPSR(GPIO85_nPCE_1) = GPIO_bit(GPIO85_nPCE_1);
  139. pxa_gpio_mode(GPIO48_nPOE_MD);
  140. pxa_gpio_mode(GPIO49_nPWE_MD);
  141. pxa_gpio_mode(GPIO50_nPIOR_MD);
  142. pxa_gpio_mode(GPIO51_nPIOW_MD);
  143. pxa_gpio_mode(GPIO55_nPREG_MD);
  144. pxa_gpio_mode(GPIO56_nPWAIT_MD);
  145. pxa_gpio_mode(GPIO57_nIOIS16_MD);
  146. pxa_gpio_mode(GPIO85_nPCE_1_MD);
  147. pxa_gpio_mode(GPIO54_nPCE_2_MD);
  148. pxa_gpio_mode(GPIO104_pSKTSEL_MD);
  149. }
  150. static void spitz_pcmcia_pwr(struct device *scoop, unsigned short cpr, int nr)
  151. {
  152. /* Only need to override behaviour for slot 0 */
  153. if (nr == 0)
  154. spitz_card_pwr_ctrl(SPITZ_PWR_CF, cpr);
  155. else
  156. write_scoop_reg(scoop, SCOOP_CPR, cpr);
  157. }
  158. static struct scoop_pcmcia_dev spitz_pcmcia_scoop[] = {
  159. {
  160. .dev = &spitzscoop_device.dev,
  161. .irq = SPITZ_IRQ_GPIO_CF_IRQ,
  162. .cd_irq = SPITZ_IRQ_GPIO_CF_CD,
  163. .cd_irq_str = "PCMCIA0 CD",
  164. },{
  165. .dev = &spitzscoop2_device.dev,
  166. .irq = SPITZ_IRQ_GPIO_CF2_IRQ,
  167. .cd_irq = -1,
  168. },
  169. };
  170. static struct scoop_pcmcia_config spitz_pcmcia_config = {
  171. .devs = &spitz_pcmcia_scoop[0],
  172. .num_devs = 2,
  173. .pcmcia_init = spitz_pcmcia_init,
  174. .power_ctrl = spitz_pcmcia_pwr,
  175. };
  176. EXPORT_SYMBOL(spitzscoop_device);
  177. EXPORT_SYMBOL(spitzscoop2_device);
  178. /*
  179. * Spitz SSP Device
  180. *
  181. * Set the parent as the scoop device because a lot of SSP devices
  182. * also use scoop functions and this makes the power up/down order
  183. * work correctly.
  184. */
  185. struct platform_device spitzssp_device = {
  186. .name = "corgi-ssp",
  187. .dev = {
  188. .parent = &spitzscoop_device.dev,
  189. },
  190. .id = -1,
  191. };
  192. struct corgissp_machinfo spitz_ssp_machinfo = {
  193. .port = 2,
  194. .cs_lcdcon = SPITZ_GPIO_LCDCON_CS,
  195. .cs_ads7846 = SPITZ_GPIO_ADS7846_CS,
  196. .cs_max1111 = SPITZ_GPIO_MAX1111_CS,
  197. .clk_lcdcon = 520,
  198. .clk_ads7846 = 14,
  199. .clk_max1111 = 56,
  200. };
  201. /*
  202. * Spitz Backlight Device
  203. */
  204. static void spitz_bl_kick_battery(void)
  205. {
  206. void (*kick_batt)(void);
  207. kick_batt = symbol_get(sharpsl_battery_kick);
  208. if (kick_batt) {
  209. kick_batt();
  210. symbol_put(sharpsl_battery_kick);
  211. }
  212. }
  213. static struct generic_bl_info spitz_bl_machinfo = {
  214. .name = "corgi-bl",
  215. .default_intensity = 0x1f,
  216. .limit_mask = 0x0b,
  217. .max_intensity = 0x2f,
  218. .kick_battery = spitz_bl_kick_battery,
  219. };
  220. static struct platform_device spitzbl_device = {
  221. .name = "generic-bl",
  222. .dev = {
  223. .platform_data = &spitz_bl_machinfo,
  224. },
  225. .id = -1,
  226. };
  227. /*
  228. * Spitz Keyboard Device
  229. */
  230. static struct platform_device spitzkbd_device = {
  231. .name = "spitz-keyboard",
  232. .id = -1,
  233. };
  234. /*
  235. * Spitz LEDs
  236. */
  237. static struct platform_device spitzled_device = {
  238. .name = "spitz-led",
  239. .id = -1,
  240. };
  241. /*
  242. * Spitz Touch Screen Device
  243. */
  244. static unsigned long (*get_hsync_invperiod)(struct device *dev);
  245. static void inline sharpsl_wait_sync(int gpio)
  246. {
  247. while((GPLR(gpio) & GPIO_bit(gpio)) == 0);
  248. while((GPLR(gpio) & GPIO_bit(gpio)) != 0);
  249. }
  250. static struct device *spitz_pxafb_dev;
  251. static int is_pxafb_device(struct device * dev, void * data)
  252. {
  253. struct platform_device *pdev = container_of(dev, struct platform_device, dev);
  254. return (strncmp(pdev->name, "pxa2xx-fb", 9) == 0);
  255. }
  256. static unsigned long spitz_get_hsync_invperiod(void)
  257. {
  258. #ifdef CONFIG_FB_PXA
  259. if (!spitz_pxafb_dev) {
  260. spitz_pxafb_dev = bus_find_device(&platform_bus_type, NULL, NULL, is_pxafb_device);
  261. if (!spitz_pxafb_dev)
  262. return 0;
  263. }
  264. if (!get_hsync_invperiod)
  265. get_hsync_invperiod = symbol_get(pxafb_get_hsync_time);
  266. if (!get_hsync_invperiod)
  267. #endif
  268. return 0;
  269. return get_hsync_invperiod(spitz_pxafb_dev);
  270. }
  271. static void spitz_put_hsync(void)
  272. {
  273. put_device(spitz_pxafb_dev);
  274. if (get_hsync_invperiod)
  275. symbol_put(pxafb_get_hsync_time);
  276. spitz_pxafb_dev = NULL;
  277. get_hsync_invperiod = NULL;
  278. }
  279. static void spitz_wait_hsync(void)
  280. {
  281. sharpsl_wait_sync(SPITZ_GPIO_HSYNC);
  282. }
  283. static struct resource spitzts_resources[] = {
  284. [0] = {
  285. .start = SPITZ_IRQ_GPIO_TP_INT,
  286. .end = SPITZ_IRQ_GPIO_TP_INT,
  287. .flags = IORESOURCE_IRQ,
  288. },
  289. };
  290. static struct corgits_machinfo spitz_ts_machinfo = {
  291. .get_hsync_invperiod = spitz_get_hsync_invperiod,
  292. .put_hsync = spitz_put_hsync,
  293. .wait_hsync = spitz_wait_hsync,
  294. };
  295. static struct platform_device spitzts_device = {
  296. .name = "corgi-ts",
  297. .dev = {
  298. .parent = &spitzssp_device.dev,
  299. .platform_data = &spitz_ts_machinfo,
  300. },
  301. .id = -1,
  302. .num_resources = ARRAY_SIZE(spitzts_resources),
  303. .resource = spitzts_resources,
  304. };
  305. /*
  306. * MMC/SD Device
  307. *
  308. * The card detect interrupt isn't debounced so we delay it by 250ms
  309. * to give the card a chance to fully insert/eject.
  310. */
  311. static struct pxamci_platform_data spitz_mci_platform_data;
  312. static int spitz_mci_init(struct device *dev, irq_handler_t spitz_detect_int, void *data)
  313. {
  314. int err;
  315. /* setup GPIO for PXA27x MMC controller */
  316. pxa_gpio_mode(GPIO32_MMCCLK_MD);
  317. pxa_gpio_mode(GPIO112_MMCCMD_MD);
  318. pxa_gpio_mode(GPIO92_MMCDAT0_MD);
  319. pxa_gpio_mode(GPIO109_MMCDAT1_MD);
  320. pxa_gpio_mode(GPIO110_MMCDAT2_MD);
  321. pxa_gpio_mode(GPIO111_MMCDAT3_MD);
  322. pxa_gpio_mode(SPITZ_GPIO_nSD_DETECT | GPIO_IN);
  323. pxa_gpio_mode(SPITZ_GPIO_nSD_WP | GPIO_IN);
  324. spitz_mci_platform_data.detect_delay = msecs_to_jiffies(250);
  325. err = request_irq(SPITZ_IRQ_GPIO_nSD_DETECT, spitz_detect_int,
  326. IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
  327. "MMC card detect", data);
  328. if (err)
  329. printk(KERN_ERR "spitz_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
  330. return err;
  331. }
  332. static void spitz_mci_setpower(struct device *dev, unsigned int vdd)
  333. {
  334. struct pxamci_platform_data* p_d = dev->platform_data;
  335. if (( 1 << vdd) & p_d->ocr_mask)
  336. spitz_card_pwr_ctrl(SPITZ_PWR_SD, 0x0004);
  337. else
  338. spitz_card_pwr_ctrl(SPITZ_PWR_SD, 0x0000);
  339. }
  340. static int spitz_mci_get_ro(struct device *dev)
  341. {
  342. return GPLR(SPITZ_GPIO_nSD_WP) & GPIO_bit(SPITZ_GPIO_nSD_WP);
  343. }
  344. static void spitz_mci_exit(struct device *dev, void *data)
  345. {
  346. free_irq(SPITZ_IRQ_GPIO_nSD_DETECT, data);
  347. }
  348. static struct pxamci_platform_data spitz_mci_platform_data = {
  349. .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
  350. .init = spitz_mci_init,
  351. .get_ro = spitz_mci_get_ro,
  352. .setpower = spitz_mci_setpower,
  353. .exit = spitz_mci_exit,
  354. };
  355. /*
  356. * USB Host (OHCI)
  357. */
  358. static int spitz_ohci_init(struct device *dev)
  359. {
  360. /* Only Port 2 is connected */
  361. pxa_gpio_mode(SPITZ_GPIO_USB_CONNECT | GPIO_IN);
  362. pxa_gpio_mode(SPITZ_GPIO_USB_HOST | GPIO_OUT);
  363. pxa_gpio_mode(SPITZ_GPIO_USB_DEVICE | GPIO_IN);
  364. /* Setup USB Port 2 Output Control Register */
  365. UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
  366. GPSR(SPITZ_GPIO_USB_HOST) = GPIO_bit(SPITZ_GPIO_USB_HOST);
  367. UHCHR = (UHCHR) &
  368. ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE);
  369. UHCRHDA |= UHCRHDA_NOCP;
  370. return 0;
  371. }
  372. static struct pxaohci_platform_data spitz_ohci_platform_data = {
  373. .port_mode = PMM_NPS_MODE,
  374. .init = spitz_ohci_init,
  375. .power_budget = 150,
  376. };
  377. /*
  378. * Irda
  379. */
  380. static void spitz_irda_transceiver_mode(struct device *dev, int mode)
  381. {
  382. if (mode & IR_OFF)
  383. set_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_IR_ON);
  384. else
  385. reset_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_IR_ON);
  386. pxa2xx_transceiver_mode(dev, mode);
  387. }
  388. #ifdef CONFIG_MACH_AKITA
  389. static void akita_irda_transceiver_mode(struct device *dev, int mode)
  390. {
  391. if (mode & IR_OFF)
  392. akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_IR_ON);
  393. else
  394. akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_IR_ON);
  395. pxa2xx_transceiver_mode(dev, mode);
  396. }
  397. #endif
  398. static struct pxaficp_platform_data spitz_ficp_platform_data = {
  399. .transceiver_cap = IR_SIRMODE | IR_OFF,
  400. .transceiver_mode = spitz_irda_transceiver_mode,
  401. };
  402. /*
  403. * Spitz PXA Framebuffer
  404. */
  405. static void spitz_lcd_power(int on, struct fb_var_screeninfo *var)
  406. {
  407. if (on)
  408. corgi_lcdtg_hw_init(var->xres);
  409. else
  410. corgi_lcdtg_suspend();
  411. }
  412. static struct pxafb_mode_info spitz_pxafb_modes[] = {
  413. {
  414. .pixclock = 19231,
  415. .xres = 480,
  416. .yres = 640,
  417. .bpp = 16,
  418. .hsync_len = 40,
  419. .left_margin = 46,
  420. .right_margin = 125,
  421. .vsync_len = 3,
  422. .upper_margin = 1,
  423. .lower_margin = 0,
  424. .sync = 0,
  425. },{
  426. .pixclock = 134617,
  427. .xres = 240,
  428. .yres = 320,
  429. .bpp = 16,
  430. .hsync_len = 20,
  431. .left_margin = 20,
  432. .right_margin = 46,
  433. .vsync_len = 2,
  434. .upper_margin = 1,
  435. .lower_margin = 0,
  436. .sync = 0,
  437. },
  438. };
  439. static struct pxafb_mach_info spitz_pxafb_info = {
  440. .modes = &spitz_pxafb_modes[0],
  441. .num_modes = 2,
  442. .fixed_modes = 1,
  443. .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act | LCCR0_LDDALT | LCCR0_OUC | LCCR0_CMDIM | LCCR0_RDSTM,
  444. .lccr3 = LCCR3_PixRsEdg | LCCR3_OutEnH,
  445. .pxafb_lcd_power = spitz_lcd_power,
  446. };
  447. static struct platform_device *devices[] __initdata = {
  448. &spitzscoop_device,
  449. &spitzssp_device,
  450. &spitzkbd_device,
  451. &spitzts_device,
  452. &spitzbl_device,
  453. &spitzled_device,
  454. };
  455. static void spitz_poweroff(void)
  456. {
  457. arm_machine_restart('g');
  458. }
  459. static void spitz_restart(char mode)
  460. {
  461. /* Bootloader magic for a reboot */
  462. if((MSC0 & 0xffff0000) == 0x7ff00000)
  463. MSC0 = (MSC0 & 0xffff) | 0x7ee00000;
  464. spitz_poweroff();
  465. }
  466. static void __init common_init(void)
  467. {
  468. init_gpio_reset(SPITZ_GPIO_ON_RESET);
  469. pm_power_off = spitz_poweroff;
  470. arm_pm_restart = spitz_restart;
  471. PMCR = 0x00;
  472. /* setup sleep mode values */
  473. PWER = 0x00000002;
  474. PFER = 0x00000000;
  475. PRER = 0x00000002;
  476. PGSR0 = 0x0158C000;
  477. PGSR1 = 0x00FF0080;
  478. PGSR2 = 0x0001C004;
  479. /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */
  480. PCFR |= PCFR_OPDE;
  481. corgi_ssp_set_machinfo(&spitz_ssp_machinfo);
  482. pxa_gpio_mode(SPITZ_GPIO_HSYNC | GPIO_IN);
  483. platform_add_devices(devices, ARRAY_SIZE(devices));
  484. pxa_set_mci_info(&spitz_mci_platform_data);
  485. pxa_set_ohci_info(&spitz_ohci_platform_data);
  486. pxa_set_ficp_info(&spitz_ficp_platform_data);
  487. set_pxa_fb_parent(&spitzssp_device.dev);
  488. set_pxa_fb_info(&spitz_pxafb_info);
  489. }
  490. #if defined(CONFIG_MACH_SPITZ) || defined(CONFIG_MACH_BORZOI)
  491. static void spitz_bl_set_intensity(int intensity)
  492. {
  493. if (intensity > 0x10)
  494. intensity += 0x10;
  495. /* Bits 0-4 are accessed via the SSP interface */
  496. corgi_ssp_blduty_set(intensity & 0x1f);
  497. /* Bit 5 is via SCOOP */
  498. if (intensity & 0x0020)
  499. reset_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_CONT);
  500. else
  501. set_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_CONT);
  502. if (intensity)
  503. set_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_ON);
  504. else
  505. reset_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_ON);
  506. }
  507. static void __init spitz_init(void)
  508. {
  509. platform_scoop_config = &spitz_pcmcia_config;
  510. spitz_bl_machinfo.set_bl_intensity = spitz_bl_set_intensity;
  511. common_init();
  512. platform_device_register(&spitzscoop2_device);
  513. }
  514. #endif
  515. #ifdef CONFIG_MACH_AKITA
  516. /*
  517. * Akita IO Expander
  518. */
  519. struct platform_device akitaioexp_device = {
  520. .name = "akita-ioexp",
  521. .id = -1,
  522. };
  523. EXPORT_SYMBOL_GPL(akitaioexp_device);
  524. static void akita_bl_set_intensity(int intensity)
  525. {
  526. if (intensity > 0x10)
  527. intensity += 0x10;
  528. /* Bits 0-4 are accessed via the SSP interface */
  529. corgi_ssp_blduty_set(intensity & 0x1f);
  530. /* Bit 5 is via IO-Expander */
  531. if (intensity & 0x0020)
  532. akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_CONT);
  533. else
  534. akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_CONT);
  535. if (intensity)
  536. akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_ON);
  537. else
  538. akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_ON);
  539. }
  540. static void __init akita_init(void)
  541. {
  542. spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode;
  543. /* We just pretend the second element of the array doesn't exist */
  544. spitz_pcmcia_config.num_devs = 1;
  545. platform_scoop_config = &spitz_pcmcia_config;
  546. spitz_bl_machinfo.set_bl_intensity = akita_bl_set_intensity;
  547. platform_device_register(&akitaioexp_device);
  548. spitzscoop_device.dev.parent = &akitaioexp_device.dev;
  549. common_init();
  550. }
  551. #endif
  552. static void __init fixup_spitz(struct machine_desc *desc,
  553. struct tag *tags, char **cmdline, struct meminfo *mi)
  554. {
  555. sharpsl_save_param();
  556. mi->nr_banks = 1;
  557. mi->bank[0].start = 0xa0000000;
  558. mi->bank[0].node = 0;
  559. mi->bank[0].size = (64*1024*1024);
  560. }
  561. #ifdef CONFIG_MACH_SPITZ
  562. MACHINE_START(SPITZ, "SHARP Spitz")
  563. .phys_io = 0x40000000,
  564. .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
  565. .fixup = fixup_spitz,
  566. .map_io = pxa_map_io,
  567. .init_irq = pxa27x_init_irq,
  568. .init_machine = spitz_init,
  569. .timer = &pxa_timer,
  570. MACHINE_END
  571. #endif
  572. #ifdef CONFIG_MACH_BORZOI
  573. MACHINE_START(BORZOI, "SHARP Borzoi")
  574. .phys_io = 0x40000000,
  575. .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
  576. .fixup = fixup_spitz,
  577. .map_io = pxa_map_io,
  578. .init_irq = pxa27x_init_irq,
  579. .init_machine = spitz_init,
  580. .timer = &pxa_timer,
  581. MACHINE_END
  582. #endif
  583. #ifdef CONFIG_MACH_AKITA
  584. MACHINE_START(AKITA, "SHARP Akita")
  585. .phys_io = 0x40000000,
  586. .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
  587. .fixup = fixup_spitz,
  588. .map_io = pxa_map_io,
  589. .init_irq = pxa27x_init_irq,
  590. .init_machine = akita_init,
  591. .timer = &pxa_timer,
  592. MACHINE_END
  593. #endif