[kernel] r18318 - in dists/sid/linux-2.6/debian: . patches/features/x86

Ben Hutchings benh at alioth.debian.org
Sat Nov 26 03:21:22 UTC 2011


Author: benh
Date: Sat Nov 26 03:21:20 2011
New Revision: 18318

Log:
amilo-rfkill: Use proper functions to write to the i8042 safely

Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/features/x86/x86-Add-amilo-rfkill-driver-for-some-Fujitsu-Siemens.patch

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	Fri Nov 25 00:46:02 2011	(r18317)
+++ dists/sid/linux-2.6/debian/changelog	Sat Nov 26 03:21:20 2011	(r18318)
@@ -14,6 +14,7 @@
   * Include module taint flags in bug reports
   * lirc_serial: Fix various bugs that may result in a crash, deadlock or
     other failure (Closes: #645811)
+  * amilo-rfkill: Use proper functions to write to the i8042 safely
 
  -- Ben Hutchings <ben at decadent.org.uk>  Tue, 22 Nov 2011 05:26:25 +0000
 

Modified: dists/sid/linux-2.6/debian/patches/features/x86/x86-Add-amilo-rfkill-driver-for-some-Fujitsu-Siemens.patch
==============================================================================
--- dists/sid/linux-2.6/debian/patches/features/x86/x86-Add-amilo-rfkill-driver-for-some-Fujitsu-Siemens.patch	Fri Nov 25 00:46:02 2011	(r18317)
+++ dists/sid/linux-2.6/debian/patches/features/x86/x86-Add-amilo-rfkill-driver-for-some-Fujitsu-Siemens.patch	Sat Nov 26 03:21:20 2011	(r18318)
@@ -9,15 +9,15 @@
 http://sourceforge.net/projects/fsaa1655g/
 http://sourceforge.net/projects/fsam7440/
 
-This adds DMI matching and replaces the procfs files with rfkill
-devices.
+This adds DMI matching, replaces the procfs files with rfkill devices,
+and uses the proper function to write to the i8042 safely.
 
 Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
 ---
  drivers/platform/x86/Kconfig        |    7 ++
  drivers/platform/x86/Makefile       |    1 +
- drivers/platform/x86/amilo-rfkill.c |  180 +++++++++++++++++++++++++++++++++++
- 3 files changed, 188 insertions(+), 0 deletions(-)
+ drivers/platform/x86/amilo-rfkill.c |  173 +++++++++++++++++++++++++++++++++++
+ 3 files changed, 181 insertions(+), 0 deletions(-)
  create mode 100644 drivers/platform/x86/amilo-rfkill.c
 
 diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
@@ -52,10 +52,10 @@
  obj-$(CONFIG_IDEAPAD_LAPTOP)	+= ideapad-laptop.o
 diff --git a/drivers/platform/x86/amilo-rfkill.c b/drivers/platform/x86/amilo-rfkill.c
 new file mode 100644
-index 0000000..028d3ec
+index 0000000..19170bb
 --- /dev/null
 +++ b/drivers/platform/x86/amilo-rfkill.c
-@@ -0,0 +1,180 @@
+@@ -0,0 +1,173 @@
 +/*
 + * Support for rfkill on some Fujitsu-Siemens Amilo laptops.
 + * Copyright 2011 Ben Hutchings.
@@ -73,6 +73,7 @@
 +
 +#include <linux/module.h>
 +#include <linux/dmi.h>
++#include <linux/i8042.h>
 +#include <linux/io.h>
 +#include <linux/moduleparam.h>
 +#include <linux/platform_device.h>
@@ -82,27 +83,19 @@
 + * These values were obtained from disassembling and debugging the
 + * PM.exe program installed in the Fujitsu-Siemens AMILO A1655G
 + */
-+#define A1655_STATE_PORT	0x64
-+#define A1655_COMMAND_PORT	0x64
-+#define A1655_DATA_PORT		0x60
-+#define A1655_WIFI_COMMAND	0xC5
++#define A1655_WIFI_COMMAND	0x10C5
 +#define A1655_WIFI_ON		0x25
 +#define A1655_WIFI_OFF		0x45
 +
 +static int amilo_a1655_rfkill_set_block(void *data, bool blocked)
 +{
-+	u8 val;
-+
-+	do
-+		val = inb(A1655_STATE_PORT);
-+	while ((val & 2) == 2);
-+	outb(A1655_WIFI_COMMAND, A1655_COMMAND_PORT);
-+	do
-+		val = inb(A1655_STATE_PORT);
-+	while ((val & 2) == 2);
-+	outb(blocked ? A1655_WIFI_OFF : A1655_WIFI_ON, A1655_DATA_PORT);
++	u8 param = blocked ? A1655_WIFI_OFF : A1655_WIFI_ON;
++	int rc;
 +
-+	return 0;
++	i8042_lock_chip();
++	rc = i8042_command(&param, A1655_WIFI_COMMAND);
++	i8042_unlock_chip();
++	return rc;
 +}
 +
 +static const struct rfkill_ops amilo_a1655_rfkill_ops = {
@@ -237,5 +230,5 @@
 +module_init(amilo_rfkill_init);
 +module_exit(amilo_rfkill_exit);
 -- 
-1.7.7.2
+1.7.7.3
 



More information about the Kernel-svn-changes mailing list