fujitsu-laptop.c 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222
  1. /*-*-linux-c-*-*/
  2. /*
  3. Copyright (C) 2007,2008 Jonathan Woithe <jwoithe@just42.net>
  4. Copyright (C) 2008 Peter Gruber <nokos@gmx.net>
  5. Copyright (C) 2008 Tony Vroon <tony@linx.net>
  6. Based on earlier work:
  7. Copyright (C) 2003 Shane Spencer <shane@bogomip.com>
  8. Adrian Yee <brewt-fujitsu@brewt.org>
  9. Templated from msi-laptop.c and thinkpad_acpi.c which is copyright
  10. by its respective authors.
  11. This program is free software; you can redistribute it and/or modify
  12. it under the terms of the GNU General Public License as published by
  13. the Free Software Foundation; either version 2 of the License, or
  14. (at your option) any later version.
  15. This program is distributed in the hope that it will be useful, but
  16. WITHOUT ANY WARRANTY; without even the implied warranty of
  17. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. General Public License for more details.
  19. You should have received a copy of the GNU General Public License
  20. along with this program; if not, write to the Free Software
  21. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  22. 02110-1301, USA.
  23. */
  24. /*
  25. * fujitsu-laptop.c - Fujitsu laptop support, providing access to additional
  26. * features made available on a range of Fujitsu laptops including the
  27. * P2xxx/P5xxx/S6xxx/S7xxx series.
  28. *
  29. * This driver exports a few files in /sys/devices/platform/fujitsu-laptop/;
  30. * others may be added at a later date.
  31. *
  32. * lcd_level - Screen brightness: contains a single integer in the
  33. * range 0..7. (rw)
  34. *
  35. * In addition to these platform device attributes the driver
  36. * registers itself in the Linux backlight control subsystem and is
  37. * available to userspace under /sys/class/backlight/fujitsu-laptop/.
  38. *
  39. * Hotkeys present on certain Fujitsu laptops (eg: the S6xxx series) are
  40. * also supported by this driver.
  41. *
  42. * This driver has been tested on a Fujitsu Lifebook S6410, S7020 and
  43. * P8010. It should work on most P-series and S-series Lifebooks, but
  44. * YMMV.
  45. *
  46. * The module parameter use_alt_lcd_levels switches between different ACPI
  47. * brightness controls which are used by different Fujitsu laptops. In most
  48. * cases the correct method is automatically detected. "use_alt_lcd_levels=1"
  49. * is applicable for a Fujitsu Lifebook S6410 if autodetection fails.
  50. *
  51. */
  52. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  53. #include <linux/module.h>
  54. #include <linux/kernel.h>
  55. #include <linux/init.h>
  56. #include <linux/acpi.h>
  57. #include <linux/dmi.h>
  58. #include <linux/backlight.h>
  59. #include <linux/input.h>
  60. #include <linux/kfifo.h>
  61. #include <linux/video_output.h>
  62. #include <linux/platform_device.h>
  63. #include <linux/slab.h>
  64. #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
  65. #include <linux/leds.h>
  66. #endif
  67. #define FUJITSU_DRIVER_VERSION "0.6.0"
  68. #define FUJITSU_LCD_N_LEVELS 8
  69. #define ACPI_FUJITSU_CLASS "fujitsu"
  70. #define ACPI_FUJITSU_HID "FUJ02B1"
  71. #define ACPI_FUJITSU_DRIVER_NAME "Fujitsu laptop FUJ02B1 ACPI brightness driver"
  72. #define ACPI_FUJITSU_DEVICE_NAME "Fujitsu FUJ02B1"
  73. #define ACPI_FUJITSU_HOTKEY_HID "FUJ02E3"
  74. #define ACPI_FUJITSU_HOTKEY_DRIVER_NAME "Fujitsu laptop FUJ02E3 ACPI hotkeys driver"
  75. #define ACPI_FUJITSU_HOTKEY_DEVICE_NAME "Fujitsu FUJ02E3"
  76. #define ACPI_FUJITSU_NOTIFY_CODE1 0x80
  77. #define ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS 0x86
  78. #define ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS 0x87
  79. /* FUNC interface - command values */
  80. #define FUNC_RFKILL 0x1000
  81. #define FUNC_LEDS 0x1001
  82. #define FUNC_BUTTONS 0x1002
  83. #define FUNC_BACKLIGHT 0x1004
  84. /* FUNC interface - responses */
  85. #define UNSUPPORTED_CMD 0x80000000
  86. #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
  87. /* FUNC interface - LED control */
  88. #define FUNC_LED_OFF 0x1
  89. #define FUNC_LED_ON 0x30001
  90. #define KEYBOARD_LAMPS 0x100
  91. #define LOGOLAMP_POWERON 0x2000
  92. #define LOGOLAMP_ALWAYS 0x4000
  93. #endif
  94. /* Hotkey details */
  95. #define KEY1_CODE 0x410 /* codes for the keys in the GIRB register */
  96. #define KEY2_CODE 0x411
  97. #define KEY3_CODE 0x412
  98. #define KEY4_CODE 0x413
  99. #define MAX_HOTKEY_RINGBUFFER_SIZE 100
  100. #define RINGBUFFERSIZE 40
  101. /* Debugging */
  102. #define FUJLAPTOP_LOG ACPI_FUJITSU_HID ": "
  103. #define FUJLAPTOP_ERR KERN_ERR FUJLAPTOP_LOG
  104. #define FUJLAPTOP_NOTICE KERN_NOTICE FUJLAPTOP_LOG
  105. #define FUJLAPTOP_INFO KERN_INFO FUJLAPTOP_LOG
  106. #define FUJLAPTOP_DEBUG KERN_DEBUG FUJLAPTOP_LOG
  107. #define FUJLAPTOP_DBG_ALL 0xffff
  108. #define FUJLAPTOP_DBG_ERROR 0x0001
  109. #define FUJLAPTOP_DBG_WARN 0x0002
  110. #define FUJLAPTOP_DBG_INFO 0x0004
  111. #define FUJLAPTOP_DBG_TRACE 0x0008
  112. #define dbg_printk(a_dbg_level, format, arg...) \
  113. do { if (dbg_level & a_dbg_level) \
  114. printk(FUJLAPTOP_DEBUG "%s: " format, __func__ , ## arg); \
  115. } while (0)
  116. #ifdef CONFIG_FUJITSU_LAPTOP_DEBUG
  117. #define vdbg_printk(a_dbg_level, format, arg...) \
  118. dbg_printk(a_dbg_level, format, ## arg)
  119. #else
  120. #define vdbg_printk(a_dbg_level, format, arg...)
  121. #endif
  122. /* Device controlling the backlight and associated keys */
  123. struct fujitsu_t {
  124. acpi_handle acpi_handle;
  125. struct acpi_device *dev;
  126. struct input_dev *input;
  127. char phys[32];
  128. struct backlight_device *bl_device;
  129. struct platform_device *pf_device;
  130. int keycode1, keycode2, keycode3, keycode4;
  131. unsigned int max_brightness;
  132. unsigned int brightness_changed;
  133. unsigned int brightness_level;
  134. };
  135. static struct fujitsu_t *fujitsu;
  136. static int use_alt_lcd_levels = -1;
  137. static int disable_brightness_adjust = -1;
  138. /* Device used to access other hotkeys on the laptop */
  139. struct fujitsu_hotkey_t {
  140. acpi_handle acpi_handle;
  141. struct acpi_device *dev;
  142. struct input_dev *input;
  143. char phys[32];
  144. struct platform_device *pf_device;
  145. struct kfifo fifo;
  146. spinlock_t fifo_lock;
  147. int rfkill_supported;
  148. int rfkill_state;
  149. int logolamp_registered;
  150. int kblamps_registered;
  151. };
  152. static struct fujitsu_hotkey_t *fujitsu_hotkey;
  153. static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event);
  154. #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
  155. static enum led_brightness logolamp_get(struct led_classdev *cdev);
  156. static void logolamp_set(struct led_classdev *cdev,
  157. enum led_brightness brightness);
  158. static struct led_classdev logolamp_led = {
  159. .name = "fujitsu::logolamp",
  160. .brightness_get = logolamp_get,
  161. .brightness_set = logolamp_set
  162. };
  163. static enum led_brightness kblamps_get(struct led_classdev *cdev);
  164. static void kblamps_set(struct led_classdev *cdev,
  165. enum led_brightness brightness);
  166. static struct led_classdev kblamps_led = {
  167. .name = "fujitsu::kblamps",
  168. .brightness_get = kblamps_get,
  169. .brightness_set = kblamps_set
  170. };
  171. #endif
  172. #ifdef CONFIG_FUJITSU_LAPTOP_DEBUG
  173. static u32 dbg_level = 0x03;
  174. #endif
  175. static void acpi_fujitsu_notify(struct acpi_device *device, u32 event);
  176. /* Fujitsu ACPI interface function */
  177. static int call_fext_func(int cmd, int arg0, int arg1, int arg2)
  178. {
  179. acpi_status status = AE_OK;
  180. union acpi_object params[4] = {
  181. { .type = ACPI_TYPE_INTEGER },
  182. { .type = ACPI_TYPE_INTEGER },
  183. { .type = ACPI_TYPE_INTEGER },
  184. { .type = ACPI_TYPE_INTEGER }
  185. };
  186. struct acpi_object_list arg_list = { 4, &params[0] };
  187. unsigned long long value;
  188. acpi_handle handle = NULL;
  189. status = acpi_get_handle(fujitsu_hotkey->acpi_handle, "FUNC", &handle);
  190. if (ACPI_FAILURE(status)) {
  191. vdbg_printk(FUJLAPTOP_DBG_ERROR,
  192. "FUNC interface is not present\n");
  193. return -ENODEV;
  194. }
  195. params[0].integer.value = cmd;
  196. params[1].integer.value = arg0;
  197. params[2].integer.value = arg1;
  198. params[3].integer.value = arg2;
  199. status = acpi_evaluate_integer(handle, NULL, &arg_list, &value);
  200. if (ACPI_FAILURE(status)) {
  201. vdbg_printk(FUJLAPTOP_DBG_WARN,
  202. "FUNC 0x%x (args 0x%x, 0x%x, 0x%x) call failed\n",
  203. cmd, arg0, arg1, arg2);
  204. return -ENODEV;
  205. }
  206. vdbg_printk(FUJLAPTOP_DBG_TRACE,
  207. "FUNC 0x%x (args 0x%x, 0x%x, 0x%x) returned 0x%x\n",
  208. cmd, arg0, arg1, arg2, (int)value);
  209. return value;
  210. }
  211. #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
  212. /* LED class callbacks */
  213. static void logolamp_set(struct led_classdev *cdev,
  214. enum led_brightness brightness)
  215. {
  216. if (brightness >= LED_FULL) {
  217. call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_POWERON, FUNC_LED_ON);
  218. call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_ALWAYS, FUNC_LED_ON);
  219. } else if (brightness >= LED_HALF) {
  220. call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_POWERON, FUNC_LED_ON);
  221. call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_ALWAYS, FUNC_LED_OFF);
  222. } else {
  223. call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_POWERON, FUNC_LED_OFF);
  224. }
  225. }
  226. static void kblamps_set(struct led_classdev *cdev,
  227. enum led_brightness brightness)
  228. {
  229. if (brightness >= LED_FULL)
  230. call_fext_func(FUNC_LEDS, 0x1, KEYBOARD_LAMPS, FUNC_LED_ON);
  231. else
  232. call_fext_func(FUNC_LEDS, 0x1, KEYBOARD_LAMPS, FUNC_LED_OFF);
  233. }
  234. static enum led_brightness logolamp_get(struct led_classdev *cdev)
  235. {
  236. enum led_brightness brightness = LED_OFF;
  237. int poweron, always;
  238. poweron = call_fext_func(FUNC_LEDS, 0x2, LOGOLAMP_POWERON, 0x0);
  239. if (poweron == FUNC_LED_ON) {
  240. brightness = LED_HALF;
  241. always = call_fext_func(FUNC_LEDS, 0x2, LOGOLAMP_ALWAYS, 0x0);
  242. if (always == FUNC_LED_ON)
  243. brightness = LED_FULL;
  244. }
  245. return brightness;
  246. }
  247. static enum led_brightness kblamps_get(struct led_classdev *cdev)
  248. {
  249. enum led_brightness brightness = LED_OFF;
  250. if (call_fext_func(FUNC_LEDS, 0x2, KEYBOARD_LAMPS, 0x0) == FUNC_LED_ON)
  251. brightness = LED_FULL;
  252. return brightness;
  253. }
  254. #endif
  255. /* Hardware access for LCD brightness control */
  256. static int set_lcd_level(int level)
  257. {
  258. acpi_status status = AE_OK;
  259. acpi_handle handle = NULL;
  260. vdbg_printk(FUJLAPTOP_DBG_TRACE, "set lcd level via SBLL [%d]\n",
  261. level);
  262. if (level < 0 || level >= fujitsu->max_brightness)
  263. return -EINVAL;
  264. status = acpi_get_handle(fujitsu->acpi_handle, "SBLL", &handle);
  265. if (ACPI_FAILURE(status)) {
  266. vdbg_printk(FUJLAPTOP_DBG_ERROR, "SBLL not present\n");
  267. return -ENODEV;
  268. }
  269. status = acpi_execute_simple_method(handle, NULL, level);
  270. if (ACPI_FAILURE(status))
  271. return -ENODEV;
  272. return 0;
  273. }
  274. static int set_lcd_level_alt(int level)
  275. {
  276. acpi_status status = AE_OK;
  277. acpi_handle handle = NULL;
  278. vdbg_printk(FUJLAPTOP_DBG_TRACE, "set lcd level via SBL2 [%d]\n",
  279. level);
  280. if (level < 0 || level >= fujitsu->max_brightness)
  281. return -EINVAL;
  282. status = acpi_get_handle(fujitsu->acpi_handle, "SBL2", &handle);
  283. if (ACPI_FAILURE(status)) {
  284. vdbg_printk(FUJLAPTOP_DBG_ERROR, "SBL2 not present\n");
  285. return -ENODEV;
  286. }
  287. status = acpi_execute_simple_method(handle, NULL, level);
  288. if (ACPI_FAILURE(status))
  289. return -ENODEV;
  290. return 0;
  291. }
  292. static int get_lcd_level(void)
  293. {
  294. unsigned long long state = 0;
  295. acpi_status status = AE_OK;
  296. vdbg_printk(FUJLAPTOP_DBG_TRACE, "get lcd level via GBLL\n");
  297. status =
  298. acpi_evaluate_integer(fujitsu->acpi_handle, "GBLL", NULL, &state);
  299. if (ACPI_FAILURE(status))
  300. return 0;
  301. fujitsu->brightness_level = state & 0x0fffffff;
  302. if (state & 0x80000000)
  303. fujitsu->brightness_changed = 1;
  304. else
  305. fujitsu->brightness_changed = 0;
  306. return fujitsu->brightness_level;
  307. }
  308. static int get_max_brightness(void)
  309. {
  310. unsigned long long state = 0;
  311. acpi_status status = AE_OK;
  312. vdbg_printk(FUJLAPTOP_DBG_TRACE, "get max lcd level via RBLL\n");
  313. status =
  314. acpi_evaluate_integer(fujitsu->acpi_handle, "RBLL", NULL, &state);
  315. if (ACPI_FAILURE(status))
  316. return -1;
  317. fujitsu->max_brightness = state;
  318. return fujitsu->max_brightness;
  319. }
  320. /* Backlight device stuff */
  321. static int bl_get_brightness(struct backlight_device *b)
  322. {
  323. return get_lcd_level();
  324. }
  325. static int bl_update_status(struct backlight_device *b)
  326. {
  327. int ret;
  328. if (b->props.power == 4)
  329. ret = call_fext_func(FUNC_BACKLIGHT, 0x1, 0x4, 0x3);
  330. else
  331. ret = call_fext_func(FUNC_BACKLIGHT, 0x1, 0x4, 0x0);
  332. if (ret != 0)
  333. vdbg_printk(FUJLAPTOP_DBG_ERROR,
  334. "Unable to adjust backlight power, error code %i\n",
  335. ret);
  336. if (use_alt_lcd_levels)
  337. ret = set_lcd_level_alt(b->props.brightness);
  338. else
  339. ret = set_lcd_level(b->props.brightness);
  340. if (ret != 0)
  341. vdbg_printk(FUJLAPTOP_DBG_ERROR,
  342. "Unable to adjust LCD brightness, error code %i\n",
  343. ret);
  344. return ret;
  345. }
  346. static const struct backlight_ops fujitsubl_ops = {
  347. .get_brightness = bl_get_brightness,
  348. .update_status = bl_update_status,
  349. };
  350. /* Platform LCD brightness device */
  351. static ssize_t
  352. show_max_brightness(struct device *dev,
  353. struct device_attribute *attr, char *buf)
  354. {
  355. int ret;
  356. ret = get_max_brightness();
  357. if (ret < 0)
  358. return ret;
  359. return sprintf(buf, "%i\n", ret);
  360. }
  361. static ssize_t
  362. show_brightness_changed(struct device *dev,
  363. struct device_attribute *attr, char *buf)
  364. {
  365. int ret;
  366. ret = fujitsu->brightness_changed;
  367. if (ret < 0)
  368. return ret;
  369. return sprintf(buf, "%i\n", ret);
  370. }
  371. static ssize_t show_lcd_level(struct device *dev,
  372. struct device_attribute *attr, char *buf)
  373. {
  374. int ret;
  375. ret = get_lcd_level();
  376. if (ret < 0)
  377. return ret;
  378. return sprintf(buf, "%i\n", ret);
  379. }
  380. static ssize_t store_lcd_level(struct device *dev,
  381. struct device_attribute *attr, const char *buf,
  382. size_t count)
  383. {
  384. int level, ret;
  385. if (sscanf(buf, "%i", &level) != 1
  386. || (level < 0 || level >= fujitsu->max_brightness))
  387. return -EINVAL;
  388. if (use_alt_lcd_levels)
  389. ret = set_lcd_level_alt(level);
  390. else
  391. ret = set_lcd_level(level);
  392. if (ret < 0)
  393. return ret;
  394. ret = get_lcd_level();
  395. if (ret < 0)
  396. return ret;
  397. return count;
  398. }
  399. static ssize_t
  400. ignore_store(struct device *dev,
  401. struct device_attribute *attr, const char *buf, size_t count)
  402. {
  403. return count;
  404. }
  405. static ssize_t
  406. show_lid_state(struct device *dev,
  407. struct device_attribute *attr, char *buf)
  408. {
  409. if (!(fujitsu_hotkey->rfkill_supported & 0x100))
  410. return sprintf(buf, "unknown\n");
  411. if (fujitsu_hotkey->rfkill_state & 0x100)
  412. return sprintf(buf, "open\n");
  413. else
  414. return sprintf(buf, "closed\n");
  415. }
  416. static ssize_t
  417. show_dock_state(struct device *dev,
  418. struct device_attribute *attr, char *buf)
  419. {
  420. if (!(fujitsu_hotkey->rfkill_supported & 0x200))
  421. return sprintf(buf, "unknown\n");
  422. if (fujitsu_hotkey->rfkill_state & 0x200)
  423. return sprintf(buf, "docked\n");
  424. else
  425. return sprintf(buf, "undocked\n");
  426. }
  427. static ssize_t
  428. show_radios_state(struct device *dev,
  429. struct device_attribute *attr, char *buf)
  430. {
  431. if (!(fujitsu_hotkey->rfkill_supported & 0x20))
  432. return sprintf(buf, "unknown\n");
  433. if (fujitsu_hotkey->rfkill_state & 0x20)
  434. return sprintf(buf, "on\n");
  435. else
  436. return sprintf(buf, "killed\n");
  437. }
  438. static DEVICE_ATTR(max_brightness, 0444, show_max_brightness, ignore_store);
  439. static DEVICE_ATTR(brightness_changed, 0444, show_brightness_changed,
  440. ignore_store);
  441. static DEVICE_ATTR(lcd_level, 0644, show_lcd_level, store_lcd_level);
  442. static DEVICE_ATTR(lid, 0444, show_lid_state, ignore_store);
  443. static DEVICE_ATTR(dock, 0444, show_dock_state, ignore_store);
  444. static DEVICE_ATTR(radios, 0444, show_radios_state, ignore_store);
  445. static struct attribute *fujitsupf_attributes[] = {
  446. &dev_attr_brightness_changed.attr,
  447. &dev_attr_max_brightness.attr,
  448. &dev_attr_lcd_level.attr,
  449. &dev_attr_lid.attr,
  450. &dev_attr_dock.attr,
  451. &dev_attr_radios.attr,
  452. NULL
  453. };
  454. static struct attribute_group fujitsupf_attribute_group = {
  455. .attrs = fujitsupf_attributes
  456. };
  457. static struct platform_driver fujitsupf_driver = {
  458. .driver = {
  459. .name = "fujitsu-laptop",
  460. .owner = THIS_MODULE,
  461. }
  462. };
  463. static void dmi_check_cb_common(const struct dmi_system_id *id)
  464. {
  465. pr_info("Identified laptop model '%s'\n", id->ident);
  466. if (use_alt_lcd_levels == -1) {
  467. if (acpi_has_method(NULL,
  468. "\\_SB.PCI0.LPCB.FJEX.SBL2"))
  469. use_alt_lcd_levels = 1;
  470. else
  471. use_alt_lcd_levels = 0;
  472. vdbg_printk(FUJLAPTOP_DBG_TRACE, "auto-detected usealt as "
  473. "%i\n", use_alt_lcd_levels);
  474. }
  475. }
  476. static int dmi_check_cb_s6410(const struct dmi_system_id *id)
  477. {
  478. dmi_check_cb_common(id);
  479. fujitsu->keycode1 = KEY_SCREENLOCK; /* "Lock" */
  480. fujitsu->keycode2 = KEY_HELP; /* "Mobility Center" */
  481. return 1;
  482. }
  483. static int dmi_check_cb_s6420(const struct dmi_system_id *id)
  484. {
  485. dmi_check_cb_common(id);
  486. fujitsu->keycode1 = KEY_SCREENLOCK; /* "Lock" */
  487. fujitsu->keycode2 = KEY_HELP; /* "Mobility Center" */
  488. return 1;
  489. }
  490. static int dmi_check_cb_p8010(const struct dmi_system_id *id)
  491. {
  492. dmi_check_cb_common(id);
  493. fujitsu->keycode1 = KEY_HELP; /* "Support" */
  494. fujitsu->keycode3 = KEY_SWITCHVIDEOMODE; /* "Presentation" */
  495. fujitsu->keycode4 = KEY_WWW; /* "Internet" */
  496. return 1;
  497. }
  498. static struct dmi_system_id fujitsu_dmi_table[] = {
  499. {
  500. .ident = "Fujitsu Siemens S6410",
  501. .matches = {
  502. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  503. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK S6410"),
  504. },
  505. .callback = dmi_check_cb_s6410},
  506. {
  507. .ident = "Fujitsu Siemens S6420",
  508. .matches = {
  509. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  510. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK S6420"),
  511. },
  512. .callback = dmi_check_cb_s6420},
  513. {
  514. .ident = "Fujitsu LifeBook P8010",
  515. .matches = {
  516. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  517. DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P8010"),
  518. },
  519. .callback = dmi_check_cb_p8010},
  520. {}
  521. };
  522. /* ACPI device for LCD brightness control */
  523. static int acpi_fujitsu_add(struct acpi_device *device)
  524. {
  525. int result = 0;
  526. int state = 0;
  527. struct input_dev *input;
  528. int error;
  529. if (!device)
  530. return -EINVAL;
  531. fujitsu->acpi_handle = device->handle;
  532. sprintf(acpi_device_name(device), "%s", ACPI_FUJITSU_DEVICE_NAME);
  533. sprintf(acpi_device_class(device), "%s", ACPI_FUJITSU_CLASS);
  534. device->driver_data = fujitsu;
  535. fujitsu->input = input = input_allocate_device();
  536. if (!input) {
  537. error = -ENOMEM;
  538. goto err_stop;
  539. }
  540. snprintf(fujitsu->phys, sizeof(fujitsu->phys),
  541. "%s/video/input0", acpi_device_hid(device));
  542. input->name = acpi_device_name(device);
  543. input->phys = fujitsu->phys;
  544. input->id.bustype = BUS_HOST;
  545. input->id.product = 0x06;
  546. input->dev.parent = &device->dev;
  547. input->evbit[0] = BIT(EV_KEY);
  548. set_bit(KEY_BRIGHTNESSUP, input->keybit);
  549. set_bit(KEY_BRIGHTNESSDOWN, input->keybit);
  550. set_bit(KEY_UNKNOWN, input->keybit);
  551. error = input_register_device(input);
  552. if (error)
  553. goto err_free_input_dev;
  554. result = acpi_bus_update_power(fujitsu->acpi_handle, &state);
  555. if (result) {
  556. pr_err("Error reading power state\n");
  557. goto err_unregister_input_dev;
  558. }
  559. pr_info("ACPI: %s [%s] (%s)\n",
  560. acpi_device_name(device), acpi_device_bid(device),
  561. !device->power.state ? "on" : "off");
  562. fujitsu->dev = device;
  563. if (acpi_has_method(device->handle, METHOD_NAME__INI)) {
  564. vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n");
  565. if (ACPI_FAILURE
  566. (acpi_evaluate_object
  567. (device->handle, METHOD_NAME__INI, NULL, NULL)))
  568. pr_err("_INI Method failed\n");
  569. }
  570. /* do config (detect defaults) */
  571. use_alt_lcd_levels = use_alt_lcd_levels == 1 ? 1 : 0;
  572. disable_brightness_adjust = disable_brightness_adjust == 1 ? 1 : 0;
  573. vdbg_printk(FUJLAPTOP_DBG_INFO,
  574. "config: [alt interface: %d], [adjust disable: %d]\n",
  575. use_alt_lcd_levels, disable_brightness_adjust);
  576. if (get_max_brightness() <= 0)
  577. fujitsu->max_brightness = FUJITSU_LCD_N_LEVELS;
  578. get_lcd_level();
  579. return result;
  580. err_unregister_input_dev:
  581. input_unregister_device(input);
  582. input = NULL;
  583. err_free_input_dev:
  584. input_free_device(input);
  585. err_stop:
  586. return result;
  587. }
  588. static int acpi_fujitsu_remove(struct acpi_device *device)
  589. {
  590. struct fujitsu_t *fujitsu = acpi_driver_data(device);
  591. struct input_dev *input = fujitsu->input;
  592. input_unregister_device(input);
  593. fujitsu->acpi_handle = NULL;
  594. return 0;
  595. }
  596. /* Brightness notify */
  597. static void acpi_fujitsu_notify(struct acpi_device *device, u32 event)
  598. {
  599. struct input_dev *input;
  600. int keycode;
  601. int oldb, newb;
  602. input = fujitsu->input;
  603. switch (event) {
  604. case ACPI_FUJITSU_NOTIFY_CODE1:
  605. keycode = 0;
  606. oldb = fujitsu->brightness_level;
  607. get_lcd_level();
  608. newb = fujitsu->brightness_level;
  609. vdbg_printk(FUJLAPTOP_DBG_TRACE,
  610. "brightness button event [%i -> %i (%i)]\n",
  611. oldb, newb, fujitsu->brightness_changed);
  612. if (oldb < newb) {
  613. if (disable_brightness_adjust != 1) {
  614. if (use_alt_lcd_levels)
  615. set_lcd_level_alt(newb);
  616. else
  617. set_lcd_level(newb);
  618. }
  619. keycode = KEY_BRIGHTNESSUP;
  620. } else if (oldb > newb) {
  621. if (disable_brightness_adjust != 1) {
  622. if (use_alt_lcd_levels)
  623. set_lcd_level_alt(newb);
  624. else
  625. set_lcd_level(newb);
  626. }
  627. keycode = KEY_BRIGHTNESSDOWN;
  628. }
  629. break;
  630. default:
  631. keycode = KEY_UNKNOWN;
  632. vdbg_printk(FUJLAPTOP_DBG_WARN,
  633. "unsupported event [0x%x]\n", event);
  634. break;
  635. }
  636. if (keycode != 0) {
  637. input_report_key(input, keycode, 1);
  638. input_sync(input);
  639. input_report_key(input, keycode, 0);
  640. input_sync(input);
  641. }
  642. }
  643. /* ACPI device for hotkey handling */
  644. static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
  645. {
  646. int result = 0;
  647. int state = 0;
  648. struct input_dev *input;
  649. int error;
  650. int i;
  651. if (!device)
  652. return -EINVAL;
  653. fujitsu_hotkey->acpi_handle = device->handle;
  654. sprintf(acpi_device_name(device), "%s",
  655. ACPI_FUJITSU_HOTKEY_DEVICE_NAME);
  656. sprintf(acpi_device_class(device), "%s", ACPI_FUJITSU_CLASS);
  657. device->driver_data = fujitsu_hotkey;
  658. /* kfifo */
  659. spin_lock_init(&fujitsu_hotkey->fifo_lock);
  660. error = kfifo_alloc(&fujitsu_hotkey->fifo, RINGBUFFERSIZE * sizeof(int),
  661. GFP_KERNEL);
  662. if (error) {
  663. pr_err("kfifo_alloc failed\n");
  664. goto err_stop;
  665. }
  666. fujitsu_hotkey->input = input = input_allocate_device();
  667. if (!input) {
  668. error = -ENOMEM;
  669. goto err_free_fifo;
  670. }
  671. snprintf(fujitsu_hotkey->phys, sizeof(fujitsu_hotkey->phys),
  672. "%s/video/input0", acpi_device_hid(device));
  673. input->name = acpi_device_name(device);
  674. input->phys = fujitsu_hotkey->phys;
  675. input->id.bustype = BUS_HOST;
  676. input->id.product = 0x06;
  677. input->dev.parent = &device->dev;
  678. set_bit(EV_KEY, input->evbit);
  679. set_bit(fujitsu->keycode1, input->keybit);
  680. set_bit(fujitsu->keycode2, input->keybit);
  681. set_bit(fujitsu->keycode3, input->keybit);
  682. set_bit(fujitsu->keycode4, input->keybit);
  683. set_bit(KEY_UNKNOWN, input->keybit);
  684. error = input_register_device(input);
  685. if (error)
  686. goto err_free_input_dev;
  687. result = acpi_bus_update_power(fujitsu_hotkey->acpi_handle, &state);
  688. if (result) {
  689. pr_err("Error reading power state\n");
  690. goto err_unregister_input_dev;
  691. }
  692. pr_info("ACPI: %s [%s] (%s)\n",
  693. acpi_device_name(device), acpi_device_bid(device),
  694. !device->power.state ? "on" : "off");
  695. fujitsu_hotkey->dev = device;
  696. if (acpi_has_method(device->handle, METHOD_NAME__INI)) {
  697. vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n");
  698. if (ACPI_FAILURE
  699. (acpi_evaluate_object
  700. (device->handle, METHOD_NAME__INI, NULL, NULL)))
  701. pr_err("_INI Method failed\n");
  702. }
  703. i = 0;
  704. while (call_fext_func(FUNC_BUTTONS, 0x1, 0x0, 0x0) != 0
  705. && (i++) < MAX_HOTKEY_RINGBUFFER_SIZE)
  706. ; /* No action, result is discarded */
  707. vdbg_printk(FUJLAPTOP_DBG_INFO, "Discarded %i ringbuffer entries\n", i);
  708. fujitsu_hotkey->rfkill_supported =
  709. call_fext_func(FUNC_RFKILL, 0x0, 0x0, 0x0);
  710. /* Make sure our bitmask of supported functions is cleared if the
  711. RFKILL function block is not implemented, like on the S7020. */
  712. if (fujitsu_hotkey->rfkill_supported == UNSUPPORTED_CMD)
  713. fujitsu_hotkey->rfkill_supported = 0;
  714. if (fujitsu_hotkey->rfkill_supported)
  715. fujitsu_hotkey->rfkill_state =
  716. call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0);
  717. /* Suspect this is a keymap of the application panel, print it */
  718. pr_info("BTNI: [0x%x]\n", call_fext_func(FUNC_BUTTONS, 0x0, 0x0, 0x0));
  719. #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
  720. if (call_fext_func(FUNC_LEDS, 0x0, 0x0, 0x0) & LOGOLAMP_POWERON) {
  721. result = led_classdev_register(&fujitsu->pf_device->dev,
  722. &logolamp_led);
  723. if (result == 0) {
  724. fujitsu_hotkey->logolamp_registered = 1;
  725. } else {
  726. pr_err("Could not register LED handler for logo lamp, error %i\n",
  727. result);
  728. }
  729. }
  730. if ((call_fext_func(FUNC_LEDS, 0x0, 0x0, 0x0) & KEYBOARD_LAMPS) &&
  731. (call_fext_func(FUNC_BUTTONS, 0x0, 0x0, 0x0) == 0x0)) {
  732. result = led_classdev_register(&fujitsu->pf_device->dev,
  733. &kblamps_led);
  734. if (result == 0) {
  735. fujitsu_hotkey->kblamps_registered = 1;
  736. } else {
  737. pr_err("Could not register LED handler for keyboard lamps, error %i\n",
  738. result);
  739. }
  740. }
  741. #endif
  742. return result;
  743. err_unregister_input_dev:
  744. input_unregister_device(input);
  745. input = NULL;
  746. err_free_input_dev:
  747. input_free_device(input);
  748. err_free_fifo:
  749. kfifo_free(&fujitsu_hotkey->fifo);
  750. err_stop:
  751. return result;
  752. }
  753. static int acpi_fujitsu_hotkey_remove(struct acpi_device *device)
  754. {
  755. struct fujitsu_hotkey_t *fujitsu_hotkey = acpi_driver_data(device);
  756. struct input_dev *input = fujitsu_hotkey->input;
  757. #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
  758. if (fujitsu_hotkey->logolamp_registered)
  759. led_classdev_unregister(&logolamp_led);
  760. if (fujitsu_hotkey->kblamps_registered)
  761. led_classdev_unregister(&kblamps_led);
  762. #endif
  763. input_unregister_device(input);
  764. kfifo_free(&fujitsu_hotkey->fifo);
  765. fujitsu_hotkey->acpi_handle = NULL;
  766. return 0;
  767. }
  768. static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event)
  769. {
  770. struct input_dev *input;
  771. int keycode, keycode_r;
  772. unsigned int irb = 1;
  773. int i, status;
  774. input = fujitsu_hotkey->input;
  775. if (fujitsu_hotkey->rfkill_supported)
  776. fujitsu_hotkey->rfkill_state =
  777. call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0);
  778. switch (event) {
  779. case ACPI_FUJITSU_NOTIFY_CODE1:
  780. i = 0;
  781. while ((irb =
  782. call_fext_func(FUNC_BUTTONS, 0x1, 0x0, 0x0)) != 0
  783. && (i++) < MAX_HOTKEY_RINGBUFFER_SIZE) {
  784. switch (irb & 0x4ff) {
  785. case KEY1_CODE:
  786. keycode = fujitsu->keycode1;
  787. break;
  788. case KEY2_CODE:
  789. keycode = fujitsu->keycode2;
  790. break;
  791. case KEY3_CODE:
  792. keycode = fujitsu->keycode3;
  793. break;
  794. case KEY4_CODE:
  795. keycode = fujitsu->keycode4;
  796. break;
  797. case 0:
  798. keycode = 0;
  799. break;
  800. default:
  801. vdbg_printk(FUJLAPTOP_DBG_WARN,
  802. "Unknown GIRB result [%x]\n", irb);
  803. keycode = -1;
  804. break;
  805. }
  806. if (keycode > 0) {
  807. vdbg_printk(FUJLAPTOP_DBG_TRACE,
  808. "Push keycode into ringbuffer [%d]\n",
  809. keycode);
  810. status = kfifo_in_locked(&fujitsu_hotkey->fifo,
  811. (unsigned char *)&keycode,
  812. sizeof(keycode),
  813. &fujitsu_hotkey->fifo_lock);
  814. if (status != sizeof(keycode)) {
  815. vdbg_printk(FUJLAPTOP_DBG_WARN,
  816. "Could not push keycode [0x%x]\n",
  817. keycode);
  818. } else {
  819. input_report_key(input, keycode, 1);
  820. input_sync(input);
  821. }
  822. } else if (keycode == 0) {
  823. while ((status =
  824. kfifo_out_locked(
  825. &fujitsu_hotkey->fifo,
  826. (unsigned char *) &keycode_r,
  827. sizeof(keycode_r),
  828. &fujitsu_hotkey->fifo_lock))
  829. == sizeof(keycode_r)) {
  830. input_report_key(input, keycode_r, 0);
  831. input_sync(input);
  832. vdbg_printk(FUJLAPTOP_DBG_TRACE,
  833. "Pop keycode from ringbuffer [%d]\n",
  834. keycode_r);
  835. }
  836. }
  837. }
  838. break;
  839. default:
  840. keycode = KEY_UNKNOWN;
  841. vdbg_printk(FUJLAPTOP_DBG_WARN,
  842. "Unsupported event [0x%x]\n", event);
  843. input_report_key(input, keycode, 1);
  844. input_sync(input);
  845. input_report_key(input, keycode, 0);
  846. input_sync(input);
  847. break;
  848. }
  849. }
  850. /* Initialization */
  851. static const struct acpi_device_id fujitsu_device_ids[] = {
  852. {ACPI_FUJITSU_HID, 0},
  853. {"", 0},
  854. };
  855. static struct acpi_driver acpi_fujitsu_driver = {
  856. .name = ACPI_FUJITSU_DRIVER_NAME,
  857. .class = ACPI_FUJITSU_CLASS,
  858. .ids = fujitsu_device_ids,
  859. .ops = {
  860. .add = acpi_fujitsu_add,
  861. .remove = acpi_fujitsu_remove,
  862. .notify = acpi_fujitsu_notify,
  863. },
  864. };
  865. static const struct acpi_device_id fujitsu_hotkey_device_ids[] = {
  866. {ACPI_FUJITSU_HOTKEY_HID, 0},
  867. {"", 0},
  868. };
  869. static struct acpi_driver acpi_fujitsu_hotkey_driver = {
  870. .name = ACPI_FUJITSU_HOTKEY_DRIVER_NAME,
  871. .class = ACPI_FUJITSU_CLASS,
  872. .ids = fujitsu_hotkey_device_ids,
  873. .ops = {
  874. .add = acpi_fujitsu_hotkey_add,
  875. .remove = acpi_fujitsu_hotkey_remove,
  876. .notify = acpi_fujitsu_hotkey_notify,
  877. },
  878. };
  879. static int __init fujitsu_init(void)
  880. {
  881. int ret, result, max_brightness;
  882. if (acpi_disabled)
  883. return -ENODEV;
  884. fujitsu = kzalloc(sizeof(struct fujitsu_t), GFP_KERNEL);
  885. if (!fujitsu)
  886. return -ENOMEM;
  887. fujitsu->keycode1 = KEY_PROG1;
  888. fujitsu->keycode2 = KEY_PROG2;
  889. fujitsu->keycode3 = KEY_PROG3;
  890. fujitsu->keycode4 = KEY_PROG4;
  891. dmi_check_system(fujitsu_dmi_table);
  892. result = acpi_bus_register_driver(&acpi_fujitsu_driver);
  893. if (result < 0) {
  894. ret = -ENODEV;
  895. goto fail_acpi;
  896. }
  897. /* Register platform stuff */
  898. fujitsu->pf_device = platform_device_alloc("fujitsu-laptop", -1);
  899. if (!fujitsu->pf_device) {
  900. ret = -ENOMEM;
  901. goto fail_platform_driver;
  902. }
  903. ret = platform_device_add(fujitsu->pf_device);
  904. if (ret)
  905. goto fail_platform_device1;
  906. ret =
  907. sysfs_create_group(&fujitsu->pf_device->dev.kobj,
  908. &fujitsupf_attribute_group);
  909. if (ret)
  910. goto fail_platform_device2;
  911. /* Register backlight stuff */
  912. if (!acpi_video_backlight_support()) {
  913. struct backlight_properties props;
  914. memset(&props, 0, sizeof(struct backlight_properties));
  915. max_brightness = fujitsu->max_brightness;
  916. props.type = BACKLIGHT_PLATFORM;
  917. props.max_brightness = max_brightness - 1;
  918. fujitsu->bl_device = backlight_device_register("fujitsu-laptop",
  919. NULL, NULL,
  920. &fujitsubl_ops,
  921. &props);
  922. if (IS_ERR(fujitsu->bl_device)) {
  923. ret = PTR_ERR(fujitsu->bl_device);
  924. fujitsu->bl_device = NULL;
  925. goto fail_sysfs_group;
  926. }
  927. fujitsu->bl_device->props.brightness = fujitsu->brightness_level;
  928. }
  929. ret = platform_driver_register(&fujitsupf_driver);
  930. if (ret)
  931. goto fail_backlight;
  932. /* Register hotkey driver */
  933. fujitsu_hotkey = kzalloc(sizeof(struct fujitsu_hotkey_t), GFP_KERNEL);
  934. if (!fujitsu_hotkey) {
  935. ret = -ENOMEM;
  936. goto fail_hotkey;
  937. }
  938. result = acpi_bus_register_driver(&acpi_fujitsu_hotkey_driver);
  939. if (result < 0) {
  940. ret = -ENODEV;
  941. goto fail_hotkey1;
  942. }
  943. /* Sync backlight power status (needs FUJ02E3 device, hence deferred) */
  944. if (!acpi_video_backlight_support()) {
  945. if (call_fext_func(FUNC_BACKLIGHT, 0x2, 0x4, 0x0) == 3)
  946. fujitsu->bl_device->props.power = 4;
  947. else
  948. fujitsu->bl_device->props.power = 0;
  949. }
  950. pr_info("driver " FUJITSU_DRIVER_VERSION " successfully loaded\n");
  951. return 0;
  952. fail_hotkey1:
  953. kfree(fujitsu_hotkey);
  954. fail_hotkey:
  955. platform_driver_unregister(&fujitsupf_driver);
  956. fail_backlight:
  957. if (fujitsu->bl_device)
  958. backlight_device_unregister(fujitsu->bl_device);
  959. fail_sysfs_group:
  960. sysfs_remove_group(&fujitsu->pf_device->dev.kobj,
  961. &fujitsupf_attribute_group);
  962. fail_platform_device2:
  963. platform_device_del(fujitsu->pf_device);
  964. fail_platform_device1:
  965. platform_device_put(fujitsu->pf_device);
  966. fail_platform_driver:
  967. acpi_bus_unregister_driver(&acpi_fujitsu_driver);
  968. fail_acpi:
  969. kfree(fujitsu);
  970. return ret;
  971. }
  972. static void __exit fujitsu_cleanup(void)
  973. {
  974. acpi_bus_unregister_driver(&acpi_fujitsu_hotkey_driver);
  975. kfree(fujitsu_hotkey);
  976. platform_driver_unregister(&fujitsupf_driver);
  977. if (fujitsu->bl_device)
  978. backlight_device_unregister(fujitsu->bl_device);
  979. sysfs_remove_group(&fujitsu->pf_device->dev.kobj,
  980. &fujitsupf_attribute_group);
  981. platform_device_unregister(fujitsu->pf_device);
  982. acpi_bus_unregister_driver(&acpi_fujitsu_driver);
  983. kfree(fujitsu);
  984. pr_info("driver unloaded\n");
  985. }
  986. module_init(fujitsu_init);
  987. module_exit(fujitsu_cleanup);
  988. module_param(use_alt_lcd_levels, uint, 0644);
  989. MODULE_PARM_DESC(use_alt_lcd_levels,
  990. "Use alternative interface for lcd_levels (needed for Lifebook s6410).");
  991. module_param(disable_brightness_adjust, uint, 0644);
  992. MODULE_PARM_DESC(disable_brightness_adjust, "Disable brightness adjustment .");
  993. #ifdef CONFIG_FUJITSU_LAPTOP_DEBUG
  994. module_param_named(debug, dbg_level, uint, 0644);
  995. MODULE_PARM_DESC(debug, "Sets debug level bit-mask");
  996. #endif
  997. MODULE_AUTHOR("Jonathan Woithe, Peter Gruber, Tony Vroon");
  998. MODULE_DESCRIPTION("Fujitsu laptop extras support");
  999. MODULE_VERSION(FUJITSU_DRIVER_VERSION);
  1000. MODULE_LICENSE("GPL");
  1001. MODULE_ALIAS("dmi:*:svnFUJITSUSIEMENS:*:pvr:rvnFUJITSU:rnFJNB1D3:*:cvrS6410:*");
  1002. MODULE_ALIAS("dmi:*:svnFUJITSUSIEMENS:*:pvr:rvnFUJITSU:rnFJNB1E6:*:cvrS6420:*");
  1003. MODULE_ALIAS("dmi:*:svnFUJITSU:*:pvr:rvnFUJITSU:rnFJNB19C:*:cvrS7020:*");
  1004. static struct pnp_device_id pnp_ids[] __used = {
  1005. {.id = "FUJ02bf"},
  1006. {.id = "FUJ02B1"},
  1007. {.id = "FUJ02E3"},
  1008. {.id = ""}
  1009. };
  1010. MODULE_DEVICE_TABLE(pnp, pnp_ids);