Re: AHCI exception, ext3 journal aborted on a VIA K8M890 / VT8251

2007-04-05 Thread Stephen Evanchik

n 4/2/07, Chuck Ebbert <[EMAIL PROTECTED]> wrote:

Stephen Evanchik wrote:
> My hardware components are the following:
>
> Motherboard: A8V-VM Socket 939 VIA K8M890 / VT8251
> CPU: Opteron 165 dual core
> Harddisk: SATA 1.5Gbps WD 160GB drive
>
> Most relevant snippet from dmesg, (you can see a longer version below):
>
> ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
> ata1.00: cmd ca/00:08:c5:b6:03/00:00:00:00:00/e0 tag 0 cdb 0x0 data 4096
> out
>res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
> ata1: soft resetting port
> ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> ata1.00: qc timeout (cmd 0xec)
> ata1.00: failed to IDENTIFY (I/O error, err_mask=0x104)
> ata1.00: revalidation failed (errno=-5)
> ata1: failed to recover some devices, retrying in 5 secs
> ata1: hard resetting port
>


I have tested 2.6.20, 2.6.20.5, 2.6.21-rc5 and all exhibit the same behavior.



We are testing fixes, but can only build test kernels for FC6. I think
this may be fixed by patches I submitted for 2.6.20.5.



I still see the above problem from 2.6.19-rc1 to 2.6.21-rc5.


Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: AHCI exception, ext3 journal aborted on a VIA K8M890 / VT8251

2007-04-05 Thread Stephen Evanchik

n 4/2/07, Chuck Ebbert [EMAIL PROTECTED] wrote:

Stephen Evanchik wrote:
 My hardware components are the following:

 Motherboard: A8V-VM Socket 939 VIA K8M890 / VT8251
 CPU: Opteron 165 dual core
 Harddisk: SATA 1.5Gbps WD 160GB drive

 Most relevant snippet from dmesg, (you can see a longer version below):

 ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
 ata1.00: cmd ca/00:08:c5:b6:03/00:00:00:00:00/e0 tag 0 cdb 0x0 data 4096
 out
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
 ata1: soft resetting port
 ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
 ata1.00: qc timeout (cmd 0xec)
 ata1.00: failed to IDENTIFY (I/O error, err_mask=0x104)
 ata1.00: revalidation failed (errno=-5)
 ata1: failed to recover some devices, retrying in 5 secs
 ata1: hard resetting port



I have tested 2.6.20, 2.6.20.5, 2.6.21-rc5 and all exhibit the same behavior.



We are testing fixes, but can only build test kernels for FC6. I think
this may be fixed by patches I submitted for 2.6.20.5.



I still see the above problem from 2.6.19-rc1 to 2.6.21-rc5.


Stephen
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


AHCI exception, ext3 journal aborted on a VIA K8M890 / VT8251

2007-04-01 Thread Stephen Evanchik

Hi everyone,

I have had a lot trouble with my AHCI controller from kernel version
2.6.19-rc1 to 2.6.21-rc5. The device is detected but the disks never
spinup and thus the rootfs is never found.

I finally was able to get Fedora's 2.6.20 and my 2.6.21-rc5 to boot
with pci=nomsi but I have been getting ext3 errors because the SATA
controller seems to die. It has happened 3 times today and has never
happened with my previous 2.6.18 kernel. The last time it happened I
was rsync'ing about 3GB of files at 30KB/sec and I was away from the
keyboard, LCD off etc. The first time it happened was after my daily
crons jobs run which are very disk intensive and I was again away from
the keyboard. The second time was during another rsync at 30KB/sec I
believe I was browsing the web but can't really be certain.

The error seems to occur when the machine is not idle; usually when I
am uploading a lot of files or scanning the disk (i.e. find / ). I
can't be certain of the trigger so any help isolating it would be
appreciated. I have stripped out any non-free modules (VMware and
fglrx) and am in the process of compiling a vanilla 2.6.20 kernel in
order to exclude any Fedora-isms.

My hardware components are the following:

Motherboard: A8V-VM Socket 939 VIA K8M890 / VT8251
CPU: Opteron 165 dual core
Harddisk: SATA 1.5Gbps WD 160GB drive

Most relevant snippet from dmesg, (you can see a longer version below):

ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata1.00: cmd ca/00:08:c5:b6:03/00:00:00:00:00/e0 tag 0 cdb 0x0 data 4096 out
   res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
ata1: soft resetting port
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata1.00: qc timeout (cmd 0xec)
ata1.00: failed to IDENTIFY (I/O error, err_mask=0x104)
ata1.00: revalidation failed (errno=-5)
ata1: failed to recover some devices, retrying in 5 secs
ata1: hard resetting port


What other information can I provide that would be helpful?


Thanks,
Stephen


==


* uname -a
 Linux small 2.6.20-1.2307.fc5smp #1 SMP Sun Mar 18 21:02:16 EDT 2007
i686 athlon i386 GNU/Linux

* Kernel commmand line
 ro root=/dev/VolGroup00/LogVol00 rhgb quiet selinux=0 pci=nomsi

* /sbin/lsmod

Module  Size  Used by
fuse   46805  2
nfsd  208561  17
exportfs9921  1 nfsd
lockd  62921  2 nfsd
nfs_acl 7745  1 nfsd
autofs424517  1
hidp   23745  2
l2cap  30785  5 hidp
bluetooth  58149  2 hidp,l2cap
sunrpc153853  12 nfsd,lockd,nfs_acl
ipt_REJECT  8769  1
nf_conntrack_ipv4  21837  5
xt_state6721  5
nf_conntrack   62665  2 nf_conntrack_ipv4,xt_state
nfnetlink  11097  2 nf_conntrack_ipv4,nf_conntrack
xt_tcpudp   7361  6
iptable_filter  7233  1
ip_tables  16517  1 iptable_filter
x_tables   19013  4 ipt_REJECT,xt_state,xt_tcpudp,ip_tables
loop   20297  0
video  20037  0
sbs19201  0
i2c_ec  9153  1 sbs
dock   14233  0
button 11985  0
battery14021  0
asus_acpi  20573  0
backlight  10433  1 asus_acpi
ac  9285  0
ipv6  275585  18
lp 16521  0
parport_pc 30309  0
parport38793  2 lp,parport_pc
cdc_acm19169  0
snd_emu10k1   114657  1
snd_rawmidi27073  1 snd_emu10k1
snd_ac97_codec 93541  1 snd_emu10k1
ac97_bus6593  1 snd_ac97_codec
snd_seq_dummy   8005  0
snd_seq_oss33857  0
snd_seq_midi_event 11329  1 snd_seq_oss
snd_seq51505  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_pcm_oss43873  0
snd_mixer_oss  19649  1 snd_pcm_oss
snd_pcm75461  3 snd_emu10k1,snd_ac97_codec,snd_pcm_oss
snd_seq_device 11981  5
snd_emu10k1,snd_rawmidi,snd_seq_dummy,snd_seq_oss,snd_seq
snd_timer  25413  3 snd_emu10k1,snd_seq,snd_pcm
snd_page_alloc 14153  2 snd_emu10k1,snd_pcm
snd_util_mem8897  1 snd_emu10k1
snd_hwdep  12997  1 snd_emu10k1
ehci_hcd   34901  0
sg 37341  0
i2c_viapro 12885  0
emu10k1_gp  8129  0
snd53957  13
snd_emu10k1,snd_rawmidi,snd_ac97_codec,snd_seq_oss,snd_seq,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_seq_device,snd_timer,snd_hwdep
uhci_hcd   27089  0
k8temp  9665  0
via_rhine  28877  0
gameport   19529  2 emu10k1_gp
soundcore  11937  1 snd
hwmon   7621  1 k8temp
serio_raw  11077  0
i2c_core   25153  2 i2c_ec,i2c_viapro
k8_edac18689  0
mii 9537  1 via_rhine

AHCI exception, ext3 journal aborted on a VIA K8M890 / VT8251

2007-04-01 Thread Stephen Evanchik

Hi everyone,

I have had a lot trouble with my AHCI controller from kernel version
2.6.19-rc1 to 2.6.21-rc5. The device is detected but the disks never
spinup and thus the rootfs is never found.

I finally was able to get Fedora's 2.6.20 and my 2.6.21-rc5 to boot
with pci=nomsi but I have been getting ext3 errors because the SATA
controller seems to die. It has happened 3 times today and has never
happened with my previous 2.6.18 kernel. The last time it happened I
was rsync'ing about 3GB of files at 30KB/sec and I was away from the
keyboard, LCD off etc. The first time it happened was after my daily
crons jobs run which are very disk intensive and I was again away from
the keyboard. The second time was during another rsync at 30KB/sec I
believe I was browsing the web but can't really be certain.

The error seems to occur when the machine is not idle; usually when I
am uploading a lot of files or scanning the disk (i.e. find / ). I
can't be certain of the trigger so any help isolating it would be
appreciated. I have stripped out any non-free modules (VMware and
fglrx) and am in the process of compiling a vanilla 2.6.20 kernel in
order to exclude any Fedora-isms.

My hardware components are the following:

Motherboard: A8V-VM Socket 939 VIA K8M890 / VT8251
CPU: Opteron 165 dual core
Harddisk: SATA 1.5Gbps WD 160GB drive

Most relevant snippet from dmesg, (you can see a longer version below):

ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata1.00: cmd ca/00:08:c5:b6:03/00:00:00:00:00/e0 tag 0 cdb 0x0 data 4096 out
   res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
ata1: soft resetting port
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata1.00: qc timeout (cmd 0xec)
ata1.00: failed to IDENTIFY (I/O error, err_mask=0x104)
ata1.00: revalidation failed (errno=-5)
ata1: failed to recover some devices, retrying in 5 secs
ata1: hard resetting port


