Commit 66d52b89 authored by Dave Jones's avatar Dave Jones Committed by Jaroslav Kysela

[PATCH] sonypi update.

From Stelian, already in 2.4
parent 39992f07
......@@ -43,7 +43,7 @@ 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[[[[[,camera],fnkeyinit],verbose],compat],nojogdial]
where:
......@@ -71,6 +71,9 @@ where:
(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:
-----------
......
......@@ -50,6 +50,7 @@ static int verbose; /* = 0 */
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 @@ void sonypi_irq(int irq, void *dev_id, struct pt_regs *regs) {
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 @@ static int __devinit sonypi_probe(struct pci_dev *pcidev) {
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);
......@@ -791,6 +797,9 @@ static int __init sonypi_setup(char *str) {
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(camera,"i");
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);
......@@ -35,7 +35,7 @@
#ifdef __KERNEL__
#define SONYPI_DRIVER_MAJORVERSION 1
#define SONYPI_DRIVER_MINORVERSION 10
#define SONYPI_DRIVER_MINORVERSION 11
#include <linux/types.h>
#include <linux/pci.h>
......@@ -141,6 +141,7 @@ static struct sonypi_irq_list sonypi_type2_irq_list[] = {
#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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment