fujitsu-laptop.c 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215
  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/fb.h>
  60. #include <linux/input.h>
  61. #include <linux/kfifo.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. #include <acpi/video.h>
  68. #define FUJITSU_DRIVER_VERSION "0.6.0"
  69. #define FUJITSU_LCD_N_LEVELS 8
  70. #define ACPI_FUJITSU_CLASS "fujitsu"
  71. #define ACPI_FUJITSU_HID "FUJ02B1"
  72. #define ACPI_FUJITSU_DRIVER_NAME "Fujitsu laptop FUJ02B1 ACPI brightness driver"
  73. #define ACPI_FUJITSU_DEVICE_NAME "Fujitsu FUJ02B1"
  74. #define ACPI_FUJITSU_HOTKEY_HID "FUJ02E3"
  75. #define ACPI_FUJITSU_HOTKEY_DRIVER_NAME "Fujitsu laptop FUJ02E3 ACPI hotkeys driver"
  76. #define ACPI_FUJITSU_HOTKEY_DEVICE_NAME "Fujitsu FUJ02E3"
  77. #define ACPI_FUJITSU_NOTIFY_CODE1 0x80
  78. #define ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS 0x86
  79. #define ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS 0x87
  80. /* FUNC interface - command values */
  81. #define FUNC_RFKILL 0x1000
  82. #define FUNC_LEDS 0x1001
  83. #define FUNC_BUTTONS 0x1002
  84. #define FUNC_BACKLIGHT 0x1004
  85. /* FUNC interface - responses */
  86. #define UNSUPPORTED_CMD 0x80000000
  87. #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
  88. /* FUNC interface - LED control */
  89. #define FUNC_LED_OFF 0x1
  90. #define FUNC_LED_ON 0x30001
  91. #define KEYBOARD_LAMPS 0x100
  92. #define LOGOLAMP_POWERON 0x2000
  93. #define LOGOLAMP_ALWAYS 0x4000
  94. #endif
  95. /* Hotkey details */
  96. #define KEY1_CODE 0x410 /* codes for the keys in the GIRB register */
  97. #define KEY2_CODE 0x411
  98. #define KEY3_CODE 0x412
  99. #define KEY4_CODE 0x413
  100. #define MAX_HOTKEY_RINGBUFFER_SIZE 100
  101. #define RINGBUFFERSIZE 40
  102. /* Debugging */
  103. #define FUJLAPTOP_LOG ACPI_FUJITSU_HID ": "
  104. #define FUJLAPTOP_ERR KERN_ERR FUJLAPTOP_LOG
  105. #define FUJLAPTOP_NOTICE KERN_NOTICE FUJLAPTOP_LOG
  106. #define FUJLAPTOP_INFO KERN_INFO FUJLAPTOP_LOG
  107. #define FUJLAPTOP_DEBUG KERN_DEBUG FUJLAPTOP_LOG
  108. #define FUJLAPTOP_DBG_ALL 0xffff
  109. #define FUJLAPTOP_DBG_ERROR 0x0001
  110. #define FUJLAPTOP_DBG_WARN 0x0002
  111. #define FUJLAPTOP_DBG_INFO 0x0004
  112. #define FUJLAPTOP_DBG_TRACE 0x0008
  113. #ifdef CONFIG_FUJITSU_LAPTOP_DEBUG
  114. #define vdbg_printk(a_dbg_level, format, arg...) \
  115. do { if (dbg_level & a_dbg_level) \
  116. printk(FUJLAPTOP_DEBUG "%s: " format, __func__ , ## arg); \
  117. } while (0)
  118. #else
  119. #define vdbg_printk(a_dbg_level, format, arg...) \
  120. do { } while (0)
  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 == FB_BLANK_POWERDOWN)
  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. }
  461. };
  462. static void __init dmi_check_cb_common(const struct dmi_system_id *id)
  463. {
  464. pr_info("Identified laptop model '%s'\n", id->ident);
  465. if (use_alt_lcd_levels == -1) {
  466. if (acpi_has_method(NULL,
  467. "\\_SB.PCI0.LPCB.FJEX.SBL2"))
  468. use_alt_lcd_levels = 1;
  469. else
  470. use_alt_lcd_levels = 0;
  471. vdbg_printk(FUJLAPTOP_DBG_TRACE, "auto-detected usealt as "
  472. "%i\n", use_alt_lcd_levels);
  473. }
  474. }
  475. static int __init dmi_check_cb_s6410(const struct dmi_system_id *id)
  476. {
  477. dmi_check_cb_common(id);
  478. fujitsu->keycode1 = KEY_SCREENLOCK; /* "Lock" */
  479. fujitsu->keycode2 = KEY_HELP; /* "Mobility Center" */
  480. return 1;
  481. }
  482. static int __init dmi_check_cb_s6420(const struct dmi_system_id *id)
  483. {
  484. dmi_check_cb_common(id);
  485. fujitsu->keycode1 = KEY_SCREENLOCK; /* "Lock" */
  486. fujitsu->keycode2 = KEY_HELP; /* "Mobility Center" */
  487. return 1;
  488. }
  489. static int __init dmi_check_cb_p8010(const struct dmi_system_id *id)
  490. {
  491. dmi_check_cb_common(id);
  492. fujitsu->keycode1 = KEY_HELP; /* "Support" */
  493. fujitsu->keycode3 = KEY_SWITCHVIDEOMODE; /* "Presentation" */
  494. fujitsu->keycode4 = KEY_WWW; /* "Internet" */
  495. return 1;
  496. }
  497. static const struct dmi_system_id fujitsu_dmi_table[] __initconst = {
  498. {
  499. .ident = "Fujitsu Siemens S6410",
  500. .matches = {
  501. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  502. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK S6410"),
  503. },
  504. .callback = dmi_check_cb_s6410},
  505. {
  506. .ident = "Fujitsu Siemens S6420",
  507. .matches = {
  508. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  509. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK S6420"),
  510. },
  511. .callback = dmi_check_cb_s6420},
  512. {
  513. .ident = "Fujitsu LifeBook P8010",
  514. .matches = {
  515. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  516. DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P8010"),
  517. },
  518. .callback = dmi_check_cb_p8010},
  519. {}
  520. };
  521. /* ACPI device for LCD brightness control */
  522. static int acpi_fujitsu_add(struct acpi_device *device)
  523. {
  524. int state = 0;
  525. struct input_dev *input;
  526. int error;
  527. if (!device)
  528. return -EINVAL;
  529. fujitsu->acpi_handle = device->handle;
  530. sprintf(acpi_device_name(device), "%s", ACPI_FUJITSU_DEVICE_NAME);
  531. sprintf(acpi_device_class(device), "%s", ACPI_FUJITSU_CLASS);
  532. device->driver_data = fujitsu;
  533. fujitsu->input = input = input_allocate_device();
  534. if (!input) {
  535. error = -ENOMEM;
  536. goto err_stop;
  537. }
  538. snprintf(fujitsu->phys, sizeof(fujitsu->phys),
  539. "%s/video/input0", acpi_device_hid(device));
  540. input->name = acpi_device_name(device);
  541. input->phys = fujitsu->phys;
  542. input->id.bustype = BUS_HOST;
  543. input->id.product = 0x06;
  544. input->dev.parent = &device->dev;
  545. input->evbit[0] = BIT(EV_KEY);
  546. set_bit(KEY_BRIGHTNESSUP, input->keybit);
  547. set_bit(KEY_BRIGHTNESSDOWN, input->keybit);
  548. set_bit(KEY_UNKNOWN, input->keybit);
  549. error = input_register_device(input);
  550. if (error)
  551. goto err_free_input_dev;
  552. error = acpi_bus_update_power(fujitsu->acpi_handle, &state);
  553. if (error) {
  554. pr_err("Error reading power state\n");
  555. goto err_unregister_input_dev;
  556. }
  557. pr_info("ACPI: %s [%s] (%s)\n",
  558. acpi_device_name(device), acpi_device_bid(device),
  559. !device->power.state ? "on" : "off");
  560. fujitsu->dev = device;
  561. if (acpi_has_method(device->handle, METHOD_NAME__INI)) {
  562. vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n");
  563. if (ACPI_FAILURE
  564. (acpi_evaluate_object
  565. (device->handle, METHOD_NAME__INI, NULL, NULL)))
  566. pr_err("_INI Method failed\n");
  567. }
  568. /* do config (detect defaults) */
  569. use_alt_lcd_levels = use_alt_lcd_levels == 1 ? 1 : 0;
  570. disable_brightness_adjust = disable_brightness_adjust == 1 ? 1 : 0;
  571. vdbg_printk(FUJLAPTOP_DBG_INFO,
  572. "config: [alt interface: %d], [adjust disable: %d]\n",
  573. use_alt_lcd_levels, disable_brightness_adjust);
  574. if (get_max_brightness() <= 0)
  575. fujitsu->max_brightness = FUJITSU_LCD_N_LEVELS;
  576. get_lcd_level();
  577. return 0;
  578. err_unregister_input_dev:
  579. input_unregister_device(input);
  580. input = NULL;
  581. err_free_input_dev:
  582. input_free_device(input);
  583. err_stop:
  584. return error;
  585. }
  586. static int acpi_fujitsu_remove(struct acpi_device *device)
  587. {
  588. struct fujitsu_t *fujitsu = acpi_driver_data(device);
  589. struct input_dev *input = fujitsu->input;
  590. input_unregister_device(input);
  591. fujitsu->acpi_handle = NULL;
  592. return 0;
  593. }
  594. /* Brightness notify */
  595. static void acpi_fujitsu_notify(struct acpi_device *device, u32 event)
  596. {
  597. struct input_dev *input;
  598. int keycode;
  599. int oldb, newb;
  600. input = fujitsu->input;
  601. switch (event) {
  602. case ACPI_FUJITSU_NOTIFY_CODE1:
  603. keycode = 0;
  604. oldb = fujitsu->brightness_level;
  605. get_lcd_level();
  606. newb = fujitsu->brightness_level;
  607. vdbg_printk(FUJLAPTOP_DBG_TRACE,
  608. "brightness button event [%i -> %i (%i)]\n",
  609. oldb, newb, fujitsu->brightness_changed);
  610. if (oldb < newb) {
  611. if (disable_brightness_adjust != 1) {
  612. if (use_alt_lcd_levels)
  613. set_lcd_level_alt(newb);
  614. else
  615. set_lcd_level(newb);
  616. }
  617. keycode = KEY_BRIGHTNESSUP;
  618. } else if (oldb > newb) {
  619. if (disable_brightness_adjust != 1) {
  620. if (use_alt_lcd_levels)
  621. set_lcd_level_alt(newb);
  622. else
  623. set_lcd_level(newb);
  624. }
  625. keycode = KEY_BRIGHTNESSDOWN;
  626. }
  627. break;
  628. default:
  629. keycode = KEY_UNKNOWN;
  630. vdbg_printk(FUJLAPTOP_DBG_WARN,
  631. "unsupported event [0x%x]\n", event);
  632. break;
  633. }
  634. if (keycode != 0) {
  635. input_report_key(input, keycode, 1);
  636. input_sync(input);
  637. input_report_key(input, keycode, 0);
  638. input_sync(input);
  639. }
  640. }
  641. /* ACPI device for hotkey handling */
  642. static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
  643. {
  644. int result = 0;
  645. int state = 0;
  646. struct input_dev *input;
  647. int error;
  648. int i;
  649. if (!device)
  650. return -EINVAL;
  651. fujitsu_hotkey->acpi_handle = device->handle;
  652. sprintf(acpi_device_name(device), "%s",
  653. ACPI_FUJITSU_HOTKEY_DEVICE_NAME);
  654. sprintf(acpi_device_class(device), "%s", ACPI_FUJITSU_CLASS);
  655. device->driver_data = fujitsu_hotkey;
  656. /* kfifo */
  657. spin_lock_init(&fujitsu_hotkey->fifo_lock);
  658. error = kfifo_alloc(&fujitsu_hotkey->fifo, RINGBUFFERSIZE * sizeof(int),
  659. GFP_KERNEL);
  660. if (error) {
  661. pr_err("kfifo_alloc failed\n");
  662. goto err_stop;
  663. }
  664. fujitsu_hotkey->input = input = input_allocate_device();
  665. if (!input) {
  666. error = -ENOMEM;
  667. goto err_free_fifo;
  668. }
  669. snprintf(fujitsu_hotkey->phys, sizeof(fujitsu_hotkey->phys),
  670. "%s/video/input0", acpi_device_hid(device));
  671. input->name = acpi_device_name(device);
  672. input->phys = fujitsu_hotkey->phys;
  673. input->id.bustype = BUS_HOST;
  674. input->id.product = 0x06;
  675. input->dev.parent = &device->dev;
  676. set_bit(EV_KEY, input->evbit);
  677. set_bit(fujitsu->keycode1, input->keybit);
  678. set_bit(fujitsu->keycode2, input->keybit);
  679. set_bit(fujitsu->keycode3, input->keybit);
  680. set_bit(fujitsu->keycode4, input->keybit);
  681. set_bit(KEY_UNKNOWN, input->keybit);
  682. error = input_register_device(input);
  683. if (error)
  684. goto err_free_input_dev;
  685. error = acpi_bus_update_power(fujitsu_hotkey->acpi_handle, &state);
  686. if (error) {
  687. pr_err("Error reading power state\n");
  688. goto err_unregister_input_dev;
  689. }
  690. pr_info("ACPI: %s [%s] (%s)\n",
  691. acpi_device_name(device), acpi_device_bid(device),
  692. !device->power.state ? "on" : "off");
  693. fujitsu_hotkey->dev = device;
  694. if (acpi_has_method(device->handle, METHOD_NAME__INI)) {
  695. vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n");
  696. if (ACPI_FAILURE
  697. (acpi_evaluate_object
  698. (device->handle, METHOD_NAME__INI, NULL, NULL)))
  699. pr_err("_INI Method failed\n");
  700. }
  701. i = 0;
  702. while (call_fext_func(FUNC_BUTTONS, 0x1, 0x0, 0x0) != 0
  703. && (i++) < MAX_HOTKEY_RINGBUFFER_SIZE)
  704. ; /* No action, result is discarded */
  705. vdbg_printk(FUJLAPTOP_DBG_INFO, "Discarded %i ringbuffer entries\n", i);
  706. fujitsu_hotkey->rfkill_supported =
  707. call_fext_func(FUNC_RFKILL, 0x0, 0x0, 0x0);
  708. /* Make sure our bitmask of supported functions is cleared if the
  709. RFKILL function block is not implemented, like on the S7020. */
  710. if (fujitsu_hotkey->rfkill_supported == UNSUPPORTED_CMD)
  711. fujitsu_hotkey->rfkill_supported = 0;
  712. if (fujitsu_hotkey->rfkill_supported)
  713. fujitsu_hotkey->rfkill_state =
  714. call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0);
  715. /* Suspect this is a keymap of the application panel, print it */
  716. pr_info("BTNI: [0x%x]\n", call_fext_func(FUNC_BUTTONS, 0x0, 0x0, 0x0));
  717. #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
  718. if (call_fext_func(FUNC_LEDS, 0x0, 0x0, 0x0) & LOGOLAMP_POWERON) {
  719. result = led_classdev_register(&fujitsu->pf_device->dev,
  720. &logolamp_led);
  721. if (result == 0) {
  722. fujitsu_hotkey->logolamp_registered = 1;
  723. } else {
  724. pr_err("Could not register LED handler for logo lamp, error %i\n",
  725. result);
  726. }
  727. }
  728. if ((call_fext_func(FUNC_LEDS, 0x0, 0x0, 0x0) & KEYBOARD_LAMPS) &&
  729. (call_fext_func(FUNC_BUTTONS, 0x0, 0x0, 0x0) == 0x0)) {
  730. result = led_classdev_register(&fujitsu->pf_device->dev,
  731. &kblamps_led);
  732. if (result == 0) {
  733. fujitsu_hotkey->kblamps_registered = 1;
  734. } else {
  735. pr_err("Could not register LED handler for keyboard lamps, error %i\n",
  736. result);
  737. }
  738. }
  739. #endif
  740. return result;
  741. err_unregister_input_dev:
  742. input_unregister_device(input);
  743. input = NULL;
  744. err_free_input_dev:
  745. input_free_device(input);
  746. err_free_fifo:
  747. kfifo_free(&fujitsu_hotkey->fifo);
  748. err_stop:
  749. return error;
  750. }
  751. static int acpi_fujitsu_hotkey_remove(struct acpi_device *device)
  752. {
  753. struct fujitsu_hotkey_t *fujitsu_hotkey = acpi_driver_data(device);
  754. struct input_dev *input = fujitsu_hotkey->input;
  755. #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
  756. if (fujitsu_hotkey->logolamp_registered)
  757. led_classdev_unregister(&logolamp_led);
  758. if (fujitsu_hotkey->kblamps_registered)
  759. led_classdev_unregister(&kblamps_led);
  760. #endif
  761. input_unregister_device(input);
  762. kfifo_free(&fujitsu_hotkey->fifo);
  763. fujitsu_hotkey->acpi_handle = NULL;
  764. return 0;
  765. }
  766. static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event)
  767. {
  768. struct input_dev *input;
  769. int keycode, keycode_r;
  770. unsigned int irb = 1;
  771. int i, status;
  772. input = fujitsu_hotkey->input;
  773. if (fujitsu_hotkey->rfkill_supported)
  774. fujitsu_hotkey->rfkill_state =
  775. call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0);
  776. switch (event) {
  777. case ACPI_FUJITSU_NOTIFY_CODE1:
  778. i = 0;
  779. while ((irb =
  780. call_fext_func(FUNC_BUTTONS, 0x1, 0x0, 0x0)) != 0
  781. && (i++) < MAX_HOTKEY_RINGBUFFER_SIZE) {
  782. switch (irb & 0x4ff) {
  783. case KEY1_CODE:
  784. keycode = fujitsu->keycode1;
  785. break;
  786. case KEY2_CODE:
  787. keycode = fujitsu->keycode2;
  788. break;
  789. case KEY3_CODE:
  790. keycode = fujitsu->keycode3;
  791. break;
  792. case KEY4_CODE:
  793. keycode = fujitsu->keycode4;
  794. break;
  795. case 0:
  796. keycode = 0;
  797. break;
  798. default:
  799. vdbg_printk(FUJLAPTOP_DBG_WARN,
  800. "Unknown GIRB result [%x]\n", irb);
  801. keycode = -1;
  802. break;
  803. }
  804. if (keycode > 0) {
  805. vdbg_printk(FUJLAPTOP_DBG_TRACE,
  806. "Push keycode into ringbuffer [%d]\n",
  807. keycode);
  808. status = kfifo_in_locked(&fujitsu_hotkey->fifo,
  809. (unsigned char *)&keycode,
  810. sizeof(keycode),
  811. &fujitsu_hotkey->fifo_lock);
  812. if (status != sizeof(keycode)) {
  813. vdbg_printk(FUJLAPTOP_DBG_WARN,
  814. "Could not push keycode [0x%x]\n",
  815. keycode);
  816. } else {
  817. input_report_key(input, keycode, 1);
  818. input_sync(input);
  819. }
  820. } else if (keycode == 0) {
  821. while ((status =
  822. kfifo_out_locked(
  823. &fujitsu_hotkey->fifo,
  824. (unsigned char *) &keycode_r,
  825. sizeof(keycode_r),
  826. &fujitsu_hotkey->fifo_lock))
  827. == sizeof(keycode_r)) {
  828. input_report_key(input, keycode_r, 0);
  829. input_sync(input);
  830. vdbg_printk(FUJLAPTOP_DBG_TRACE,
  831. "Pop keycode from ringbuffer [%d]\n",
  832. keycode_r);
  833. }
  834. }
  835. }
  836. break;
  837. default:
  838. keycode = KEY_UNKNOWN;
  839. vdbg_printk(FUJLAPTOP_DBG_WARN,
  840. "Unsupported event [0x%x]\n", event);
  841. input_report_key(input, keycode, 1);
  842. input_sync(input);
  843. input_report_key(input, keycode, 0);
  844. input_sync(input);
  845. break;
  846. }
  847. }
  848. /* Initialization */
  849. static const struct acpi_device_id fujitsu_device_ids[] = {
  850. {ACPI_FUJITSU_HID, 0},
  851. {"", 0},
  852. };
  853. static struct acpi_driver acpi_fujitsu_driver = {
  854. .name = ACPI_FUJITSU_DRIVER_NAME,
  855. .class = ACPI_FUJITSU_CLASS,
  856. .ids = fujitsu_device_ids,
  857. .ops = {
  858. .add = acpi_fujitsu_add,
  859. .remove = acpi_fujitsu_remove,
  860. .notify = acpi_fujitsu_notify,
  861. },
  862. };
  863. static const struct acpi_device_id fujitsu_hotkey_device_ids[] = {
  864. {ACPI_FUJITSU_HOTKEY_HID, 0},
  865. {"", 0},
  866. };
  867. static struct acpi_driver acpi_fujitsu_hotkey_driver = {
  868. .name = ACPI_FUJITSU_HOTKEY_DRIVER_NAME,
  869. .class = ACPI_FUJITSU_CLASS,
  870. .ids = fujitsu_hotkey_device_ids,
  871. .ops = {
  872. .add = acpi_fujitsu_hotkey_add,
  873. .remove = acpi_fujitsu_hotkey_remove,
  874. .notify = acpi_fujitsu_hotkey_notify,
  875. },
  876. };
  877. static const struct acpi_device_id fujitsu_ids[] __used = {
  878. {ACPI_FUJITSU_HID, 0},
  879. {ACPI_FUJITSU_HOTKEY_HID, 0},
  880. {"", 0}
  881. };
  882. MODULE_DEVICE_TABLE(acpi, fujitsu_ids);
  883. static int __init fujitsu_init(void)
  884. {
  885. int ret, result, max_brightness;
  886. if (acpi_disabled)
  887. return -ENODEV;
  888. fujitsu = kzalloc(sizeof(struct fujitsu_t), GFP_KERNEL);
  889. if (!fujitsu)
  890. return -ENOMEM;
  891. fujitsu->keycode1 = KEY_PROG1;
  892. fujitsu->keycode2 = KEY_PROG2;
  893. fujitsu->keycode3 = KEY_PROG3;
  894. fujitsu->keycode4 = KEY_PROG4;
  895. dmi_check_system(fujitsu_dmi_table);
  896. result = acpi_bus_register_driver(&acpi_fujitsu_driver);
  897. if (result < 0) {
  898. ret = -ENODEV;
  899. goto fail_acpi;
  900. }
  901. /* Register platform stuff */
  902. fujitsu->pf_device = platform_device_alloc("fujitsu-laptop", -1);
  903. if (!fujitsu->pf_device) {
  904. ret = -ENOMEM;
  905. goto fail_platform_driver;
  906. }
  907. ret = platform_device_add(fujitsu->pf_device);
  908. if (ret)
  909. goto fail_platform_device1;
  910. ret =
  911. sysfs_create_group(&fujitsu->pf_device->dev.kobj,
  912. &fujitsupf_attribute_group);
  913. if (ret)
  914. goto fail_platform_device2;
  915. /* Register backlight stuff */
  916. if (acpi_video_get_backlight_type() == acpi_backlight_vendor) {
  917. struct backlight_properties props;
  918. memset(&props, 0, sizeof(struct backlight_properties));
  919. max_brightness = fujitsu->max_brightness;
  920. props.type = BACKLIGHT_PLATFORM;
  921. props.max_brightness = max_brightness - 1;
  922. fujitsu->bl_device = backlight_device_register("fujitsu-laptop",
  923. NULL, NULL,
  924. &fujitsubl_ops,
  925. &props);
  926. if (IS_ERR(fujitsu->bl_device)) {
  927. ret = PTR_ERR(fujitsu->bl_device);
  928. fujitsu->bl_device = NULL;
  929. goto fail_sysfs_group;
  930. }
  931. fujitsu->bl_device->props.brightness = fujitsu->brightness_level;
  932. }
  933. ret = platform_driver_register(&fujitsupf_driver);
  934. if (ret)
  935. goto fail_backlight;
  936. /* Register hotkey driver */
  937. fujitsu_hotkey = kzalloc(sizeof(struct fujitsu_hotkey_t), GFP_KERNEL);
  938. if (!fujitsu_hotkey) {
  939. ret = -ENOMEM;
  940. goto fail_hotkey;
  941. }
  942. result = acpi_bus_register_driver(&acpi_fujitsu_hotkey_driver);
  943. if (result < 0) {
  944. ret = -ENODEV;
  945. goto fail_hotkey1;
  946. }
  947. /* Sync backlight power status (needs FUJ02E3 device, hence deferred) */
  948. if (acpi_video_get_backlight_type() == acpi_backlight_vendor) {
  949. if (call_fext_func(FUNC_BACKLIGHT, 0x2, 0x4, 0x0) == 3)
  950. fujitsu->bl_device->props.power = FB_BLANK_POWERDOWN;
  951. else
  952. fujitsu->bl_device->props.power = FB_BLANK_UNBLANK;
  953. }
  954. pr_info("driver " FUJITSU_DRIVER_VERSION " successfully loaded\n");
  955. return 0;
  956. fail_hotkey1:
  957. kfree(fujitsu_hotkey);
  958. fail_hotkey:
  959. platform_driver_unregister(&fujitsupf_driver);
  960. fail_backlight:
  961. backlight_device_unregister(fujitsu->bl_device);
  962. fail_sysfs_group:
  963. sysfs_remove_group(&fujitsu->pf_device->dev.kobj,
  964. &fujitsupf_attribute_group);
  965. fail_platform_device2:
  966. platform_device_del(fujitsu->pf_device);
  967. fail_platform_device1:
  968. platform_device_put(fujitsu->pf_device);
  969. fail_platform_driver:
  970. acpi_bus_unregister_driver(&acpi_fujitsu_driver);
  971. fail_acpi:
  972. kfree(fujitsu);
  973. return ret;
  974. }
  975. static void __exit fujitsu_cleanup(void)
  976. {
  977. acpi_bus_unregister_driver(&acpi_fujitsu_hotkey_driver);
  978. kfree(fujitsu_hotkey);
  979. platform_driver_unregister(&fujitsupf_driver);
  980. backlight_device_unregister(fujitsu->bl_device);
  981. sysfs_remove_group(&fujitsu->pf_device->dev.kobj,
  982. &fujitsupf_attribute_group);
  983. platform_device_unregister(fujitsu->pf_device);
  984. acpi_bus_unregister_driver(&acpi_fujitsu_driver);
  985. kfree(fujitsu);
  986. pr_info("driver unloaded\n");
  987. }
  988. module_init(fujitsu_init);
  989. module_exit(fujitsu_cleanup);
  990. module_param(use_alt_lcd_levels, uint, 0644);
  991. MODULE_PARM_DESC(use_alt_lcd_levels,
  992. "Use alternative interface for lcd_levels (needed for Lifebook s6410).");
  993. module_param(disable_brightness_adjust, uint, 0644);
  994. MODULE_PARM_DESC(disable_brightness_adjust, "Disable brightness adjustment .");
  995. #ifdef CONFIG_FUJITSU_LAPTOP_DEBUG
  996. module_param_named(debug, dbg_level, uint, 0644);
  997. MODULE_PARM_DESC(debug, "Sets debug level bit-mask");
  998. #endif
  999. MODULE_AUTHOR("Jonathan Woithe, Peter Gruber, Tony Vroon");
  1000. MODULE_DESCRIPTION("Fujitsu laptop extras support");
  1001. MODULE_VERSION(FUJITSU_DRIVER_VERSION);
  1002. MODULE_LICENSE("GPL");
  1003. MODULE_ALIAS("dmi:*:svnFUJITSUSIEMENS:*:pvr:rvnFUJITSU:rnFJNB1D3:*:cvrS6410:*");
  1004. MODULE_ALIAS("dmi:*:svnFUJITSUSIEMENS:*:pvr:rvnFUJITSU:rnFJNB1E6:*:cvrS6420:*");
  1005. MODULE_ALIAS("dmi:*:svnFUJITSU:*:pvr:rvnFUJITSU:rnFJNB19C:*:cvrS7020:*");