What other information can I provide that would be helpful?


Thanks,
Stephen


==


* uname -a
 Linux small 2.6.20-1.2307.fc5smp #1 SMP Sun Mar 18 21:02:16 EDT 2007
i686 athlon i386 GNU/Linux

* Kernel commmand line
 ro root=/dev/VolGroup00/LogVol00 rhgb quiet selinux=0 pci=nomsi

* /sbin/lsmod

Module  Size  Used by
fuse   46805  2
nfsd  208561  17
exportfs9921  1 nfsd
lockd  62921  2 nfsd
nfs_acl 7745  1 nfsd
autofs424517  1
hidp   23745  2
l2cap  30785  5 hidp
bluetooth  58149  2 hidp,l2cap
sunrpc153853  12 nfsd,lockd,nfs_acl
ipt_REJECT  8769  1
nf_conntrack_ipv4  21837  5
xt_state6721  5
nf_conntrack   62665  2 nf_conntrack_ipv4,xt_state
nfnetlink  11097  2 nf_conntrack_ipv4,nf_conntrack
xt_tcpudp   7361  6
iptable_filter  7233  1
ip_tables  16517  1 iptable_filter
x_tables   19013  4 ipt_REJECT,xt_state,xt_tcpudp,ip_tables
loop   20297  0
video  20037  0
sbs19201  0
i2c_ec  9153  1 sbs
dock   14233  0
button 11985  0
battery14021  0
asus_acpi  20573  0
backlight  10433  1 asus_acpi
ac  9285  0
ipv6  275585  18
lp 16521  0
parport_pc 30309  0
parport38793  2 lp,parport_pc
cdc_acm19169  0
snd_emu10k1   114657  1
snd_rawmidi27073  1 snd_emu10k1
snd_ac97_codec 93541  1 snd_emu10k1
ac97_bus6593  1 snd_ac97_codec
snd_seq_dummy   8005  0
snd_seq_oss33857  0
snd_seq_midi_event 11329  1 snd_seq_oss
snd_seq51505  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_pcm_oss43873  0
snd_mixer_oss  19649  1 snd_pcm_oss
snd_pcm75461  3 snd_emu10k1,snd_ac97_codec,snd_pcm_oss
snd_seq_device 11981  5
snd_emu10k1,snd_rawmidi,snd_seq_dummy,snd_seq_oss,snd_seq
snd_timer  25413  3 snd_emu10k1,snd_seq,snd_pcm
snd_page_alloc 14153  2 snd_emu10k1,snd_pcm
snd_util_mem8897  1 snd_emu10k1
snd_hwdep  12997  1 snd_emu10k1
ehci_hcd   34901  0
sg 37341  0
i2c_viapro 12885  0
emu10k1_gp  8129  0
snd53957  13
snd_emu10k1,snd_rawmidi,snd_ac97_codec,snd_seq_oss,snd_seq,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_seq_device,snd_timer,snd_hwdep
uhci_hcd   27089  0
k8temp  9665  0
via_rhine  28877  0
gameport   19529  2 emu10k1_gp
soundcore  11937  1 snd
hwmon   7621  1 k8temp
serio_raw  11077  0
i2c_core   25153  2 i2c_ec,i2c_viapro
k8_edac18689  0
mii 9537  1 via_rhine

Re: SATA ahci Bug in 2.6.19.x

2007-01-25 Thread Stephen Evanchik

On 1/26/07, Luming Yu <[EMAIL PROTECTED]> wrote:

>
Is there any difference in dmesg with acpi=off?
what is your sata driver?


The only difference is that I don't see the "ACPI: PCI Interrupt
:00:0f.0[B] -> GSI
21 (level, low) -> IRQ 19" printk. The driver is AHCI but the device
is a VIA chip.

I'll get a caputre of the boot log when I find my serial cable. This
could be related to the VIA PIC quirks that was changed by Alan.

Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: SATA ahci Bug in 2.6.19.x

2007-01-25 Thread Stephen Evanchik

On 1/25/07, Luming Yu <[EMAIL PROTECTED]> wrote:

From the log:
2.6.18.3:
ACPI: PCI Interrupt :00:0f.0[B] -> GSI 21 (level, low) -> IRQ 217
2.6.20-rc5:
"ACPI: PCI Interrupt :00:0f.0[B] -> GSI 21 (level, low) -> IRQ 21"

Sounds like acpi interrupt configure problem. Please try acpi=off first.



Still does not recognize the SATA device (and the machine fails to
come up). I tested this with 2.6.19.2, 2.6.20-rc5 and -rc6 this
evening. I am going to build a vanilla 2.6.18 and see if that still
works as I am currently running an FC5 kernel.

Stephen


--
Stephen Evanchik
http://stephen.evanchik.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: SATA ahci Bug in 2.6.19.x

2007-01-25 Thread Stephen Evanchik

On 1/25/07, Luming Yu [EMAIL PROTECTED] wrote:

From the log:
2.6.18.3:
ACPI: PCI Interrupt :00:0f.0[B] - GSI 21 (level, low) - IRQ 217
2.6.20-rc5:
ACPI: PCI Interrupt :00:0f.0[B] - GSI 21 (level, low) - IRQ 21

Sounds like acpi interrupt configure problem. Please try acpi=off first.



Still does not recognize the SATA device (and the machine fails to
come up). I tested this with 2.6.19.2, 2.6.20-rc5 and -rc6 this
evening. I am going to build a vanilla 2.6.18 and see if that still
works as I am currently running an FC5 kernel.

Stephen


--
Stephen Evanchik
http://stephen.evanchik.com
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: SATA ahci Bug in 2.6.19.x

2007-01-25 Thread Stephen Evanchik

On 1/26/07, Luming Yu [EMAIL PROTECTED] wrote:


Is there any difference in dmesg with acpi=off?
what is your sata driver?


The only difference is that I don't see the ACPI: PCI Interrupt
:00:0f.0[B] - GSI
21 (level, low) - IRQ 19 printk. The driver is AHCI but the device
is a VIA chip.

I'll get a caputre of the boot log when I find my serial cable. This
could be related to the VIA PIC quirks that was changed by Alan.

Stephen
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: SATA ahci Bug in 2.6.19.x

2007-01-22 Thread Stephen Evanchik

On 1/22/07, Stefan Priebe - FH <[EMAIL PROTECTED]> wrote:


I've an Asus A8V Mainboard which works wonderful with a 2.6.18.X kernel.
But i cannot use the SATA Controller with a 2.6.19.x Kernel.


I also have an Asus A8V motherboard that cannot boot a newer kernel
because the SATA controller does not come up properly. I have tried
kernels 2.6.19.2 and 2.6.20-rc5 with no luck. It looks like later
kernels don't recognize the proper IRQ of the device as compared to
the 2.6.18 boot logs.


"ACPI: PCI Interrupt :00:0f.0[B] -> GSI 21 (level, low) -> IRQ 21"
"ahci :00:0f.0: AHCI 0001. 32 slots 4 ports 3 Gbps 0xf impl IDE
mode"
"ahci :00:0f.0: flags: 64bit ncq pm led clo pmp pio slum part "
"ata1: SATA max UDMA/133 cmd 0xC2004D00 ctl 0x0 bmdma 0x0 irq 1277"
"ata2: SATA max UDMA/133 cmd 0xC2004D80 ctl 0x0 bmdma 0x0 irq 1277"
"ata3: SATA max UDMA/133 cmd 0xC2004E00 ctl 0x0 bmdma 0x0 irq 1277"
"ata4: SATA max UDMA/133 cmd 0xC2004E80 ctl 0x0 bmdma 0x0 irq 1277"


Similar output as above.


Does any one have any ideas?


Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: SATA ahci Bug in 2.6.19.x

2007-01-22 Thread Stephen Evanchik

On 1/22/07, Stefan Priebe - FH [EMAIL PROTECTED] wrote:


I've an Asus A8V Mainboard which works wonderful with a 2.6.18.X kernel.
But i cannot use the SATA Controller with a 2.6.19.x Kernel.


I also have an Asus A8V motherboard that cannot boot a newer kernel
because the SATA controller does not come up properly. I have tried
kernels 2.6.19.2 and 2.6.20-rc5 with no luck. It looks like later
kernels don't recognize the proper IRQ of the device as compared to
the 2.6.18 boot logs.


ACPI: PCI Interrupt :00:0f.0[B] - GSI 21 (level, low) - IRQ 21
ahci :00:0f.0: AHCI 0001. 32 slots 4 ports 3 Gbps 0xf impl IDE
mode
ahci :00:0f.0: flags: 64bit ncq pm led clo pmp pio slum part 
ata1: SATA max UDMA/133 cmd 0xC2004D00 ctl 0x0 bmdma 0x0 irq 1277
ata2: SATA max UDMA/133 cmd 0xC2004D80 ctl 0x0 bmdma 0x0 irq 1277
ata3: SATA max UDMA/133 cmd 0xC2004E00 ctl 0x0 bmdma 0x0 irq 1277
ata4: SATA max UDMA/133 cmd 0xC2004E80 ctl 0x0 bmdma 0x0 irq 1277


Similar output as above.


Does any one have any ideas?


Stephen
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Synaptics and TrackPoint problems in 2.6.12

2005-07-19 Thread Stephen Evanchik
Dimitry,

I have been receiving a lot of complaints that TrackPoints on
Synaptics pass-thru ports stopped working with 2.6.12. I retested
2.6.9 and 2.6.11-rc3 successfully, I believe 2.6.11.7 may also work
but that is unconfirmed at this point.

