Skip to contentSkip to conversation

sonypi and input subsystem

PATCH RESEND New Stelian Pop 1 participant 1 message Feb 21, 2003

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 sonypi and input subsystem

Hi,

The attached patch makes the sonypi driver forward the VAIO jogdial events directly to the input subsystem as mouse wheel events. This way one is not required anymore to have an external daemon polling /dev/sonypi if interested only in jogdial events.

This new behaviour is controlled by a module option ("useinput"), which is active by default.

Linus, Alan, please apply.

Thanks,

Stelian.

===== Documentation/sonypi.txt 1.10 vs edited =====

Documentation/sonypi.txt +7 -2
@@ -1,6 +1,6 @@
 Sony Programmable I/O Control Device Driver Readme
 --------------------------------------------------
-	Copyright (C) 2001-2002 Stelian Pop <[email protected]>
+	Copyright (C) 2001-2003 Stelian Pop <[email protected]>
 	Copyright (C) 2001-2002 Alcôve <www.alcove.com>
 	Copyright (C) 2001 Michael Ashley <[email protected]>
 	Copyright (C) 2001 Junichi Morita <[email protected]>
@@ -44,7 +44,7 @@
 to /etc/modules.conf file, when the driver is compiled as a module or by
 adding the following to the kernel command line (in your bootloader):
 
-	sonypi=minor[,verbose[,fnkeyinit[,camera[,compat[,mask]]]]]
+	sonypi=minor[,verbose[,fnkeyinit[,camera[,compat[,mask[,useinput]]]]]]
 
 where:
 
@@ -96,6 +96,11 @@
 				SONYPI_THUMBPHRASE_MASK 	0x0200
 				SONYPI_MEYE_MASK		0x0400
 				SONYPI_MEMORYSTICK_MASK		0x0800
+
+	useinput:	if set (which is the default) jogdial events are
+			forwarded to the input subsystem as mouse wheel
+			events.
+			
 
 Module use:
 -----------

===== include/linux/sonypi.h 1.8 vs edited =====

include/linux/sonypi.h +1 -1
@@ -1,7 +1,7 @@
 /* 
  * Sony Programmable I/O Control Device driver for VAIO
  *
- * Copyright (C) 2001-2002 Stelian Pop <[email protected]>
+ * Copyright (C) 2001-2003 Stelian Pop <[email protected]>
  *
  * Copyright (C) 2001-2002 Alcôve <www.alcove.com>
  *

===== drivers/char/sonypi.h 1.14 vs edited =====

drivers/char/sonypi.h +11 -4
@@ -1,7 +1,7 @@
 /* 
  * Sony Programmable I/O Control Device driver for VAIO
  *
- * Copyright (C) 2001-2002 Stelian Pop <[email protected]>
+ * Copyright (C) 2001-2003 Stelian Pop <[email protected]>
  *
  * Copyright (C) 2001-2002 Alcôve <www.alcove.com>
  *
@@ -37,7 +37,7 @@
 #ifdef __KERNEL__
 
 #define SONYPI_DRIVER_MAJORVERSION	 1
-#define SONYPI_DRIVER_MINORVERSION	17
+#define SONYPI_DRIVER_MINORVERSION	18
 
 #define SONYPI_DEVICE_MODEL_TYPE1	1
 #define SONYPI_DEVICE_MODEL_TYPE2	2
@@ -45,6 +45,7 @@
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/pci.h>
+#include <linux/input.h>
 #include <linux/pm.h>
 #include <linux/acpi.h>
 #include "linux/sonypi.h"
@@ -334,6 +335,9 @@
 	unsigned char buf[SONYPI_BUF_SIZE];
 };
 
+/* The name of the Jog Dial for the input device drivers */
+#define SONYPI_INPUTNAME	"Sony VAIO Jog Dial"
+
 struct sonypi_device {
 	struct pci_dev *dev;
 	u16 irq;
@@ -347,7 +351,10 @@
 	struct sonypi_queue queue;
 	int open_count;
 	int model;
-#if CONFIG_PM
+#if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
+	struct input_dev jog_dev;
+#endif
+#ifdef CONFIG_PM
 	struct pm_dev *pm;
 #endif
 };
@@ -363,7 +370,7 @@
 		printk(KERN_WARNING "sonypi command failed at %s : %s (line %d)\n", __FILE__, __FUNCTION__, __LINE__); \
 }
 
-#if !defined(CONFIG_ACPI)
+#ifndef CONFIG_ACPI
 extern int verbose;
 
 static inline int ec_write(u8 addr, u8 value) {

===== drivers/char/sonypi.c 1.13 vs edited =====

drivers/char/sonypi.c +60 -11

170 lines not on this page · raw message

Signature · 1 line
Stelian Pop <[email protected]>