fujitsu-laptop.c 31 KB

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