2002-04-17 15:58:18

by Stelian Pop

[permalink] [raw]
Subject: [BKPATCH 2.5] sonypi driver: forward port from 2.5

Hi,

This patch forward ports the sonypi driver from the 2.4 kernels:
- fix order and syntax for driver parameters on the kernel command line
- add the nojogdial parameter for dealing with Vaio FX series

Linus, please apply.

Stelian.


You can import this changeset into BK by piping this whole message to
'| bk receive [path to repository]' or apply the patch as usual.

===================================================================


[email protected], 2002-04-17 16:13:38+02:00, [email protected]
Forward port from 2.4:
- fix order and syntax for driver parameters on the kernel command line
- add the nojogdial parameter for dealing with Vaio FX series


Documentation/sonypi.txt | 7 +++++--
drivers/char/sonypi.c | 19 +++++++++++++++----
drivers/char/sonypi.h | 3 ++-
3 files changed, 22 insertions(+), 7 deletions(-)


diff -Nru a/Documentation/sonypi.txt b/Documentation/sonypi.txt
--- a/Documentation/sonypi.txt Wed Apr 17 16:14:01 2002
+++ b/Documentation/sonypi.txt Wed Apr 17 16:14:01 2002
@@ -36,14 +36,14 @@
driver and the ACPI BIOS, because Sony doesn't agree to release any programming
specs for its laptops. If someone convinces them to do so, drop me a note.

-Module options:
+Driver options:
---------------

Several options can be passed to the sonypi driver, either by adding them
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[[[[,camera],fnkeyinit],verbose],compat]
+ sonypi=minor[,verbose[,fnkeyinit[,camera[,compat[,nojogdial]]]]]

where:

@@ -70,6 +70,9 @@
events. If the driver worked for you in the past
(prior to version 1.5) and does not work anymore,
add this option and report to the author.
+
+ nojogdial: gives more accurate PKEY events on those Vaio models
+ which don't have a jogdial (like the FX series).

Module use:
-----------
diff -Nru a/drivers/char/sonypi.c b/drivers/char/sonypi.c
--- a/drivers/char/sonypi.c Wed Apr 17 16:14:01 2002
+++ b/drivers/char/sonypi.c Wed Apr 17 16:14:01 2002
@@ -50,6 +50,7 @@
static int fnkeyinit; /* = 0 */
static int camera; /* = 0 */
static int compat; /* = 0 */
+static int nojogdial; /* = 0 */

/* Inits the queue */
static inline void sonypi_initq(void) {
@@ -310,24 +311,28 @@
int i;
u8 sonypi_jogger_ev, sonypi_fnkey_ev;
u8 sonypi_capture_ev, sonypi_bluetooth_ev;
+ u8 sonypi_pkey_ev;

if (sonypi_device.model == SONYPI_DEVICE_MODEL_TYPE2) {
sonypi_jogger_ev = SONYPI_TYPE2_JOGGER_EV;
sonypi_fnkey_ev = SONYPI_TYPE2_FNKEY_EV;
sonypi_capture_ev = SONYPI_TYPE2_CAPTURE_EV;
sonypi_bluetooth_ev = SONYPI_TYPE2_BLUETOOTH_EV;
+ sonypi_pkey_ev = nojogdial ? SONYPI_TYPE2_PKEY_EV
+ : SONYPI_TYPE1_PKEY_EV;
}
else {
sonypi_jogger_ev = SONYPI_TYPE1_JOGGER_EV;
sonypi_fnkey_ev = SONYPI_TYPE1_FNKEY_EV;
sonypi_capture_ev = SONYPI_TYPE1_CAPTURE_EV;
sonypi_bluetooth_ev = SONYPI_TYPE1_BLUETOOTH_EV;
+ sonypi_pkey_ev = SONYPI_TYPE1_PKEY_EV;
}

v1 = inb_p(sonypi_device.ioport1);
v2 = inb_p(sonypi_device.ioport2);

- if ((v2 & SONYPI_TYPE1_PKEY_EV) == SONYPI_TYPE1_PKEY_EV) {
+ if ((v2 & sonypi_pkey_ev) == sonypi_pkey_ev) {
for (i = 0; sonypi_pkeyev[i].event; i++)
if (sonypi_pkeyev[i].data == v1) {
event = sonypi_pkeyev[i].event;
@@ -713,11 +718,12 @@
SONYPI_DRIVER_MAJORVERSION,
SONYPI_DRIVER_MINORVERSION);
printk(KERN_INFO "sonypi: detected %s model, "
- "camera = %s, compat = %s\n",
+ "camera = %s, compat = %s, nojogdial = %s\n",
(sonypi_device.model == SONYPI_DEVICE_MODEL_TYPE1) ?
"type1" : "type2",
camera ? "on" : "off",
- compat ? "on" : "off");
+ compat ? "on" : "off",
+ nojogdial ? "on" : "off");
printk(KERN_INFO "sonypi: enabled at irq=%d, port1=0x%x, port2=0x%x\n",
sonypi_device.irq,
sonypi_device.ioport1, sonypi_device.ioport2);
@@ -773,7 +779,7 @@

#ifndef MODULE
static int __init sonypi_setup(char *str) {
- int ints[6];
+ int ints[7];

str = get_options(str, ARRAY_SIZE(ints), ints);
if (ints[0] <= 0)
@@ -791,6 +797,9 @@
if (ints[0] == 4)
goto out;
compat = ints[5];
+ if (ints[0] == 5)
+ goto out;
+ nojogdial = ints[6];
out:
return 1;
}
@@ -817,5 +826,7 @@
MODULE_PARM_DESC(camera, "set this if you have a MotionEye camera (PictureBook series)");
MODULE_PARM(compat,"i");
MODULE_PARM_DESC(compat, "set this if you want to enable backward compatibility mode");
+MODULE_PARM(nojogdial, "i");
+MODULE_PARM_DESC(nojogdial, "set this if you have a Vaio without a jogdial (like the fx series)");

EXPORT_SYMBOL(sonypi_camera_command);
diff -Nru a/drivers/char/sonypi.h b/drivers/char/sonypi.h
--- a/drivers/char/sonypi.h Wed Apr 17 16:14:01 2002
+++ b/drivers/char/sonypi.h Wed Apr 17 16:14:01 2002
@@ -35,7 +35,7 @@
#ifdef __KERNEL__

#define SONYPI_DRIVER_MAJORVERSION 1
-#define SONYPI_DRIVER_MINORVERSION 10
+#define SONYPI_DRIVER_MINORVERSION 12

#include <linux/types.h>
#include <linux/pci.h>
@@ -141,6 +141,7 @@
#define SONYPI_TYPE1_BLUETOOTH_EV 0x30
#define SONYPI_TYPE2_BLUETOOTH_EV 0x08
#define SONYPI_TYPE1_PKEY_EV 0x40
+#define SONYPI_TYPE2_PKEY_EV 0x08
#define SONYPI_BACK_EV 0x08
#define SONYPI_LID_EV 0x38


===================================================================


This BitKeeper patch contains the following changesets:
+
## Wrapped with gzip_uu ##


begin 664 bkpatch15352
M'XL(`"F#O3P``\U7^V_:2!#^V?XK1D1WE[0\=M?K%Q'7]`*]0VT21"[116F%
MMO:"W8`7V880'7_\C>T`22"/THM4`UZ\.SOSS>.;A1TX2V1<UY)4#D,1Z3OP
METK2NC96XU`FU4BF.-55"J=J@1K)6AI&H9K4KF0<R6%M&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