The behavior is always the same .. after sending the read secondary ID
command, the TrackPoint seems to be disabled from that point forward.

Any ideas?

-- 
Stephen Evanchik
http://stephen.evanchik.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Synaptics and TrackPoint problems in 2.6.12

2005-07-19 Thread Stephen Evanchik
Dimitry,

I have been receiving a lot of complaints that TrackPoints on
Synaptics pass-thru ports stopped working with 2.6.12. I retested
2.6.9 and 2.6.11-rc3 successfully, I believe 2.6.11.7 may also work
but that is unconfirmed at this point.

The behavior is always the same .. after sending the read secondary ID
command, the TrackPoint seems to be disabled from that point forward.

Any ideas?

-- 
Stephen Evanchik
http://stephen.evanchik.com
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11] IBM TrackPoint support

2005-03-15 Thread Stephen Evanchik
On Tue, 15 Mar 2005 20:49:25 +0100, PaweÅ Sikora <[EMAIL PROTECTED]> wrote:
> On Monday 14 of March 2005 06:02, Stephen Evanchik wrote:
> > Here's the latest patch for TracKPoint devices. I have changed the
> > sysfs filenames to be more descriptive for commonly used attributes. I
> > also implemented the set_properties flag for initialization.
> >
> > It patches against 2.6.11 and 2.6.11.3 however I have not tested it
> > with 2.6.11.3 .
> >
> > Any comments are appreciated.
> 
>   CC [M]  drivers/input/mouse/psmouse-base.o
> drivers/input/mouse/psmouse-base.c: In function 'psmouse_extensions':
> drivers/input/mouse/psmouse-base.c:489: error: 'PSMOUSE_TRACKPOINT' undeclared
> 
> ;-)

Thanks, I noticed this last night and have it fixed in the new patch
yet to be submitted ;)


Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11] IBM TrackPoint support

2005-03-15 Thread Stephen Evanchik
On Tue, 15 Mar 2005 20:49:25 +0100, Pawe Sikora [EMAIL PROTECTED] wrote:
 On Monday 14 of March 2005 06:02, Stephen Evanchik wrote:
  Here's the latest patch for TracKPoint devices. I have changed the
  sysfs filenames to be more descriptive for commonly used attributes. I
  also implemented the set_properties flag for initialization.
 
  It patches against 2.6.11 and 2.6.11.3 however I have not tested it
  with 2.6.11.3 .
 
  Any comments are appreciated.
 
   CC [M]  drivers/input/mouse/psmouse-base.o
 drivers/input/mouse/psmouse-base.c: In function 'psmouse_extensions':
 drivers/input/mouse/psmouse-base.c:489: error: 'PSMOUSE_TRACKPOINT' undeclared
 
 ;-)

Thanks, I noticed this last night and have it fixed in the new patch
yet to be submitted ;)


Stephen
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11] IBM TrackPoint support

2005-03-14 Thread Stephen Evanchik
On Mon, 14 Mar 2005 13:19:56 +0100, Vojtech Pavlik <[EMAIL PROTECTED]> wrote:
> How much does it interpret the stream in non-transparent mode? Are
> commands also passed through in soft transparent mode?
>
> I'm asking because we might want to implement a passthrough port
> similarly to what the Synaptics driver does and allow extended protocol
> mice to be connected to the external mouse port.

I originally thought that I could implement something similar to the
Synaptics driver. Unfortunately, while in transparent mode bytes are
relayed unmodified with the TrackPoint controller disabled. In other
words, no simultaneous usage.

That doesn't mean extended protocol mice couldn't be supported in
transparent mode however. I didn't find it particularly useful given
the TrackPoint itself would be disabled.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11] IBM TrackPoint support

2005-03-14 Thread Stephen Evanchik
On Mon, 14 Mar 2005 09:19:49 +0100, Vojtech Pavlik <[EMAIL PROTECTED]> wrote:
> > +/*
> > + * Mode manipulation
> > + */
> > +#define TP_SET_SOFT_TRANS (0x4E) /* Set mode */
> > +#define TP_CANCEL_SOFT_TRANS (0xB9) /* Cancel mode */
> > +#define TP_SET_HARD_TRANS (0x45) /* Mode can only be set */
> 
> What exactly is transparent mode?

Transparency mode, when enabled, turns off the TrackPoint controller's
interpretation of the byte stream going to and coming from the
external PS/2 port if present.

Soft transparency mode can be cancelled, while hard transparency mode
requires a reset of the device and possibly the machine.

Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11] IBM TrackPoint support

2005-03-14 Thread Stephen Evanchik
On Mon, 14 Mar 2005 09:19:49 +0100, Vojtech Pavlik [EMAIL PROTECTED] wrote:
  +/*
  + * Mode manipulation
  + */
  +#define TP_SET_SOFT_TRANS (0x4E) /* Set mode */
  +#define TP_CANCEL_SOFT_TRANS (0xB9) /* Cancel mode */
  +#define TP_SET_HARD_TRANS (0x45) /* Mode can only be set */
 
 What exactly is transparent mode?

Transparency mode, when enabled, turns off the TrackPoint controller's
interpretation of the byte stream going to and coming from the
external PS/2 port if present.

Soft transparency mode can be cancelled, while hard transparency mode
requires a reset of the device and possibly the machine.

Stephen
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11] IBM TrackPoint support

2005-03-14 Thread Stephen Evanchik
On Mon, 14 Mar 2005 13:19:56 +0100, Vojtech Pavlik [EMAIL PROTECTED] wrote:
 How much does it interpret the stream in non-transparent mode? Are
 commands also passed through in soft transparent mode?

 I'm asking because we might want to implement a passthrough port
 similarly to what the Synaptics driver does and allow extended protocol
 mice to be connected to the external mouse port.

I originally thought that I could implement something similar to the
Synaptics driver. Unfortunately, while in transparent mode bytes are
relayed unmodified with the TrackPoint controller disabled. In other
words, no simultaneous usage.

That doesn't mean extended protocol mice couldn't be supported in
transparent mode however. I didn't find it particularly useful given
the TrackPoint itself would be disabled.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2.6.11] IBM TrackPoint support

2005-03-13 Thread Stephen Evanchik
Here's the latest patch for TracKPoint devices. I have changed the
sysfs filenames to be more descriptive for commonly used attributes. I
also implemented the set_properties flag for initialization.

It patches against 2.6.11 and 2.6.11.3 however I have not tested it
with 2.6.11.3 .

Any comments are appreciated.


Stephen


--- a/drivers/input/mouse/trackpoint.c  1969-12-31 19:00:00.0 -0500
+++ b/drivers/input/mouse/trackpoint.c  2005-03-13 23:43:14.0 -0500
@@ -0,0 +1,352 @@
+/*
+ * Stephen Evanchik <[EMAIL PROTECTED]>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * Trademarks are the property of their respective owners.
+ *
+ * 13/02/2005 - Removed middle button scroll, see Xorg for
+ * scroll emulation.
+ *
+ * 03/02/2005 - Remove proc and module parameters
+ * Added sysfs attributes
+ *
+ * 29/01/2005 - Fixed UltraNav support
+ * Moved to libps2 interface
+ * Renamed internal property variables to be consistent with 
reference docs
+ * Fixed negative inertia not being set properly
+ * Added middle button scroll module parameter
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "psmouse.h"
+#include "trackpoint.h"
+
+
+PSMOUSE_DEFINE_ATTR(sensitivity);
+PSMOUSE_DEFINE_ATTR(speed);
+PSMOUSE_DEFINE_ATTR(inertia);
+PSMOUSE_DEFINE_ATTR(reach);
+PSMOUSE_DEFINE_ATTR(draghys);
+PSMOUSE_DEFINE_ATTR(mindrag);
+PSMOUSE_DEFINE_ATTR(thresh);
+PSMOUSE_DEFINE_ATTR(upthresh);
+PSMOUSE_DEFINE_ATTR(ztime);
+PSMOUSE_DEFINE_ATTR(jenks);
+PSMOUSE_DEFINE_ATTR(press_to_select);
+PSMOUSE_DEFINE_ATTR(skipback);
+PSMOUSE_DEFINE_ATTR(middle_btn_disable);
+PSMOUSE_DEFINE_ATTR(ext_dev);
+PSMOUSE_DEFINE_ATTR(transparent);
+
+
+#define MAKE_ATTR_READ(_item) \
+   static ssize_t psmouse_attr_show_##_item(struct psmouse *psmouse, char 
*buf) \
+   { \
+   struct trackpoint_data *tp = psmouse->private; \
+   return sprintf(buf, "%lu\n", (unsigned long)tp->_item); \
+   }
+
+#define MAKE_ATTR_WRITE(_item, command) \
+   static ssize_t psmouse_attr_set_##_item(struct psmouse *psmouse,
const char *buf, size_t count) \
+   { \
+   char *rest; \
+   unsigned long value; \
+   struct trackpoint_data *tp = psmouse->private; \
+   value = simple_strtoul(buf, , 10); \
+   if(*rest) \
+   return -EINVAL; \
+   tp->_item = value; \
+   trackpoint_write(>ps2dev, command, tp->_item); \
+   return count; \
+   }
+
+#define MAKE_ATTR_TOGGLE(_item, command, mask) \
+   static ssize_t psmouse_attr_set_##_item(struct psmouse *psmouse,
const char *buf, size_t count) \
+   { \
+   unsigned char toggle; \
+   struct trackpoint_data *tp = psmouse->private; \
+   toggle = (buf[0] == '1') ? 1 : 0; \
+   if( toggle != tp->_item) { \
+   tp->_item = toggle; \
+   trackpoint_toggle_bit(>ps2dev, command, mask); 
\
+   } \
+   return count; \
+   }
+
+
+/*
+ * Device IO: read, write and toggle bit
+ */
+static void trackpoint_command(struct ps2dev *ps2dev, unsigned char cmd)
+{
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, TP_COMMAND));
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, cmd));
+}
+
+static void trackpoint_read(struct ps2dev *ps2dev, unsigned char loc,
unsigned char *results)
+{
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, TP_COMMAND));
+   ps2_command(ps2dev, results, MAKE_PS2_CMD(0, 1, loc));
+}
+
+static void trackpoint_write(struct ps2dev *ps2dev, unsigned char
loc, unsigned char val)
+{
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, TP_COMMAND));
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, TP_WRITE_MEM));
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, loc));
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, val));
+}
+
+static int trackpoint_toggle_bit(struct ps2dev *ps2dev, unsigned char
loc, unsigned char mask)
+{
+   /* Bad things will happen if the loc param isn't in this range */
+   if(loc < 0x20 || loc >= 0x2F)
+   return -1;
+   
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, TP_COMMAND));
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, TP_TOGGLE));
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, loc));
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, mask));
+   
+   return 0;
+}
+
+
+MAKE_ATTR_WRITE(sensitivity, TP_SENS);
+MAKE_ATTR_READ(sensitivity);
+
+MAKE_ATTR_WRITE(speed, TP_SPEED);
+MAKE_ATTR_READ(speed);
+
+MAKE_ATTR_WRITE(inertia, TP_INERTIA);
+MAKE_ATTR_READ(inertia);
+
+MAKE

