fujitsu-laptop.c 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220
  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. #define dbg_printk(a_dbg_level, format, arg...) \
  112. do { if (dbg_level & a_dbg_level) \
  113. printk(FUJLAPTOP_DEBUG "%s: " format, __func__ , ## arg); \
  114. } while (0)
  115. #ifdef CONFIG_FUJITSU_LAPTOP_DEBUG
  116. #define vdbg_printk(a_dbg_level, format, arg...) \
  117. dbg_printk(a_dbg_level, format, ## arg)
  118. #else
  119. #define vdbg_printk(a_dbg_level, format, arg...)
  120. #endif
  121. /* Device controlling the backlight and associated keys */
  122. struct fujitsu_t {
  123. acpi_handle acpi_handle;
  124. struct acpi_device *dev;
  125. struct input_dev *input;
  126. char phys[32];
  127. struct backlight_device *bl_device;
  128. struct platform_device *pf_device;
  129. int keycode1, keycode2, keycode3, keycode4;
  130. unsigned int max_brightness;
  131. unsigned int brightness_changed;
  132. unsigned int brightness_level;
  133. };
  134. static struct fujitsu_t *fujitsu;
  135. static int use_alt_lcd_levels = -1;
  136. static int disable_brightness_adjust = -1;
  137. /* Device used to access other hotkeys on the laptop */
  138. struct fujitsu_hotkey_t {
  139. acpi_handle acpi_handle;
  140. struct acpi_device *dev;
  141. struct input_dev *input;
  142. char phys[32];
  143. struct platform_device *pf_device;
  144. struct kfifo fifo;
  145. spinlock_t fifo_lock;
  146. int rfkill_supported;
  147. int rfkill_state;
  148. int logolamp_registered;
  149. int kblamps_registered;
  150. };
  151. static struct fujitsu_hotkey_t *fujitsu_hotkey;
  152. static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event);
  153. #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
  154. static enum led_brightness logolamp_get(struct led_classdev *cdev);
  155. static void logolamp_set(struct led_classdev *cdev,
  156. enum led_brightness brightness);
  157. static struct led_classdev logolamp_led = {
  158. .name = "fujitsu::logolamp",
  159. .brightness_get = logolamp_get,
  160. .brightness_set = logolamp_set
  161. };
  162. static enum led_brightness kblamps_get(struct led_classdev *cdev);
  163. static void kblamps_set(struct led_classdev *cdev,
  164. enum led_brightness brightness);
  165. static struct led_classdev kblamps_led = {
  166. .name = "fujitsu::kblamps",
  167. .brightness_get = kblamps_get,
  168. .brightness_set = kblamps_set
  169. };
  170. #endif
  171. #ifdef CONFIG_FUJITSU_LAPTOP_DEBUG
  172. static u32 dbg_level = 0x03;
  173. #endif
  174. static void acpi_fujitsu_notify(struct acpi_device *device, u32 event);
  175. /* Fujitsu ACPI interface function */
  176. static int call_fext_func(int cmd, int arg0, int arg1, int arg2)
  177. {
  178. acpi_status status = AE_OK;
  179. union acpi_object params[4] = {
  180. { .type = ACPI_TYPE_INTEGER },
  181. { .type = ACPI_TYPE_INTEGER },
  182. { .type = ACPI_TYPE_INTEGER },
  183. { .type = ACPI_TYPE_INTEGER }
  184. };
  185. struct acpi_object_list arg_list = { 4, &params[0] };
  186. unsigned long long value;
  187. acpi_handle handle = NULL;
  188. status = acpi_get_handle(fujitsu_hotkey->acpi_handle, "FUNC", &handle);
  189. if (ACPI_FAILURE(status)) {
  190. vdbg_printk(FUJLAPTOP_DBG_ERROR,
  191. "FUNC interface is not present\n");
  192. return -ENODEV;
  193. }
  194. params[0].integer.value = cmd;
  195. params[1].integer.value = arg0;
  196. params[2].integer.value = arg1;
  197. params[3].integer.value = arg2;
  198. status = acpi_evaluate_integer(handle, NULL, &arg_list, &value);
  199. if (ACPI_FAILURE(status)) {
  200. vdbg_printk(FUJLAPTOP_DBG_WARN,
  201. "FUNC 0x%x (args 0x%x, 0x%x, 0x%x) call failed\n",
  202. cmd, arg0, arg1, arg2);
  203. return -ENODEV;
  204. }
  205. vdbg_printk(FUJLAPTOP_DBG_TRACE,
  206. "FUNC 0x%x (args 0x%x, 0x%x, 0x%x) returned 0x%x\n",
  207. cmd, arg0, arg1, arg2, (int)value);
  208. return value;
  209. }
  210. #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
  211. /* LED class callbacks */
  212. static void logolamp_set(struct led_classdev *cdev,
  213. enum led_brightness brightness)
  214. {
  215. if (brightness >= LED_FULL) {
  216. call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_POWERON, FUNC_LED_ON);
  217. call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_ALWAYS, FUNC_LED_ON);
  218. } else if (brightness >= LED_HALF) {
  219. call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_POWERON, FUNC_LED_ON);
  220. call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_ALWAYS, FUNC_LED_OFF);
  221. } else {
  222. call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_POWERON, FUNC_LED_OFF);
  223. }
  224. }
  225. static void kblamps_set(struct led_classdev *cdev,
  226. enum led_brightness brightness)
  227. {
  228. if (brightness >= LED_FULL)
  229. call_fext_func(FUNC_LEDS, 0x1, KEYBOARD_LAMPS, FUNC_LED_ON);
  230. else
  231. call_fext_func(FUNC_LEDS, 0x1, KEYBOARD_LAMPS, FUNC_LED_OFF);
  232. }
  233. static enum led_brightness logolamp_get(struct led_classdev *cdev)
  234. {
  235. enum led_brightness brightness = LED_OFF;
  236. int poweron, always;
  237. poweron = call_fext_func(FUNC_LEDS, 0x2, LOGOLAMP_POWERON, 0x0);
  238. if (poweron == FUNC_LED_ON) {
  239. brightness = LED_HALF;
  240. always = call_fext_func(FUNC_LEDS, 0x2, LOGOLAMP_ALWAYS, 0x0);
  241. if (always == FUNC_LED_ON)
  242. brightness = LED_FULL;
  243. }
  244. return brightness;
  245. }
  246. static enum led_brightness kblamps_get(struct led_classdev *cdev)
  247. {
  248. enum led_brightness brightness = LED_OFF;
  249. if (call_fext_func(FUNC_LEDS, 0x2, KEYBOARD_LAMPS, 0x0) == FUNC_LED_ON)
  250. brightness = LED_FULL;
  251. return brightness;
  252. }
  253. #endif
  254. /* Hardware access for LCD brightness control */
  255. static int set_lcd_level(int level)
  256. {
  257. acpi_status status = AE_OK;
  258. acpi_handle handle = NULL;
  259. vdbg_printk(FUJLAPTOP_DBG_TRACE, "set lcd level via SBLL [%d]\n",
  260. level);
  261. if (level < 0 || level >= fujitsu->max_brightness)
  262. return -EINVAL;
  263. status = acpi_get_handle(fujitsu->acpi_handle, "SBLL", &handle);
  264. if (ACPI_FAILURE(status)) {
  265. vdbg_printk(FUJLAPTOP_DBG_ERROR, "SBLL not present\n");
  266. return -ENODEV;
  267. }
  268. status = acpi_execute_simple_method(handle, NULL, level);
  269. if (ACPI_FAILURE(status))
  270. return -ENODEV;
  271. return 0;
  272. }
  273. static int set_lcd_level_alt(int level)
  274. {
  275. acpi_status status = AE_OK;
  276. acpi_handle handle = NULL;
  277. vdbg_printk(FUJLAPTOP_DBG_TRACE, "set lcd level via SBL2 [%d]\n",
  278. level);
  279. if (level < 0 || level >= fujitsu->max_brightness)
  280. return -EINVAL;
  281. status = acpi_get_handle(fujitsu->acpi_handle, "SBL2", &handle);
  282. if (ACPI_FAILURE(status)) {
  283. vdbg_printk(FUJLAPTOP_DBG_ERROR, "SBL2 not present\n");
  284. return -ENODEV;
  285. }
  286. status = acpi_execute_simple_method(handle, NULL, level);
  287. if (ACPI_FAILURE(status))
  288. return -ENODEV;
  289. return 0;
  290. }
  291. static int get_lcd_level(void)
  292. {
  293. unsigned long long state = 0;
  294. acpi_status status = AE_OK;
  295. vdbg_printk(FUJLAPTOP_DBG_TRACE, "get lcd level via GBLL\n");
  296. status =
  297. acpi_evaluate_integer(fujitsu->acpi_handle, "GBLL", NULL, &state);
  298. if (ACPI_FAILURE(status))
  299. return 0;
  300. fujitsu->brightness_level = state & 0x0fffffff;
  301. if (state & 0x80000000)
  302. fujitsu->brightness_changed = 1;
  303. else
  304. fujitsu->brightness_changed = 0;
  305. return fujitsu->brightness_level;
  306. }
  307. static int get_max_brightness(void)
  308. {
  309. unsigned long long state = 0;
  310. acpi_status status = AE_OK;
  311. vdbg_printk(FUJLAPTOP_DBG_TRACE, "get max lcd level via RBLL\n");
  312. status =
  313. acpi_evaluate_integer(fujitsu->acpi_handle, "RBLL", NULL, &state);
  314. if (ACPI_FAILURE(status))
  315. return -1;
  316. fujitsu->max_brightness = state;
  317. return fujitsu->max_brightness;
  318. }
  319. /* Backlight device stuff */
  320. static int bl_get_brightness(struct backlight_device *b)
  321. {
  322. return get_lcd_level();
  323. }
  324. static int bl_update_status(struct backlight_device *b)
  325. {
  326. int ret;
  327. if (b->props.power == 4)
  328. ret = call_fext_func(FUNC_BACKLIGHT, 0x1, 0x4, 0x3);
  329. else
  330. ret = call_fext_func(FUNC_BACKLIGHT, 0x1, 0x4, 0x0);
  331. if (ret != 0)
  332. vdbg_printk(FUJLAPTOP_DBG_ERROR,
  333. "Unable to adjust backlight power, error code %i\n",
  334. ret);
  335. if (use_alt_lcd_levels)
  336. ret = set_lcd_level_alt(b->props.brightness);
  337. else
  338. ret = set_lcd_level(b->props.brightness);
  339. if (ret != 0)
  340. vdbg_printk(FUJLAPTOP_DBG_ERROR,
  341. "Unable to adjust LCD brightness, error code %i\n",
  342. ret);
  343. return ret;
  344. }
  345. static const struct backlight_ops fujitsubl_ops = {
  346. .get_brightness = bl_get_brightness,
  347. .update_status = bl_update_status,
  348. };
  349. /* Platform LCD brightness device */
  350. static ssize_t
  351. show_max_brightness(struct device *dev,
  352. struct device_attribute *attr, char *buf)
  353. {
  354. int ret;
  355. ret = get_max_brightness();
  356. if (ret < 0)
  357. return ret;
  358. return sprintf(buf, "%i\n", ret);
  359. }
  360. static ssize_t
  361. show_brightness_changed(struct device *dev,
  362. struct device_attribute *attr, char *buf)
  363. {
  364. int ret;
  365. ret = fujitsu->brightness_changed;
  366. if (ret < 0)
  367. return ret;
  368. return sprintf(buf, "%i\n", ret);
  369. }
  370. static ssize_t show_lcd_level(struct device *dev,
  371. struct device_attribute *attr, char *buf)
  372. {
  373. int ret;
  374. ret = get_lcd_level();
  375. if (ret < 0)
  376. return ret;
  377. return sprintf(buf, "%i\n", ret);
  378. }
  379. static ssize_t store_lcd_level(struct device *dev,
  380. struct device_attribute *attr, const char *buf,
  381. size_t count)
  382. {
  383. int level, ret;
  384. if (sscanf(buf, "%i", &level) != 1
  385. || (level < 0 || level >= fujitsu->max_brightness))
  386. return -EINVAL;
  387. if (use_alt_lcd_levels)
  388. ret = set_lcd_level_alt(level);
  389. else
  390. ret = set_lcd_level(level);
  391. if (ret < 0)
  392. return ret;
  393. ret = get_lcd_level();
  394. if (ret < 0)
  395. return ret;
  396. return count;
  397. }
  398. static ssize_t
  399. ignore_store(struct device *dev,
  400. struct device_attribute *attr, const char *buf, size_t count)
  401. {
  402. return count;
  403. }
  404. static ssize_t
  405. show_lid_state(struct device *dev,
  406. struct device_attribute *attr, char *buf)
  407. {
  408. if (!(fujitsu_hotkey->rfkill_supported & 0x100))
  409. return sprintf(buf, "unknown\n");
  410. if (fujitsu_hotkey->rfkill_state & 0x100)
  411. return sprintf(buf, "open\n");
  412. else
  413. return sprintf(buf, "closed\n");
  414. }
  415. static ssize_t
  416. show_dock_state(struct device *dev,
  417. struct device_attribute *attr, char *buf)
  418. {
  419. if (!(fujitsu_hotkey->rfkill_supported & 0x200))
  420. return sprintf(buf, "unknown\n");
  421. if (fujitsu_hotkey->rfkill_state & 0x200)
  422. return sprintf(buf, "docked\n");
  423. else
  424. return sprintf(buf, "undocked\n");
  425. }
  426. static ssize_t
  427. show_radios_state(struct device *dev,
  428. struct device_attribute *attr, char *buf)
  429. {
  430. if (!(fujitsu_hotkey->rfkill_supported & 0x20))
  431. return sprintf(buf, "unknown\n");
  432. if (fujitsu_hotkey->rfkill_state & 0x20)
  433. return sprintf(buf, "on\n");
  434. else
  435. return sprintf(buf, "killed\n");
  436. }
  437. static DEVICE_ATTR(max_brightness, 0444, show_max_brightness, ignore_store);
  438. static DEVICE_ATTR(brightness_changed, 0444, show_brightness_changed,
  439. ignore_store);
  440. static DEVICE_ATTR(lcd_level, 0644, show_lcd_level, store_lcd_level);
  441. static DEVICE_ATTR(lid, 0444, show_lid_state, ignore_store);
  442. static DEVICE_ATTR(dock, 0444, show_dock_state, ignore_store);
  443. static DEVICE_ATTR(radios, 0444, show_radios_state, ignore_store);
  444. static struct attribute *fujitsupf_attributes[] = {
  445. &dev_attr_brightness_changed.attr,
  446. &dev_attr_max_brightness.attr,
  447. &dev_attr_lcd_level.attr,
  448. &dev_attr_lid.attr,
  449. &dev_attr_dock.attr,
  450. &dev_attr_radios.attr,
  451. NULL
  452. };
  453. static struct attribute_group fujitsupf_attribute_group = {
  454. .attrs = fujitsupf_attributes
  455. };
  456. static struct platform_driver fujitsupf_driver = {
  457. .driver = {
  458. .name = "fujitsu-laptop",
  459. .owner = THIS_MODULE,
  460. }
  461. };
  462. static void 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 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 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 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 struct dmi_system_id fujitsu_dmi_table[] = {
  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 int __init fujitsu_init(void)
  878. {
  879. int ret, result, max_brightness;
  880. if (acpi_disabled)
  881. return -ENODEV;
  882. fujitsu = kzalloc(sizeof(struct fujitsu_t), GFP_KERNEL);
  883. if (!fujitsu)
  884. return -ENOMEM;
  885. fujitsu->keycode1 = KEY_PROG1;
  886. fujitsu->keycode2 = KEY_PROG2;
  887. fujitsu->keycode3 = KEY_PROG3;
  888. fujitsu->keycode4 = KEY_PROG4;
  889. dmi_check_system(fujitsu_dmi_table);
  890. result = acpi_bus_register_driver(&acpi_fujitsu_driver);
  891. if (result < 0) {
  892. ret = -ENODEV;
  893. goto fail_acpi;
  894. }
  895. /* Register platform stuff */
  896. fujitsu->pf_device = platform_device_alloc("fujitsu-laptop", -1);
  897. if (!fujitsu->pf_device) {
  898. ret = -ENOMEM;
  899. goto fail_platform_driver;
  900. }
  901. ret = platform_device_add(fujitsu->pf_device);
  902. if (ret)
  903. goto fail_platform_device1;
  904. ret =
  905. sysfs_create_group(&fujitsu->pf_device->dev.kobj,
  906. &fujitsupf_attribute_group);
  907. if (ret)
  908. goto fail_platform_device2;
  909. /* Register backlight stuff */
  910. if (!acpi_video_backlight_support()) {
  911. struct backlight_properties props;
  912. memset(&props, 0, sizeof(struct backlight_properties));
  913. max_brightness = fujitsu->max_brightness;
  914. props.type = BACKLIGHT_PLATFORM;
  915. props.max_brightness = max_brightness - 1;
  916. fujitsu->bl_device = backlight_device_register("fujitsu-laptop",
  917. NULL, NULL,
  918. &fujitsubl_ops,
  919. &props);
  920. if (IS_ERR(fujitsu->bl_device)) {
  921. ret = PTR_ERR(fujitsu->bl_device);
  922. fujitsu->bl_device = NULL;
  923. goto fail_sysfs_group;
  924. }
  925. fujitsu->bl_device->props.brightness = fujitsu->brightness_level;
  926. }
  927. ret = platform_driver_register(&fujitsupf_driver);
  928. if (ret)
  929. goto fail_backlight;
  930. /* Register hotkey driver */
  931. fujitsu_hotkey = kzalloc(sizeof(struct fujitsu_hotkey_t), GFP_KERNEL);
  932. if (!fujitsu_hotkey) {
  933. ret = -ENOMEM;
  934. goto fail_hotkey;
  935. }
  936. result = acpi_bus_register_driver(&acpi_fujitsu_hotkey_driver);
  937. if (result < 0) {
  938. ret = -ENODEV;
  939. goto fail_hotkey1;
  940. }
  941. /* Sync backlight power status (needs FUJ02E3 device, hence deferred) */
  942. if (!acpi_video_backlight_support()) {
  943. if (call_fext_func(FUNC_BACKLIGHT, 0x2, 0x4, 0x0) == 3)
  944. fujitsu->bl_device->props.power = 4;
  945. else
  946. fujitsu->bl_device->props.power = 0;
  947. }
  948. pr_info("driver " FUJITSU_DRIVER_VERSION " successfully loaded\n");
  949. return 0;
  950. fail_hotkey1:
  951. kfree(fujitsu_hotkey);
  952. fail_hotkey:
  953. platform_driver_unregister(&fujitsupf_driver);
  954. fail_backlight:
  955. if (fujitsu->bl_device)
  956. backlight_device_unregister(fujitsu->bl_device);
  957. fail_sysfs_group:
  958. sysfs_remove_group(&fujitsu->pf_device->dev.kobj,
  959. &fujitsupf_attribute_group);
  960. fail_platform_device2:
  961. platform_device_del(fujitsu->pf_device);
  962. fail_platform_device1:
  963. platform_device_put(fujitsu->pf_device);
  964. fail_platform_driver:
  965. acpi_bus_unregister_driver(&acpi_fujitsu_driver);
  966. fail_acpi:
  967. kfree(fujitsu);
  968. return ret;
  969. }
  970. static void __exit fujitsu_cleanup(void)
  971. {
  972. acpi_bus_unregister_driver(&acpi_fujitsu_hotkey_driver);
  973. kfree(fujitsu_hotkey);
  974. platform_driver_unregister(&fujitsupf_driver);
  975. if (fujitsu->bl_device)
  976. backlight_device_unregister(fujitsu->bl_device);
  977. sysfs_remove_group(&fujitsu->pf_device->dev.kobj,
  978. &fujitsupf_attribute_group);
  979. platform_device_unregister(fujitsu->pf_device);
  980. acpi_bus_unregister_driver(&acpi_fujitsu_driver);
  981. kfree(fujitsu);
  982. pr_info("driver unloaded\n");
  983. }
  984. module_init(fujitsu_init);
  985. module_exit(fujitsu_cleanup);
  986. module_param(use_alt_lcd_levels, uint, 0644);
  987. MODULE_PARM_DESC(use_alt_lcd_levels,
  988. "Use alternative interface for lcd_levels (needed for Lifebook s6410).");
  989. module_param(disable_brightness_adjust, uint, 0644);
  990. MODULE_PARM_DESC(disable_brightness_adjust, "Disable brightness adjustment .");
  991. #ifdef CONFIG_FUJITSU_LAPTOP_DEBUG
  992. module_param_named(debug, dbg_level, uint, 0644);
  993. MODULE_PARM_DESC(debug, "Sets debug level bit-mask");
  994. #endif
  995. MODULE_AUTHOR("Jonathan Woithe, Peter Gruber, Tony Vroon");
  996. MODULE_DESCRIPTION("Fujitsu laptop extras support");
  997. MODULE_VERSION(FUJITSU_DRIVER_VERSION);
  998. MODULE_LICENSE("GPL");
  999. MODULE_ALIAS("dmi:*:svnFUJITSUSIEMENS:*:pvr:rvnFUJITSU:rnFJNB1D3:*:cvrS6410:*");
  1000. MODULE_ALIAS("dmi:*:svnFUJITSUSIEMENS:*:pvr:rvnFUJITSU:rnFJNB1E6:*:cvrS6420:*");
  1001. MODULE_ALIAS("dmi:*:svnFUJITSU:*:pvr:rvnFUJITSU:rnFJNB19C:*:cvrS7020:*");
  1002. static struct pnp_device_id pnp_ids[] __used = {
  1003. {.id = "FUJ02bf"},
  1004. {.id = "FUJ02B1"},
  1005. {.id = "FUJ02E3"},
  1006. {.id = ""}
  1007. };
  1008. MODULE_DEVICE_TABLE(pnp, pnp_ids);