Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753900AbaF3FnN (ORCPT ); Mon, 30 Jun 2014 01:43:13 -0400 Received: from relay-s04-hub005.domainlocalhost.com ([74.115.207.216]:8545 "EHLO relay-S04-HUB005.domainlocalhost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751302AbaF3FnL (ORCPT ); Mon, 30 Jun 2014 01:43:11 -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/yAn5uJBvZQ Date: Mon, 30 Jun 2014 05:43:06 +0000 Message-ID: <77BC725C9062764F874D79F51E1F1A8F4C902B3B@S04-MBX01-01.s04.local> References: In-Reply-To: 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.155] Content-Type: multipart/mixed; boundary="_016_77BC725C9062764F874D79F51E1F1A8F4C902B3BS04MBX0101s04lo_" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --_016_77BC725C9062764F874D79F51E1F1A8F4C902B3BS04MBX0101s04lo_ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 SGkgUGF0cmlrLA0KDQpUaGFua3MgZm9yIHlvdXIgZmVlZGJhY2ssIEknbSBzb3JyeSBmb3IgdGhl IG1pc3Rha2UgYW5kIGluY29udmVuaWVuY2UuDQpBdHRhY2hlZCBhcmUgdGhlIHBhdGNoZXMgZmls ZXMsIEkgc2VudCBpdCBmaXJzdGx5Lg0KSSB3aWxsIGZ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ZpZGVudGlhbCBpbmZvcm1hdGlvbi4gSWYgaXQgaGFzIGJlZW4gcmVjZWl2ZWQgaW4gZXJy b3IsIHBsZWFzZSBhZHZpc2UgdGhlIHNlbmRlciBhbmQgaW1tZWRpYXRlbHkgZGVsZXRlIHRoaXMg bWVzc2FnZS4NCg== --_016_77BC725C9062764F874D79F51E1F1A8F4C902B3BS04MBX0101s04lo_ Content-Type: application/octet-stream; name="cyapa_0_instruction.patch" Content-Description: cyapa_0_instruction.patch Content-Disposition: attachment; filename="cyapa_0_instruction.patch"; size=2598; creation-date="Fri, 06 Jun 2014 08:03:16 GMT"; modification-date="Fri, 06 Jun 2014 06:53:43 GMT" Content-Transfer-Encoding: base64 VGhpcyBwYXRjaCBzZXQgaXMgbWFkZSBiYXNlZCBvbiBrZXJuZWwgMy4xNS4wLXJjOC4KSXQncyBh aW1lZCB0byByZS1hcmNoaXRlY3R1cmUgdGhlIGN5YXBhIGRyaXZlciB0byBzdXBwb3J0Cm9sZCBn ZW4zIHRyYWNrcGFkIGRldmljZSBhbmQgbmV3IGdlbjUgdHJhY2twYWQgZGV2aWNlIGluIG9uZQpj eWFwYSBkcml2ZXIgZm9yIGVhc2lseSBwcm9kdWN0aW9ucyBzdXBwb3J0IGJhc2VkIG9uCmN1c3Rv bWVycycgcmVxdWlyZW1lbnRzLCBhbmQgYWRkIHN5c2ZzIGZ1bmN0aW9ucyBhbmQgaW50ZXJmYWNl cwpzdXBwb3J0ZWQgdGhhdCByZXF1aXJlZCBieSB1c2VycyBhbmQgY3VzdG9tZXJzLgpCZWNhdXNl IHRoZSBlYXJsaWVyIGdlbjMgYW5kIHRoZSBsYXRlc3QgZ2VuNSB0cmFja3BhZCBkZXZpZXMgdXNp bmcKdHdvIGRpZmZlcmVudCBjaGlwc2V0cywgYW5kIGhhdmUgZGlmZmVyZW50IHByb3RvY29sIGFu ZCBpbnRlcmZhY2VzLgpJZiBzdXBwb3J0ZWQgdGhlc2UgdHdvIHRyYWNrcGFkIGRldm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9ucyBzdXBwb3J0ZWQuCgpwYXRjaCA5LzE0OiBhZGQgZ2VuMyB0cmFj a3BhZCBkZXZpY2UgcmVhZCBmaXJtd2FyZSBpbWFnZSBmdW5jdGlvbiBzdXBwb3J0ZWQuCgpwYXRj aCAxMC8xNDogYWRkIGdlbjUgdHJhY2twYWQgZGV2aWNlIGJhc2ljIGZ1bmN0aW9ucyBzdXBwb3J0 ZWQuCgpwYXRjaCAxMS8xNDogYWRkIGdlbjUgdHJhY2twYWQgZGV2aWNlIGZpcm13YXJlIHVwZGF0 ZSBmdW5jdGlvbiBzdXBwb3J0ZWQuCgpwYXRjaCAxMi8xNDogYWRkIGdlbjUgdHJhY2twYWQgZGV2 aWNlIHJlcG9ydCBiYXNlbGluZSBhbmQgZG8gZm9yY2UKcmUtY2FsaWJyYXRlIGZ1bmN0aW9ucyBz dXBwb3J0ZWQuCgpwYXRjaCAxMy8xNDogYWRkIGdlbjUgdHJhY2twYWQgZGV2aWNlIHJlYWQgZmly bXdhcmUgaW1hZ2UgYW5kIHJlcG9ydApzZW5zb3JzJyByYXcgZGF0YSB2YWx1ZXMgZnVuY3Rpb25z IHN1cHBvcnRlZC4KCnBhdGNoIDE0LzE0OiBhZGQgZnVuY3Rpb24gdG8gbW9uaXRvciBMSUQgY2xv c2UgZXZlbnQgdG8gb2ZmIHRyYWNrcGFkIGRldmljZS4K --_016_77BC725C9062764F874D79F51E1F1A8F4C902B3BS04MBX0101s04lo_ Content-Type: application/octet-stream; name="cyapa_1_basic.patch" Content-Description: cyapa_1_basic.patch Content-Disposition: attachment; filename="cyapa_1_basic.patch"; size=45524; creation-date="Fri, 06 Jun 2014 08:03:16 GMT"; modification-date="Fri, 06 Jun 2014 02:01:09 GMT" Content-Transfer-Encoding: base64 U2lnbmVkLW9mZi1ieTogRHUsIER1ZGxleSA8ZHVkbEBjeXByZXNzLmNvbT4KLS0tCmRpZmYgLS1n aXQgYS9kcml2ZXJzL2lucHV0L21vdXNlL01ha2VmaWxlIGIv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ywgc2l6ZV90IGxl biwgdTggKnZhbHVlcyk7Citzc2l6ZV90IGN5YXBhX2kyY193cml0ZShzdHJ1Y3QgY3lhcGEgKmN5 YXBhLCB1OCByZWcsCisJCQkJc2l6ZV90IGxlbiwgY29uc3QgdTggKnZhbHVlcyk7CisKK2ludCBj eWFwYV9wb2xsX3N0YXRlKHN0cnVjdCBjeWFwYSAqY3lhcGEsIHVuc2lnbmVkIGludCB0aW1lb3V0 KTsKK3ZvaWQgY3lhcGFfZGV0ZWN0X2FzeW5jKHZvaWQgKmRhdGEsIGFzeW5jX2Nvb2tpZV90IGNv b2tpZSk7CisKK3U4IGN5YXBhX3NsZWVwX3RpbWVfdG9fcHdyX2NtZCh1MTYgc2xlZXBfdGltZSk7 Cit1MTYgY3lhcGFfcHdyX2NtZF90b19zbGVlcF90aW1lKHU4IHB3cl9tb2RlKTsKKworCitleHRl cm4gY29uc3QgY2hhciB1bmlxdWVfc3RyW107CisKKyNlbmRpZgo= --_016_77BC725C9062764F874D79F51E1F1A8F4C902B3BS04MBX0101s04lo_ Content-Type: application/octet-stream; name="cyapa_2_add_pm_interface.patch" Content-Description: cyapa_2_add_pm_interface.patch Content-Disposition: attachment; filename="cyapa_2_add_pm_interface.patch"; size=3416; creation-date="Fri, 06 Jun 2014 08:03:16 GMT"; modification-date="Fri, 06 Jun 2014 02:01:06 GMT" Content-Transfer-Encoding: base64 U2lnbmVkLW9mZi1ieTogRHUsIER1ZGxleSA8ZHVkbEBjeXByZXNzLmNvbT4KLS0tCmRpZmYgLS1n aXQgYS9kcml2ZXJzL2lucHV0L21vdXNlL2N5YXBhLmMgYi9kcml2ZXJzL2lucHV0L21vdXNlL2N5 YXBhLmMKaW5kZXggZDVhZGVlOC4uMWRmYzE2ZCAxMDA2NDQKLS0tIGEvZHJpdmVycy9pbnB1dC9t b3VzZS9jeWFwYS5jCisrKyBiL2RyaXZlcnMvaW5wdXQvbW91c2UvY3lhcGEuYwpAQCAtNDYyLDYg KzQ2MiwxMCB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IGN5YXBhICpjeWFwYSA9IChzdHJ1Y3QgY3lhcGEgKilkYXRhOwpAQCAtNTc1LDYg KzY1NCwxMiBAQCBzdGF0aWMgaW50IGN5YXBhX3Byb2JlKHN0cnVjdCBpMmNfY2xpZW50ICpjbGll bnQsCiAJfQogCWN5YXBhX2Rpc2FibGVfaXJxKGN5YXBhKTsKIAorI2lmZGVmIENPTkZJR19QTV9T TEVFUAorCWlmIChkZXZpY2VfY2FuX3dha2V1cChkZXYpICYmCisJICAgIHN5c2ZzX21lcmdlX2dy b3VwKCZjbGllbnQtPmRldi5rb2JqLCAmY3lhcGFfcG93ZXJfd2FrZXVwX2dyb3VwKSkKKwkJZGV2 X3dhcm4oZGV2LCAiZXJyb3IgY3JlYXRpbmcgd2FrZXVwIHBvd2VyIGVudHJpZXMuXG4iKTsKKyNl bmRpZiAvKiBDT05GSUdfUE1fU0xFRVAgKi8KKwogCWFzeW5jX3NjaGVkdWxlKGN5YXBhX2RldGVj dF9hbmRfc3RhcnQsIGN5YXBhKTsKIAlyZXR1cm4gMDsKIApAQCAtNTkwLDYgKzY3NSw5IEBAIHN0 YXRpYyBpbnQgY3lhcGFfcmVtb3ZlKHN0cnVjdCBpMmNfY2xpZW50ICpjbGllbnQpCiB7CiAJc3Ry dWN0IGN5YXBhICpjeWFwYSA9IGkyY19nZXRfY2xpZW50ZGF0YShjbGllbnQpOwogCisjaWZkZWYg Q09ORklHX1BNX1NMRUVQCisJc3lzZnNfdW5tZXJnZV9ncm91cCgmY2xpZW50LT5kZXYua29iaiwg JmN5YXBhX3Bvd2VyX3dha2V1cF9ncm91cCk7CisjZW5kaWYKIAlmcmVlX2lycShjeWFwYS0+aXJx LCBjeWFwYSk7CiAKIAlpbnB1dF91bnJlZ2lzdGVyX2RldmljZShjeWFwYS0+aW5wdXQpOwo= --_016_77BC725C9062764F874D79F51E1F1A8F4C902B3BS04MBX0101s04lo_ Content-Type: application/octet-stream; name="cyapa_3_add_runtime_power_supported.patch" Content-Description: cyapa_3_add_runtime_power_supported.patch Content-Disposition: attachment; filename="cyapa_3_add_runtime_power_supported.patch"; size=6148; creation-date="Fri, 06 Jun 2014 08:03:16 GMT"; modification-date="Fri, 06 Jun 2014 02:01:04 GMT" Content-Transfer-Encoding: base64 U2lnbmVkLW9mZi1ieTogRHUsIER1ZGxleSA8ZHVkbEBjeXByZXNzLmNvbT4KLS0tCmRpZmYgLS1n aXQgYS9kcml2ZXJzL2lucHV0L21vdXNlL2N5YXBhLmMgYi9kcml2ZXJzL2lucHV0L21vdXNlL2N5 YXBhLmMKaW5kZXggMWRmYzE2ZC4uYzJiNjdkMyAxMDA2NDQKLS0tIGEvZHJpdmVycy9pbnB1dC9t b3VzZS9jeWFwYS5jCisrKyBiL2RyaXZlcnMvaW5wdXQvbW91c2UvY3lhcGEuYwpAQCAtMzQ2LDkg KzM0NiwxNiBAQCBzdGF0aWMgaW50IGN5YXBhX2NoZWNrX2lzX29wZXJhdGlvbmFsKHN0cnVjdCBj eWFwYSAqY3lhcGEpCiBzdGF0aWMgaXJxcmV0dXJuX3QgY3lhcGFfaXJxKGludCBpcnEsIHZvaWQg KmRldl9pZCkKIHsKIAlzdHJ1Y3QgY3lhcGEgKmN5YXBhID0gZGV2X2lkOworCXN0cnVjdCBkZXZp Y2UgKmRldiA9ICZjeWFwYS0+Y2xpZW50LT5kZXY7CiAJc3RydWN0IGlucHV0X2RldiAqaW5wdXQg PSBjeWFwYS0+aW5wdXQ7CiAJYm9vbCBjb250OwogCisJcG1fcnVudGltZV9nZXRfc3luYyhkZXYp OworCXBtX3J1bnRpbWVfbWFya19sYXN0X2J1c3koZGV2KTsKKworCWlmIChkZXZpY2VfbWF5X3dh a2V1cChkZXYpKQorCQlwbV93YWtldXBfZXZlbnQoZGV2LCAwKTsKKwogCS8qIGludGVycnVwdCBl dmVudCBtYXliZSBjdWFzZWQgYnkgaG9zdCBjb21tYW5kIHRvIHRyYWNrcGFkIGRldmljZS4gKi8K IAljb250ID0gdHJ1ZTsKIAl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yhjeWFwYV9ydW50aW1lX3N1c3BlbmQs IGN5YXBhX3J1bnRpbWVfcmVzdW1lLCBOVUxMKQogfTsKIAogc3RhdGljIGNvbnN0IHN0cnVjdCBp MmNfZGV2aWNlX2lkIGN5YXBhX2lkX3RhYmxlW10gPSB7CmRpZmYgLS1naXQgYS9kcml2ZXJzL2lu cHV0L21vdXNlL2N5YXBhLmggYi9kcml2ZXJzL2lucHV0L21vdXNlL2N5YXBhLmgKaW5kZXggMTc4 MGQ4Mi4uOTFmYjg0YSAxMDA2NDQKLS0tIGEvZHJpdmVycy9pbnB1dC9tb3VzZS9jeWFwYS5oCisr KyBiL2RyaXZlcnMvaW5wdXQvbW91c2UvY3lhcGEuaApAQCAtMTk5LDYgKzE5OSwxMCBAQCBzdHJ1 Y3QgY3lhcGEgewogCS8qIHBvd2VyIG1vZGUgc2V0dGluZ3MgKi8KIAl1OCBzdXNwZW5kX3Bvd2Vy X21vZGU7CiAJdTE2IHN1c3BlbmRfc2xlZXBfdGltZTsKKyNpZmRlZiBDT05GSUdfUE1fUlVOVElN RQorCXU4IHJ1bnRpbWVfc3VzcGVuZF9wb3dlcl9tb2RlOworCXUxNiBydW50aW1lX3N1c3BlbmRf c2xlZXBfdGltZTsKKyNlbmRpZiAvKiBDT05GSUdfUE1fUlVOVElNRSAqLwogCiAJLyogcmVhZCBm cm9tIHF1ZXJ5IGRhdGEgcmVnaW9uLiAqLwogCWNoYXIgcHJvZHVjdF9pZFsxNl07Cg== --_016_77BC725C9062764F874D79F51E1F1A8F4C902B3BS04MBX0101s04lo_ Content-Type: application/octet-stream; name="cyapa_4_add_sysfs_interface.patch" Content-Description: cyapa_4_add_sysfs_interface.patch Content-Disposition: attachment; filename="cyapa_4_add_sysfs_interface.patch"; size=7249; creation-date="Fri, 06 Jun 2014 08:03:16 GMT"; modification-date="Fri, 06 Jun 2014 02:01:00 GMT" Content-Transfer-Encoding: base64 U2lnbmVkLW9mZi1ieTogRHUsIER1ZGxleSA8ZHVkbEB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04MBX0101s04lo_ Content-Type: application/octet-stream; name="cyapa_5_add_read_fw_read_raw_data.patch" Content-Description: cyapa_5_add_read_fw_read_raw_data.patch Content-Disposition: attachment; filename="cyapa_5_add_read_fw_read_raw_data.patch"; size=7410; creation-date="Fri, 06 Jun 2014 08:03:16 GMT"; modification-date="Fri, 06 Jun 2014 02:00:58 GMT" Content-Transfer-Encoding: base64 U2lnbmVkLW9mZi1ieTogRHUsIER1ZGxleSA8ZHVkbEBjeXByZXNzLmNvbT4KLS0tCmRpZmYgLS1n aXQgYS9kcml2ZXJzL2lucHV0L21vdXNlL2N5YXBhLmMgYi9kcml2ZXJzL2lucHV0L21vdXNlL2N5 YXBhLmMKaW5kZXggM2I4MGRlNi4uYjVkYzlmOSAxMDA2NDQKLS0tIGEvZHJpdmVycy9pbnB1dC9t b3VzZS9jeWFwYS5jCisrKyBiL2RyaXZlcnMvaW5wdXQvbW91c2UvY3lhcGEuYwpAQCAtMzksNiAr MzksOSBAQAogCiBjb25zdCBjaGFyIHVuaXF1ZV9zdHJbXSA9ICJDWVRSQSI7CiAKKy8qIGdsb2Jh bCByb290IG5vZGUgb2YgdGhlIGN5YXBhIGRlYnVnZnMgZGlyZWN0b3J5LiAqLworc3RhdGljIHN0 cnVjdCBkZW50cnkgKmN5YXBhX2RlYnVnZnNfcm9vdDsKKwogCiB2b2lkIGN5YXBhX2VuYWJsZV9p cnEoc3RydWN0IGN5YXBhICpjeWFwYSkKIHsKQEAgLTIwNSw2ICsyMDgsOSBAQCBjb25zdCBzdHJ1 Y3QgY3lhcGFfZGV2X29wcyBjeWFwYV9kZWZhdWx0X29wcyA9IHsKIAlOVUxMLAogCU5VTEwsCiAK KwlOVUxMLAorCU5VTEwsCisKIAljeWFwYV9kZWZhdWx0X2lycV9oYW5kbGVyLAogCU5VTEwsCiAJ TlVMTCwKQEAgLTU1NCw2ICs1NjAsMjA1IEBAIGRvbmU6CiB9CiAKIC8qCisgKioqKioqKioqKioq KioqKioqKioqKioqKioqKio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Y3Qg ZGVudHJ5ICpkZW50cnlfZGV2OworCisJLyogQnVmZmVyIHRvIHN0b3JlIGZpcm13YXJlIHJlYWQg dXNpbmcgZGVidWdmcyAqLworCXN0cnVjdCBtdXRleCBkZWJ1Z2ZzX211dGV4OworCXU4ICpyZWFk X2Z3X2ltYWdlOworCXNpemVfdCByZWFkX2Z3X2ltYWdlX3NpemU7CisJLyogQnVmZmVyIHRvIHN0 b3JlIHNlbnNvcnMnIHJhdyBkYXRhICovCisJdTggKnRwX3Jhd19kYXRhOworCXNpemVfdCB0cF9y YXdfZGF0YV9zaXplOworCiAJY29uc3Qgc3RydWN0IGN5YXBhX2Rldl9vcHMgKm9wczsKIH07CiAK --_016_77BC725C9062764F874D79F51E1F1A8F4C902B3BS04MBX0101s04lo_ Content-Type: application/octet-stream; name="cyapa_6_add_gen3_supported.patch" Content-Description: cyapa_6_add_gen3_supported.patch Content-Disposition: attachment; filename="cyapa_6_add_gen3_supported.patch"; size=27480; creation-date="Fri, 06 Jun 2014 08:03:16 GMT"; modification-date="Fri, 06 Jun 2014 02:07:29 GMT" Content-Transfer-Encoding: base64 U2lnbmVkLW9mZi1ieTogRHUsIER1ZGxleSA8ZHVkbEBjeXByZXNzLmNvbT4KLS0tCmRpZmYgLS1n aXQgYS9kcml2ZXJzL2lucHV0L21vdXNlL01ha2VmaWxlIGIvZHJpdmVycy9pbnB1dC9tb3VzZS9N YWtlZmlsZQppbmRleCBkODk0OGRmLi5jYzI5MjdiIDEwMDY0NAotLS0gYS9kcml2ZXJzL2lucHV0 L21vdXNlL01ha2VmaWxlCisrKyBiL2RyaXZlcnMvaW5wdXQvbW91c2UvTWFrZWZpbGUKQEAgLTM1 LDUgKzM1LDUgQEAgcHNtb3VzZS0kKENPTkZJR19NT1VTRV9QUzJfVFJBQ0tQT0lOVCkJKz0gdHJh Y2twb2ludC5vCiBwc21vdXNlLSQoQ09ORklHX01PVVNFX1BTMl9UT1VDSEtJVCkJKz0gdG91Y2hr aXRfcHMyL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R5ICYgQ0FQQUJJTElUWV9SSUdIVF9CVE5fTUFTSykKKwkJaW5w dXRfcmVwb3J0X2tleShpbnB1dCwgQlROX1JJR0hULAorCQkJCSAhIShkYXRhLmZpbmdlcl9idG4g JiBPUF9EQVRBX1JJR0hUX0JUTikpOworCWlucHV0X3N5bmMoaW5wdXQpOworfQorCisKK2NvbnN0 IHN0cnVjdCBjeWFwYV9kZXZfb3BzIGN5YXBhX2dlbjNfb3BzID0geworCU5VTEwsCisJTlVMTCwK KwlOVUxMLAorCU5VTEwsCisJTlVMTCwKKwlOVUxMLAorCU5VTEwsCisKKwlOVUxMLAorCU5VTEws CisKKwlOVUxMLAorCU5VTEwsCisKKwlOVUxMLAorCU5VTEwsCisKKwljeWFwYV9nZW4zX3N0YXRl X3BhcnNlLAorCWN5YXBhX2dlbjNfZG9fb3BlcmF0aW9uYWxfY2hlY2ssCisKKwljeWFwYV9nZW4z X2lycV9oYW5kbGVyLAorCU5VTEwsCisJTlVMTCwKKwljeWFwYV9nZW4zX3NldF9wb3dlcl9tb2Rl LAorfTsK --_016_77BC725C9062764F874D79F51E1F1A8F4C902B3BS04MBX0101s04lo_ Content-Type: application/octet-stream; name="cyapa_7_add_gen3_update_fw.patch" Content-Description: cyapa_7_add_gen3_update_fw.patch Content-Disposition: attachment; filename="cyapa_7_add_gen3_update_fw.patch"; size=8488; creation-date="Fri, 06 Jun 2014 08:03:16 GMT"; modification-date="Fri, 06 Jun 2014 02:07:27 GMT" Content-Transfer-Encoding: base64 U2lnbmVkLW9mZi1ieTogRHUsIER1ZGxleSA8ZHVkbEBjeXByZXNzLmNvbT4KLS0tCmRpZmYgLS1n aXQgYS9kcml2ZXJzL2lucHV0L21vdXNlL2N5YXBhX2dlbjMuYyBiL2RyaXZlcnMvaW5wdXQvbW91 c2UvY3lhcGFfZ2VuMy5jCmluZGV4IDUzNDVhOWUuLmEzZTFlNzIgMTAwNjQ0Ci0tLSBhL2RyaXZl cnMvaW5wdXQvbW91c2UvY3lhc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WN0IGN5YXBhX2Rldl9v cHMgY3lhcGFfZ2VuM19vcHMgPSB7CisJY3lhcGFfZ2VuM19jaGVja19mdywKKwljeWFwYV9nZW4z X2JsX2VudGVyLAorCWN5YXBhX2dlbjNfYmxfYWN0aXZhdGUsCiAJTlVMTCwKKwljeWFwYV9nZW4z X2RvX2Z3X3VwZGF0ZSwKIAlOVUxMLAotCU5VTEwsCi0JTlVMTCwKLQlOVUxMLAotCU5VTEwsCi0J TlVMTCwKKwljeWFwYV9nZW4zX2JsX2RlYWN0aXZhdGUsCiAKIAlOVUxMLAogCU5VTEwsCg== --_016_77BC725C9062764F874D79F51E1F1A8F4C902B3BS04MBX0101s04lo_ Content-Type: application/octet-stream; name="cyapa_8_add_gen3_baseline_calibrate.patch" Content-Description: cyapa_8_add_gen3_baseline_calibrate.patch Content-Disposition: attachment; filename="cyapa_8_add_gen3_baseline_calibrate.patch"; size=3843; creation-date="Fri, 06 Jun 2014 08:03:16 GMT"; modification-date="Fri, 06 Jun 2014 02:07:26 GMT" Content-Transfer-Encoding: base64 U2lnbmVkLW9mZi1ieTogRHUsIER1ZGxleSA8ZHVkbEBjeXByZXNzLmNvbT4KLS0tCmRpZmYgLS1n aXQgYS9kcml2ZXJzL2lucHV0L21vdXNlL2N5YXBhX2dlbjMuYyBiL2RyaXZlcnMvaW5wdXQvbW91 c2UvY3lhcGFfZ2VuMy5jCmluZGV4IGEzZTFlNzIuLjlmZmRiYzEgMTAwNjQ0Ci0tLSBhL2RyaXZl cnMvaW5wdXQvbW91c2UvY3lhcGFfZ2VuMy5jCisrKyBiL2RyaXZlcnMvaW5wdXQvbW91c2UvY3lh cGFfZ2VuMy5jCkBAIC03MjQsNiArNzI0LDEzOCBAQCBzdGF0aWMgaW50IGN5YXBhX2dlbjNfZG9f ZndfdXBkYXRlKHN0cnVjdCBjeWFwYSAqY3lhcGEsCiAJcmV0dXJuIDA7CiB9CiAKK3N0YXRpYyBz c2l6ZV90IGN5YXBhX2dlbjNfZG9fY2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q CkBAIC05ODcsOCArMTExOSw4IEBAIGNvbnN0IHN0cnVjdCBjeWFwYV9kZXZfb3BzIGN5YXBhX2dl bjNfb3BzID0gewogCU5VTEwsCiAJY3lhcGFfZ2VuM19ibF9kZWFjdGl2YXRlLAogCi0JTlVMTCwK LQlOVUxMLAorCWN5YXBhX2dlbjNfc2hvd19iYXNlbGluZSwKKwljeWFwYV9nZW4zX2RvX2NhbGli cmF0ZSwKIAogCU5VTEwsCiAJTlVMTCwK --_016_77BC725C9062764F874D79F51E1F1A8F4C902B3BS04MBX0101s04lo_ Content-Type: application/octet-stream; name="cyapa_9_add_gen3_read_fw.patch" Content-Description: cyapa_9_add_gen3_read_fw.patch Content-Disposition: attachment; filename="cyapa_9_add_gen3_read_fw.patch"; size=2848; creation-date="Fri, 06 Jun 2014 08:03:16 GMT"; modification-date="Fri, 06 Jun 2014 02:07:23 GMT" Content-Transfer-Encoding: base64 U2lnbmVkLW9mZi1ieTogRHUsIER1ZGxleSA8ZHVkbEBjeXByZXNzLmNvbT4KLS0tCmRpZmYgLS1n aXQgYS9kcml2ZXJzL2lucHV0L21vdXNlL2N5YXBhX2dlbjMuYyBiL2RyaXZlcnMvaW5wdXQvbW91 c2UvY3lhcGFfZ2VuMy5jCmluZGV4IDlmZmRiYzEuLmU5MDNlNjIgMTAwNjQ0Ci0tLSBhL2RyaXZl cnMvaW5wdXQvbW91c2UvY3lhcGFfZ2VuMy5jCisrKyBiL2RyaXZlcnMvaW5wdXQvbW91c2UvY3lh cGFfZ2VuMy5jCkBAIC02ODksNiArNjg5LDM1IEBAIHN0YXRpYyBpbnQgY3lhcGFfZ2VuM193cml0 ZV9md19ibG9jayhzdHJ1Y3QgY3lhcGEgKmN5YXBhLAogCXJldHVybiByZXQ7CiB9CiAKKy8qCisg KiBBIGZpcm13YXJlIGJsb2NrIHJlYWQgY29tbWFuZCByZWFkcyAxNiBieXRlcyBvZiBkYXRhIGZy b20gZmxhc2ggc3RhcnRpbmcKKyAqIGZyb20g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--_016_77BC725C9062764F874D79F51E1F1A8F4C902B3BS04MBX0101s04lo_ Content-Type: application/octet-stream; name="cyapa_10_add_gen5_supported.patch" Content-Description: cyapa_10_add_gen5_supported.patch Content-Disposition: attachment; filename="cyapa_10_add_gen5_supported.patch"; size=49832; creation-date="Fri, 06 Jun 2014 08:03:16 GMT"; modification-date="Fri, 06 Jun 2014 02:07:22 GMT" Content-Transfer-Encoding: base64 U2lnbmVkLW9mZi1ieTogRHUsIER1ZGxleSA8ZHVkbEBjeXByZXNzLmNvbT4KLS0tCmRpZmYgLS1n aXQgYS9kcml2ZXJzL2lucHV0L21vdXNlL01ha2VmaWxlIGIvZHJpdmVycy9pbnB1dC9tb3VzZS9N YWtlZmlsZQppbmRleCBjYzI5MjdiLi41OWExYWJkIDEwMDY0NAotLS0gYS9kcml2ZXJzL2lucHV0 L21vdXNlL01ha2VmaWxlCisrKyBiL2RyaXZlcnMvaW5wdXQvbW91c2UvTWFrZWZpbGUKQEAgLTM1 LDUgKzM1LDUgQEAgcHNtb3VzZS0kKENPTkZJR19NT1VTRV9QUzJfVFJBQ0tQT0lOVCkJKz0gdHJh Y2twb2ludC5vCiBwc21vdXNlLSQoQ09ORklHX01PVVNFX1BTMl9UT1VDSEtJVCkJKz0gdG91Y2hr aXRfcHMyLm8KIHBzbW91c2UtJChDT05GSUdfTU9VU0VfUFMyX0NZUFJFU1MpCSs9IGN5cHJlc3Nf cHMyLm8KIAotY3lhcGF0cC15IDo9IGN5YXBhLm8gY3lhcGFfZ2VuMy5vCitjeWFwYXRwLXkgOj0g Y3lhcGEubyBjeWFwYV9nZW4zLm8gY3lhcGFfZ2VuNS5vCiAKZGlmZiAtLWdpdCBhL2RyaXZlcnMv aW5wdXQvbW91c2UvY3lhcGEuYyBiL2RyaXZlcnMvaW5wdXQvbW91c2UvY3lhcGEuYwppbmRleCAz Zjg3MGU1Li44ZDM3MDMyIDEwMDY0NAotLS0gYS9kcml2ZXJzL2lucHV0L21vdXNlL2N5YXBhLm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AgICAgICAyCisKKyNkZWZpbmUgR0VONV9QQVJBTUVURVJfRElTQUJMRV9QSVBf UkVQT1JUICAgIDB4MDgKKworI2RlZmluZSBHRU41X1BPV0VSX1NUQVRFX0FDVElWRSAgICAgICAg ICAgICAgMHgwMQorI2RlZmluZSBHRU41X1BPV0VSX1NUQVRFX0xPT0tfRk9SX1RPVUNIICAgICAg MHgwMgorI2RlZmluZSBHRU41X1BPV0VSX1NUQVRFX1JFQURZICAgICAgICAgICAgICAgMHgwMwor I2RlZmluZSBHRU41X1BPV0VSX1NUQVRFX0lETEUgICAgICAgICAgICAgICAgMHgwNAorI2RlZmlu ZSBHRU41X1BPV0VSX1NUQVRFX0JUTl9PTkxZICAgICAgICAgICAgMHgwNQorI2RlZmluZSBHRU41 X1BPV0VSX1NUQVRFX09GRiAgICAgICAgICAgICAgICAgMHgwNgorCisjZGVmaW5lIEdFTjVfREVF UF9TTEVFUF9TVEFURV9NQVNLICAweDAzCisjZGVmaW5lIEdFTjVfREVFUF9TTEVFUF9TVEFURV9P TiAgICAweDAwCisjZGVmaW5lIEdFTjVfREVFUF9TTEVFUF9TVEFURV9PRkYgICAweDAxCisKKyNk ZWZpbmUgR0VONV9ERUVQX1NMRUVQX09QQ09ERSAgICAgIDB4MDgKKyNkZWZpbmUgR0VONV9ERUVQ X1NMRUVQX09QQ09ERV9NQVNLIDB4MGYKKworI2RlZmluZSBHRU41X1BPV0VSX1JFQURZX01BWF9J TlRSVkxfVElNRSAgNTAgICAvKiB1bml0OiBtcyAqLworI2RlZmluZSBHRU41X1BPV0VSX0lETEVf TUFYX0lOVFJWTF9USU1FICAgMjUwICAvKiB1bml0OiBtcyAqLworCisjZGVmaW5lIEdFTjVfQ01E X1JFUE9SVF9JRF9PRkZTRVQgICAgICAgNAorCisjZGVmaW5lIEdFTjVfUkVTUF9SRVBPUlRfSURf T0ZGU0VUICAgICAgMgorI2RlZmluZSBHRU41X1JFU1BfUlNWRF9PRkZTRVQgICAgICAgICAgIDMK KyNkZWZpbmUgICAgIEdFTjVfUkVTUF9SU1ZEX0tFWSAgICAgICAgICAweDAwCisjZGVmaW5lIEdF TjVfUkVTUF9CTF9TT1BfT0ZGU0VUICAgICAgICAgNAorI2RlZmluZSAgICAgR0VONV9TT1BfS0VZ ICAgICAgICAgICAgICAgIDB4MDEgIC8qIFN0YXJ0IG9mIFBhY2tldCAqLworI2RlZmluZSAgICAg R0VONV9FT1BfS0VZICAgICAgICAgICAgICAgIDB4MTcgIC8qIEVuZCBvZiBQYWNrZXQgKi8KKyNk ZWZpbmUgR0VONV9SRVNQX0FQUF9DTURfT0ZGU0VUICAgICAgICA0CisjZGVmaW5lICAgICBHRVRf R0VONV9DTURfQ09ERShyZWcpICAgICAgKChyZWcpICYgMHg3ZikKKworI2RlZmluZSBHRU41X01J Tl9CTF9DTURfTEVOR1RIICAgICAgICAgICAxMworI2RlZmluZSBHRU41X01JTl9CTF9SRVNQX0xF TkdUSCAgICAgICAgICAxMQorI2RlZmluZSBHRU41X01JTl9BUFBfQ01EX0xFTkdUSCAgICAgICAg ICA3CisjZGVmaW5lIEdFTjVfTUlOX0FQUF9SRVNQX0xFTkdUSCAgICAgICAgIDUKKyNkZWZpbmUg R0VONV9VTlNVUFBPUlRFRF9DTURfUkVTUF9MRU5HVEggNgorCisjZGVmaW5lIEdFTjVfUkVTUF9M RU5HVEhfU0laRSAyCisKKyNkZWZpbmUgR0VONV9ISURfREVTQ1JJUFRPUl9TSVpFICAgICAgMzIK KyNkZWZpbmUgR0VONV9CTF9ISURfUkVQT1JUX0lEICAgICAgICAgMHhmZgorI2RlZmluZSBHRU41 X0FQUF9ISURfUkVQT1JUX0lEICAgICAgICAweGY3CisjZGVmaW5lIEdFTjVfQkxfTUFYX09VVFBV VF9MRU5HVEggICAgIDB4MDEwMAorI2RlZmluZSBHRU41X0FQUF9NQVhfT1VUUFVUX0xFTkdUSCAg ICAweDAwZmUKKworI2RlZmluZSBHRU41X0JMX1JFUE9SVF9ERVNDUklQVE9SX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ydF9hYnMoaW5w dXQsIEFCU19NVF9XSURUSF9NSU5PUiwKKwkJCQl0b3VjaC0+bWlub3JfdG9vbF9sZW4pOworCisJ CQlpbnB1dF9yZXBvcnRfYWJzKGlucHV0LCBBQlNfTVRfT1JJRU5UQVRJT04sCisJCQkJdG91Y2gt Pm9yaWVudGF0aW9uKTsKKwkJfQorCisJCWlucHV0X210X3N5bmNfZnJhbWUoaW5wdXQpOworCisJ CWlucHV0X3N5bmMoaW5wdXQpOworCX0KK30KKworY29uc3Qgc3RydWN0IGN5YXBhX2Rldl9vcHMg Y3lhcGFfZ2VuNV9vcHMgPSB7CisJTlVMTCwKKwlOVUxMLAorCU5VTEwsCisJTlVMTCwKKwlOVUxM LAorCU5VTEwsCisJTlVMTCwKKworCU5VTEwsCisJTlVMTCwKKworCU5VTEwsCisJTlVMTCwKKwor CWN5YXBhX2dlbjVfZ2V0X3ByaXZhdGVfc2l6ZSwKKwljeWFwYV9nZW41X3ByaXZhdGVfaW5pdCwK KworCWN5YXBhX2dlbjVfc3RhdGVfcGFyc2UsCisJY3lhcGFfZ2VuNV9kb19vcGVyYXRpb25hbF9j aGVjaywKKworCWN5YXBhX2dlbjVfaXJxX2hhbmRsZXIsCisJY3lhcGFfZ2VuNV9pcnFfY21kX2hh bmRsZXIsCisJY3lhcGFfZW1wdHlfcGlwX291dHB1dF9kYXRhLAorCWN5YXBhX2dlbjVfc2V0X3Bv d2VyX21vZGUsCit9Owo= --_016_77BC725C9062764F874D79F51E1F1A8F4C902B3BS04MBX0101s04lo_ Content-Type: application/octet-stream; name="cyapa_11_add_gen5_update_fw.patch" Content-Description: cyapa_11_add_gen5_update_fw.patch Content-Disposition: attachment; filename="cyapa_11_add_gen5_update_fw.patch"; size=10657; creation-date="Fri, 06 Jun 2014 08:03:16 GMT"; modification-date="Fri, 06 Jun 2014 02:07:20 GMT" Content-Transfer-Encoding: base64 U2lnbmVkLW9mZi1ieTogRHUsIER1ZGxleSA8ZHVkbEBjeXByZXNzLmN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XBhX2dlbjVfYmxfZW50ZXIs CiAJTlVMTCwKLQlOVUxMLAotCU5VTEwsCi0JTlVMTCwKLQlOVUxMLAorCWN5YXBhX2dlbjVfYmxf aW5pdGlhdGUsCisJY3lhcGFfZ2VuNV9kb19md191cGRhdGUsCiAJTlVMTCwKIAlOVUxMLAogCg== --_016_77BC725C9062764F874D79F51E1F1A8F4C902B3BS04MBX0101s04lo_ Content-Type: application/octet-stream; name="cyapa_12_add_gen5_baseline_calibrate.patch" Content-Description: cyapa_12_add_gen5_baseline_calibrate.patch Content-Disposition: attachment; filename="cyapa_12_add_gen5_baseline_calibrate.patch"; size=20485; creation-date="Fri, 06 Jun 2014 08:03:16 GMT"; modification-date="Fri, 06 Jun 2014 02:07:17 GMT" Content-Transfer-Encoding: base64 U2lnbmVkLW9mZi1ieTogRHUsIER1ZGxleSA8ZHVkbEBjeXByZXNzLmNvbT4KLS0tCmRpZmYgLS1n aXQgYS9kcml2ZXJzL2lucHV0L21vdXNlL2N5YXBhX2dlbjUuYyBiL2RyaXZlcnMvaW5wdXQvbW91 c2UvY3lhcGFfZ2VuNS5jCmluZGV4IGU3MjBlZWQuLjNkYTZhOTEgMTAwNjQ0Ci0tLSBhL2RyaXZl cnMvaW5wdXQvbW91c2UvY3lhcGFfZ2VuNS5jCisrKyBiL2RyaXZlcnMvaW5wdXQvbW91c2UvY3lh cGFfZ2VuNS5jCkBAIC0xNDc5LDYgKzE0NzksNjc5IEBAIHN0YXRpYyBpbnQgY3lhcGFfZ2VuNV9z ZXRfcG93ZXJfbW9kZShzdHJ1Y3QgY3lhcGEgKmN5YXBhLAogCXJldHVybiByZXQ7CiB9CiAKK3N0 YXRpYyBpbnQgY3lhcGFfZ2VuNV9yZXN1bWVfc2Nhbm5pbmcoc3RydWN0IGN5YXBhICpjeWFwYSkK K3sKKwl1OCBjbWRbN10gPSB7IDB4MDQsIDB4MDAsIDB4MDUsIDB4MDAsIDB4MmYsIDB4MDAsIDB4 MDQgfTsKKwl1OCByZ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V90eXBlID09IEdFTjVfUkVUUklFVkVfTVVUVUFMX1BX Q19EQVRBKSB7CisJCWlmICh0bXBfY291bnQgPT0gMCkKKwkJCXJldHVybiAwOworCQkvKiBhbGdv cml0aG0gdG8gZGV0ZWN0IGVsZWN0cm9kZXNfcnggdmFsdWUuICovCisJCXRtcF9hdmUgPSB0bXBf c3VtIC8gdG1wX2NvdW50OworCQl0bXBfY291bnQgPSB0bXBfYXZlICogMTUgLyAxMDA7CisJCWlm IChhYnModG1wX2F2ZSAtICppZGFjX2F2ZSkgPiB0bXBfY291bnQgfHwKKwkJCShhYnModG1wX2F2 ZSAtICppZGFjX21pbikgPiAodG1wX2NvdW50ICogMikgJiYKKwkJCQkqaWRhY19taW4gPCB0bXBf bWluKSB8fAorCQkJKGFicygqaWRhY19tYXggLSB0bXBfYXZlKSA+ICh0bXBfY291bnQgKiAyKSAm JgorCQkJCSppZGFjX21heCA+IHRtcF9tYXgpKSB7CisJCQkvKiBvdmVyY291bnQgdGhlIG11dHVh bCBnbG9iYWwgaWRhYyB2YWx1ZXMuICovCisJCQljeWFwYS0+ZWxlY3Ryb2Rlc19yeCA9IHRtcF9t YXhfZWxlbWVudHM7CisJCQkqaWRhY19taW4gPSB0bXBfbWluOworCQkJKmlkYWNfbWF4ID0gdG1w X21heDsKKwkJCSppZGFjX2F2ZSA9IHRtcF9hdmU7CisJCX0gZWxzZQorCQkJY3lhcGEtPmVsZWN0 cm9kZXNfcnggPSBlbGVjdHJvZGVzX3J4OworCX0KKworCXJldHVybiAwOworfQorCitzdGF0aWMg aW50IGN5YXBhX2dlbjVfcmVhZF9tdXR1YWxfaWRhY19kYXRhKHN0cnVjdCBjeWFwYSAqY3lhcGEs CisJaW50ICpnaWRhY19tdXR1YWxfbWF4LCBpbnQgKmdpZGFjX211dHVhbF9taW4sIGludCAqZ2lk YWNfbXV0dWFsX2F2ZSwKKwlpbnQgKmxpZGFjX211dHVhbF9tYXgsIGludCAqbGlkYWNfbXV0dWFs X21pbiwg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BfZGF0YVsyNTZdOyAgLyogbWF4 IGJ5dGVzIGNhbiB0cmFuc2ZlciBvbmUgdGltZS4gKi8KKwlpbnQgcmVzcF9sZW47CisJaW50IHJl YWRfZWxlbWVudHM7CisJaW50IHJlYWRfbGVuOworCXUxNiBvZmZzZXQ7CisJczMyIHZhbHVlOwor CWludCBzdW0sIGNvdW50OworCWludCBkYXRhX3NpemU7CisJczMyICppbnRwOworCisJaWYgKGNt ZF9jb2RlICE9IEdFTjVfQ01EX1JFVFJJRVZFX1BBTkVMX1NDQU4gfHwKKwkJKHJhd19kYXRhX3R5 cGUgPiBHRU41X1BBTkVMX1NDQU5fU0VMRl9ESUZGQ09VTlQpIHx8CisJCSFyYXdfZGF0YV9tYXgg fHwgIXJhd19kYXRhX21pbiB8fCAhcmF3X2RhdGFfYXZlKQorCQlyZXR1cm4gLUVJTlZBTDsKKwor CWludHAgPSAoczMyICopYnVmZmVyOworCSpyYXdfZGF0YV9tYXggPSBJTlRfTUlOOworCSpyYXdf ZGF0YV9taW4gPSBJTlRfTUFYOworCXN1bSA9IGNvdW50ID0gMDsKKwlvZmZzZXQgPSAwOworCXJl YWRfZWxlbWVudHMgPSAoMjU2IC0gMTApIC8gNDsgIC8qIGN1cnJlbnRseSwgbWF4IGVsZW1lbnQg c2l6ZSBpcyA0LiAqLworCXJlYWRfbGVuID0gcmVhZF9lbGVtZW50cyAqIDQ7CisJZG8geworCQlj bWRbMF0gPSAweDA0OworCQljbWRbMV0gPSAweDAwOworCQljbWRbMl0gPSAweDBhOworCQljbWRb M10gPSAweDAwOworCQljbWRbNF0gPSBHRU41X0FQUF9DTURfUkVQT1JUX0lEOworCQljbWRbNV0g PSAweDAwOworCQljbWRbNl0gPSBjbWRfY29kZTsgIC8qIGNvbW1hbmQgY29kZSAqLworCQlwdXRf dW5hbGlnbmVkX2xlMTYob2Zmc2V0LCAmY21kWzddKTsKKwkJcHV0X3VuYWxpZ25lZF9sZTE2KHJl YWRfZWxlbWVudHMsICZjbWR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kJcmF3X2Nh cF9zZWxmX21pbiwgcmF3X2NhcF9zZWxmX21heCwgcmF3X2NhcF9zZWxmX2F2ZSwKKwkJbXV0dWFs X2RpZmZkYXRhX21pbiwgbXV0dWFsX2RpZmZkYXRhX21heCwgbXV0dWFsX2RpZmZkYXRhX2F2ZSwK KwkJc2VsZl9kaWZmZGF0YV9taW4sIHNlbGZfZGlmZmRhdGFfbWF4LCBzZWxmX2RpZmZkYXRhX2F2 ZSwKKwkJbXV0dWFsX2Jhc2VsaW5lX21pbiwgbXV0dWFsX2Jhc2VsaW5lX21heCwgbXV0dWFsX2Jh c2VsaW5lX2F2ZSwKKwkJc2VsZl9iYXNlbGluZV9taW4sIHNlbGZfYmFzZWxpbmVfbWF4LCBzZWxm X2Jhc2VsaW5lX2F2ZSk7CisJcmV0dXJuIHJldCArIGVycjsKK30KKwogc3RhdGljIGJvb2wgY3lh cGFfZ2VuNV9zb3J0X3N5c3RlbV9pbmZvX2RhdGEoc3RydWN0IGN5YXBhICpjeWFwYSwKIAkJdTgg KmJ1ZiwgaW50IGxlbikKIHsKQEAgLTE4NjcsOCArMjU0MCw4IEBAIGNvbnN0IHN0cnVjdCBjeWFw YV9kZXZfb3BzIGN5YXBhX2dlbjVfb3BzID0gewogCU5VTEwsCiAJTlVMTCwKIAotCU5VTEwsCi0J TlVMTCwKKwljeWFwYV9nZW41X3Nob3dfYmFzZWxpbmUsCisJY3lhcGFfZ2VuNV9kb19jYWxpYnJh dGUsCiAKIAlOVUxMLAogCU5VTEwsCg== --_016_77BC725C9062764F874D79F51E1F1A8F4C902B3BS04MBX0101s04lo_ Content-Type: application/octet-stream; name="cyapa_13_add_gen5_raed_fw_read_raw_data.patch" Content-Description: cyapa_13_add_gen5_raed_fw_read_raw_data.patch Content-Disposition: attachment; filename="cyapa_13_add_gen5_raed_fw_read_raw_data.patch"; size=9084; creation-date="Fri, 06 Jun 2014 08:03:16 GMT"; modification-date="Fri, 06 Jun 2014 02:07:09 GMT" Content-Transfer-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yA9IHsKIAljeWFwYV9nZW41X3Nob3dfYmFzZWxpbmUsCiAJY3lhcGFfZ2VuNV9kb19jYWxp YnJhdGUsCiAKLQlOVUxMLAotCU5VTEwsCisJY3lhcGFfZ2VuNV9yZWFkX2Z3LAorCWN5YXBhX2dl bjVfcmVhZF9yYXdfZGF0YSwKIAogCWN5YXBhX2dlbjVfZ2V0X3ByaXZhdGVfc2l6ZSwKIAljeWFw YV9nZW41X3ByaXZhdGVfaW5pdCwK --_016_77BC725C9062764F874D79F51E1F1A8F4C902B3BS04MBX0101s04lo_ Content-Type: application/octet-stream; name="cyapa_14_add_LID.patch" Content-Description: cyapa_14_add_LID.patch Content-Disposition: attachment; filename="cyapa_14_add_LID.patch"; size=5649; creation-date="Fri, 06 Jun 2014 08:03:16 GMT"; modification-date="Fri, 06 Jun 2014 02:01:11 GMT" Content-Transfer-Encoding: base64 U2lnbmVkLW9mZi1ieTogRHUsIER1ZGxleSA8ZHVkbEBjeXByZXNzLmNvbT4KLS0tCmRpZmYgLS1n aXQgYS9kcml2ZXJzL2lucHV0L21vdXNlL2N5YXBhLmMgYi9kcml2ZXJzL2lucHV0L21vdXNlL2N5 YXBhLmMKaW5kZXggOGQzNzAzMi4uNzYwYTQzYiAxMDA2NDQKLS0tIGEvZHJpdmVycy9pbnB1dC9t b3VzZS9jeWFwYS5jCisrKyBiL2RyaXZlcnMvaW5wdXQvbW91c2UvY3lhcGEuYwpAQCAtMTE2Niw2 ICsxMTY2LDE0MCBAQCBzdGF0aWMgY29uc3Qgc3RydWN0IGF0dHJpYnV0ZV9ncm91cCBjeWFwYV9z eXNmc19ncm91cCA9IHsKIAkuYXR0cnMgPSBjeWFwYV9zeXNmc19lbnRyaWVzLAogfTsKIAorCisv KgorICogV2UgcmVseSBvbiBFVl9TVyBhbmQgU1dfTElEIGJpdHMgdG8gaWRlbnRpZnkgYSBMSUQg ZGV2aWNlLCBhbmQgaG9vaworICogdXAgb3VyIGZpbHRlciB0byBsaXN0ZW4gZm9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NyBAQCBzdHJ1Y3QgY3lhcGEgewogCXU4IHJ1 bnRpbWVfc3VzcGVuZF9wb3dlcl9tb2RlOwogCXUxNiBydW50aW1lX3N1c3BlbmRfc2xlZXBfdGlt ZTsKICNlbmRpZiAvKiBDT05GSUdfUE1fUlVOVElNRSAqLworCWJvb2wgc3VzcGVuZGVkOwogCiAJ LyogcmVhZCBmcm9tIHF1ZXJ5IGRhdGEgcmVnaW9uLiAqLwogCWNoYXIgcHJvZHVjdF9pZFsxNl07 CkBAIC0yNTksNiArMjYwLDkgQEAgc3RydWN0IGN5YXBhIHsKIAlzaXplX3QgdHBfcmF3X2RhdGFf c2l6ZTsKIAogCWNvbnN0IHN0cnVjdCBjeWFwYV9kZXZfb3BzICpvcHM7CisKKwlib29sIGxpZF9o YW5kbGVyX3JlZ2lzdGVyZWQ7CisJc3RydWN0IGlucHV0X2hhbmRsZXIgbGlkX2hhbmRsZXI7CiB9 OwogCiAK --_016_77BC725C9062764F874D79F51E1F1A8F4C902B3BS04MBX0101s04lo_-- -- 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/