fujitsu-laptop.c 31 KB

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