corgi_lcd.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. /*
  2. * linux/arch/arm/mach-pxa/corgi_lcd.c
  3. *
  4. * Corgi/Spitz LCD Specific Code
  5. *
  6. * Copyright (C) 2005 Richard Purdie
  7. *
  8. * Connectivity:
  9. * Corgi - LCD to ATI Imageon w100 (Wallaby)
  10. * Spitz - LCD to PXA Framebuffer
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License version 2 as
  14. * published by the Free Software Foundation.
  15. *
  16. */
  17. #include <linux/delay.h>
  18. #include <linux/kernel.h>
  19. #include <linux/platform_device.h>
  20. #include <linux/module.h>
  21. #include <linux/string.h>
  22. #include <asm/arch/akita.h>
  23. #include <asm/arch/corgi.h>
  24. #include <asm/hardware.h>
  25. #include <asm/arch/pxa-regs.h>
  26. #include <asm/arch/sharpsl.h>
  27. #include <asm/arch/spitz.h>
  28. #include <asm/hardware/scoop.h>
  29. #include <asm/mach/sharpsl_param.h>
  30. #include "generic.h"
  31. /* Register Addresses */
  32. #define RESCTL_ADRS 0x00
  33. #define PHACTRL_ADRS 0x01
  34. #define DUTYCTRL_ADRS 0x02
  35. #define POWERREG0_ADRS 0x03
  36. #define POWERREG1_ADRS 0x04
  37. #define GPOR3_ADRS 0x05
  38. #define PICTRL_ADRS 0x06
  39. #define POLCTRL_ADRS 0x07
  40. /* Resgister Bit Definitions */
  41. #define RESCTL_QVGA 0x01
  42. #define RESCTL_VGA 0x00
  43. #define POWER1_VW_ON 0x01 /* VW Supply FET ON */
  44. #define POWER1_GVSS_ON 0x02 /* GVSS(-8V) Power Supply ON */
  45. #define POWER1_VDD_ON 0x04 /* VDD(8V),SVSS(-4V) Power Supply ON */
  46. #define POWER1_VW_OFF 0x00 /* VW Supply FET OFF */
  47. #define POWER1_GVSS_OFF 0x00 /* GVSS(-8V) Power Supply OFF */
  48. #define POWER1_VDD_OFF 0x00 /* VDD(8V),SVSS(-4V) Power Supply OFF */
  49. #define POWER0_COM_DCLK 0x01 /* COM Voltage DC Bias DAC Serial Data Clock */
  50. #define POWER0_COM_DOUT 0x02 /* COM Voltage DC Bias DAC Serial Data Out */
  51. #define POWER0_DAC_ON 0x04 /* DAC Power Supply ON */
  52. #define POWER0_COM_ON 0x08 /* COM Powewr Supply ON */
  53. #define POWER0_VCC5_ON 0x10 /* VCC5 Power Supply ON */
  54. #define POWER0_DAC_OFF 0x00 /* DAC Power Supply OFF */
  55. #define POWER0_COM_OFF 0x00 /* COM Powewr Supply OFF */
  56. #define POWER0_VCC5_OFF 0x00 /* VCC5 Power Supply OFF */
  57. #define PICTRL_INIT_STATE 0x01
  58. #define PICTRL_INIOFF 0x02
  59. #define PICTRL_POWER_DOWN 0x04
  60. #define PICTRL_COM_SIGNAL_OFF 0x08
  61. #define PICTRL_DAC_SIGNAL_OFF 0x10
  62. #define POLCTRL_SYNC_POL_FALL 0x01
  63. #define POLCTRL_EN_POL_FALL 0x02
  64. #define POLCTRL_DATA_POL_FALL 0x04
  65. #define POLCTRL_SYNC_ACT_H 0x08
  66. #define POLCTRL_EN_ACT_L 0x10
  67. #define POLCTRL_SYNC_POL_RISE 0x00
  68. #define POLCTRL_EN_POL_RISE 0x00
  69. #define POLCTRL_DATA_POL_RISE 0x00
  70. #define POLCTRL_SYNC_ACT_L 0x00
  71. #define POLCTRL_EN_ACT_H 0x00
  72. #define PHACTRL_PHASE_MANUAL 0x01
  73. #define DEFAULT_PHAD_QVGA (9)
  74. #define DEFAULT_COMADJ (125)
  75. /*
  76. * This is only a psuedo I2C interface. We can't use the standard kernel
  77. * routines as the interface is write only. We just assume the data is acked...
  78. */
  79. static void lcdtg_ssp_i2c_send(u8 data)
  80. {
  81. corgi_ssp_lcdtg_send(POWERREG0_ADRS, data);
  82. udelay(10);
  83. }
  84. static void lcdtg_i2c_send_bit(u8 data)
  85. {
  86. lcdtg_ssp_i2c_send(data);
  87. lcdtg_ssp_i2c_send(data | POWER0_COM_DCLK);
  88. lcdtg_ssp_i2c_send(data);
  89. }
  90. static void lcdtg_i2c_send_start(u8 base)
  91. {
  92. lcdtg_ssp_i2c_send(base | POWER0_COM_DCLK | POWER0_COM_DOUT);
  93. lcdtg_ssp_i2c_send(base | POWER0_COM_DCLK);
  94. lcdtg_ssp_i2c_send(base);
  95. }
  96. static void lcdtg_i2c_send_stop(u8 base)
  97. {
  98. lcdtg_ssp_i2c_send(base);
  99. lcdtg_ssp_i2c_send(base | POWER0_COM_DCLK);
  100. lcdtg_ssp_i2c_send(base | POWER0_COM_DCLK | POWER0_COM_DOUT);
  101. }
  102. static void lcdtg_i2c_send_byte(u8 base, u8 data)
  103. {
  104. int i;
  105. for (i = 0; i < 8; i++) {
  106. if (data & 0x80)
  107. lcdtg_i2c_send_bit(base | POWER0_COM_DOUT);
  108. else
  109. lcdtg_i2c_send_bit(base);
  110. data <<= 1;
  111. }
  112. }
  113. static void lcdtg_i2c_wait_ack(u8 base)
  114. {
  115. lcdtg_i2c_send_bit(base);
  116. }
  117. static void lcdtg_set_common_voltage(u8 base_data, u8 data)
  118. {
  119. /* Set Common Voltage to M62332FP via I2C */
  120. lcdtg_i2c_send_start(base_data);
  121. lcdtg_i2c_send_byte(base_data, 0x9c);
  122. lcdtg_i2c_wait_ack(base_data);
  123. lcdtg_i2c_send_byte(base_data, 0x00);
  124. lcdtg_i2c_wait_ack(base_data);
  125. lcdtg_i2c_send_byte(base_data, data);
  126. lcdtg_i2c_wait_ack(base_data);
  127. lcdtg_i2c_send_stop(base_data);
  128. }
  129. /* Set Phase Adjuct */
  130. static void lcdtg_set_phadadj(int mode)
  131. {
  132. int adj;
  133. switch(mode) {
  134. case 480:
  135. case 640:
  136. /* Setting for VGA */
  137. adj = sharpsl_param.phadadj;
  138. if (adj < 0) {
  139. adj = PHACTRL_PHASE_MANUAL;
  140. } else {
  141. adj = ((adj & 0x0f) << 1) | PHACTRL_PHASE_MANUAL;
  142. }
  143. break;
  144. case 240:
  145. case 320:
  146. default:
  147. /* Setting for QVGA */
  148. adj = (DEFAULT_PHAD_QVGA << 1) | PHACTRL_PHASE_MANUAL;
  149. break;
  150. }
  151. corgi_ssp_lcdtg_send(PHACTRL_ADRS, adj);
  152. }
  153. static int lcd_inited;
  154. static void lcdtg_hw_init(int mode)
  155. {
  156. if (!lcd_inited) {
  157. int comadj;
  158. /* Initialize Internal Logic & Port */
  159. corgi_ssp_lcdtg_send(PICTRL_ADRS, PICTRL_POWER_DOWN | PICTRL_INIOFF | PICTRL_INIT_STATE
  160. | PICTRL_COM_SIGNAL_OFF | PICTRL_DAC_SIGNAL_OFF);
  161. corgi_ssp_lcdtg_send(POWERREG0_ADRS, POWER0_COM_DCLK | POWER0_COM_DOUT | POWER0_DAC_OFF
  162. | POWER0_COM_OFF | POWER0_VCC5_OFF);
  163. corgi_ssp_lcdtg_send(POWERREG1_ADRS, POWER1_VW_OFF | POWER1_GVSS_OFF | POWER1_VDD_OFF);
  164. /* VDD(+8V), SVSS(-4V) ON */
  165. corgi_ssp_lcdtg_send(POWERREG1_ADRS, POWER1_VW_OFF | POWER1_GVSS_OFF | POWER1_VDD_ON);
  166. mdelay(3);
  167. /* DAC ON */
  168. corgi_ssp_lcdtg_send(POWERREG0_ADRS, POWER0_COM_DCLK | POWER0_COM_DOUT | POWER0_DAC_ON
  169. | POWER0_COM_OFF | POWER0_VCC5_OFF);
  170. /* INIB = H, INI = L */
  171. /* PICTL[0] = H , PICTL[1] = PICTL[2] = PICTL[4] = L */
  172. corgi_ssp_lcdtg_send(PICTRL_ADRS, PICTRL_INIT_STATE | PICTRL_COM_SIGNAL_OFF);
  173. /* Set Common Voltage */
  174. comadj = sharpsl_param.comadj;
  175. if (comadj < 0)
  176. comadj = DEFAULT_COMADJ;
  177. lcdtg_set_common_voltage((POWER0_DAC_ON | POWER0_COM_OFF | POWER0_VCC5_OFF), comadj);
  178. /* VCC5 ON, DAC ON */
  179. corgi_ssp_lcdtg_send(POWERREG0_ADRS, POWER0_COM_DCLK | POWER0_COM_DOUT | POWER0_DAC_ON |
  180. POWER0_COM_OFF | POWER0_VCC5_ON);
  181. /* GVSS(-8V) ON, VDD ON */
  182. corgi_ssp_lcdtg_send(POWERREG1_ADRS, POWER1_VW_OFF | POWER1_GVSS_ON | POWER1_VDD_ON);
  183. mdelay(2);
  184. /* COM SIGNAL ON (PICTL[3] = L) */
  185. corgi_ssp_lcdtg_send(PICTRL_ADRS, PICTRL_INIT_STATE);
  186. /* COM ON, DAC ON, VCC5_ON */
  187. corgi_ssp_lcdtg_send(POWERREG0_ADRS, POWER0_COM_DCLK | POWER0_COM_DOUT | POWER0_DAC_ON
  188. | POWER0_COM_ON | POWER0_VCC5_ON);
  189. /* VW ON, GVSS ON, VDD ON */
  190. corgi_ssp_lcdtg_send(POWERREG1_ADRS, POWER1_VW_ON | POWER1_GVSS_ON | POWER1_VDD_ON);
  191. /* Signals output enable */
  192. corgi_ssp_lcdtg_send(PICTRL_ADRS, 0);
  193. /* Set Phase Adjuct */
  194. lcdtg_set_phadadj(mode);
  195. /* Initialize for Input Signals from ATI */
  196. corgi_ssp_lcdtg_send(POLCTRL_ADRS, POLCTRL_SYNC_POL_RISE | POLCTRL_EN_POL_RISE
  197. | POLCTRL_DATA_POL_RISE | POLCTRL_SYNC_ACT_L | POLCTRL_EN_ACT_H);
  198. udelay(1000);
  199. lcd_inited=1;
  200. } else {
  201. lcdtg_set_phadadj(mode);
  202. }
  203. switch(mode) {
  204. case 480:
  205. case 640:
  206. /* Set Lcd Resolution (VGA) */
  207. corgi_ssp_lcdtg_send(RESCTL_ADRS, RESCTL_VGA);
  208. break;
  209. case 240:
  210. case 320:
  211. default:
  212. /* Set Lcd Resolution (QVGA) */
  213. corgi_ssp_lcdtg_send(RESCTL_ADRS, RESCTL_QVGA);
  214. break;
  215. }
  216. }
  217. static void lcdtg_suspend(void)
  218. {
  219. /* 60Hz x 2 frame = 16.7msec x 2 = 33.4 msec */
  220. mdelay(34);
  221. /* (1)VW OFF */
  222. corgi_ssp_lcdtg_send(POWERREG1_ADRS, POWER1_VW_OFF | POWER1_GVSS_ON | POWER1_VDD_ON);
  223. /* (2)COM OFF */
  224. corgi_ssp_lcdtg_send(PICTRL_ADRS, PICTRL_COM_SIGNAL_OFF);
  225. corgi_ssp_lcdtg_send(POWERREG0_ADRS, POWER0_DAC_ON | POWER0_COM_OFF | POWER0_VCC5_ON);
  226. /* (3)Set Common Voltage Bias 0V */
  227. lcdtg_set_common_voltage(POWER0_DAC_ON | POWER0_COM_OFF | POWER0_VCC5_ON, 0);
  228. /* (4)GVSS OFF */
  229. corgi_ssp_lcdtg_send(POWERREG1_ADRS, POWER1_VW_OFF | POWER1_GVSS_OFF | POWER1_VDD_ON);
  230. /* (5)VCC5 OFF */
  231. corgi_ssp_lcdtg_send(POWERREG0_ADRS, POWER0_DAC_ON | POWER0_COM_OFF | POWER0_VCC5_OFF);
  232. /* (6)Set PDWN, INIOFF, DACOFF */
  233. corgi_ssp_lcdtg_send(PICTRL_ADRS, PICTRL_INIOFF | PICTRL_DAC_SIGNAL_OFF |
  234. PICTRL_POWER_DOWN | PICTRL_COM_SIGNAL_OFF);
  235. /* (7)DAC OFF */
  236. corgi_ssp_lcdtg_send(POWERREG0_ADRS, POWER0_DAC_OFF | POWER0_COM_OFF | POWER0_VCC5_OFF);
  237. /* (8)VDD OFF */
  238. corgi_ssp_lcdtg_send(POWERREG1_ADRS, POWER1_VW_OFF | POWER1_GVSS_OFF | POWER1_VDD_OFF);
  239. lcd_inited = 0;
  240. }
  241. /*
  242. * Corgi w100 Frame Buffer Device
  243. */
  244. #ifdef CONFIG_PXA_SHARP_C7xx
  245. #include <video/w100fb.h>
  246. static void w100_lcdtg_suspend(struct w100fb_par *par)
  247. {
  248. lcdtg_suspend();
  249. }
  250. static void w100_lcdtg_init(struct w100fb_par *par)
  251. {
  252. lcdtg_hw_init(par->xres);
  253. }
  254. static struct w100_tg_info corgi_lcdtg_info = {
  255. .change = w100_lcdtg_init,
  256. .suspend = w100_lcdtg_suspend,
  257. .resume = w100_lcdtg_init,
  258. };
  259. static struct w100_mem_info corgi_fb_mem = {
  260. .ext_cntl = 0x00040003,
  261. .sdram_mode_reg = 0x00650021,
  262. .ext_timing_cntl = 0x10002a4a,
  263. .io_cntl = 0x7ff87012,
  264. .size = 0x1fffff,
  265. };
  266. static struct w100_gen_regs corgi_fb_regs = {
  267. .lcd_format = 0x00000003,
  268. .lcdd_cntl1 = 0x01CC0000,
  269. .lcdd_cntl2 = 0x0003FFFF,
  270. .genlcd_cntl1 = 0x00FFFF0D,
  271. .genlcd_cntl2 = 0x003F3003,
  272. .genlcd_cntl3 = 0x000102aa,
  273. };
  274. static struct w100_gpio_regs corgi_fb_gpio = {
  275. .init_data1 = 0x000000bf,
  276. .init_data2 = 0x00000000,
  277. .gpio_dir1 = 0x00000000,
  278. .gpio_oe1 = 0x03c0feff,
  279. .gpio_dir2 = 0x00000000,
  280. .gpio_oe2 = 0x00000000,
  281. };
  282. static struct w100_mode corgi_fb_modes[] = {
  283. {
  284. .xres = 480,
  285. .yres = 640,
  286. .left_margin = 0x56,
  287. .right_margin = 0x55,
  288. .upper_margin = 0x03,
  289. .lower_margin = 0x00,
  290. .crtc_ss = 0x82360056,
  291. .crtc_ls = 0xA0280000,
  292. .crtc_gs = 0x80280028,
  293. .crtc_vpos_gs = 0x02830002,
  294. .crtc_rev = 0x00400008,
  295. .crtc_dclk = 0xA0000000,
  296. .crtc_gclk = 0x8015010F,
  297. .crtc_goe = 0x80100110,
  298. .crtc_ps1_active = 0x41060010,
  299. .pll_freq = 75,
  300. .fast_pll_freq = 100,
  301. .sysclk_src = CLK_SRC_PLL,
  302. .sysclk_divider = 0,
  303. .pixclk_src = CLK_SRC_PLL,
  304. .pixclk_divider = 2,
  305. .pixclk_divider_rotated = 6,
  306. },{
  307. .xres = 240,
  308. .yres = 320,
  309. .left_margin = 0x27,
  310. .right_margin = 0x2e,
  311. .upper_margin = 0x01,
  312. .lower_margin = 0x00,
  313. .crtc_ss = 0x81170027,
  314. .crtc_ls = 0xA0140000,
  315. .crtc_gs = 0xC0140014,
  316. .crtc_vpos_gs = 0x00010141,
  317. .crtc_rev = 0x00400008,
  318. .crtc_dclk = 0xA0000000,
  319. .crtc_gclk = 0x8015010F,
  320. .crtc_goe = 0x80100110,
  321. .crtc_ps1_active = 0x41060010,
  322. .pll_freq = 0,
  323. .fast_pll_freq = 0,
  324. .sysclk_src = CLK_SRC_XTAL,
  325. .sysclk_divider = 0,
  326. .pixclk_src = CLK_SRC_XTAL,
  327. .pixclk_divider = 1,
  328. .pixclk_divider_rotated = 1,
  329. },
  330. };
  331. static struct w100fb_mach_info corgi_fb_info = {
  332. .tg = &corgi_lcdtg_info,
  333. .init_mode = INIT_MODE_ROTATED,
  334. .mem = &corgi_fb_mem,
  335. .regs = &corgi_fb_regs,
  336. .modelist = &corgi_fb_modes[0],
  337. .num_modes = 2,
  338. .gpio = &corgi_fb_gpio,
  339. .xtal_freq = 12500000,
  340. .xtal_dbl = 0,
  341. };
  342. static struct resource corgi_fb_resources[] = {
  343. [0] = {
  344. .start = 0x08000000,
  345. .end = 0x08ffffff,
  346. .flags = IORESOURCE_MEM,
  347. },
  348. };
  349. struct platform_device corgifb_device = {
  350. .name = "w100fb",
  351. .id = -1,
  352. .num_resources = ARRAY_SIZE(corgi_fb_resources),
  353. .resource = corgi_fb_resources,
  354. .dev = {
  355. .platform_data = &corgi_fb_info,
  356. .parent = &corgissp_device.dev,
  357. },
  358. };
  359. #endif
  360. /*
  361. * Spitz PXA Frame Buffer Device
  362. */
  363. #ifdef CONFIG_PXA_SHARP_Cxx00
  364. #include <asm/arch/pxafb.h>
  365. void spitz_lcd_power(int on, struct fb_var_screeninfo *var)
  366. {
  367. if (on)
  368. lcdtg_hw_init(var->xres);
  369. else
  370. lcdtg_suspend();
  371. }
  372. #endif
  373. /*
  374. * Corgi/Spitz Touchscreen to LCD interface
  375. */
  376. static unsigned long (*get_hsync_time)(struct device *dev);
  377. static void inline sharpsl_wait_sync(int gpio)
  378. {
  379. while((GPLR(gpio) & GPIO_bit(gpio)) == 0);
  380. while((GPLR(gpio) & GPIO_bit(gpio)) != 0);
  381. }
  382. #ifdef CONFIG_PXA_SHARP_C7xx
  383. unsigned long corgi_get_hsync_len(void)
  384. {
  385. if (!get_hsync_time)
  386. get_hsync_time = symbol_get(w100fb_get_hsynclen);
  387. if (!get_hsync_time)
  388. return 0;
  389. return get_hsync_time(&corgifb_device.dev);
  390. }
  391. void corgi_put_hsync(void)
  392. {
  393. if (get_hsync_time)
  394. symbol_put(w100fb_get_hsynclen);
  395. get_hsync_time = NULL;
  396. }
  397. void corgi_wait_hsync(void)
  398. {
  399. sharpsl_wait_sync(CORGI_GPIO_HSYNC);
  400. }
  401. #endif
  402. #ifdef CONFIG_PXA_SHARP_Cxx00
  403. static struct device *spitz_pxafb_dev;
  404. static int is_pxafb_device(struct device * dev, void * data)
  405. {
  406. struct platform_device *pdev = container_of(dev, struct platform_device, dev);
  407. return (strncmp(pdev->name, "pxa2xx-fb", 9) == 0);
  408. }
  409. unsigned long spitz_get_hsync_len(void)
  410. {
  411. #ifdef CONFIG_FB_PXA
  412. if (!spitz_pxafb_dev) {
  413. spitz_pxafb_dev = bus_find_device(&platform_bus_type, NULL, NULL, is_pxafb_device);
  414. if (!spitz_pxafb_dev)
  415. return 0;
  416. }
  417. if (!get_hsync_time)
  418. get_hsync_time = symbol_get(pxafb_get_hsync_time);
  419. if (!get_hsync_time)
  420. #endif
  421. return 0;
  422. return pxafb_get_hsync_time(spitz_pxafb_dev);
  423. }
  424. void spitz_put_hsync(void)
  425. {
  426. put_device(spitz_pxafb_dev);
  427. if (get_hsync_time)
  428. symbol_put(pxafb_get_hsync_time);
  429. spitz_pxafb_dev = NULL;
  430. get_hsync_time = NULL;
  431. }
  432. void spitz_wait_hsync(void)
  433. {
  434. sharpsl_wait_sync(SPITZ_GPIO_HSYNC);
  435. }
  436. #endif
  437. /*
  438. * Corgi/Spitz Backlight Power
  439. */
  440. #ifdef CONFIG_PXA_SHARP_C7xx
  441. void corgi_bl_set_intensity(int intensity)
  442. {
  443. if (intensity > 0x10)
  444. intensity += 0x10;
  445. /* Bits 0-4 are accessed via the SSP interface */
  446. corgi_ssp_blduty_set(intensity & 0x1f);
  447. /* Bit 5 is via SCOOP */
  448. if (intensity & 0x0020)
  449. set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_BACKLIGHT_CONT);
  450. else
  451. reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_BACKLIGHT_CONT);
  452. }
  453. #endif
  454. #if defined(CONFIG_MACH_SPITZ) || defined(CONFIG_MACH_BORZOI)
  455. void spitz_bl_set_intensity(int intensity)
  456. {
  457. if (intensity > 0x10)
  458. intensity += 0x10;
  459. /* Bits 0-4 are accessed via the SSP interface */
  460. corgi_ssp_blduty_set(intensity & 0x1f);
  461. /* Bit 5 is via SCOOP */
  462. if (intensity & 0x0020)
  463. reset_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_CONT);
  464. else
  465. set_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_CONT);
  466. if (intensity)
  467. set_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_ON);
  468. else
  469. reset_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_ON);
  470. }
  471. #endif
  472. #ifdef CONFIG_MACH_AKITA
  473. void akita_bl_set_intensity(int intensity)
  474. {
  475. if (intensity > 0x10)
  476. intensity += 0x10;
  477. /* Bits 0-4 are accessed via the SSP interface */
  478. corgi_ssp_blduty_set(intensity & 0x1f);
  479. /* Bit 5 is via IO-Expander */
  480. if (intensity & 0x0020)
  481. akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_CONT);
  482. else
  483. akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_CONT);
  484. if (intensity)
  485. akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_ON);
  486. else
  487. akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_ON);
  488. }
  489. #endif