[parisc-linux] Thomas Marteau kbd patch adapted.
=?iso-8859-1?Q?Jo=EBl_Soete?=
jso@europay.com
Wed, 5 Sep 2001 15:01:08 +0200
--0__=C1256ABE0044855E8f9e8a93df938690918cC1256ABE0044855E
Content-type: text/plain; charset=us-ascii
Dear all,
I just adapt the patch keyboard of Thomas taking account of kernel update,
reports of experiences of Richard.
I can only test it against 2.4.9-pa14 (cvs update) and seems to work as
well as with 712 as with b180 model
(unplug, replug: ok with hp kbd; Caps lock do not hang the "system")
In the hope to be helpful,
Joel
PS: I do just add some initial variable value to avoid compile warning. I
do not yet find the way the avoid the last (sorry I have not enough C
writing experience)
(See attached file: hp_psaux.patch)
**********************************************************************
This e-mail and any attachments to it may contain confidential information which is strictly intended for the use of the authorised recipient. If you have received this e-mail in error, please delete it and notify the sender by replying to this e-mail.
Thank you for your co-operation.
**********************************************************************
--0__=C1256ABE0044855E8f9e8a93df938690918cC1256ABE0044855E
Content-type: application/octet-stream;
name="hp_psaux.patch"
Content-Disposition: attachment; filename="hp_psaux.patch"
Content-transfer-encoding: base64
LS0tIGhwX3BzYXV4LmMJV2VkIFNlcCAgNSAxMDo1MTo0NCAyMDAxCisrKyBocF9wc2F1eC5jLm9y
aWcJVHVlIEF1ZyAyOCAxMjowMjozMiAyMDAxCkBAIC00NCw1ICs0NCw0IEBACiAvKiBIUCBzcGVj
aWZpYyBMQVNJIFBTLzIga2V5Ym9hcmQgYW5kIHBzYXV4IGNvbnN0YW50cyAqLwogI2RlZmluZQlB
VVhfUkVQTFlfQUNLCTB4RkEJLyogQ29tbWFuZCBieXRlIEFDSy4gKi8KLSNkZWZpbmUJQVVYX1JF
U0VORAkweEZFCS8qIFNlbnQgYnkgdGhlIGtleWIuIEFza2luZyBmb3IgcmVzZW5kaW5nIHRoZSBs
YXN0IGNvbW1hbmQuICovCiAjZGVmaW5lCUFVWF9SRUNPTk5FQ1QJMHhBQQkvKiBzY2FuY29kZSB3
aGVuIHBzMiBkZXZpY2UgaXMgcGx1Z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Agd2hpbGUg
KChyZWFkX3N0YXR1cyhocGEpICYgTEFTSV9TVEFUX1RCTkUpKTsKLSAgICAgICAgICAgICAgIGdz
Y193cml0ZWIoMHgwMCwgaHBhK0xBU0lfWE1UREFUQSk7Ci0KLSAgICAgICAgICAgICAgIHdoaWxl
ICghKHJlYWRfc3RhdHVzKGhwYSkgJiBMQVNJX1NUQVRfUkJORSkpOwotCi0gICAgICAgICAgICAg
ICB3aGlsZSAoKHJlYWRfc3RhdHVzKGhwYSkgJiBMQVNJX1NUQVRfUkJORSkpIHsKLSAgICAgICAg
ICAgICAgICAgICAgICAgZGF0YT1yZWFkX2lucHV0KGhwYSk7Ci0gICAgICAgICAgICAgICAgICAg
ICAgIGZhaWwrKzsKLSAgICAgICAgICAgICAgICAgICAgICAgaWYoZmFpbD09MTApIGJyZWFrOwot
ICAgICAgICAgICAgICAgfQotICAgICAgIH13aGlsZShkYXRhIT1BVVhfUkVQTFlfQUNLKTsKLQot
ICAgICAgIGZhaWw9MDsKLSAgICAgICBkbyB7Ci0gICAgICAgICAgICAgICB3aGlsZSAoKHJlYWRf
c3RhdHVzKGhwYSkgJiBMQVNJX1NUQVRfVEJORSkpOwotICAgICAgICAgICAgICAgZ3NjX3dyaXRl
YihLQkRfQ01EX0VOQUJMRSwgaHBhK0xBU0lfWE1UREFUQSk7Ci0KLSAgICAgICAgICAgICAgIHdo
aWxlICghKHJlYWRfc3RhdHVzKGhwYSkgJiBMQVNJX1NUQVRfUkJORSkpOwotICAgICAgICAgICAg
ICAgd2hpbGUgKChyZWFkX3N0YXR1cyhocGEpICYgTEFTSV9TVEFUX1JCTkUpKSB7Ci0gICAgICAg
ICAgICAgICAgICAgICAgIGRhdGE9cmVhZF9pbnB1dChocGEpOwotICAgICAgICAgICAgICAgICAg
ICAgICBmYWlsKys7Ci0gICAgICAgICAgICAgICAgICAgICAgIGlmKGZhaWw9PTEwKSBicmVhazsK
LSAgICAgICAgICAgICAgIH0KLQotICAgICAgIH13aGlsZShkY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