[PATCH] update for ALi Audio Driver (0.14.10)

lei_hu@ali.com.tw
Thu, 6 Jun 2002 14:27:16 +0800


--0__=48256BD00020BE4E8f9e8a93df938690918c48256BD00020BE4E
Content-type: text/plain; charset=us-ascii

Dear all
I rewrite the part to read/write registers of the audio codec for Ali 5451
Audio Driver.
Best Regards

Lei Hu
Information about update:
Updated files: trident.c
Location: drivers/sound
Driver Version: 0.14.10
Kernel Version: 2.4.18
Attach Patch file:
(See attached file: patch)
--0__=48256BD00020BE4E8f9e8a93df938690918c48256BD00020BE4E
Content-type: application/octet-stream;
name="patch"
Content-Disposition: attachment; filename="patch"
Content-transfer-encoding: base64

LS0tIGRyaXZlcnMvc291bmQvdHJpZGVudC5jLm9yaWcJVGh1IEp1biAgNiAxMzowNzozMCAyMDAy
CisrKyBkcml2ZXJzL3NvdW5kL3RyaWRlbnQuYwlUaHUgSnVuICA2IDEzOjU5OjU5IDIwMDIKQEAg
LTM2LDYgKzM2LDkgQEAKICAqCUZvdW5kYXRpb24sIEluYy4sIDY3NSBNYXNzIEF2ZSwgQ2FtYnJp
ZGdlLCBNQSAwMjEzOSwgVVNBLgogICoKICAqICBIaXN0b3J5CisgKiAgdjAuMTQuMTAKKyAqICAg
ICAgSnVuZSA2IDIwMDIgTGVpIEh1IDxMZWlfaHVAYWxpLmNvbS50dz4KKyAqICAgICAgcmV3cml0
ZSB0aGUgcGFydCB0byByZWFkL3dyaXRlIHJlZ2lzdGVycyBvZiBhdWRpbyBjb2RlYyBmb3IgQWxp
NTQ1MSAKICAqICB2MC4xNC45ZAogICogIAlPY3RvYmVyIDggMjAwMSBBcm5hbGRvIENhcnZhbGhv
IGRlIE1lbG8gPGFjbWVAY29uZWN0aXZhLmNvbS5icj4KICAqCXVzZSBzZXRfY3VycmVudF9zdGF0
ZSwgcHJvcGVybHkgcmVsZWFzZSByZXNvdXJjZXMgb24gZmFpbHVyZSBpbgpAQCAtNDYsNyArNDks
NyBAQAogICoJdGhpcyBjaGlwIGlzIG9mdG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F0YSB8d2NvbnRyb2wpLCBUUklEX1JFRyhj
YXJkLEFMSV9BQzk3X1dSSVRFICkpOworCisgICAgICAgIGlmKCF3YWl0Zm9yc3RpbWVydGljayhj
YXJkKSkKKwl7CisJCQkJcHJpbnRrKCIgQklUX0NMT0NLIGlzIGRlYWQgXG4iKTsKKwkJCQlnb3Rv
IGwxOworCX0KKworICAgICAgICBuY291bnQgPSAxMDsKKwkgd2hpbGUoMSkKKwkJICB7CisKKwkJ
CSAgd2NvbnRyb2wgPSBpbncoVFJJRF9SRUcoY2FyZCwgQUxJX0FDOTdfV1JJVEUpKTsKKwkJCSAg
aWYoIXdjb250cm9sICYgMHg4MDAwKQorCQkJCSAgYnJlYWs7CisJCQkgIGlmKG5jb3VudCA8PTAp
CisJCQkJICBicmVhazsKKwkJCSAgaWYobmNvdW50LS09PTEpCisJCQkgIHsKKwkJCQkgIHByaW50
aygiIGFsaV9hYzk3X3NldCA6dHJ5IGNsZWFyIGJ1c3kgZmxhZyEhXG4iKTsKKyAgICAgICAgICAg
ICAgICAgIG91dHcod2NvbnRyb2wgJiAweDdmZmYsIFRSSURfUkVHKGNhcmQsIEFMSV9BQzk3X1dS
SVRFKSk7CisJCQkgIH0KKwkJCSAgdWRlbGF5KDEwKTsKKwkJICB9CisKK2wxOgorCQkgIHJlbGVh
c2Vjb2RlY2FjY2VzcyhjYXJkKTsKKwkJICByZXR1cm47Cit9CisKKworCisKIHN0YXRpYyB2b2lk
IGFsaV9lbmFibGVfc3BlY2lhbF9jaGFubmVsKHN0cnVjdCB0cmlkZW50X3N0YXRlICpzdGF0KQog
ewogCXN0cnVjdCB0cmlkZW50X2NhcmQgKmNhcmQgPSBzdGF0LT5jYXJkOwo=

--0__=48256BD00020BE4E8f9e8a93df938690918c48256BD00020BE4E--

-
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/