[PATCH 2.6.11] IBM TrackPoint support

2005-03-13 Thread Stephen Evanchik
Here's the latest patch for TracKPoint devices. I have changed the
sysfs filenames to be more descriptive for commonly used attributes. I
also implemented the set_properties flag for initialization.

It patches against 2.6.11 and 2.6.11.3 however I have not tested it
with 2.6.11.3 .

Any comments are appreciated.


Stephen


--- a/drivers/input/mouse/trackpoint.c  1969-12-31 19:00:00.0 -0500
+++ b/drivers/input/mouse/trackpoint.c  2005-03-13 23:43:14.0 -0500
@@ -0,0 +1,352 @@
+/*
+ * Stephen Evanchik [EMAIL PROTECTED]
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * Trademarks are the property of their respective owners.
+ *
+ * 13/02/2005 - Removed middle button scroll, see Xorg for
+ * scroll emulation.
+ *
+ * 03/02/2005 - Remove proc and module parameters
+ * Added sysfs attributes
+ *
+ * 29/01/2005 - Fixed UltraNav support
+ * Moved to libps2 interface
+ * Renamed internal property variables to be consistent with 
reference docs
+ * Fixed negative inertia not being set properly
+ * Added middle button scroll module parameter
+ *
+ */
+
+#include linux/delay.h
+#include linux/serio.h
+#include linux/module.h
+#include linux/moduleparam.h
+#include linux/input.h
+#include linux/libps2.h
+#include linux/proc_fs.h
+#include asm/uaccess.h
+#include psmouse.h
+#include trackpoint.h
+
+
+PSMOUSE_DEFINE_ATTR(sensitivity);
+PSMOUSE_DEFINE_ATTR(speed);
+PSMOUSE_DEFINE_ATTR(inertia);
+PSMOUSE_DEFINE_ATTR(reach);
+PSMOUSE_DEFINE_ATTR(draghys);
+PSMOUSE_DEFINE_ATTR(mindrag);
+PSMOUSE_DEFINE_ATTR(thresh);
+PSMOUSE_DEFINE_ATTR(upthresh);
+PSMOUSE_DEFINE_ATTR(ztime);
+PSMOUSE_DEFINE_ATTR(jenks);
+PSMOUSE_DEFINE_ATTR(press_to_select);
+PSMOUSE_DEFINE_ATTR(skipback);
+PSMOUSE_DEFINE_ATTR(middle_btn_disable);
+PSMOUSE_DEFINE_ATTR(ext_dev);
+PSMOUSE_DEFINE_ATTR(transparent);
+
+
+#define MAKE_ATTR_READ(_item) \
+   static ssize_t psmouse_attr_show_##_item(struct psmouse *psmouse, char 
*buf) \
+   { \
+   struct trackpoint_data *tp = psmouse-private; \
+   return sprintf(buf, %lu\n, (unsigned long)tp-_item); \
+   }
+
+#define MAKE_ATTR_WRITE(_item, command) \
+   static ssize_t psmouse_attr_set_##_item(struct psmouse *psmouse,
const char *buf, size_t count) \
+   { \
+   char *rest; \
+   unsigned long value; \
+   struct trackpoint_data *tp = psmouse-private; \
+   value = simple_strtoul(buf, rest, 10); \
+   if(*rest) \
+   return -EINVAL; \
+   tp-_item = value; \
+   trackpoint_write(psmouse-ps2dev, command, tp-_item); \
+   return count; \
+   }
+
+#define MAKE_ATTR_TOGGLE(_item, command, mask) \
+   static ssize_t psmouse_attr_set_##_item(struct psmouse *psmouse,
const char *buf, size_t count) \
+   { \
+   unsigned char toggle; \
+   struct trackpoint_data *tp = psmouse-private; \
+   toggle = (buf[0] == '1') ? 1 : 0; \
+   if( toggle != tp-_item) { \
+   tp-_item = toggle; \
+   trackpoint_toggle_bit(psmouse-ps2dev, command, mask); 
\
+   } \
+   return count; \
+   }
+
+
+/*
+ * Device IO: read, write and toggle bit
+ */
+static void trackpoint_command(struct ps2dev *ps2dev, unsigned char cmd)
+{
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, TP_COMMAND));
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, cmd));
+}
+
+static void trackpoint_read(struct ps2dev *ps2dev, unsigned char loc,
unsigned char *results)
+{
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, TP_COMMAND));
+   ps2_command(ps2dev, results, MAKE_PS2_CMD(0, 1, loc));
+}
+
+static void trackpoint_write(struct ps2dev *ps2dev, unsigned char
loc, unsigned char val)
+{
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, TP_COMMAND));
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, TP_WRITE_MEM));
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, loc));
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, val));
+}
+
+static int trackpoint_toggle_bit(struct ps2dev *ps2dev, unsigned char
loc, unsigned char mask)
+{
+   /* Bad things will happen if the loc param isn't in this range */
+   if(loc  0x20 || loc = 0x2F)
+   return -1;
+   
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, TP_COMMAND));
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, TP_TOGGLE));
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, loc));
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, mask));
+   
+   return 0;
+}
+
+
+MAKE_ATTR_WRITE(sensitivity, TP_SENS);
+MAKE_ATTR_READ(sensitivity);
+
+MAKE_ATTR_WRITE(speed, TP_SPEED);
+MAKE_ATTR_READ(speed);
+
+MAKE_ATTR_WRITE(inertia

Re: PATCH 2.6.11-rc4]: IBM TrackPoint configuration support

2005-02-15 Thread Stephen Evanchik
On Tue, 15 Feb 2005 15:16:18 +0100, Vojtech Pavlik <[EMAIL PROTECTED]> wrote:
 
> Stephen, if you fix the above, and send me the patch, I'll merge it,
> there isn't any other problem with it.

Ok, more descriptive names, I noticed that psmouse->disconnect wasn't
being called when my laptop suspended so I made the reconnect function
sync the in memory configuration with what is actually on the device.

Also, I removed the external port disable commands in trackpoint_init
-- they didn't seem to do anything on my T23.



Stephen


diff -uNr a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile
--- a/drivers/input/mouse/Makefile  2005-02-13 12:47:32.0 -0500
+++ b/drivers/input/mouse/Makefile  2005-02-13 12:46:30.0 -0500
@@ -14,4 +14,4 @@
 obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o
 obj-$(CONFIG_MOUSE_VSXXXAA)+= vsxxxaa.o
 
-psmouse-objs  := psmouse-base.o alps.o logips2pp.o synaptics.o
+psmouse-objs  := psmouse-base.o alps.o logips2pp.o synaptics.o trackpoint.o
diff -uNr a/drivers/input/mouse/psmouse-base.c
b/drivers/input/mouse/psmouse-base.c
--- a/drivers/input/mouse/psmouse-base.c2005-02-13 12:47:32.0 
-0500
+++ b/drivers/input/mouse/psmouse-base.c2005-02-13 17:33:17.0 
-0500
@@ -23,6 +23,7 @@
 #include "psmouse.h"
 #include "synaptics.h"
 #include "logips2pp.h"
+#include "trackpoint.h"
 #include "alps.h"
 
 #define DRIVER_DESC"PS/2 mouse driver"
@@ -482,6 +483,16 @@
return PSMOUSE_IMPS;
 
 /*
+ * Try to initialize the IBM TrackPoint
+ */
+   if (max_proto > PSMOUSE_PS2 && trackpoint_init(psmouse) == 0) {
+   psmouse->vendor = "IBM";
+   psmouse->name = "TrackPoint";
+ 
+   return PSMOUSE_PS2;
+   }
+
+/*
  * Okay, all failed, we have a standard mouse here. The number of the buttons
  * is still a question, though. We assume 3.
  */
