Hello.
Here is a patch (tested on kernels 2.4.3 and 2.4.4) that adds 2 ioctl's=
in serial.c. One, TCSSERCPR, sets the CPR register in 16C950 UARTs. Th=
is register is a pre-scaler (that is, a divisor) for the clock. If the =
value is N, the clock is divided by N/8.=20
If N<8, pre-scaling is disabled by setting bit 7 of MCR to 0. The other=
one, TCGSERCPR,, reads the value of CPR. If pre-scaling is disabled, i=
t returns 8 (i.e., the clock frequency is left intact).
The patch also disables resetting the UART via the CSR register every t=
ime the serial device is opened (in the startup() function). This would=
reset the content of CPR.
---------------------------------------------------------
Fabrizio Gennari tel. +39 039 203 7816
Philips Research Monza fax. +39 039 203 7800
via G. Casati 23 fabrizio.gennari@philips.com
20052 Monza (MI) Italy http://www.research.philips.com
=
--Boundary=_0.0_=0056900018047773
Content-Type: application/octet-stream; name=serial-patch
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=serial-patch
ZGlmZiAtcnVOIGxpbnV4LTIuNC4zL2RyaXZlcnMvY2hhci9zZXJpYWwuYyBsaW51eC0yLjQuMy1w
YXRjaGVkL2RyaXZlcnMvY2hhci9zZXJpYWwuYwotLS0gbGludXgtMi40LjMvZHJpdmVycy9jaGFy
L3NlcmlhbC5jCVdlZCBNYXIgIDcgMDU6MTM6NTEgMjAwMQorKysgbGludXgtMi40LjMtcGF0Y2hl
ZC9kcml2ZXJzL2NoYXIvc2VyaWFsLmMJRnJpIE1heSAxOCAxNjoyODozMCAyMDAxCkBAIC0xMjU5
LDcgKzEyNTksNyBAQAogCQlzZXJpYWxfb3V0cChpbmZvLCBVQVJUX0VGUiwgVUFSVF9FRlJfRUNC
KTsKIAkJc2VyaWFsX291dHAoaW5mbywgVUFSVF9JRVIsIDApOwogCQlzZXJpYWxfb3V0cChpbmZv
LCBVQVJUX0xDUiwgMCk7Ci0JCXNlcmlhbF9pY3Jfd3JpdGUoaW5mbywgVUFSVF9DU1IsIDApOyAv
KiBSZXNldCB0aGUgVUFSVCAqLworCQkvKgkJc2VyaWFsX2ljc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UlRfTUNSX09VVDEJMHgwNAkvKiBP
dXQxIGNvbXBsZW1lbnQgKi8K
--Boundary=_0.0_=0056900018047773--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/