Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753340AbaGAHLl (ORCPT ); Tue, 1 Jul 2014 03:11:41 -0400 Received: from relay-s04-hub004.domainlocalhost.com ([74.115.207.103]:33228 "EHLO relay-S04-HUB004.domainlocalhost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751269AbaGAHLj (ORCPT ); Tue, 1 Jul 2014 03:11:39 -0400 From: Dudley Du To: Patrik Fimml CC: Dmitry Torokhov , "Rafael J. Wysocki" , Alan Stern , Benson Leung , Lily Rui , Daniel Kurtz , "linux-input@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v2 0/14] input: cyapa: re-architecture driver to support multi-trackpads in one driver Thread-Topic: [PATCH v2 0/14] input: cyapa: re-architecture driver to support multi-trackpads in one driver Thread-Index: AQHPkmJ9t+T52SM2e0uifNVuU/yAn5uJBvZQgAFS9ICAAHa+8A== Date: Tue, 1 Jul 2014 07:11:36 +0000 Message-ID: <77BC725C9062764F874D79F51E1F1A8F4C90A06E@S04-MBX01-04.s04.local> References: <77BC725C9062764F874D79F51E1F1A8F4C902B3B@S04-MBX01-01.s04.local> <20140630195935.GA18256@google.com> In-Reply-To: <20140630195935.GA18256@google.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.30.12.153] Content-Type: multipart/mixed; boundary="_015_77BC725C9062764F874D79F51E1F1A8F4C90A06ES04MBX0104s04lo_" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --_015_77BC725C9062764F874D79F51E1F1A8F4C90A06ES04MBX0104s04lo_ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 SGkgUGF0cmlrLCBBbGwsDQoNCkF0dGFjaGVkIGZpbGVzIGFyZSB0aGUgbm9uLW1vZGlmaWVkIHBh dGNoZXMgd2l0aCBoZWFkZXJz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lzIG1lc3NhZ2UgYW5kIGFueSBhdHRhY2htZW50cyBtYXkgY29udGFpbiBDeXByZXNzIChvciBp dHMgc3Vic2lkaWFyaWVzKSBjb25maWRlbnRpYWwgaW5mb3JtYXRpb24uIElmIGl0IGhhcyBiZWVu IHJlY2VpdmVkIGluIGVycm9yLCBwbGVhc2UgYWR2aXNlIHRoZSBzZW5kZXIgYW5kIGltbWVkaWF0 ZWx5IGRlbGV0ZSB0aGlzIG1lc3NhZ2UuDQo= --_015_77BC725C9062764F874D79F51E1F1A8F4C90A06ES04MBX0104s04lo_ Content-Type: application/octet-stream; name="0001-input-cyapa-re-architecture-driver-to-support-multi-.patch" Content-Description: 0001-input-cyapa-re-architecture-driver-to-support-multi-.patch Content-Disposition: attachment; filename="0001-input-cyapa-re-architecture-driver-to-support-multi-.patch"; size=46608; creation-date="Tue, 01 Jul 2014 07:03:50 GMT"; modification-date="Tue, 01 Jul 2014 06:51:44 GMT" Content-Transfer-Encoding: base64 RnJvbSBjZGRlMjQ0Y2ViNDA0ZTBkNmY4NTQwMTFmMjk2NjZjMmRiNjQ0OTQ1IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxAY3lwcmVzcy5jb20+CkRhdGU6IFR1 ZSwgMSBKdWwgMjAxNCAxNDozMjozOSArMDgwMApTdWJqZWN0OiBbUEFUQ0ggMDEvMTRdIGlucHV0 OiBjeWFwYTogcmUtYXJjaGl0ZWN0dXJlIGRyaXZlciB0byBzdXBwb3J0CiBtdWx0aS10cmFja3Bh ZHMgaW4gb25lIGRyaXZlcgoKSW4gb3JkZXIgdG8gc3VwcG9ydCB0d28gZGlmZmVyZW50IGNvbW11 bmljYXRpb24gcHJvdG9jb2wgYmFzZWQgdHJhY2twYWQKZGV2aWNlIGluIG9uZSBjeWFwYSwgdGhl IG5ldyBjeWFwYSBkcml2ZXIgaXMgcmUtZGVzaWduZWQgd2l0aApvbmUgY3lhcGEgZHJpdmV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QgdG8gY29udmVydCBJZGxlX1RpbWUgdG8g SWRsZV9Db21tYW5kIGlzOgorICogICBJZGxlX0NvbW1hbmQgPSBJZGxlIFRpbWUgLyAxMDsKKyAq IFdoZW4gSWRsZV9UaW1lID49IDEwMCwgdGhlIGZvcm1hdCB0byBjb252ZXJ0IElkbGVfVGltZSB0 byBJZGxlX0NvbW1hbmQgaXM6CisgKiAgIElkbGVfQ29tbWFuZCA9IElkbGUgVGltZSAvIDIwICsg NTsKKyAqLwordTggY3lhcGFfc2xlZXBfdGltZV90b19wd3JfY21kKHUxNiBzbGVlcF90aW1lKQor eworCWlmIChzbGVlcF90aW1lIDwgMjApCisJCXNsZWVwX3RpbWUgPSAyMDsgICAgIC8qIG1pbmlt YWwgc2xlZXAgdGltZS4gKi8KKwllbHNlIGlmIChzbGVlcF90aW1lID4gMTAwMCkKKwkJc2xlZXBf dGltZSA9IDEwMDA7ICAgLyogbWF4aW1hbCBzbGVlcCB0aW1lLiAqLworCisJaWYgKHNsZWVwX3Rp bWUgPCAxMDApCisJCXJldHVybiAoKHNsZWVwX3RpbWUgLyAxMCkgPDwgMikgJiBQV1JfTU9ERV9N QVNLOworCWVsc2UKKwkJcmV0dXJuICgoc2xlZXBfdGltZSAvIDIwICsgNSkgPDwgMikgJiBQV1Jf TU9ERV9NQVNLOworfQorCit1MTYgY3lhcGFfcHdyX2NtZF90b19zbGVlcF90aW1lKHU4IHB3cl9t b2RlKQoreworCXU4IGVuY29kZWRfdGltZSA9IHB3cl9tb2RlID4+IDI7CisKKwlyZXR1cm4gKGVu Y29kZWRfdGltZSA8IDEwKSA/IGVuY29kZWRfdGltZSAqIDEwCisJCQkJICAgOiAoZW5jb2RlZF90 aW1lIC0gNSkgKiAyMDsKK30KKwordm9pZCBjeWFwYV9kZXRlY3RfYXN5bmModm9pZCAqZGF0YSwg YXN5bmNfY29va2llX3QgY29va2llKQoreworCXN0cnVjdCBjeWFwYSAqY3lhcGEgPSAoc3RydWN0 IGN5YXBhICopZG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IGN5YXBhX2kyY193cml0ZShzdHJ1Y3QgY3lhcGEgKmN5YXBhLCB1OCByZWcs CisJCQkJc2l6ZV90IGxlbiwgY29uc3QgdTggKnZhbHVlcyk7CisKK2ludCBjeWFwYV9wb2xsX3N0 YXRlKHN0cnVjdCBjeWFwYSAqY3lhcGEsIHVuc2lnbmVkIGludCB0aW1lb3V0KTsKK3ZvaWQgY3lh cGFfZGV0ZWN0X2FzeW5jKHZvaWQgKmRhdGEsIGFzeW5jX2Nvb2tpZV90IGNvb2tpZSk7CisKK3U4 IGN5YXBhX3NsZWVwX3RpbWVfdG9fcHdyX2NtZCh1MTYgc2xlZXBfdGltZSk7Cit1MTYgY3lhcGFf cHdyX2NtZF90b19zbGVlcF90aW1lKHU4IHB3cl9tb2RlKTsKKworCitleHRlcm4gY29uc3QgY2hh ciB1bmlxdWVfc3RyW107CisKKyNlbmRpZgotLSAKMS43LjkuNQoK --_015_77BC725C9062764F874D79F51E1F1A8F4C90A06ES04MBX0104s04lo_ Content-Type: application/octet-stream; name="0002-input-cyapa-add-cyapa-driver-power-management-interf.patch" Content-Description: 0002-input-cyapa-add-cyapa-driver-power-management-interf.patch Content-Disposition: attachment; filename="0002-input-cyapa-add-cyapa-driver-power-management-interf.patch"; size=3992; creation-date="Tue, 01 Jul 2014 07:03:50 GMT"; modification-date="Tue, 01 Jul 2014 06:51:44 GMT" Content-Transfer-Encoding: base64 RnJvbSA0ZWU0ZTEwNjcyNGMwMWJlODBiNjc0NjgyMzRiZWZhNjEwYjcxZDM3IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxAY3lwcmVzcy5jb20+CkRhdGU6IFR1 ZSwgMSBKdWwgMjAxNCAxNDozNDo1NiArMDgwMApTdWJqZWN0OiBbUEFUQ0ggMDIvMTRdIGlucHV0 OiBjeWFwYTogYWRkIGN5YXBhIGRyaXZlciBwb3dlciBtYW5hZ2VtZW50CiBpbnRlcmZhY2VzIH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bWVyZ2VfZ3JvdXAoJmNs aWVudC0+ZGV2LmtvYmosICZjeWFwYV9wb3dlcl93YWtldXBfZ3JvdXApKQorCQlkZXZfd2Fybihk ZXYsICJlcnJvciBjcmVhdGluZyB3YWtldXAgcG93ZXIgZW50cmllcy5cbiIpOworI2VuZGlmIC8q IENPTkZJR19QTV9TTEVFUCAqLworCiAJYXN5bmNfc2NoZWR1bGUoY3lhcGFfZGV0ZWN0X2FuZF9z dGFydCwgY3lhcGEpOwogCXJldHVybiAwOwogCkBAIC01OTEsNiArNjc2LDkgQEAgc3RhdGljIGlu dCBjeWFwYV9yZW1vdmUoc3RydWN0IGkyY19jbGllbnQgKmNsaWVudCkKIHsKIAlzdHJ1Y3QgY3lh cGEgKmN5YXBhID0gaTJjX2dldF9jbGllbnRkYXRhKGNsaWVudCk7CiAKKyNpZmRlZiBDT05GSUdf UE1fU0xFRVAKKwlzeXNmc191bm1lcmdlX2dyb3VwKCZjbGllbnQtPmRldi5rb2JqLCAmY3lhcGFf cG93ZXJfd2FrZXVwX2dyb3VwKTsKKyNlbmRpZgogCWZyZWVfaXJxKGN5YXBhLT5pcnEsIGN5YXBh KTsKIAogCWlucHV0X3VucmVnaXN0ZXJfZGV2aWNlKGN5YXBhLT5pbnB1dCk7Ci0tIAoxLjcuOS41 Cgo= --_015_77BC725C9062764F874D79F51E1F1A8F4C90A06ES04MBX0104s04lo_ Content-Type: application/octet-stream; name="0003-input-cyapa-add-cyapa-driver-runtime-power-managemen.patch" Content-Description: 0003-input-cyapa-add-cyapa-driver-runtime-power-managemen.patch Content-Disposition: attachment; filename="0003-input-cyapa-add-cyapa-driver-runtime-power-managemen.patch"; size=6789; creation-date="Tue, 01 Jul 2014 07:03:50 GMT"; modification-date="Tue, 01 Jul 2014 06:51:44 GMT" Content-Transfer-Encoding: base64 RnJvbSAwMWVjZDIyOTc5MjljYTgxYTY0NjdlNzI1YWIxYjhhYTU0NjEyODRlIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjA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IAkvKiBwb3dlciBtb2RlIHNldHRpbmdzICovCiAJdTggc3VzcGVuZF9wb3dl cl9tb2RlOwogCXUxNiBzdXNwZW5kX3NsZWVwX3RpbWU7CisjaWZkZWYgQ09ORklHX1BNX1JVTlRJ TUUKKwl1OCBydW50aW1lX3N1c3BlbmRfcG93ZXJfbW9kZTsKKwl1MTYgcnVudGltZV9zdXNwZW5k X3NsZWVwX3RpbWU7CisjZW5kaWYgLyogQ09ORklHX1BNX1JVTlRJTUUgKi8KIAogCS8qIHJlYWQg ZnJvbSBxdWVyeSBkYXRhIHJlZ2lvbi4gKi8KIAljaGFyIHByb2R1Y3RfaWRbMTZdOwotLSAKMS43 LjkuNQoK --_015_77BC725C9062764F874D79F51E1F1A8F4C90A06ES04MBX0104s04lo_ Content-Type: application/octet-stream; name="0004-input-cyapa-add-cyapa-key-function-interfaces-in-sys.patch" Content-Description: 0004-input-cyapa-add-cyapa-key-function-interfaces-in-sys.patch Content-Disposition: attachment; filename="0004-input-cyapa-add-cyapa-key-function-interfaces-in-sys.patch"; size=8282; creation-date="Tue, 01 Jul 2014 07:03:50 GMT"; modification-date="Tue, 01 Jul 2014 06:51:44 GMT" Content-Transfer-Encoding: base64 RnJvbSBlMDMyNjE5NzQ0OTVjMzU4NTY5NDg1Yzg5MjgyYTRiN2U0NWI1MWY3IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxAY3lwcmVzcy5jb20+CkRhdGU6IFR1 ZSwgMSBKdWwgMjAxNCAxNDozODozMCArMDgwMApTdWJqZWN0OiBbUEFUQ0ggMDQvMTRdIGlucHV0 OiBjeWFwYTogYWRkIGN5YXBhIGtleSBmdW5jdGlvbiBpbnRlcmZhY2VzIGluCiBzeXNmcyBzeXN0 ZW0KCkFkZCBrZXkgYmFzaWMgZnVuY3Rpb24gaW50ZXJmYWNlcyBpbiBjeWFwYSBkcml2ZXIgaW4g c3lzZnMgc3lzdGVtLAp0aGVz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nQpOwogCiBzdHJ1Y3QgY3lhcGFfZGV2X29wcyB7CisJaW50ICgqY3lhcGFf Y2hlY2tfZncpKHN0cnVjdCBjeWFwYSAqLCBjb25zdCBzdHJ1Y3QgZmlybXdhcmUgKik7CisJaW50 ICgqY3lhcGFfYmxfZW50ZXIpKHN0cnVjdCBjeWFwYSAqKTsKKwlpbnQgKCpjeWFwYV9ibF9hY3Rp dmF0ZSkoc3RydWN0IGN5YXBhICopOworCWludCAoKmN5YXBhX2JsX2luaXRpYXRlKShzdHJ1Y3Qg Y3lhcGEgKiwgY29uc3Qgc3RydWN0IGZpcm13YXJlICopOworCWludCAoKmN5YXBhX3VwZGF0ZV9m dykoc3RydWN0IGN5YXBhICosIGNvbnN0IHN0cnVjdCBmaXJtd2FyZSAqKTsKKwlpbnQgKCpjeWFw YV9ibF92ZXJpZnlfYXBwX2ludGVncml0eSkoc3RydWN0IGN5YXBhICopOworCWludCAoKmN5YXBh X2JsX2RlYWN0aXZhdGUpKHN0cnVjdCBjeWFwYSAqKTsKKworCXNzaXplX3QgKCpjeWFwYV9zaG93 X2Jhc2VsaW5lKShzdHJ1Y3QgZGV2aWNlICosCisJCQlzdHJ1Y3QgZGV2aWNlX2F0dHJpYnV0ZSAq LCBjaGFyICopOworCXNzaXplX3QgKCpjeWFwYV9jYWxpYnJhdGVfc3RvcmUpKHN0cnVjdCBkZXZp Y2UgKiwKKwkJCXN0cnVjdCBkZXZpY2VfYXR0cmlidXRlICosIGNvbnN0IGNoYXIgKiwgc2l6ZV90 KTsKKwogCXNpemVfdCAoKmN5YXBhX2dldF9wcml2YXRlX3NpemUpKHZvaWQpOwogCWludCAoKmN5 YXBhX3ByaXZhdGVfaW5pdCkoc3RydWN0IGN5YXBhICpjeWFwYSwgdm9pZCAqcHJpdmF0ZV9tZW0p OwogCi0tIAoxLjcuOS41Cgo= --_015_77BC725C9062764F874D79F51E1F1A8F4C90A06ES04MBX0104s04lo_ Content-Type: application/octet-stream; name="0005-input-cyapa-add-read-firmware-image-and-raw-data-int.patch" Content-Description: 0005-input-cyapa-add-read-firmware-image-and-raw-data-int.patch Content-Disposition: attachment; filename="0005-input-cyapa-add-read-firmware-image-and-raw-data-int.patch"; size=7960; creation-date="Tue, 01 Jul 2014 07:03:50 GMT"; modification-date="Tue, 01 Jul 2014 06:51:44 GMT" Content-Transfer-Encoding: base64 RnJvbSBiOTk4OWZlZDAxYTEyODMxMzRkOGI5NjVkNjZkYTY0MDhmZGQxNGRhIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxAY3lwcmVzcy5jb20+CkRhdGU6IFR1 ZSwgMSBKdWwgMjAxNCAxNDozOToyMSArMDgwMApTdWJqZWN0OiBbUEFUQ0ggMDUvMTRdIGlucHV0 OiBjeWFwYTogYWRkIHJlYWQgZmlybXdhcmUgaW1hZ2UgYW5kIHJhdyBkYXRhCiBpbnRlcmZhY2Vz IGluIGRlYnVnZnMgc3lzdGVtCgpBZGQgcmVhZF9mdyBhbmQgcmF3X2RhdGEgZGVidWdmcyBpbnRl cmZhY2VzIGZvciBlYXNpZXIgaXNzdWVzIGxvY2F0aW9uCmFuZCBjb2xsZWN0aW9uIHdoZW4gcmVw b3J0IGJ5IHVzZXIuClRFU1Q9dGVzdCBvbiBDaG9tZWJvb2tzLgoKU2lnbmVkLW9mZi1ieTogRHVk bGV5IER1IDxkdWRsQGN5cHJlc3MuY29tPgotLS0KIGRyaXZlcnMvaW5wdXQvbW91c2UvY3lhcGEu YyB8ICAyMjMgKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKwogZHJp dmVycy9pbnB1dC9tb3VzZS9jeWFwYS5oIHwgICAxNCArKysKIDIgZmlsZXMgY2hhbmdlZCwgMjM3 IGluc2VydGlvbnMoKykKCmRpZmYgLS1naXQgYS9kcml2ZXJzL2lucHV0L21vdXNlL2N5YXBhLmMg Yi9kcml2ZXJzL2lucHV0L21vdXNlL2N5YXBhL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m9wczsKIH07CiAKLS0gCjEuNy45LjUKCg== --_015_77BC725C9062764F874D79F51E1F1A8F4C90A06ES04MBX0104s04lo_ Content-Type: application/octet-stream; name="0006-input-cyapa-add-gen3-trackpad-device-basic-functions.patch" Content-Description: 0006-input-cyapa-add-gen3-trackpad-device-basic-functions.patch Content-Disposition: attachment; filename="0006-input-cyapa-add-gen3-trackpad-device-basic-functions.patch"; size=28310; creation-date="Tue, 01 Jul 2014 07:03:50 GMT"; modification-date="Tue, 01 Jul 2014 06:51:44 GMT" Content-Transfer-Encoding: base64 RnJvbSAyNjIzM2M2MzUyOWVhMTgxMjBiMTNlYjA0Y2MzZTcyMzAxNmU2ODBkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxAY3lwcmVzcy5jb20+CkRhdGU6IFR1 ZSwgMSBKdWwgMjAxNCAxNDo0MDoxOSArMDgwMApTdWJqZWN0OiBbUEFUQ0ggMDYvMTRdIGlucHV0 OiBjeWFwYTogYWRkIGdlbjMgdHJhY2twYWQgZGV2aWNlIGJhc2ljIGZ1bmN0aW9ucwogc3VwcG9y dGVkCgpCYXNlZCBvbiB0aGUgY3lhcGEgY29yZSwgYWRkIHRoZSBnZW4zIHRyYWNrcGFkIGRldmlj ZSdzIGJhc2ljIGZ1bmN0aW9ucwpzdXBwb3J0ZWQsIHNvIGdlbjMgdHJhY2twYWQgZGV2aWNlIGNh biB3b3JrIHdpdGgga2VybmVsIGlucHV0IHN5c3RlbS4KVGhlIGJhc2ljIGZ1bmN0aW9uIGlzIGFi c29sdXRlbHkgc2FtZSBhcyBwcmV2aW91cyBjeWFwYSBkcml2ZXIgb25seQpzdXBwb3J0IGdlbjMg dHJhY2twYWQgZGV2aWNlLgpURVNUPXRlc3Qgb24gQ2hvbWVib29rcy4KClNpZ25lZC1vZmYtYnk6 IER1ZGxleSBEdSA8ZHVkbEBjeXByZXNzLmNvbT4KLS0tCiBkcml2ZXJzL2lucHV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jeWFwYV9nZW4zX29wcyA9 IHsKKwlOVUxMLAorCU5VTEwsCisJTlVMTCwKKwlOVUxMLAorCU5VTEwsCisJTlVMTCwKKwlOVUxM LAorCisJTlVMTCwKKwlOVUxMLAorCisJTlVMTCwKKwlOVUxMLAorCisJTlVMTCwKKwlOVUxMLAor CisJY3lhcGFfZ2VuM19zdGF0ZV9wYXJzZSwKKwljeWFwYV9nZW4zX2RvX29wZXJhdGlvbmFsX2No ZWNrLAorCisJY3lhcGFfZ2VuM19pcnFfaGFuZGxlciwKKwlOVUxMLAorCU5VTEwsCisJY3lhcGFf Z2VuM19zZXRfcG93ZXJfbW9kZSwKK307Ci0tIAoxLjcuOS41Cgo= --_015_77BC725C9062764F874D79F51E1F1A8F4C90A06ES04MBX0104s04lo_ Content-Type: application/octet-stream; name="0007-input-cyapa-add-gen3-trackpad-device-firmware-update.patch" Content-Description: 0007-input-cyapa-add-gen3-trackpad-device-firmware-update.patch Content-Disposition: attachment; filename="0007-input-cyapa-add-gen3-trackpad-device-firmware-update.patch"; size=9048; creation-date="Tue, 01 Jul 2014 07:03:50 GMT"; modification-date="Tue, 01 Jul 2014 06:51:44 GMT" Content-Transfer-Encoding: base64 RnJvbSBkMmUyOGUyYjBjMTJmNTkzNDVjOTQ2YTJjOTI4YjFjNzI2MzkwMTUzIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxAY3lwcmVzcy5jb20+CkRhdGU6IFR1 ZSwgMSBKdWwgMjAxNCAxNDo0MzowMiArMDgwMApTdWJqZWN0OiBbUEFUQ0ggMDcvMTRdIGlucHV0 OiBjeWFwYTogYWRkIGdlbjMgdHJhY2twYWQgZGV2aWNlIGZpcm13YXJlIHVwZGF0ZQogZnVuY3Rp b24gc3VwcG9ydGVkCgpBZGQgZmlybXdhcmUgaW1hZ2UgdXBkYXRlIGZ1bmN0aW9uIHN1cHBvcnRl ZCBmb3IgZ2VuMyB0cmFja3BhZCBk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Ul9CTE9DS19TVEFSVCArIGk7CisJCXNpemVfdCBhZGRyID0gaSAq IENZQVBBX0ZXX0JMT0NLX1NJWkU7CisJCWNvbnN0IHU4ICpkYXRhID0gJmZ3LT5kYXRhW2FkZHJd OworCisJCXJldCA9IGN5YXBhX2dlbjNfd3JpdGVfZndfYmxvY2soY3lhcGEsIGJsb2NrLCBkYXRh KTsKKwkJaWYgKHJldCkgeworCQkJZGV2X2VycihkZXYsICJGVyB1cGRhdGUgYWJvcnRlZCwgJWRc biIsIHJldCk7CisJCQlyZXR1cm4gcmV0OworCQl9CisJfQorCisJcmV0dXJuIDA7Cit9CisKIC8q CiAgKiBjeWFwYV9nZXRfd2FpdF90aW1lX2Zvcl9wd3JfY21kCiAgKgpAQCAtNzA3LDEzICs5ODIs MTMgQEAgc3RhdGljIHZvaWQgY3lhcGFfZ2VuM19pcnFfaGFuZGxlcihzdHJ1Y3QgY3lhcGEgKmN5 YXBhKQogCiAKIGNvbnN0IHN0cnVjdCBjeWFwYV9kZXZfb3BzIGN5YXBhX2dlbjNfb3BzID0gewor CWN5YXBhX2dlbjNfY2hlY2tfZncsCisJY3lhcGFfZ2VuM19ibF9lbnRlciwKKwljeWFwYV9nZW4z X2JsX2FjdGl2YXRlLAogCU5VTEwsCisJY3lhcGFfZ2VuM19kb19md191cGRhdGUsCiAJTlVMTCwK LQlOVUxMLAotCU5VTEwsCi0JTlVMTCwKLQlOVUxMLAotCU5VTEwsCisJY3lhcGFfZ2VuM19ibF9k ZWFjdGl2YXRlLAogCiAJTlVMTCwKIAlOVUxMLAotLSAKMS43LjkuNQoK --_015_77BC725C9062764F874D79F51E1F1A8F4C90A06ES04MBX0104s04lo_ Content-Type: application/octet-stream; name="0008-input-cyapa-add-gen3-trackpad-device-baseline-and-ca.patch" Content-Description: 0008-input-cyapa-add-gen3-trackpad-device-baseline-and-ca.patch Content-Disposition: attachment; filename="0008-input-cyapa-add-gen3-trackpad-device-baseline-and-ca.patch"; size=4438; creation-date="Tue, 01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VkIE1pbjogJWRcbiIsCisJCW1heF9iYXNlbGluZSwgbWlu X2Jhc2VsaW5lKTsKKwlyZXQgPSBzY25wcmludGYoYnVmLCBQQUdFX1NJWkUsICIlZCAlZFxuIiwg bWF4X2Jhc2VsaW5lLCBtaW5fYmFzZWxpbmUpOworCitvdXQ6CisJY3lhcGFfZW5hYmxlX2lycShj eWFwYSk7CisJcmV0dXJuIHJldDsKK30KKwogLyoKICAqIGN5YXBhX2dldF93YWl0X3RpbWVfZm9y X3B3cl9jbWQKICAqCkBAIC05OTAsOCArMTEyMiw4IEBAIGNvbnN0IHN0cnVjdCBjeWFwYV9kZXZf b3BzIGN5YXBhX2dlbjNfb3BzID0gewogCU5VTEwsCiAJY3lhcGFfZ2VuM19ibF9kZWFjdGl2YXRl LAogCi0JTlVMTCwKLQlOVUxMLAorCWN5YXBhX2dlbjNfc2hvd19iYXNlbGluZSwKKwljeWFwYV9n ZW4zX2RvX2NhbGlicmF0ZSwKIAogCU5VTEwsCiAJTlVMTCwKLS0gCjEuNy45LjUKCg== --_015_77BC725C9062764F874D79F51E1F1A8F4C90A06ES04MBX0104s04lo_ Content-Type: application/octet-stream; name="0009-input-cyapa-add-gen3-trackpad-device-read-firmware-i.patch" Content-Description: 0009-input-cyapa-add-gen3-trackpad-device-read-firmware-i.patch Content-Disposition: attachment; filename="0009-input-cyapa-add-gen3-trackpad-device-read-firmware-i.patch"; size=3400; creation-date="Tue, 01 Jul 2014 07:03:50 GMT"; modification-date="Tue, 01 Jul 2014 06:51:44 GMT" Content-Transfer-Encoding: base64 RnJvbSA5MTc4N2RmY2ZlMTE2OWRhYjcwMzQzZDk0ZjNjNGYwZTI3ZTgzMGE3IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxAY3lwcmVzcy5jb20+CkRhdGU6IFR1 ZSwgMSBKdWwgMjAxNCAxNDo0NzowOSArMDgwMApTdWJqZWN0OiBbUEFUQ0ggMDkvMT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iAJTlVMTCwKLS0gCjEuNy45LjUKCg== --_015_77BC725C9062764F874D79F51E1F1A8F4C90A06ES04MBX0104s04lo_ Content-Type: application/octet-stream; name="0010-input-cyapa-add-gen5-trackpad-device-basic-functions.patch" Content-Description: 0010-input-cyapa-add-gen5-trackpad-device-basic-functions.patch Content-Disposition: attachment; filename="0010-input-cyapa-add-gen5-trackpad-device-basic-functions.patch"; size=50777; creation-date="Tue, 01 Jul 2014 07:03:50 GMT"; modification-date="Tue, 01 Jul 2014 06:51:44 GMT" Content-Transfer-Encoding: base64 RnJvbSBhZTZiNTU0ZTQ5MTFkYzE2NjU0YzRiNDkzMzA0NmUzZTM2YzcyOTNlIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxAY3lwcmVzcy5jb20+CkRhdGU6IFR1 ZSwgMSBKdWwgMjAxNCAxNDo0ODoxMCArMDgwMApTdWJqZWN0OiBbUEFUQ0ggMTAvMTRdIGlucHV0 OiBjeWFwYTogYWRkIGdlbjUgdHJhY2twYWQgZGV2aWNlIGJhc2ljIGZ1bmN0aW9ucwogc3VwcG9y dGVkCgpCYXNlZCBvbiB0aGUgY3lhcGEgY29yZSwgYWRkIHRoZSBnZW41IHRyYWNrcGFkIGRldmlj ZSdzIGJhc2ljIGZ1bmN0aW9ucwpzdXBwb3J0ZWQsIHNvIGdlbjUgdHJhY2twYWQgZGV2aWNlIGNh biB3b3JrIHdpdGgga2VybmVsIGlucHV0IHN5c3RlbS4KQW5kIGFsc28gYmFzZWQgb24gdGhlIHN0 YXRlIHBhcnNlIGludGVyZmFjZSwgdGhlIGN5YXBhIGRyaXZlciBjYW4KYXV0b21hdGljYWxseSBk ZXRlcm1pbmUgdGhlIGF0dGFjaGVkIGlzIGdlbjMgb3IgZ2VuNSBwcm90b2NvbCB0cmFja3BhZApk ZXZpY2UsIHRoZW4gc2V0IHRoZSBjb3JyZWN0IHByb3RvY29sIHRvIHdvcmsgd2l0aC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fTUFYX0lOVFJWTF9USU1FICA1MCAgIC8qIHVuaXQ6IG1zICovCisjZGVm aW5lIEdFTjVfUE9XRVJfSURMRV9NQVhfSU5UUlZMX1RJTUUgICAyNTAgIC8qIHVuaXQ6IG1zICov CisKKyNkZWZpbmUgR0VONV9DTURfUkVQT1JUX0lEX09GRlNFVCAgICAgICA0CisKKyNkZWZpbmUg R0VONV9SRVNQX1JFUE9SVF9JRF9PRkZTRVQgICAgICAyCisjZGVmaW5lIEdFTjVfUkVTUF9SU1ZE X09GRlNFVCAgICAgICAgICAgMworI2RlZmluZSAgICAgR0VONV9SRVNQX1JTVkRfS0VZICAgICAg ICAgIDB4MDAKKyNkZWZpbmUgR0VONV9SRVNQX0JMX1NPUF9PRkZTRVQgICAgICAgICA0CisjZGVm aW5lICAgICBHRU41X1NPUF9LRVkgICAgICAgICAgICAgICAgMHgwMSAgLyogU3RhcnQgb2YgUGFj a2V0ICovCisjZGVmaW5lICAgICBHRU41X0VPUF9LRVkgICAgICAgICAgICAgICAgMHgxNyAgLyog RW5kIG9mIFBhY2tldCAqLworI2RlZmluZSBHRU41X1JFU1BfQVBQX0NNRF9PRkZTRVQgICAgICAg IDQKKyNkZWZpbmUgICAgIEdFVF9HRU41X0NNRF9DT0RFKHJlZykgICAgICAoKHJlZykgJiAweDdm KQorCisjZGVmaW5lIEdFTjVfTUlOX0JMX0NNRF9MRU5HVEggICAgICAgICAgIDEzCisjZGVmaW5l IEdFTjVfTUlOX0JMX1JFU1BfTEVOR1RIICAgICAgICAgIDExCisjZGVmaW5lIEdFTjVfTUlOX0FQ UF9DTURfTEVOR1RIICAgICAgICAgIDcKKyNkZWZpbmUgR0VONV9NSU5fQVBQX1JFU1BfTEVOR1RI ICAgICAgICAgNQorI2RlZmluZSBHRU41X1VOU1VQUE9SVEVEX0NNRF9SRVNQX0xFTkdUSCA2CisK KyNkZWZpbmUgR0VONV9SRVNQX0xFTkdUSF9TSVpFIDIKKworI2RlZmluZSBHRU41X0hJRF9ER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y biByZXQ7Cit9CisKK3N0YXRpYyBib29sIGN5YXBhX2dlbjVfc29ydF9zeXN0ZW1faW5mb19kYXRh KHN0cnVjdCBjeWFwYSAqY3lhcGEsCisJCXU4ICpidWYsIGludCBsZW4pCit7CisJLyogY2hlY2sg dGhlIHJlcG9ydCBpZCBhbmQgY29tbWFuZCBjb2RlICovCisJaWYgKGJ1ZlsyXSA9PSBHRU41X0FQ UF9SRVNQX1JFUE9SVF9JRCAmJgorCQkJR0VUX0dFTjVfQ01EX0NPREUoYnVmWzRdKSA9PSAweDAy KQorCQlyZXR1cm4gdHJ1ZTsKKworCXJldHVybiBmYWxzZTsKK30KKworc3RhdGljIGludCBjeWFw YV9nZW41X2JsX3F1ZXJ5X2RhdGEoc3RydWN0IGN5YXBhICpjeWFwYSkKK3sKKwlpbnQgcmV0Owor CXU4IGNtZFsxNl07CisJaW50IGNtZF9sZW47CisJdTggcmVzcF9kYXRhW0dFTjVfQkxfUkVBRF9B UFBfSU5GT19SRVNQX0xFTl07CisJaW50IHJlc3BfbGVuOworCisJLyogcmVhZCBhcHBsaWNhdGlv biBpbmZvcm1hdGlvbi4gKi8KKwljbWRbMF0gPSAweDA0OworCWNtZFsxXSA9IDB4MDA7CisJY21k WzJdID0gMHgwYjsKKwljbWRbM10gPSAweDAwOworCWNtZFs0XSA9IDB4NDA7CisJY21kWzVdID0g MHgwMDsKKwljbWRbNl0gPSBHRU41X1NPUF9LRVk7CisJY21kWzddID0gMHgzYzsgIC8qIHJlYWQg YXBwbGljYXRpb24gaW5mb3JtYXRpb24gY29tbWFuZCBjb2RlICovCisJY21kWzhdID0gMHgwMDsK KwljbWRbOV0gPSAweDAwOworCWNtZFsxMF0gPSAweGIwOworCWNtZFsxMV0gPSAweDQyOworCWNt ZFsxMl0gPSBHRU41X0VPUF9LRVk7CisJY21kX2xlbiA9IDEzOworCXJlc3BfbGVuID0gR0VONV9C TF9SRUFEX0FQUF9JTkZPX1JFU1BfTEVOOworCXJldCA9IGN5YXBh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TX01UX1RPVUNIX01JTk9S LAorCQkJCXRvdWNoLT5taW5vcl9heGlzX2xlbik7CisKKwkJCWlucHV0X3JlcG9ydF9hYnMoaW5w dXQsIEFCU19NVF9XSURUSF9NQUpPUiwKKwkJCQl0b3VjaC0+bWFqb3JfdG9vbF9sZW4pOworCQkJ aW5wdXRfcmVwb3J0X2FicyhpbnB1dCwgQUJTX01UX1dJRFRIX01JTk9SLAorCQkJCXRvdWNoLT5t aW5vcl90b29sX2xlbik7CisKKwkJCWlucHV0X3JlcG9ydF9hYnMoaW5wdXQsIEFCU19NVF9PUklF TlRBVElPTiwKKwkJCQl0b3VjaC0+b3JpZW50YXRpb24pOworCQl9CisKKwkJaW5wdXRfbXRfc3lu Y19mcmFtZShpbnB1dCk7CisKKwkJaW5wdXRfc3luYyhpbnB1dCk7CisJfQorfQorCitjb25zdCBz dHJ1Y3QgY3lhcGFfZGV2X29wcyBjeWFwYV9nZW41X29wcyA9IHsKKwlOVUxMLAorCU5VTEwsCisJ TlVMTCwKKwlOVUxMLAorCU5VTEwsCisJTlVMTCwKKwlOVUxMLAorCisJTlVMTCwKKwlOVUxMLAor CisJTlVMTCwKKwlOVUxMLAorCisJY3lhcGFfZ2VuNV9nZXRfcHJpdmF0ZV9zaXplLAorCWN5YXBh X2dlbjVfcHJpdmF0ZV9pbml0LAorCisJY3lhcGFfZ2VuNV9zdGF0ZV9wYXJzZSwKKwljeWFwYV9n ZW41X2RvX29wZXJhdGlvbmFsX2NoZWNrLAorCisJY3lhcGFfZ2VuNV9pcnFfaGFuZGxlciwKKwlj eWFwYV9nZW41X2lycV9jbWRfaGFuZGxlciwKKwljeWFwYV9lbXB0eV9waXBfb3V0cHV0X2RhdGEs CisJY3lhcGFfZ2VuNV9zZXRfcG93ZXJfbW9kZSwKK307Ci0tIAoxLjcuOS41Cgo= --_015_77BC725C9062764F874D79F51E1F1A8F4C90A06ES04MBX0104s04lo_ Content-Type: application/octet-stream; name="0011-input-cyapa-add-gen5-trackpad-device-firmware-update.patch" Content-Description: 0011-input-cyapa-add-gen5-trackpad-device-firmware-update.patch Content-Disposition: attachment; filename="0011-input-cyapa-add-gen5-trackpad-device-firmware-update.patch"; size=11256; creation-date="Tue, 01 Jul 2014 07:03:50 GMT"; modification-date="Tue, 01 Jul 2014 06:51:44 GMT" Content-Transfer-Encoding: base64 RnJvbSAxNGNhNGQ5YjM5MDBmMWI5MTA0ZGQzMzdlN2Y3Y2E5NzhjNTdlNGFlIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxAY3lwcmVzcy5jb20+CkRhdGU6IFR1 ZSwgMSBKdWwgMjAxNCAxNDo0OTowMSArMDgwMApTdWJqZWN0OiBbUEFUQ0ggMTEvMTRdIGlucHV0 OiBjeWFwYTogYWRkIGdlbjUgdHJhY2twYWQgZGV2aWNlIGZpcm13YXJlIHVwZGF0ZQogZnVuY3Rp b24gc3VwcG9ydGVkCgpBZGQgZmlybXdhcmUgaW1hZ2UgdXBkYXRlIGZ1bmN0aW9uIHN1cHBvcnRl ZCBmb3IgZ2VuNSB0cmFja3BhZCBkZXZpY2UsCndoaWNoIGl0cyBmdW5jdGlvbiBpcyBzdXBwbGll ZCB0aHJvdWdoIGN5YXBhIGNvcmUgdXBkYXRlX2Z3IGludGVyZmFjZS4KVEVTVD10ZXN0IG9uIENo b21lYm9va3MuCgpTaWduZWQtb2ZmLWJ5OiBEdWRsZXkgRHUgPGR1ZGxAY3lwcmVzcy5jb20+Ci0t LQogZHJpdmVycy9pbnB1dC9tb3VzZS9LY29uZmlnICAgICAgfCAgICAyICstCiBkcml2ZXJzL2lu cHV0L21vdXNlL2N5YXBhX2dlbjUuYyB8ICAyOTkgKysrKysrKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrKy0KIDIgZmlsZXMgY2hhbmdlZCwgMjk2IGluc2VydGlvbnMoKyksIDUgZGVsZXRp b25zKC0pCgpkaWZmIC0tZ2l0IGEvZHJpdmVycy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QlOVUxMLAotCU5VTEwsCi0JTlVMTCwK KwljeWFwYV9nZW41X2JsX2luaXRpYXRlLAorCWN5YXBhX2dlbjVfZG9fZndfdXBkYXRlLAogCU5V TEwsCiAJTlVMTCwKIAotLSAKMS43LjkuNQoK --_015_77BC725C9062764F874D79F51E1F1A8F4C90A06ES04MBX0104s04lo_ Content-Type: application/octet-stream; name="0012-input-cyapa-add-gen5-trackpad-device-baseline-and-ca.patch" Content-Description: 0012-input-cyapa-add-gen5-trackpad-device-baseline-and-ca.patch Content-Disposition: attachment; filename="0012-input-cyapa-add-gen5-trackpad-device-baseline-and-ca.patch"; size=21080; creation-date="Tue, 01 Jul 2014 07:03:50 GMT"; modification-date="Tue, 01 Jul 2014 06:51:44 GMT" Content-Transfer-Encoding: base64 RnJvbSBjMmRiN2ZmZWNiODljMzVjZDM5YzVhMzIzMzRkMDUyZWU3OTBjMDkxIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxAY3lwcmVzcy5jb20+CkRhdGU6IFR1 ZSwgMSBKdWwgMjAxNCAxNDo0OTo1MCArMDgwMApTdWJqZWN0OiBbUEFUQ0ggMTIvMTRdIGlucHV0 OiBjeWFwYTogYWRkIGdlbjUgdHJhY2twYWQgZGV2aWNlIGJhc2VsaW5lIGFuZAogY2FsaWJyYXRl IGZ1bmN0aW9ucyBzdXBwb3J0ZWQKCkFkZCByZXBvcnQgYmFzZWxpbmUgYW5kIGZvcmNlIGNhbGli cmF0ZSBmdW5jdGlvbnMgc3VwcG9ydGVkIGZvciBnZW41CnRyYWNrcGFkIGRldmljZSwgd2hpY2gg dGhlc2UgZnVuY3Rpb25zIGFyZSBzdXBwbGllZCB0aHJvdWdoCmN5YXBhIGNvcmUgYmFzZWxpbmUg YW5kIGNhbGlicmF0ZSBpbnRlcmZhY2VzLgpURVNUPXRlc3Qgb24gQ2hvbWVib29rcy4KClNpZ25l ZC1vZmYtYnk6IER1ZGxleSBEd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V9zaXpl KSB7CisJCQl2YWx1ZSA9IGN5YXBhX3BhcnNlX3N0cnVjdHVyZV9kYXRhKHJlc3BfZGF0YVs5XSwK KwkJCQkJJnJlc3BfZGF0YVtpXSwgKmRhdGFfc2l6ZSk7CisJCQkqaWRhY19taW4gPSBtaW4odmFs dWUsICppZGFjX21pbik7CisJCQkqaWRhY19tYXggPSBtYXgodmFsdWUsICppZGFjX21heCk7CisK KwkJCWlmIChpZGFjX2RhdGFfdHlwZSA9PSBHRU41X1JFVFJJRVZFX01VVFVBTF9QV0NfREFUQSAm JgorCQkJCXRtcF9jb3VudCA8IHRtcF9tYXhfZWxlbWVudHMgJiYKKwkJCQlyZWFkX2dsb2JhbF9p ZGFjKSB7CisJCQkJdG1wX21pbiA9IG1pbih2YWx1ZSwgdG1wX21pbik7CisJCQkJdG1wX21heCA9 IG1heCh2YWx1ZSwgdG1wX21heCk7CisJCQkJdG1wX3N1bSArPSB2YWx1ZTsKKwkJCQl0bXBfY291 bnQrKzsKKwkJCX0KKworCQkJc3VtICs9IHZhbHVlOworCQkJY291bnQrKzsKKworCQkJaWYgKGNv dW50ID49IG1heF9lbGVtZW50X2NudCkKKwkJCQlnb3RvIG91dDsKKwkJfQorCX0gd2hpbGUgKHRy dWUpOworCitvdXQ6CisJKmlkYWNfYXZlID0gY291bnQgPyAoc3VtIC8gY291bnQpIDogMDsKKwor CWlmIChyZWFkX2dsb2JhbF9pZGFjICYmCisJCWlkYWNfZGF0YV90eXBlID09IEdFTjVfUkVUUklF VkVfTVVUVUFMX1BXQ19EQVRBKSB7CisJCWlmICh0bXBfY291bnQgPT0gMCkKKwkJCXJldHVybiAw OworCQkvKiBhbGdvcml0aG0gdG8gZGV0ZWN0IGVsZWN0cm9kZXNfcnggdmFsdWUuICovCisJCXRt cF9hdmUgPSB0bXBfc3VtIC8gdG1wX2NvdW50OworCQl0bXBfY291bnQgPSB0bXBfYXZlICogMTUg LyAxMDA7CisJCWlmIChhYnModG1wX2F2ZSAtICppZG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c2VsaW5lX21pbiwgbXV0dWFsX2Jhc2VsaW5lX21h eCwgbXV0dWFsX2Jhc2VsaW5lX2F2ZSwKKwkJc2VsZl9iYXNlbGluZV9taW4sIHNlbGZfYmFzZWxp bmVfbWF4LCBzZWxmX2Jhc2VsaW5lX2F2ZSk7CisJcmV0dXJuIHJldCArIGVycjsKK30KKwogc3Rh dGljIGJvb2wgY3lhcGFfZ2VuNV9zb3J0X3N5c3RlbV9pbmZvX2RhdGEoc3RydWN0IGN5YXBhICpj eWFwYSwKIAkJdTggKmJ1ZiwgaW50IGxlbikKIHsKQEAgLTE4NjcsOCArMjU0MCw4IEBAIGNvbnN0 IHN0cnVjdCBjeWFwYV9kZXZfb3BzIGN5YXBhX2dlbjVfb3BzID0gewogCU5VTEwsCiAJTlVMTCwK IAotCU5VTEwsCi0JTlVMTCwKKwljeWFwYV9nZW41X3Nob3dfYmFzZWxpbmUsCisJY3lhcGFfZ2Vu NV9kb19jYWxpYnJhdGUsCiAKIAlOVUxMLAogCU5VTEwsCi0tIAoxLjcuOS41Cgo= --_015_77BC725C9062764F874D79F51E1F1A8F4C90A06ES04MBX0104s04lo_ Content-Type: application/octet-stream; name="0013-input-cyapa-add-gen5-trackpad-device-read-firmware-i.patch" Content-Description: 0013-input-cyapa-add-gen5-trackpad-device-read-firmware-i.patch Content-Disposition: attachment; filename="0013-input-cyapa-add-gen5-trackpad-device-read-firmware-i.patch"; size=10087; creation-date="Tue, 01 Jul 2014 07:03:50 GMT"; modification-date="Tue, 01 Jul 2014 06:51:44 GMT" Content-Transfer-Encoding: base64 RnJvbSAxOGU1NGNjY2ExZDA3ZjNlZDcyMGY5YjFhNTRiZTY1YWJkODZmZTczIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxAY3lwcmVzcy5jb20+CkRhdGU6IFR1 ZSwgMSBKdWwgMjAxNCAxNDo1MDozOCArMDgwMApTdWJqZWN0OiBbUEFUQ0ggMTM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b25zdCBzdHJ1Y3QgY3lh cGFfZGV2X29wcyBjeWFwYV9nZW41X29wcyA9IHsKIAljeWFwYV9nZW41X3Nob3dfYmFzZWxpbmUs CiAJY3lhcGFfZ2VuNV9kb19jYWxpYnJhdGUsCiAKLQlOVUxMLAotCU5VTEwsCisJY3lhcGFfZ2Vu NV9yZWFkX2Z3LAorCWN5YXBhX2dlbjVfcmVhZF9yYXdfZGF0YSwKIAogCWN5YXBhX2dlbjVfZ2V0 X3ByaXZhdGVfc2l6ZSwKIAljeWFwYV9nZW41X3ByaXZhdGVfaW5pdCwKLS0gCjEuNy45LjUKCg== --_015_77BC725C9062764F874D79F51E1F1A8F4C90A06ES04MBX0104s04lo_ Content-Type: application/octet-stream; name="0014-input-cyapa-add-function-to-monitor-LID-close-event-.patch" Content-Description: 0014-input-cyapa-add-function-to-monitor-LID-close-event-.patch Content-Disposition: attachment; filename="0014-input-cyapa-add-function-to-monitor-LID-close-event-.patch"; size=6873; creation-date="Tue, 01 Jul 2014 07:03:50 GMT"; modification-date="Tue, 01 Jul 2014 06:51:44 GMT" Content-Transfer-Encoding: base64 RnJvbSBjM2I5YmE2YWRlNzdjZmVjOTA2YzNhMDViNTc2ZTRjNDM0MTY4MzFmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxAY3lwcmVzcy5jb20+CkRhdGU6IFR1 ZSwgMSBKdWwgMjAxNCAxNDo1MTozMSArMDgwMApTdWJqZWN0OiBbUEFUQ0ggMTQvMTRdIGlucHV0 OiBjeWFwYTogYWRkIGZ1bmN0aW9uIHRvIG1vbml0b3IgTElEIGNsb3NlIGV2ZW50CiB0byBvZmYg dHJhY2twYWQgZGV2aWNlCgpBZGQgdGhlIGZ1bmN0aW9uIHRvIG1vbml0b3IgbGlkIGNsb3NlIGV2 ZW50IHRvIHN1c3BlbmQgYW5kIHJlc3VtZQp0cmFja3BhZCBkZXZpY2UuCkJlY2F1c2Ugc3lzdG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5YXBhX2Rldl9vcHMgKm9wczsK KworCWJvb2wgbGlkX2hhbmRsZXJfcmVnaXN0ZXJlZDsKKwlzdHJ1Y3QgaW5wdXRfaGFuZGxlciBs aWRfaGFuZGxlcjsKIH07CiAKIAotLSAKMS43LjkuNQoK --_015_77BC725C9062764F874D79F51E1F1A8F4C90A06ES04MBX0104s04lo_-- -- 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/