diff -uNr a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
--- a/drivers/input/mouse/trackpoint.c  1969-12-31 19:00:00.00000 -0500
+++ b/drivers/input/mouse/trackpoint.c  2005-02-15 23:05:08.0 -0500
@@ -0,0 +1,344 @@
+/*
+ * Stephen Evanchik <[EMAIL PROTECTED]>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * Trademarks are the property of their respective owners.
+ *
+ * 13/02/2005 - Removed middle button scroll, see Xorg for
+ * scroll emulation.
+ *
+ * 03/02/2005 - Remove proc and module parameters
+ * Added sysfs attributes
+ *
+ * 29/01/2005 - Fixed UltraNav support
+ * Moved to libps2 interface
+ * Renamed internal property variables to be consistent with 
reference docs
+ * Fixed negative inertia not being set properly
+ * Added middle button scroll module parameter
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "psmouse.h"
+#include "trackpoint.h"
+
+
+PSMOUSE_DEFINE_ATTR(sensitivity);
+PSMOUSE_DEFINE_ATTR(speed);
+PSMOUSE_DEFINE_ATTR(inertia);
+PSMOUSE_DEFINE_ATTR(reach);
+PSMOUSE_DEFINE_ATTR(draghys);
+PSMOUSE_DEFINE_ATTR(mindrag);
+PSMOUSE_DEFINE_ATTR(thresh);
+PSMOUSE_DEFINE_ATTR(upthresh);
+PSMOUSE_DEFINE_ATTR(ztime);
+PSMOUSE_DEFINE_ATTR(jenks);
+PSMOUSE_DEFINE_ATTR(press_to_select);
+PSMOUSE_DEFINE_ATTR(skipback);
+PSMOUSE_DEFINE_ATTR(middle_btn_disable);
+PSMOUSE_DEFINE_ATTR(ext_dev);
+PSMOUSE_DEFINE_ATTR(transparent);
+
+
+#define MAKE_ATTR_READ(_item) \
+static ssize_t psmouse_attr_show_##_item(struct psmouse
*psmouse, char *buf) \
+{ \
+struct trackpoint_data *tp = psmouse->private; \
+return sprintf(buf, "%lu\n", (unsigned long)tp->_item); \
+}
+
+#define MAKE_ATTR_WRITE(_item, command) \
+static ssize_t psmouse_attr_set_##_item(struct psmouse
*psmouse, const char *buf, size_t count) \
+{ \
+   char *rest; \
+unsigned long value; \
+struct trackpoint_data *tp = psmouse->private; \
+value = simple_strtoul(buf, , 10); \
+   if(*rest) \
+   return -EINVAL; \
+   tp->_item = value; \
+trackpoint_write(>ps2dev, command, tp->_item); \
+return count; \
+}
+
+#define MAKE_ATTR_TOGGLE(_item, command, mask) \
+static ssize_t psmouse_attr_set_##_item(struct psmouse
*psmouse, const char *buf, size_t count) \
+{ \
+unsigned char toggle; \
+struct trackpoint_data *tp = psmouse->private; \
+toggle = (buf[0] == '1') ? 1 : 0; \
+if( toggle != tp->_item) { \

Re: PATCH 2.6.11-rc4]: IBM TrackPoint configuration support

2005-02-15 Thread Stephen Evanchik
On Tue, 15 Feb 2005 15:16:18 +0100, Vojtech Pavlik [EMAIL PROTECTED] wrote:
 
 Stephen, if you fix the above, and send me the patch, I'll merge it,
 there isn't any other problem with it.

Ok, more descriptive names, I noticed that psmouse-disconnect wasn't
being called when my laptop suspended so I made the reconnect function
sync the in memory configuration with what is actually on the device.

Also, I removed the external port disable commands in trackpoint_init
-- they didn't seem to do anything on my T23.



Stephen


diff -uNr a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile
--- a/drivers/input/mouse/Makefile  2005-02-13 12:47:32.0 -0500
+++ b/drivers/input/mouse/Makefile  2005-02-13 12:46:30.0 -0500
@@ -14,4 +14,4 @@
 obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o
 obj-$(CONFIG_MOUSE_VSXXXAA)+= vsxxxaa.o
 
-psmouse-objs  := psmouse-base.o alps.o logips2pp.o synaptics.o
+psmouse-objs  := psmouse-base.o alps.o logips2pp.o synaptics.o trackpoint.o
diff -uNr a/drivers/input/mouse/psmouse-base.c
b/drivers/input/mouse/psmouse-base.c
--- a/drivers/input/mouse/psmouse-base.c2005-02-13 12:47:32.0 
-0500
+++ b/drivers/input/mouse/psmouse-base.c2005-02-13 17:33:17.0 
-0500
@@ -23,6 +23,7 @@
 #include psmouse.h
 #include synaptics.h
 #include logips2pp.h
+#include trackpoint.h
 #include alps.h
 
 #define DRIVER_DESCPS/2 mouse driver
@@ -482,6 +483,16 @@
return PSMOUSE_IMPS;
 
 /*
+ * Try to initialize the IBM TrackPoint
+ */
+   if (max_proto  PSMOUSE_PS2  trackpoint_init(psmouse) == 0) {
+   psmouse-vendor = IBM;
+   psmouse-name = TrackPoint;
+ 
+   return PSMOUSE_PS2;
+   }
+
+/*
  * Okay, all failed, we have a standard mouse here. The number of the buttons
  * is still a question, though. We assume 3.
  */
diff -uNr a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
--- a/drivers/input/mouse/trackpoint.c  1969-12-31 19:00:00.0 -0500
+++ b/drivers/input/mouse/trackpoint.c  2005-02-15 23:05:08.0 -0500
@@ -0,0 +1,344 @@
+/*
+ * Stephen Evanchik [EMAIL PROTECTED]
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * Trademarks are the property of their respective owners.
+ *
+ * 13/02/2005 - Removed middle button scroll, see Xorg for
+ * scroll emulation.
+ *
+ * 03/02/2005 - Remove proc and module parameters
+ * Added sysfs attributes
+ *
+ * 29/01/2005 - Fixed UltraNav support
+ * Moved to libps2 interface
+ * Renamed internal property variables to be consistent with 
reference docs
+ * Fixed negative inertia not being set properly
+ * Added middle button scroll module parameter
+ *
+ */
+
+#include linux/delay.h
+#include linux/serio.h
+#include linux/module.h
+#include linux/moduleparam.h
+#include linux/input.h
+#include linux/libps2.h
+#include linux/proc_fs.h
+#include asm/uaccess.h
+#include psmouse.h
+#include trackpoint.h
+
+
+PSMOUSE_DEFINE_ATTR(sensitivity);
+PSMOUSE_DEFINE_ATTR(speed);
+PSMOUSE_DEFINE_ATTR(inertia);
+PSMOUSE_DEFINE_ATTR(reach);
+PSMOUSE_DEFINE_ATTR(draghys);
+PSMOUSE_DEFINE_ATTR(mindrag);
+PSMOUSE_DEFINE_ATTR(thresh);
+PSMOUSE_DEFINE_ATTR(upthresh);
+PSMOUSE_DEFINE_ATTR(ztime);
+PSMOUSE_DEFINE_ATTR(jenks);
+PSMOUSE_DEFINE_ATTR(press_to_select);
+PSMOUSE_DEFINE_ATTR(skipback);
+PSMOUSE_DEFINE_ATTR(middle_btn_disable);
+PSMOUSE_DEFINE_ATTR(ext_dev);
+PSMOUSE_DEFINE_ATTR(transparent);
+
+
+#define MAKE_ATTR_READ(_item) \
+static ssize_t psmouse_attr_show_##_item(struct psmouse
*psmouse, char *buf) \
+{ \
+struct trackpoint_data *tp = psmouse-private; \
+return sprintf(buf, %lu\n, (unsigned long)tp-_item); \
+}
+
+#define MAKE_ATTR_WRITE(_item, command) \
+static ssize_t psmouse_attr_set_##_item(struct psmouse
*psmouse, const char *buf, size_t count) \
+{ \
+   char *rest; \
+unsigned long value; \
+struct trackpoint_data *tp = psmouse-private; \
+value = simple_strtoul(buf, rest, 10); \
+   if(*rest) \
+   return -EINVAL; \
+   tp-_item = value; \
+trackpoint_write(psmouse-ps2dev, command, tp-_item); \
+return count; \
+}
+
+#define MAKE_ATTR_TOGGLE(_item, command, mask) \
+static ssize_t psmouse_attr_set_##_item(struct psmouse
*psmouse, const char *buf, size_t count) \
+{ \
+unsigned char toggle; \
+struct trackpoint_data *tp = psmouse-private; \
+toggle = (buf[0] == '1') ? 1 : 0; \
+if( toggle != tp-_item) { \
+tp-_item = toggle; \
+trackpoint_toggle_bit(psmouse

PATCH 2.6.11-rc4]: IBM TrackPoint configuration support

2005-02-13 Thread Stephen Evanchik
Here is the latest IBM TrackPoint patch. I believe I made all of the
necessary changes in this release including the removal of the
middle-to-scroll functionality. One item I didn't address was a
comment about checking the return code of ps2_command ..

I looked at other usages and it wasn't clear to me how to actually
implement something that is sane. In some places an error causes a
return out of the function and in others the return value is ignored.
Should I check each return value or the first ?

Any comments are greatly appreciated. I have tested this on my T23 as
well as a T40 and T42p ..

Stephen


diff -uNr a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile
--- a/drivers/input/mouse/Makefile  2005-02-13 12:47:32.0 -0500
+++ b/drivers/input/mouse/Makefile  2005-02-13 12:46:30.0 -0500
@@ -14,4 +14,4 @@
 obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o
 obj-$(CONFIG_MOUSE_VSXXXAA)+= vsxxxaa.o
 
-psmouse-objs  := psmouse-base.o alps.o logips2pp.o synaptics.o
+psmouse-objs  := psmouse-base.o alps.o logips2pp.o synaptics.o trackpoint.o
diff -uNr a/drivers/input/mouse/psmouse-base.c
b/drivers/input/mouse/psmouse-base.c
--- a/drivers/input/mouse/psmouse-base.c2005-02-13 12:47:32.0 
-0500
+++ b/drivers/input/mouse/psmouse-base.c2005-02-13 17:33:17.0 
-0500
@@ -23,6 +23,7 @@
 #include "psmouse.h"
 #include "synaptics.h"
 #include "logips2pp.h"
+#include "trackpoint.h"
 #include "alps.h"
 
 #define DRIVER_DESC"PS/2 mouse driver"
@@ -482,6 +483,16 @@
return PSMOUSE_IMPS;
 
 /*
+ * Try to initialize the IBM TrackPoint
+ */
+   if (max_proto > PSMOUSE_PS2 && trackpoint_init(psmouse) == 0) {
+   psmouse->vendor = "IBM";
+   psmouse->name = "TrackPoint";
+ 
+   return PSMOUSE_PS2;
+   }
+
+/*
  * Okay, all failed, we have a standard mouse here. The number of the buttons
  * is still a question, though. We assume 3.
  */
diff -uNr a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
--- a/drivers/input/mouse/trackpoint.c  1969-12-31 19:00:00.0 -0500
+++ b/drivers/input/mouse/trackpoint.c  2005-02-13 19:26:09.0 -0500
@@ -0,0 +1,347 @@
+/*
+ * Stephen Evanchik <[EMAIL PROTECTED]>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * Trademarks are the property of their respective owners.
+ *
+ * 13/02/2005 - Removed middle button scroll, see Xorg for
+ * scroll emulation.
+ *
+ * 03/02/2005 - Remove proc and module parameters
+ * Added sysfs attributes
+ *
+ * 29/01/2005 - Fixed UltraNav support
+ * Moved to libps2 interface
+ * Renamed internal property variables to be consistent with 
reference docs
+ * Fixed negative inertia not being set properly
+ * Added middle button scroll module parameter
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "psmouse.h"
+#include "trackpoint.h"
+
+
+PSMOUSE_DEFINE_ATTR(sensitivity);
+PSMOUSE_DEFINE_ATTR(speed);
+PSMOUSE_DEFINE_ATTR(inertia);
+PSMOUSE_DEFINE_ATTR(reach);
+PSMOUSE_DEFINE_ATTR(draghys);
+PSMOUSE_DEFINE_ATTR(mindrag);
+PSMOUSE_DEFINE_ATTR(thresh);
+PSMOUSE_DEFINE_ATTR(upthresh);
+PSMOUSE_DEFINE_ATTR(ztime);
+PSMOUSE_DEFINE_ATTR(jenks);
+PSMOUSE_DEFINE_ATTR(ptson);
+PSMOUSE_DEFINE_ATTR(skipback);
+PSMOUSE_DEFINE_ATTR(mb);
+PSMOUSE_DEFINE_ATTR(ext_dev);
+PSMOUSE_DEFINE_ATTR(transparent);
+
+
+#define MAKE_ATTR_READ(_item) \
+static ssize_t psmouse_attr_show_##_item(struct psmouse
*psmouse, char *buf) \
+{ \
+struct trackpoint_data *tp = psmouse->private; \
+return sprintf(buf, "%lu\n", (unsigned long)tp->_item); \
+}
+
+#define MAKE_ATTR_WRITE(_item, command) \
+static ssize_t psmouse_attr_set_##_item(struct psmouse
*psmouse, const char *buf, size_t count) \
+{ \
+   char *rest; \
+unsigned long value; \
+struct trackpoint_data *tp = psmouse->private; \
+value = simple_strtoul(buf, , 10); \
+   if(*rest) \
+   return -EINVAL; \
+   tp->_item = value; \
+trackpoint_write(>ps2dev, command, tp->_item); \
+return count; \
+}
+
+#define MAKE_ATTR_TOGGLE(_item, command, mask) \
+static ssize_t psmouse_attr_set_##_item(struct psmouse
*psmouse, const char *buf, size_t count) \
+{ \
+unsigned char toggle; \
+struct trackpoint_data *tp = psmouse->private; \
+toggle = (buf[0] == '1') ? 1 : 0; \
+   

Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-13 Thread Stephen Evanchik
On Sun, 13 Feb 2005 20:31:49 +0100, Vojtech Pavlik <[EMAIL PROTECTED]> wrote:
>
> You're right. The IBM trackpoints unfortunately don't have a 'native'
> mode, they always do full processing and send classic PS/2 packets.
> 
> I think we shouldn't need a handler, since we can use the PS/2 protocol
> one. We'll need some options to set the trackpoint tap behavior (as far
> as I know it can only be mapped to a button), and we'll need a safe
> detection, but that's all.

The tap only sends a button one event. As far as the Press to Select
qualities are concerned, the necessary options are exposed by the
driver in the sysfs filesystem now. Understanding their  effects on
how a press, drag, double press is detected is another matter.

I'll send a 2.6.11-rc4 based patch later today for consideration.

Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-13 Thread Stephen Evanchik
On Thu, 3 Feb 2005 22:52:44 -0500, Dmitry Torokhov
<[EMAIL PROTECTED]> wrote:
> OK, I have read the code once again, and saw that you have special
> handling within PS/2 protocol based on model constant. Please set
> psmouse type to PSMOUSE_TRACKPOINT instead of model and provide full
> protocol handler, like ALPS, Synaptics and Logitech do. Trackpoint
> is different and complex enough to warrant it.

I'm not sure that I think a protocol handler is necessary unless I am
misunderstanding what you mean. The TrackPoint is nothing more than a
PS/2 mouse with 2 or 3 buttons that responds to an additional set of
commands. The extra handling has to do with middle-to-scroll which
could be done in userspace.

Aside from that the only time TracKPoint specific processing occurs is
when some property is being manipulated.

Do you still think a custom handler is necessary? 

Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-13 Thread Stephen Evanchik
On Mon, 7 Feb 2005 11:14:17 +0100, Vojtech Pavlik <[EMAIL PROTECTED]> wrote:
> > Perhaps this should be done in userspace? It is probably usable on
> > non-trackpoint devices, too...
> 
> For a big part it's not possible to do in userspace, because the
> touchpoint doesn't give the pressure information, it only can be mapped
> to a button click.
> 
> But middle-button-to-scroll would be doable in userspace, yes.
> 

Middle-to-scroll in the newer Xorg releases. I received a number of
requests from users to include this feature, I'm not sure why the Xorg
option is inadequate. It can be removed if necessary.


Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-13 Thread Stephen Evanchik
On Mon, 7 Feb 2005 11:14:17 +0100, Vojtech Pavlik [EMAIL PROTECTED] wrote:
  Perhaps this should be done in userspace? It is probably usable on
  non-trackpoint devices, too...
 
 For a big part it's not possible to do in userspace, because the
 touchpoint doesn't give the pressure information, it only can be mapped
 to a button click.
 
 But middle-button-to-scroll would be doable in userspace, yes.
 

Middle-to-scroll in the newer Xorg releases. I received a number of
requests from users to include this feature, I'm not sure why the Xorg
option is inadequate. It can be removed if necessary.


Stephen
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-13 Thread Stephen Evanchik
On Thu, 3 Feb 2005 22:52:44 -0500, Dmitry Torokhov
[EMAIL PROTECTED] wrote:
 OK, I have read the code once again, and saw that you have special
 handling within PS/2 protocol based on model constant. Please set
 psmouse type to PSMOUSE_TRACKPOINT instead of model and provide full
 protocol handler, like ALPS, Synaptics and Logitech do. Trackpoint
 is different and complex enough to warrant it.

I'm not sure that I think a protocol handler is necessary unless I am
misunderstanding what you mean. The TrackPoint is nothing more than a
PS/2 mouse with 2 or 3 buttons that responds to an additional set of
commands. The extra handling has to do with middle-to-scroll which
could be done in userspace.

Aside from that the only time TracKPoint specific processing occurs is
when some property is being manipulated.

Do you still think a custom handler is necessary? 

Stephen
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-13 Thread Stephen Evanchik
On Sun, 13 Feb 2005 20:31:49 +0100, Vojtech Pavlik [EMAIL PROTECTED] wrote:

 You're right. The IBM trackpoints unfortunately don't have a 'native'
 mode, they always do full processing and send classic PS/2 packets.
 
 I think we shouldn't need a handler, since we can use the PS/2 protocol
 one. We'll need some options to set the trackpoint tap behavior (as far
 as I know it can only be mapped to a button), and we'll need a safe
 detection, but that's all.

The tap only sends a button one event. As far as the Press to Select
qualities are concerned, the necessary options are exposed by the
driver in the sysfs filesystem now. Understanding their  effects on
how a press, drag, double press is detected is another matter.

I'll send a 2.6.11-rc4 based patch later today for consideration.

Stephen
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


PATCH 2.6.11-rc4]: IBM TrackPoint configuration support

2005-02-13 Thread Stephen Evanchik
Here is the latest IBM TrackPoint patch. I believe I made all of the
necessary changes in this release including the removal of the
middle-to-scroll functionality. One item I didn't address was a
comment about checking the return code of ps2_command ..

I looked at other usages and it wasn't clear to me how to actually
implement something that is sane. In some places an error causes a
return out of the function and in others the return value is ignored.
Should I check each return value or the first ?

Any comments are greatly appreciated. I have tested this on my T23 as
well as a T40 and T42p ..

Stephen


diff -uNr a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile
--- a/drivers/input/mouse/Makefile  2005-02-13 12:47:32.0 -0500
+++ b/drivers/input/mouse/Makefile  2005-02-13 12:46:30.0 -0500
@@ -14,4 +14,4 @@
 obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o
 obj-$(CONFIG_MOUSE_VSXXXAA)+= vsxxxaa.o
 
-psmouse-objs  := psmouse-base.o alps.o logips2pp.o synaptics.o
+psmouse-objs  := psmouse-base.o alps.o logips2pp.o synaptics.o trackpoint.o
diff -uNr a/drivers/input/mouse/psmouse-base.c
b/drivers/input/mouse/psmouse-base.c
--- a/drivers/input/mouse/psmouse-base.c2005-02-13 12:47:32.0 
-0500
+++ b/drivers/input/mouse/psmouse-base.c2005-02-13 17:33:17.0 
-0500
@@ -23,6 +23,7 @@
 #include psmouse.h
 #include synaptics.h
 #include logips2pp.h
+#include trackpoint.h
 #include alps.h
 
 #define DRIVER_DESCPS/2 mouse driver
@@ -482,6 +483,16 @@
return PSMOUSE_IMPS;
 
 /*
+ * Try to initialize the IBM TrackPoint
+ */
+   if (max_proto  PSMOUSE_PS2  trackpoint_init(psmouse) == 0) {
+   psmouse-vendor = IBM;
+   psmouse-name = TrackPoint;
+ 
+   return PSMOUSE_PS2;
+   }
+
+/*
  * Okay, all failed, we have a standard mouse here. The number of the buttons
  * is still a question, though. We assume 3.
  */
diff -uNr a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
--- a/drivers/input/mouse/trackpoint.c  1969-12-31 19:00:00.0 -0500
+++ b/drivers/input/mouse/trackpoint.c  2005-02-13 19:26:09.0 -0500
@@ -0,0 +1,347 @@
+/*
+ * Stephen Evanchik [EMAIL PROTECTED]
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * Trademarks are the property of their respective owners.
+ *
+ * 13/02/2005 - Removed middle button scroll, see Xorg for
+ * scroll emulation.
+ *
+ * 03/02/2005 - Remove proc and module parameters
+ * Added sysfs attributes
+ *
+ * 29/01/2005 - Fixed UltraNav support
+ * Moved to libps2 interface
+ * Renamed internal property variables to be consistent with 
reference docs
+ * Fixed negative inertia not being set properly
+ * Added middle button scroll module parameter
+ *
+ */
+
+#include linux/delay.h
+#include linux/serio.h
+#include linux/module.h
+#include linux/moduleparam.h
+#include linux/input.h
+#include linux/libps2.h
+#include linux/proc_fs.h
+#include asm/uaccess.h
+#include psmouse.h
+#include trackpoint.h
+
+
+PSMOUSE_DEFINE_ATTR(sensitivity);
+PSMOUSE_DEFINE_ATTR(speed);
+PSMOUSE_DEFINE_ATTR(inertia);
+PSMOUSE_DEFINE_ATTR(reach);
+PSMOUSE_DEFINE_ATTR(draghys);
+PSMOUSE_DEFINE_ATTR(mindrag);
+PSMOUSE_DEFINE_ATTR(thresh);
+PSMOUSE_DEFINE_ATTR(upthresh);
+PSMOUSE_DEFINE_ATTR(ztime);
+PSMOUSE_DEFINE_ATTR(jenks);
+PSMOUSE_DEFINE_ATTR(ptson);
+PSMOUSE_DEFINE_ATTR(skipback);
+PSMOUSE_DEFINE_ATTR(mb);
+PSMOUSE_DEFINE_ATTR(ext_dev);
+PSMOUSE_DEFINE_ATTR(transparent);
+
+
+#define MAKE_ATTR_READ(_item) \
+static ssize_t psmouse_attr_show_##_item(struct psmouse
*psmouse, char *buf) \
+{ \
+struct trackpoint_data *tp = psmouse-private; \
+return sprintf(buf, %lu\n, (unsigned long)tp-_item); \
+}
+
+#define MAKE_ATTR_WRITE(_item, command) \
+static ssize_t psmouse_attr_set_##_item(struct psmouse
*psmouse, const char *buf, size_t count) \
+{ \
+   char *rest; \
+unsigned long value; \
+struct trackpoint_data *tp = psmouse-private; \
+value = simple_strtoul(buf, rest, 10); \
+   if(*rest) \
+   return -EINVAL; \
+   tp-_item = value; \
+trackpoint_write(psmouse-ps2dev, command, tp-_item); \
+return count; \
+}
+
+#define MAKE_ATTR_TOGGLE(_item, command, mask) \
+static ssize_t psmouse_attr_set_##_item(struct psmouse
*psmouse, const char *buf, size_t count) \
+{ \
+unsigned char toggle; \
+struct trackpoint_data *tp = psmouse-private; \
+toggle = (buf[0] == '1') ? 1 : 0; \
+if( toggle != tp-_item) { \
+tp-_item

Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-04 Thread Stephen Evanchik
On Fri, 4 Feb 2005 07:35:20 +0100, Vojtech Pavlik <[EMAIL PROTECTED]> wrote:
> > >  /*
> > > + * Try to initialize the IBM TrackPoint
> > > + */
> > > +   if (max_proto > PSMOUSE_PS2 && trackpoint_init(psmouse) == 0) {
> > > +   psmouse->vendor = "IBM";
> > > +   psmouse->name = "TrackPoint";
> > > +
> > > +   return PSMOUSE_PS2;
> >
> > Why PSMOUSE_PS2? Reconnect will surely not like it.
> 
> Indeed. IIRC this patch killed wheel mouse detection in ubuntu.

Earlier versions of the patch didn't disable the device while probing
so events could be interpreted as the magic ID of a TrackPoint. It now
resets and disables the PS/2 device before detection but not after a
detect failure.

I'll clean that up so its more sensible.


Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-04 Thread Stephen Evanchik
On Fri, 4 Feb 2005 07:35:20 +0100, Vojtech Pavlik [EMAIL PROTECTED] wrote:
/*
   + * Try to initialize the IBM TrackPoint
   + */
   +   if (max_proto  PSMOUSE_PS2  trackpoint_init(psmouse) == 0) {
   +   psmouse-vendor = IBM;
   +   psmouse-name = TrackPoint;
   +
   +   return PSMOUSE_PS2;
 
  Why PSMOUSE_PS2? Reconnect will surely not like it.
 
 Indeed. IIRC this patch killed wheel mouse detection in ubuntu.

Earlier versions of the patch didn't disable the device while probing
so events could be interpreted as the magic ID of a TrackPoint. It now
resets and disables the PS/2 device before detection but not after a
detect failure.

I'll clean that up so its more sensible.


Stephen
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-03 Thread Stephen Evanchik
On Thu, 3 Feb 2005 22:52:44 -0500, Dmitry Torokhov
<[EMAIL PROTECTED]> wrote:
> OK, I have read the code once again, and saw that you have special
> handling within PS/2 protocol based on model constant. Please set
> psmouse type to PSMOUSE_TRACKPOINT instead of model and provide full
> protocol handler, like ALPS, Synaptics and Logitech do. Trackpoint
> is different and complex enough to warrant it.

Thanks, I've made all the changes suggested and I'll incorporate this
too. I'll send a new patch at the end of the weekend when I get back.


Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-03 Thread Stephen Evanchik
Vojtech,

Here is a patch that exposes the IBM TrackPoint's extended properties
as well as scroll wheel emulation.


I would appreciate comments and suggestions to make this more acceptable.


Stephen


diff -uNr a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile
--- a/drivers/input/mouse/Makefile  2005-02-03 17:30:40.0 -0500
+++ b/drivers/input/mouse/Makefile  2005-02-03 17:29:42.0 -0500
@@ -14,4 +14,4 @@
 obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o
 obj-$(CONFIG_MOUSE_VSXXXAA)+= vsxxxaa.o
 
-psmouse-objs  := psmouse-base.o alps.o logips2pp.o synaptics.o
+psmouse-objs  := psmouse-base.o alps.o logips2pp.o synaptics.o trackpoint.o
diff -uNr a/drivers/input/mouse/psmouse-base.c
b/drivers/input/mouse/psmouse-base.c
--- a/drivers/input/mouse/psmouse-base.c2005-02-03 17:30:40.0 
-0500
+++ b/drivers/input/mouse/psmouse-base.c2005-02-03 17:29:42.0 
-0500
@@ -23,6 +23,7 @@
 #include "psmouse.h"
 #include "synaptics.h"
 #include "logips2pp.h"
+#include "trackpoint.h"
 #include "alps.h"
 
 #define DRIVER_DESC"PS/2 mouse driver"
@@ -119,6 +120,13 @@
}
 
 /*
+ * TrackPoint scroll simulation handler if the BTN_MIDDLE is down
+ */
+
+   if(psmouse->model == PSMOUSE_TRACKPOINT)
+   trackpoint_sim_scroll(psmouse);
+
+/*
  * Generic PS/2 Mouse
  */
 
@@ -482,6 +490,16 @@
return PSMOUSE_IMPS;
 
 /*
+ * Try to initialize the IBM TrackPoint
+ */
+   if (max_proto > PSMOUSE_PS2 && trackpoint_init(psmouse) == 0) {
+   psmouse->vendor = "IBM";
+   psmouse->name = "TrackPoint";
+ 
+   return PSMOUSE_PS2;
+   }
+
+/*
  * Okay, all failed, we have a standard mouse here. The number of the buttons
  * is still a question, though. We assume 3.
  */
diff -uNr a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
--- a/drivers/input/mouse/trackpoint.c  1969-12-31 19:00:00.0 -0500
+++ b/drivers/input/mouse/trackpoint.c  2005-02-03 17:29:42.0 -0500
@@ -0,0 +1,649 @@
+/*
+ * Stephen Evanchik <[EMAIL PROTECTED]>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * Trademarks are the property of their respective owners.
+ *
+ * 29/01/2005 - Fixed UltraNav support
+ * Moved to libps2 interface
+ * Renamed internal property variables to be consistent with 
reference docs
+ * Fixed negative inertia not being set properly
+ * Added middle button scroll module parameter
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "psmouse.h"
+#include "trackpoint.h"
+
+
+int tp_sens = TP_DEF_SENS;
+module_param_named(sens, tp_sens, uint, 0);
+MODULE_PARM_DESC(sens, "Sensitivity");
+
+int tp_speed = TP_DEF_SPEED;
+module_param_named(speed, tp_speed, uint, 0);
+MODULE_PARM_DESC(speed, "Speed of pointer");
+
+int tp_reach = TP_DEF_REACH;
+module_param_named(reach, tp_reach, uint, 0);
+MODULE_PARM_DESC(reach, "Backup Range");
+
+int tp_draghys = TP_DEF_DRAGHYS;
+module_param_named(draghys, tp_draghys, uint, 0);
+MODULE_PARM_DESC(draghys, "Resistance to dragging");
+
+int tp_mindrag = TP_DEF_MINDRAG;
+module_param_named(mindrag, tp_mindrag, uint, 0);
+MODULE_PARM_DESC(mindrag, "Drag threshold");
+
+int tp_thresh = TP_DEF_THRESH;
+module_param_named(thresh, tp_thresh, uint, 0);
+MODULE_PARM_DESC(thresh, "Force necessary to trigger a press or release");
+
+int tp_upthresh = TP_UP_THRESH;
+module_param_named(upthresh, tp_upthresh, uint, 0);
+MODULE_PARM_DESC(upthresh, "Force necessary to trigger a click");
+
+int tp_ztime = TP_DEF_Z_TIME;
+module_param_named(ztime, tp_ztime, uint, 0);
+MODULE_PARM_DESC(ztime, "Determines how sharp a press is");
+
+int tp_jenks = TP_DEF_JENKS_CURV;
+module_param_named(jenks, tp_jenks, uint, 0);
+MODULE_PARM_DESC(jenks, "Double click sensitivity");
+
+
+/* Toggles */
+int tp_ptson = TP_DEF_PTSON;
+module_param_named(ptson, tp_ptson, uint, 0);
+MODULE_PARM_DESC(ptson, "Press to Select");
+
+int tp_mb = TP_DEF_MB;
+module_param_named(mb, tp_mb, uint, 0);
+MODULE_PARM_DESC(mb, "Middle button is disabled");
+
+int tp_mb_scroll = TP_DEF_MB_SCROLL;
+module_param_named(mb_scroll, tp_mb_scroll, uint, 0);
+MODULE_PARM_DESC(mb_scroll, "Scroll with middle button");
+
+
+__obsolete_setup("pts=");
+__obsolete_setup("backup=");
+__obsolete_setup("draghyst=");
+
+/*
+ * Device IO: read, write and toggle bit
+ */
+static void trackpoint_command(struct ps2dev *ps2dev, unsigned char cmd)
+{  
+   ps2_command(ps2dev, NULL, MAKE_P

[PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-03 Thread Stephen Evanchik
Vojtech,

Here is a patch that exposes the IBM TrackPoint's extended properties
as well as scroll wheel emulation.


I would appreciate comments and suggestions to make this more acceptable.


Stephen


diff -uNr a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile
--- a/drivers/input/mouse/Makefile  2005-02-03 17:30:40.0 -0500
+++ b/drivers/input/mouse/Makefile  2005-02-03 17:29:42.0 -0500
@@ -14,4 +14,4 @@
 obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o
 obj-$(CONFIG_MOUSE_VSXXXAA)+= vsxxxaa.o
 
-psmouse-objs  := psmouse-base.o alps.o logips2pp.o synaptics.o
+psmouse-objs  := psmouse-base.o alps.o logips2pp.o synaptics.o trackpoint.o
diff -uNr a/drivers/input/mouse/psmouse-base.c
b/drivers/input/mouse/psmouse-base.c
--- a/drivers/input/mouse/psmouse-base.c2005-02-03 17:30:40.0 
-0500
+++ b/drivers/input/mouse/psmouse-base.c2005-02-03 17:29:42.0 
-0500
@@ -23,6 +23,7 @@
 #include psmouse.h
 #include synaptics.h
 #include logips2pp.h
+#include trackpoint.h
 #include alps.h
 
 #define DRIVER_DESCPS/2 mouse driver
@@ -119,6 +120,13 @@
}
 
 /*
+ * TrackPoint scroll simulation handler if the BTN_MIDDLE is down
+ */
+
+   if(psmouse-model == PSMOUSE_TRACKPOINT)
+   trackpoint_sim_scroll(psmouse);
+
+/*
  * Generic PS/2 Mouse
  */
 
@@ -482,6 +490,16 @@
return PSMOUSE_IMPS;
 
 /*
+ * Try to initialize the IBM TrackPoint
+ */
+   if (max_proto  PSMOUSE_PS2  trackpoint_init(psmouse) == 0) {
+   psmouse-vendor = IBM;
+   psmouse-name = TrackPoint;
+ 
+   return PSMOUSE_PS2;
+   }
+
+/*
  * Okay, all failed, we have a standard mouse here. The number of the buttons
  * is still a question, though. We assume 3.
  */
diff -uNr a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
--- a/drivers/input/mouse/trackpoint.c  1969-12-31 19:00:00.0 -0500
+++ b/drivers/input/mouse/trackpoint.c  2005-02-03 17:29:42.0 -0500
@@ -0,0 +1,649 @@
+/*
+ * Stephen Evanchik [EMAIL PROTECTED]
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * Trademarks are the property of their respective owners.
+ *
+ * 29/01/2005 - Fixed UltraNav support
+ * Moved to libps2 interface
+ * Renamed internal property variables to be consistent with 
reference docs
+ * Fixed negative inertia not being set properly
+ * Added middle button scroll module parameter
+ *
+ */
+
+#include linux/delay.h
+#include linux/serio.h
+#include linux/module.h
+#include linux/moduleparam.h
+#include linux/input.h
+#include linux/libps2.h
+#include linux/proc_fs.h
+#include asm/uaccess.h
+#include psmouse.h
+#include trackpoint.h
+
+
+int tp_sens = TP_DEF_SENS;
+module_param_named(sens, tp_sens, uint, 0);
+MODULE_PARM_DESC(sens, Sensitivity);
+
+int tp_speed = TP_DEF_SPEED;
+module_param_named(speed, tp_speed, uint, 0);
+MODULE_PARM_DESC(speed, Speed of pointer);
+
+int tp_reach = TP_DEF_REACH;
+module_param_named(reach, tp_reach, uint, 0);
+MODULE_PARM_DESC(reach, Backup Range);
+
+int tp_draghys = TP_DEF_DRAGHYS;
+module_param_named(draghys, tp_draghys, uint, 0);
+MODULE_PARM_DESC(draghys, Resistance to dragging);
+
+int tp_mindrag = TP_DEF_MINDRAG;
+module_param_named(mindrag, tp_mindrag, uint, 0);
+MODULE_PARM_DESC(mindrag, Drag threshold);
+
+int tp_thresh = TP_DEF_THRESH;
+module_param_named(thresh, tp_thresh, uint, 0);
+MODULE_PARM_DESC(thresh, Force necessary to trigger a press or release);
+
+int tp_upthresh = TP_UP_THRESH;
+module_param_named(upthresh, tp_upthresh, uint, 0);
+MODULE_PARM_DESC(upthresh, Force necessary to trigger a click);
+
+int tp_ztime = TP_DEF_Z_TIME;
+module_param_named(ztime, tp_ztime, uint, 0);
+MODULE_PARM_DESC(ztime, Determines how sharp a press is);
+
+int tp_jenks = TP_DEF_JENKS_CURV;
+module_param_named(jenks, tp_jenks, uint, 0);
+MODULE_PARM_DESC(jenks, Double click sensitivity);
+
+
+/* Toggles */
+int tp_ptson = TP_DEF_PTSON;
+module_param_named(ptson, tp_ptson, uint, 0);
+MODULE_PARM_DESC(ptson, Press to Select);
+
+int tp_mb = TP_DEF_MB;
+module_param_named(mb, tp_mb, uint, 0);
+MODULE_PARM_DESC(mb, Middle button is disabled);
+
+int tp_mb_scroll = TP_DEF_MB_SCROLL;
+module_param_named(mb_scroll, tp_mb_scroll, uint, 0);
+MODULE_PARM_DESC(mb_scroll, Scroll with middle button);
+
+
+__obsolete_setup(pts=);
+__obsolete_setup(backup=);
+__obsolete_setup(draghyst=);
+
+/*
+ * Device IO: read, write and toggle bit
+ */
+static void trackpoint_command(struct ps2dev *ps2dev, unsigned char cmd)
+{  
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, TP_COMMAND));
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, cmd));
+}
+
+static void trackpoint_read(struct ps2dev *ps2dev, unsigned char loc,
unsigned char *results)
+{
+   ps2_command(ps2dev, NULL

Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-03 Thread Stephen Evanchik
On Thu, 3 Feb 2005 22:52:44 -0500, Dmitry Torokhov
[EMAIL PROTECTED] wrote:
 OK, I have read the code once again, and saw that you have special
 handling within PS/2 protocol based on model constant. Please set
 psmouse type to PSMOUSE_TRACKPOINT instead of model and provide full
 protocol handler, like ALPS, Synaptics and Logitech do. Trackpoint
 is different and complex enough to warrant it.

Thanks, I've made all the changes suggested and I'll incorporate this
too. I'll send a new patch at the end of the weekend when I get back.


Stephen
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/