Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751902AbaLQKzL (ORCPT ); Wed, 17 Dec 2014 05:55:11 -0500 Received: from mail-bn1on0139.outbound.protection.outlook.com ([157.56.110.139]:21280 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751257AbaLQKzI (ORCPT ); Wed, 17 Dec 2014 05:55:08 -0500 From: Dudley Du To: Jeremiah Mahler , Dudley Du CC: "dmitry.torokhov@gmail.com" , "rydberg@euromail.se" , "bleung@google.com" , "linux-input@vger.kernel.org" , "linux-kernel@vger.kernel.org" , David Solda Subject: RE: [PATCH v16 01/12] input: cyapa: re-design driver to support Thread-Topic: [PATCH v16 01/12] input: cyapa: re-design driver to support Thread-Index: AdAZ3moPZDW6X3ZuSs2FUqtqBLB2qAAA9cUAAAE5/dA= Date: Wed, 17 Dec 2014 10:55:00 +0000 Message-ID: References: <20141217101434.GA2155@newt.localdomain> In-Reply-To: <20141217101434.GA2155@newt.localdomain> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [157.95.211.187] authentication-results: gmail.com; dkim=none (message not signed) header.d=none; x-microsoft-antispam: BCL:0;PCL:0;RULEID:;SRVR:CY1PR0601MB1081; x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:;SRVR:CY1PR0601MB1081; x-forefront-prvs: 042857DBB5 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(24454002)(199003)(51704005)(51914003)(51164003)(189002)(164054003)(13464003)(54356999)(74316001)(99936001)(68736005)(107046002)(21056001)(66066001)(87936001)(2656002)(33656002)(19580405001)(20776003)(99396003)(64706001)(2900100001)(105586002)(2950100001)(54606007)(86362001)(40100003)(101416001)(19580395003)(62966003)(99286002)(102836002)(15975445007)(92566001)(77156002)(31966008)(76176999)(97736003)(4396001)(122556002)(106356001)(50986999)(54206007)(46102003)(76576001)(120916001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0601MB1081;H:BN1PR06MB070.namprd06.prod.outlook.com;FPR:;SPF:None;MLV:sfv;PTR:InfoNoRecords;A:1;MX:1;LANG:; Content-Type: multipart/mixed; boundary="_013_BN1PR06MB0702F0782A3A6B975EDA156D16D0BN1PR06MB070namprd_" MIME-Version: 1.0 X-OriginatorOrg: cypress.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --_013_BN1PR06MB0702F0782A3A6B975EDA156D16D0BN1PR06MB070namprd_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Jeremiah, Thanks for the feedback. Yes, the our net proxy may broken this. It needs sometime to fix this. Attched are the patch files, could you try to apply these patch files first= ly. Thanks, Dudley > -----Original Message----- > From: linux-input-owner@vger.kernel.org > [mailto:linux-input-owner@vger.kernel.org] On Behalf Of Jeremiah Mahler > Sent: 2014?12?17? 18:15 > To: Dudley Du > Cc: dmitry.torokhov@gmail.com; rydberg@euromail.se; bleung@google.com; > linux-input@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: [PATCH v16 01/12] input: cyapa: re-design driver to support > > Dudley, > > On Wed, Dec 17, 2014 at 05:55:37PM +0800, Dudley Du wrote: > > In order to support multiple different chipsets and communication proto= cols > > trackpad devices in one cyapa driver, the new cyapa driver is re-design= ed > > with one cyapa driver core and multiple device specific functions compo= nent. > > The cyapa driver core is contained in this patch, it supplies basic fun= ctions > [...] > > + > > +.set_power_mode =3D cyapa_gen3_set_power_mode, > > +}; > > -- > > 1.9.1 > > > > Unfortunately this patch and the others do not apply. > > Patch failed at 0001 input: cyapa: re-design driver to support > The copy of the patch that failed is found in: > /home/jeri/linux-next/.git/rebase-apply/patch > When you have resolved this problem, run "git am --continue". > If you prefer to skip this patch, run "git am --skip" instead. > To restore the original branch and stop patching, run "git am > --abort". > > It looks like your mailer may have done some line wrapping that > messed up the patches. > > ... > - { CYAPA_SMBUS_BLK_HEAD, 16 }, > -}; > +static int cyapa_reinitialize(struct cyapa *cyapa); > > -static ssize_t cyapa_i2c_reg_read_block(struct cyapa *cyapa, u8 reg, > size_t > len, > +/* Returns 0 on success, else negative errno on failure. */ > +static ssize_t cyapa_i2c_read(struct cyapa *cyapa, u8 reg, size_t len, > u8 *values) > { > - > ... > > linux/Documentation/email-clients.txt has good information about these > problems. > > -- > - Jeremiah Mahler > -- > To unsubscribe from this list: send the line "unsubscribe linux-input" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html This message and any attachments may contain Cypress (or its subsidiaries) = confidential information. If it has been received in error, please advise t= he sender and immediately delete this message. --_013_BN1PR06MB0702F0782A3A6B975EDA156D16D0BN1PR06MB070namprd_ Content-Type: application/octet-stream; name="0001-input-cyapa-re-design-driver-to-support-multi-trackp.patch" Content-Description: 0001-input-cyapa-re-design-driver-to-support-multi-trackp.patch Content-Disposition: attachment; filename="0001-input-cyapa-re-design-driver-to-support-multi-trackp.patch"; size=74022; creation-date="Wed, 17 Dec 2014 08:57:47 GMT"; modification-date="Wed, 17 Dec 2014 09:13:24 GMT" Content-Transfer-Encoding: base64 RnJvbSBhYzJjYWM2NTBkZDg0OTFkNWU2ZmZjYWRmNGFiNGFhNTg1NTk3MzlhIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxleS5kdWxpeGluQGdtYWlsLmNvbT4K RGF0ZTogV2VkLCAxNyBEZWMgMjAxNCAxNjo1NjoyNyArMDgwMApTdWJqZWN0OiBbUEFUQ0ggdjE2 IDAxLzEyXSBpbnB1dDogY3lhcGE6IHJlLWRlc2lnbiBkcml2ZXIgdG8gc3VwcG9ydAogbXVsdGkt dHJhY2twYWQgaW4gb25lIGRyaXZlcgpUbzogZG1pdHJ5LnRvcm9raG92QGdtYWlsLmNvbSwKICAg IGptbWFobGVyQGdtYWls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TikpOworCWlucHV0X3N5bmMoaW5wdXQp OworCisJcmV0dXJuIDA7Cit9CisKK2NvbnN0IHN0cnVjdCBjeWFwYV9kZXZfb3BzIGN5YXBhX2dl bjNfb3BzID0geworCS5zdGF0ZV9wYXJzZSA9IGN5YXBhX2dlbjNfc3RhdGVfcGFyc2UsCisJLm9w ZXJhdGlvbmFsX2NoZWNrID0gY3lhcGFfZ2VuM19kb19vcGVyYXRpb25hbF9jaGVjaywKKworCS5p cnFfaGFuZGxlciA9IGN5YXBhX2dlbjNfaXJxX2hhbmRsZXIsCisJLmlycV9jbWRfaGFuZGxlciA9 IGN5YXBhX2dlbjNfaXJxX2NtZF9oYW5kbGVyLAorCisJLnNldF9wb3dlcl9tb2RlID0gY3lhcGFf Z2VuM19zZXRfcG93ZXJfbW9kZSwKK307Ci0tIAoxLjkuMQoK --_013_BN1PR06MB0702F0782A3A6B975EDA156D16D0BN1PR06MB070namprd_ Content-Type: application/octet-stream; name="0002-input-cyapa-add-gen5-trackpad-device-basic-functions.patch" Content-Description: 0002-input-cyapa-add-gen5-trackpad-device-basic-functions.patch Content-Disposition: attachment; filename="0002-input-cyapa-add-gen5-trackpad-device-basic-functions.patch"; size=54441; creation-date="Wed, 17 Dec 2014 08:57:47 GMT"; modification-date="Wed, 17 Dec 2014 09:13:01 GMT" Content-Transfer-Encoding: base64 RnJvbSBjOWI0YjRhMzJiZTA3NzQ4NGIxNDNiZWRkZTMxMzM2MWVkNDk5OGEwIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxleS5kdWxpeGluQGdtYWlsLmNvbT4K RGF0ZTogV2VkLCAxNyBEZWMgMjAxNCAxNjo1NjoyOCArMDgwMApTdWJqZWN0OiBbUEFUQ0ggdjE2 IDAyLzEyXSBpbnB1dDogY3lhcGE6IGFkZCBnZW41IHRyYWNrcGFkIGRldmljZSBiYXNpYyBmdW5j dGlvbnMKIHN1cHBvcnQKVG86IGRtaXR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TURfU0VUX1BBUkFNRVRFUgkJICAgICAweDA2CisjZGVmaW5lIEdFTjVfUEFS QU1FVEVSX0FDVF9JTlRFUlZMX0lEICAgICAgICAweDRkCisjZGVmaW5lIEdFTjVfUEFSQU1FVEVS X0FDVF9JTlRFUlZMX1NJWkUgICAgICAxCisjZGVmaW5lIEdFTjVfUEFSQU1FVEVSX0FDVF9MRlRf SU5URVJWTF9JRCAgICAweDRmCisjZGVmaW5lIEdFTjVfUEFSQU1FVEVSX0FDVF9MRlRfSU5URVJW TF9TSVpFICAyCisjZGVmaW5lIEdFTjVfUEFSQU1FVEVSX0xQX0lOVFJWTF9JRCAgICAgICAgICAw eDRjCisjZGVmaW5lIEdFTjVfUEFSQU1FVEVSX0xQX0lOVFJWTF9TSVpFICAgICAgICAyCisKKyNk ZWZpbmUgR0VONV9QQVJBTUVURVJfRElTQUJMRV9QSVBfUkVQT1JUICAgIDB4MDgKKworI2RlZmlu ZSBHRU41X1BPV0VSX1NUQVRFX0FDVElWRSAgICAgICAgICAgICAgMHgwMQorI2RlZmluZSBHRU41 X1BPV0VSX1NUQVRFX0xPT0tfRk9SX1RPVUNIICAgICAgMHgwMgorI2RlZmluZSBHRU41X1BPV0VS X1NUQVRFX1JFQURZICAgICAgICAgICAgICAgMHgwMworI2RlZmluZSBHRU41X1BPV0VSX1NUQVRF X0lETEUgICAgICAgICAgICAgICAgMHgwNAorI2RlZmluZSBHRU41X1BPV0VSX1NUQVRFX0JUTl9P TkxZICAgICAgICAgICAgMHgwNQorI2RlZmluZSBHRU41X1BPV0VSX1NUQVRFX09GRiAgICAgICAg ICAgICAgICAgMHgwNgorCisjZGVmaW5lIEdFTjVfREVFUF9TTEVFUF9TVEFURV9NQVNLICAweDAz CisjZGVmaW5lIEdFTjVfREVFUF9TTEVFUF9TVEFURV9PTiAgICAweDAwCisjZGVmaW5lIEdFTjVf REVFUF9TTEVFUF9TVEFURV9PRkYgICAweDAxCisKKyNkZWZpbmUgR0VONV9ERUVQX1NMRUVQX09Q Q09ERSAgICAgIDB4MDgKKyNkZWZpbmUgR0VONV9ERUVQX1NMRUVQX09QQ09ERV9NQVNLIDB4MGYK KworI2RlZmluZSBHRU41X1BPV0VSX1JFQURZX01BWF9JTlRSVkxfVElNRSAgNTAgICAvKiBVbml0 OiBtcyAqLworI2RlZmluZSBHRU41X1BPV0VSX0lETEVfTUFYX0lOVFJWTF9USU1FICAgMjUwICAv KiBVbml0OiBtcyAqLworCisjZGVmaW5lIEdFTjVfQ01EX1JFUE9SVF9JRF9PRkZTRVQgICAgICAg NAorCisjZGVmaW5lIEdFTjVfUkVTUF9SRVBPUlRfSURfT0ZGU0VUICAgICAgMgorI2RlZmluZSBH RU41X1JFU1BfUlNWRF9PRkZTRVQgICAgICAgICAgIDMKKyNkZWZpbmUgICAgIEdFTjVfUkVTUF9S U1ZEX0tFWSAgICAgICAgICAweDAwCisjZGVmaW5lIEdFTjVfUkVTUF9CTF9TT1BfT0ZGU0VUICAg ICAgICAgNAorI2RlZmluZSAgICAgR0VONV9TT1BfS0VZICAgICAgICAgICAgICAgIDB4MDEgIC8q IFN0YXJ0IG9mIFBhY2tldCAqLworI2RlZmluZSAgICAgR0VONV9FT1BfS0VZICAgICAgICAgICAg ICAgIDB4MTcgIC8qIEVuZCBvZiBQYWNrZXQgKi8KKyNkZWZpbmUgR0VONV9SRVNQX0FQUF9DTURf T0ZGU0VUICAgICAgICA0CisjZGVmaW5lICAgICBHRVRfR0VONV9DTURfQ09ERShyZWcpICAgICAg KChyZWcpICYgMHg3ZikKKworI2RlZmluZSBWQUxJRF9DTURfUkVTUF9IRUFERVIocmVzcCwgY21k KQkJCQkgICAgXAorCSgoKHJlc3ApW0dFTjVfUkVTUF9SRVBPUlRfSURfT0ZGU0VUXSA9PSBHRU41 X0FQUF9SRVNQX1JFUE9SVF9JRCkgJiYgXAorCSgocmVzcClbR0VONV9SRVNQX1JTVkRfT0ZGU0VU XSA9PSBHRU41X1JFU1BfUlNWRF9LRVkpICYmCSAgIC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XJlcG9ydF9sZW4gPiBHRU41X0JUTl9SRVBPUlRfTUFYX1NJWkUpKSB7CisJCS8qIEludmFsaWQg cmVwb3J0IGRhdGEgbGVuZ3RoIG9mIGJ1dHRvbiBwYWNrZXQuICovCisJCWRldl9lcnIoZGV2LCAi aW52YWxpZCBidXR0b24gcGFja2V0IGxlbmd0aD0lZFxuIiwgcmVwb3J0X2xlbik7CisJCXJldHVy biAwOworCX0KKworCWlmIChyZXBvcnRfaWQgPT0gR0VONV9UT1VDSF9SRVBPUlRfSUQpCisJCWN5 YXBhX2dlbjVfcmVwb3J0X3RvdWNoZXMoY3lhcGEsICZyZXBvcnRfZGF0YSk7CisJZWxzZQorCQlj eWFwYV9nZW41X3JlcG9ydF9idXR0b25zKGN5YXBhLCAmcmVwb3J0X2RhdGEpOworCisJcmV0dXJu IDA7Cit9CisKK2NvbnN0IHN0cnVjdCBjeWFwYV9kZXZfb3BzIGN5YXBhX2dlbjVfb3BzID0gewor CS5pbml0aWFsaXplID0gY3lhcGFfZ2VuNV9pbml0aWFsaXplLAorCisJLnN0YXRlX3BhcnNlID0g Y3lhcGFfZ2VuNV9zdGF0ZV9wYXJzZSwKKwkub3BlcmF0aW9uYWxfY2hlY2sgPSBjeWFwYV9nZW41 X2RvX29wZXJhdGlvbmFsX2NoZWNrLAorCisJLmlycV9oYW5kbGVyID0gY3lhcGFfZ2VuNV9pcnFf aGFuZGxlciwKKwkuaXJxX2NtZF9oYW5kbGVyID0gY3lhcGFfZ2VuNV9pcnFfY21kX2hhbmRsZXIs CisJLnNvcnRfZW1wdHlfb3V0cHV0X2RhdGEgPSBjeWFwYV9lbXB0eV9waXBfb3V0cHV0X2RhdGEs CisJLnNldF9wb3dlcl9tb2RlID0gY3lhcGFfZ2VuNV9zZXRfcG93ZXJfbW9kZSwKK307Ci0tIAox LjkuMQoK --_013_BN1PR06MB0702F0782A3A6B975EDA156D16D0BN1PR06MB070namprd_ Content-Type: application/octet-stream; name="0003-input-cyapa-add-power-management-interfaces-support-.patch" Content-Description: 0003-input-cyapa-add-power-management-interfaces-support-.patch Content-Disposition: attachment; filename="0003-input-cyapa-add-power-management-interfaces-support-.patch"; size=4407; creation-date="Wed, 17 Dec 2014 08:57:47 GMT"; modification-date="Wed, 17 Dec 2014 09:12:58 GMT" Content-Transfer-Encoding: base64 RnJvbSA4ZjZhNDIyM2M5MzAwNzQxMDQ5MzQ3ODc4MGU0MmE2ZmQ1YWRjYWZkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxleS5kdWxpeGluQGdtYWlsLmNvbT4K RGF0ZTogV2VkLCAxNyBEZWMgMjAxNCAxNjo1NjoyOCArMDgwMApTdWJqZWN0OiBbUEFUQ0ggdjE2 IDAzLzEyXSBpbnB1dDogY3lhcGE6IGFkZCBwb3dlciBtYW5hZ2VtZW50IGludGVyZmFjZXMgc3Vw cG9ydAogZm9yIHRoZSBkZXZpY2UKVG86IGRtaXRyeS50b3Jva2hvdkBnbWFpbC5jb20sCiAgICBq bW1haGxlckBnbWFpbC5jb20sCiAgICByeWRiZXJnQGV1cm9tYWlsLnNlCkNjOiBibGV1bmdAZ29v Z2xlLmNvbSwKICAgIGxpbnV4LWlucHV0QHZnZXIua2VybmVsLm9yZywKICAgIGxpbnV4LWtlcm5l bEB2Z2VyLmtlcm5lbC5vcmcKCkFkZCBzdXNwZW5kX3NjYW5yYXRlX21zIHBvd2VyIG1hbmFnZW1l bnQgaW50ZXJmYWNlcyBpbiBkZXZpY2Uncwpwb3dlciBncm91cCwgc28gdXNlcnMgb3IgYXBwbGlj YXRpb25zIGNhbiBjb250cm9sIHRoZSBwb3dlciBtYW5hZ2VtZW50CnN0cmF0ZWd5IG9mIHRyYWNr cGFkIGRldmljZSBhcyB0aGVpciByZXF1aXJlbWVudHMuClRFU1Q9dGVzdCBvbiBDaHJvbWVib29r cy4KClNpZ25lZC1vZmYtYnk6IER1ZGxleSBEdSA8ZHVkbGV5LmR1bGl4aW5AZ21haWwuY29tPgot LS0KIGRyaXZlcnMvaW5wdXQvbW91c2UvY3lhcGEuYyB8IDExMSArKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKysrKysrKysrKwogMSBmaWxlIGNoYW5nZWQsIDExMSBpbnNlcnRpb25z KCspCgpkaWZmIC0tZ2l0IGEvZHJpdmVycy9pbnB1dC9tb3VzZS9jeWFwYS5jIGIvZHJpdmVycy9p bnB1dC9tb3VzZS9jeWFwYS5jCmluZGV4IGQ0NTYwYTMuLjczZjY4MTcgMTAwNjQ0Ci0tLSBhL2Ry aXZlcnMvaW5wdXQvbW91c2UvY3lhcGEuYworKysgYi9kcml2ZXJzL2lucHV0L21vdXNlL2N5YXBh LmMKQEAgLTU3NSw2ICs1NzUsOTYgQEAgb3V0OgogCXJldHVybiBJUlFfSEFORExFRDsKIH0KIAor LyoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKgorICogc3lzZnMgaW50ZXJmYWNlCisgKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyovCisjaWZkZWYgQ09ORklH X1BNX1NMRUVQCitzdGF0aWMgc3NpemVfdCBjeWFwYV9zaG93X3N1c3BlbmRfc2NhbnJhdGUoc3Ry dWN0IGRldmljZSAqZGV2LAorCQkJCQkgICBzdHJ1Y3QgZGV2aWNlX2F0dHJpYnV0ZSAqYXR0ciwK KwkJCQkJICAgY2hhciAqYnVmKQoreworCXN0cnVjdCBjeWFwYSAqY3lhcGEgPSBkZXZfZ2V0X2Ry dmRhdGEoZGV2KTsKKwl1OCBwd3JfY21kID0gY3lhcGEtPnN1c3BlbmRfcG93ZXJfbW9kZTsKKwl1 MTYgc2xlZXBfdGltZTsKKwlpbnQgbGVuOworCWludCBlcnJvcjsKKworCWVycm9yID0gbXV0ZXhf bG9ja19pbnRlcnJ1cHRpYmxlKCZjeWFwYS0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Gdyb3VwOiAlZFxuIiwKKwkJCQllcnJvcik7CisJCQlyZXR1cm4gZXJy b3I7CisJCX0KKworCQllcnJvciA9IGRldm1fYWRkX2FjdGlvbihkZXYsCisJCQkJY3lhcGFfcmVt b3ZlX3Bvd2VyX3dha2V1cF9ncm91cCwgY3lhcGEpOworCQlpZiAoZXJyb3IpIHsKKwkJCWN5YXBh X3JlbW92ZV9wb3dlcl93YWtldXBfZ3JvdXAoY3lhcGEpOworCQkJZGV2X2VycihkZXYsICJmYWls ZWQgdG8gYWRkIHBvd2VyIGNsZWFudXAgYWN0aW9uOiAlZFxuIiwKKwkJCQllcnJvcik7CisJCQly ZXR1cm4gZXJyb3I7CisJCX0KKwl9CisjZW5kaWYgLyogQ09ORklHX1BNX1NMRUVQICovCisKIAll cnJvciA9IGRldm1fcmVxdWVzdF90aHJlYWRlZF9pcnEoZGV2LCBjbGllbnQtPmlycSwKIAkJCQkJ ICBOVUxMLCBjeWFwYV9pcnEsCiAJCQkJCSAgSVJRRl9UUklHR0VSX0ZBTExJTkcgfCBJUlFGX09O RVNIT1QsCi0tIAoxLjkuMQoK --_013_BN1PR06MB0702F0782A3A6B975EDA156D16D0BN1PR06MB070namprd_ Content-Type: application/octet-stream; name="0004-input-cyapa-add-runtime-power-management-interfaces-.patch" Content-Description: 0004-input-cyapa-add-runtime-power-management-interfaces-.patch Content-Disposition: attachment; filename="0004-input-cyapa-add-runtime-power-management-interfaces-.patch"; size=8412; creation-date="Wed, 17 Dec 2014 08:57:48 GMT"; modification-date="Wed, 17 Dec 2014 09:12:54 GMT" Content-Transfer-Encoding: base64 RnJvbSBjODc1N2E5MTEzNDgwYzA0YmRkNTMxZjg4Y2U5OTA5NmFkZDFkMzQzIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxleS5kdWxpeGluQGdtYWlsLmNvbT4K RGF0ZTogV2VkLCAxNyBEZWMgMjAxNCAxNjo1NjoyOSArMDgwMAp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1c3BlbmRfcG93ZXJfbW9kZTsKKwl1MTYgcnVudGltZV9zdXNwZW5kX3NsZWVwX3Rp bWU7CisjZW5kaWYgLyogQ09ORklHX1BNX1JVTlRJTUUgKi8KIAl1OCBkZXZfcHdyX21vZGU7CiAJ dTE2IGRldl9zbGVlcF90aW1lOwogCi0tIAoxLjkuMQoK --_013_BN1PR06MB0702F0782A3A6B975EDA156D16D0BN1PR06MB070namprd_ Content-Type: application/octet-stream; name="0005-input-cyapa-add-sysfs-interfaces-support-in-the-cyap.patch" Content-Description: 0005-input-cyapa-add-sysfs-interfaces-support-in-the-cyap.patch Content-Disposition: attachment; filename="0005-input-cyapa-add-sysfs-interfaces-support-in-the-cyap.patch"; size=10538; creation-date="Wed, 17 Dec 2014 08:57:48 GMT"; modification-date="Wed, 17 Dec 2014 09:12:50 GMT" Content-Transfer-Encoding: base64 RnJvbSBhZGM0ZGMzODZkNzQ2NmU4YzIzNjM4ZGMzZTg0YzY3ZTMwZDBjNTU4IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxleS5kdWxpeGluQGdtYWlsLmNvbT4K RGF0ZTogV2VkLCAxNyBEZWMgMjAxNCAxNjo1NjozMCArMDgwMApTdWJqZWN0OiBbUEFUQ0ggdjE2 IDA1LzEyXSBpbnB1dDogY3lhcGE6IGFkZCBzeXNmcyBpbnRlcmZhY2VzIHN1cHBvcnQgaW4gdGhl IGN5YXBhCiBkcml2ZXIKVG86IGRtaXRyeS50b3Jva2hvdkBnbWFpbC5jb20sCiAgICBqbW1haGxl ckBnbWFpbC5jb20sCiAgICByeWRiZXJnQGV1cm9tYWlsLnNlCkNjOiBibGV1bmdAZ29vZ2xlLmNv bSwKICAgIGxpbnV4LWlucHV0QHZnZXIua2VybmVsLm9yZywKICAgIGxpbnV4LWtlcm5lbEB2Z2Vy Lmtlcm5lbC5vcmcKCkFkZCBkZXZpY2UncyBiYXNpYyBjb250cm9sIGFuZCBm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eW5j X2xvY2spOworCXJldHVybiBlcnJvcjsKK30KKworc3RhdGljIHNzaXplX3QgY3lhcGFfc2hvd19w cm9kdWN0X2lkKHN0cnVjdCBkZXZpY2UgKmRldiwKKwkJCQkgICAgIHN0cnVjdCBkZXZpY2VfYXR0 cmlidXRlICphdHRyLCBjaGFyICpidWYpCit7CisJc3RydWN0IGN5YXBhICpjeWFwYSA9IGRldl9n ZXRfZHJ2ZGF0YShkZXYpOworCWludCBzaXplOworCWludCBlcnJvcjsKKworCWVycm9yID0gbXV0 ZXhfbG9ja19pbnRlcnJ1cHRpYmxlKCZjeWFwYS0+c3RhdGVfc3luY19sb2NrKTsKKwlpZiAoZXJy b3IpCisJCXJldHVybiBlcnJvcjsKKwlzaXplID0gc2NucHJpbnRmKGJ1ZiwgUEFHRV9TSVpFLCAi JXNcbiIsIGN5YXBhLT5wcm9kdWN0X2lkKTsKKwltdXRleF91bmxvY2soJmN5YXBhLT5zdGF0ZV9z eW5jX2xvY2spOworCXJldHVybiBzaXplOworfQorCitzdGF0aWMgaW50IGN5YXBhX2Zpcm13YXJl KHN0cnVjdCBjeWFwYSAqY3lhcGEsIGNvbnN0IGNoYXIgKmZ3X25hbWUpCit7CisJc3RydWN0IGRl dmljZSAqZGV2ID0gJmN5YXBhLT5jbGllbnQtPmRldjsKKwljb25zdCBzdHJ1Y3QgZmlybXdhcmUg KmZ3OworCWludCBlcnJvcjsKKworCWVycm9yID0gcmVxdWVzdF9maXJtd2FyZSgmZncsIGZ3X25h bWUsIGRldik7CisJaWYgKGVycm9yKSB7CisJCWRldl9lcnIoZGV2LCAiQ291bGQgbm90IGxvYWQg ZmlybXdhcmUgZnJvbSAlczogJWRcbiIsCisJCQlmd19uYW1lLCBlcnJvcik7CisJCXJldHVybiBl cnJvcjsKKwl9CisKKwlpZiAoY3lhcGEtPm9wcy0+Y2hlY2tfZncpIHsKKwkJZXJyb3IgPSBjeWFw YS0+b3BzLT5jaGVja19mdyhjeWFwYSwgZncpOworCQlpZ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uIiwgZXJyb3IpOworCQlyZXR1cm4g ZXJyb3I7CisJfQorCisJZXJyb3IgPSBkZXZtX2FkZF9hY3Rpb24oZGV2LCBjeWFwYV9yZW1vdmVf c3lzZnNfZ3JvdXAsIGN5YXBhKTsKKwlpZiAoZXJyb3IpIHsKKwkJY3lhcGFfcmVtb3ZlX3N5c2Zz X2dyb3VwKGN5YXBhKTsKKwkJZGV2X2VycihkZXYsICJmYWlsZWQgdG8gYWRkIHN5c2ZzIGNsZWFu dXAgYWN0aW9uOiAlZFxuIiwgZXJyb3IpOworCQlyZXR1cm4gZXJyb3I7CisJfQorCiAjaWZkZWYg Q09ORklHX1BNX1NMRUVQCiAJaWYgKGRldmljZV9jYW5fd2FrZXVwKGRldikpIHsKIAkJZXJyb3Ig PSBzeXNmc19tZXJnZV9ncm91cCgmY2xpZW50LT5kZXYua29iaiwKLS0gCjEuOS4xCgo= --_013_BN1PR06MB0702F0782A3A6B975EDA156D16D0BN1PR06MB070namprd_ Content-Type: application/octet-stream; name="0006-input-cyapa-add-gen3-trackpad-device-firmware-update.patch" Content-Description: 0006-input-cyapa-add-gen3-trackpad-device-firmware-update.patch Content-Disposition: attachment; filename="0006-input-cyapa-add-gen3-trackpad-device-firmware-update.patch"; size=10353; creation-date="Wed, 17 Dec 2014 08:57:48 GMT"; modification-date="Wed, 17 Dec 2014 09:12:48 GMT" Content-Transfer-Encoding: base64 RnJvbSBhMmExZWY1NjhiOTlkZmJhYjM3MGY1MTcyZTlhNWI5Mjc3MWM0MjdlIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxleS5kdWxpeGluQGdtYWlsLmNvbT4K RGF0ZTogV2VkLCAxNyBEZWMgMjAxNCAxNjo1NjozMCArMDgwMApTdWJqZWN0OiBbUEFUQ0ggdjE2 IDA2LzEyXSBpbnB1dDogY3lhcGE6IGFkZCBnZW4zIHRyYWNrcGFkIGRldmljZSBmaXJtd2FyZSB1 cGRh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X3B3cl9jbWQKICAqCkBA IC03OTEsNiArMTA3MywxMiBAQCBzdGF0aWMgaW50IGN5YXBhX2dlbjNfaXJxX2hhbmRsZXIoc3Ry dWN0IGN5YXBhICpjeWFwYSkKIH0KIAogY29uc3Qgc3RydWN0IGN5YXBhX2Rldl9vcHMgY3lhcGFf Z2VuM19vcHMgPSB7CisJLmNoZWNrX2Z3ID0gY3lhcGFfZ2VuM19jaGVja19mdywKKwkuYmxfZW50 ZXIgPSBjeWFwYV9nZW4zX2JsX2VudGVyLAorCS5ibF9hY3RpdmF0ZSA9IGN5YXBhX2dlbjNfYmxf YWN0aXZhdGUsCisJLnVwZGF0ZV9mdyA9IGN5YXBhX2dlbjNfZG9fZndfdXBkYXRlLAorCS5ibF9k ZWFjdGl2YXRlID0gY3lhcGFfZ2VuM19ibF9kZWFjdGl2YXRlLAorCiAJLnN0YXRlX3BhcnNlID0g Y3lhcGFfZ2VuM19zdGF0ZV9wYXJzZSwKIAkub3BlcmF0aW9uYWxfY2hlY2sgPSBjeWFwYV9nZW4z X2RvX29wZXJhdGlvbmFsX2NoZWNrLAogCi0tIAoxLjkuMQoK --_013_BN1PR06MB0702F0782A3A6B975EDA156D16D0BN1PR06MB070namprd_ Content-Type: application/octet-stream; name="0007-input-cyapa-add-gen3-trackpad-device-read-baseline-f.patch" Content-Description: 0007-input-cyapa-add-gen3-trackpad-device-read-baseline-f.patch Content-Disposition: attachment; filename="0007-input-cyapa-add-gen3-trackpad-device-read-baseline-f.patch"; size=3112; creation-date="Wed, 17 Dec 2014 08:57:48 GMT"; modification-date="Wed, 17 Dec 2014 09:12:45 GMT" Content-Transfer-Encoding: base64 RnJvbSA0MzU4NzNiNDc3ZDYxMmI3ZmM1ZTg2MDBlZjgzZWZkNDk2N2U2ZTA1IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxleS5kdWxpeGluQGdtYWlsLmNvbT4K RGF0ZTogV2VkLCAxNyB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GJnKGRldiwgIkJhc2VsaW5lIHJlcG9ydCBzdWNjZXNzZnVsLiBNYXg6ICVkIE1pbjogJWRcbiIs CisJCW1heF9iYXNlbGluZSwgbWluX2Jhc2VsaW5lKTsKKwlyZXQgPSBzY25wcmludGYoYnVmLCBQ QUdFX1NJWkUsICIlZCAlZFxuIiwgbWF4X2Jhc2VsaW5lLCBtaW5fYmFzZWxpbmUpOworCitvdXQ6 CisJcmV0dXJuIHJldDsKK30KKwogLyoKICAqIGN5YXBhX2dldF93YWl0X3RpbWVfZm9yX3B3cl9j bWQKICAqCkBAIC0xMDc5LDYgKzExNDksOCBAQCBjb25zdCBzdHJ1Y3QgY3lhcGFfZGV2X29wcyBj eWFwYV9nZW4zX29wcyA9IHsKIAkudXBkYXRlX2Z3ID0gY3lhcGFfZ2VuM19kb19md191cGRhdGUs CiAJLmJsX2RlYWN0aXZhdGUgPSBjeWFwYV9nZW4zX2JsX2RlYWN0aXZhdGUsCiAKKwkuc2hvd19i YXNlbGluZSA9IGN5YXBhX2dlbjNfc2hvd19iYXNlbGluZSwKKwogCS5zdGF0ZV9wYXJzZSA9IGN5 YXBhX2dlbjNfc3RhdGVfcGFyc2UsCiAJLm9wZXJhdGlvbmFsX2NoZWNrID0gY3lhcGFfZ2VuM19k b19vcGVyYXRpb25hbF9jaGVjaywKIAotLSAKMS45LjEKCg== --_013_BN1PR06MB0702F0782A3A6B975EDA156D16D0BN1PR06MB070namprd_ Content-Type: application/octet-stream; name="0008-input-cyapa-add-gen3-trackpad-device-force-re-calibr.patch" Content-Description: 0008-input-cyapa-add-gen3-trackpad-device-force-re-calibr.patch Content-Disposition: attachment; filename="0008-input-cyapa-add-gen3-trackpad-device-force-re-calibr.patch"; size=2895; creation-date="Wed, 17 Dec 2014 08:57:48 GMT"; modification-date="Wed, 17 Dec 2014 09:12:42 GMT" Content-Transfer-Encoding: base64 RnJvbSBlZGNkYzk3ODRmY2NhNzQzODE3OGMwM2I1NzZiYzk2M2JlMTRlYzFkIE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NzaXplX3QgY3lhcGFfZ2VuM19zaG93X2Jhc2VsaW5lKHN0 cnVjdCBkZXZpY2UgKmRldiwKIAkJCQkgICBzdHJ1Y3QgZGV2aWNlX2F0dHJpYnV0ZSAqYXR0ciwg Y2hhciAqYnVmKQogewpAQCAtMTE1MCw2ICsxMjA4LDcgQEAgY29uc3Qgc3RydWN0IGN5YXBhX2Rl dl9vcHMgY3lhcGFfZ2VuM19vcHMgPSB7CiAJLmJsX2RlYWN0aXZhdGUgPSBjeWFwYV9nZW4zX2Js X2RlYWN0aXZhdGUsCiAKIAkuc2hvd19iYXNlbGluZSA9IGN5YXBhX2dlbjNfc2hvd19iYXNlbGlu ZSwKKwkuY2FsaWJyYXRlX3N0b3JlID0gY3lhcGFfZ2VuM19kb19jYWxpYnJhdGUsCiAKIAkuc3Rh dGVfcGFyc2UgPSBjeWFwYV9nZW4zX3N0YXRlX3BhcnNlLAogCS5vcGVyYXRpb25hbF9jaGVjayA9 IGN5YXBhX2dlbjNfZG9fb3BlcmF0aW9uYWxfY2hlY2ssCi0tIAoxLjkuMQoK --_013_BN1PR06MB0702F0782A3A6B975EDA156D16D0BN1PR06MB070namprd_ Content-Type: application/octet-stream; name="0009-input-cyapa-add-gen5-trackpad-device-firmware-update.patch" Content-Description: 0009-input-cyapa-add-gen5-trackpad-device-firmware-update.patch Content-Disposition: attachment; filename="0009-input-cyapa-add-gen5-trackpad-device-firmware-update.patch"; size=15489; creation-date="Wed, 17 Dec 2014 08:57:48 GMT"; modification-date="Wed, 17 Dec 2014 09:12:39 GMT" Content-Transfer-Encoding: base64 RnJvbSAwNjYyZWJjMDU1MDFmOWMyYjhiZmE3NDQyMWZkNDVmZDNmOTYzMjRjIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxleS5kdWxpeGluQGdtYWlsLmNvbT4K RGF0ZTogV2VkLCAxNyBEZWMgMjAxNCAxNjo1NjozMiArMDgwMApTdWJqZWN0O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FfZ2VuNV9kb19md191cGRh dGUsCisKIAkuaW5pdGlhbGl6ZSA9IGN5YXBhX2dlbjVfaW5pdGlhbGl6ZSwKIAogCS5zdGF0ZV9w YXJzZSA9IGN5YXBhX2dlbjVfc3RhdGVfcGFyc2UsCi0tIAoxLjkuMQoK --_013_BN1PR06MB0702F0782A3A6B975EDA156D16D0BN1PR06MB070namprd_ Content-Type: application/octet-stream; name="0010-input-cyapa-add-gen5-trackpad-device-read-baseline-f.patch" Content-Description: 0010-input-cyapa-add-gen5-trackpad-device-read-baseline-f.patch Content-Disposition: attachment; filename="0010-input-cyapa-add-gen5-trackpad-device-read-baseline-f.patch"; size=22205; creation-date="Wed, 17 Dec 2014 08:57:48 GMT"; modification-date="Wed, 17 Dec 2014 09:12:35 GMT" Content-Transfer-Encoding: base64 RnJvbSBkZjJkNjc1Y2IzZGI5ZjJhZjM2NThjMmI5ZmQxNjNjNDY4YWRmMTFkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxleS5kdWxpeGluQGdtYWlsLmNvbT4K RGF0ZTogV2VkLCAxNyBEZWMgMjAxNCAxNjo1NjozMiArMDgwMApTdWJqZWN0OiBbUEFUQ0ggdjE2 IDEwLzEyXSBpbnB1dDogY3lhcGE6IGFkZCBnZW41IHRyYWNrcGFkIGRldmljZSByZWFkIGJhc2Vs aW5lCiBmdW5jdGlvbiBzdXBwb3J0ClRvOiBkbWl0cnkudG9yb2tob3ZAZ21haWwuY29tLAogICAg am1tYWhsZXJAZ21haWwuY29tLAogICAgcnlkYmVyZ0BldXJvbWFpbC5zZQpDYzogYmxldW5nQGdv b2dsZS5jb20sCiAgICBsaW51eC1pbnB1dEB2Z2VyLmtlcm5lbC5vcmcsCiAgICBsaW51eC1rZXJu ZWxAdmdlci5rZXJuZWwub3JnCgpBZGQgcmVhZCBiYXNlbGluZSBmdW5jdGlvbiBzdXBwb3J0ZWQg Zm9yIGdlbjUgdHJhY2tw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0BN1PR06MB070namprd_ Content-Type: application/octet-stream; name="0011-input-cyapa-add-gen5-trackpad-device-force-re-calibr.patch" Content-Description: 0011-input-cyapa-add-gen5-trackpad-device-force-re-calibr.patch Content-Disposition: attachment; filename="0011-input-cyapa-add-gen5-trackpad-device-force-re-calibr.patch"; size=3318; creation-date="Wed, 17 Dec 2014 08:57:48 GMT"; modification-date="Wed, 17 Dec 2014 09:12:31 GMT" Content-Transfer-Encoding: base64 RnJvbSA3MGM3MmNiMmI2ZmJlYzc3YmE5YjQzOTIzNmNlMjZkZGFhMmRlZjc1IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxleS5kdWxpeGluQGdtYWlsLmNvbT4K RGF0ZTogV2VkLCAxNyBEZWMgMjAxNCAxNjo1NjozMyArMDgwMApTdWJqZWN0OiBbUEFUQ0ggdjE2 IDExLzEyXSBpbnB1dDogY3lhcGE6IGFkZCBnZW41IHRyYWNrcGFkIGRldmljZSBmb3JjZQogcmUt Y2FsaWJyYXRlIGZ1bmN0aW9uIHN1cHBvcnQKVG86IGRtaXRyeS50b3Jva2hvdkBnbWFpbC5jb20s CiAgICBqbW1haGxlckBnbWFpbC5jb20sCiAgICByeWRiZXJnQGV1cm9tYWlsLnNlCkNjOiBibGV1 bmdAZ29vZ2xlLmNvbSwKICAgIGxpbnV4LWlucHV0QHZnZXIua2VybmVsLm9yZywKICAgIGxpbnV4 LWtlcm5lbEB2Z2VyLmtlcm5lbC5vcmcKCkFkZCBmb3JjZSByZS1jYWxpYnJhdGUgZnVuY3Rpb24g c3VwcG9ydGVkIGZvciBnZW41IHRyYWNrcGFkIGRldmljZSwKaXQgY2FuIGJlIHVzZWQgdGhyb3Vn aCBzeXNmcyBjYWxpYnJhdGUgaW50ZXJmYWNlLgpURVNUPXRlc3Qgb24gQ2hyb21lYm9va3MuCgpT aWduZWQtb2ZmLWJ5OiBEdWRsZXkgRHUgPGR1ZGxleS5kdWxpeGlu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51 bV9iaXRzKQogewogCWlmICh2YWx1ZSA+PiAobnVtX2JpdHMgLSAxKSkKQEAgLTI2ODksNiArMjc1 Myw3IEBAIGNvbnN0IHN0cnVjdCBjeWFwYV9kZXZfb3BzIGN5YXBhX2dlbjVfb3BzID0gewogCS51 cGRhdGVfZncgPSBjeWFwYV9nZW41X2RvX2Z3X3VwZGF0ZSwKIAogCS5zaG93X2Jhc2VsaW5lID0g Y3lhcGFfZ2VuNV9zaG93X2Jhc2VsaW5lLAorCS5jYWxpYnJhdGVfc3RvcmUgPSBjeWFwYV9nZW41 X2RvX2NhbGlicmF0ZSwKIAogCS5pbml0aWFsaXplID0gY3lhcGFfZ2VuNV9pbml0aWFsaXplLAog Ci0tIAoxLjkuMQoK --_013_BN1PR06MB0702F0782A3A6B975EDA156D16D0BN1PR06MB070namprd_ Content-Type: application/octet-stream; name="0012-input-cyapa-add-acpi-device-id-support.patch" Content-Description: 0012-input-cyapa-add-acpi-device-id-support.patch Content-Disposition: attachment; filename="0012-input-cyapa-add-acpi-device-id-support.patch"; size=1666; creation-date="Wed, 17 Dec 2014 08:57:48 GMT"; modification-date="Wed, 17 Dec 2014 09:12:26 GMT" Content-Transfer-Encoding: base64 RnJvbSBiZDgyMzBhOWQxZmYzYTI4NmJiYWZkYzQ4NTRkMzFmYTU1OWE4NzY0IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEdWRsZXkgRHUgPGR1ZGxleS5kdWxpeGluQGdtYWlsLmNvbT4K RGF0ZTogV2VkLCAxNyBEZWMgMjAxNCAxNjo1NjozMyArMDgwMApTdWJqZWN0OiBbUEFUQ0ggdjE2 IDEyLzEyXSBpbnB1dDogY3lhcGE6IGFkZCBhY3BpIGRldmljZSBpZCBzdXBwb3J0ClRvOiBkbWl0 cnkudG9yb2tob3ZAZ21haWwuY29tLAogICAgam1tYWhsZXJAZ21haWwuY29tLAogICAgcnlkYmVy Z0BldXJvbWFpbC5zZQpDYzogYmxldW5nQGdvb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BNT0RVTEVfREVWSUNFX1RBQkxFKGkyYywgY3lhcGFf aWRfdGFibGUpOwogCisjaWZkZWYgQ09ORklHX0FDUEkKK3N0YXRpYyBjb25zdCBzdHJ1Y3QgYWNw aV9kZXZpY2VfaWQgY3lhcGFfYWNwaV9pZFtdID0geworCXsgIkNZQVAwMDAwIiwgMCB9LCAgLyog R2VuMyB0cmFja3BhZCB3aXRoIDB4NjcgSTJDIGFkZHJlc3MuICovCisJeyAiQ1lBUDAwMDEiLCAw IH0sICAvKiBHZW41IHRyYWNrcGFkIHdpdGggMHgyNCBJMkMgYWRkcmVzcy4gKi8KKwl7IH0KK307 CitNT0RVTEVfREVWSUNFX1RBQkxFKGFjcGksIGN5YXBhX2FjcGlfaWQpOworI2VuZGlmCisKIHN0 YXRpYyBzdHJ1Y3QgaTJjX2RyaXZlciBjeWFwYV9kcml2ZXIgPSB7CiAJLmRyaXZlciA9IHsKIAkJ Lm5hbWUgPSAiY3lhcGEiLAogCQkub3duZXIgPSBUSElTX01PRFVMRSwKIAkJLnBtID0gJmN5YXBh X3BtX29wcywKKyNpZmRlZiBDT05GSUdfQUNQSQorCQkuYWNwaV9tYXRjaF90YWJsZSA9IEFDUElf UFRSKGN5YXBhX2FjcGlfaWQpLAorI2VuZGlmCiAJfSwKIAogCS5wcm9iZSA9IGN5YXBhX3Byb2Jl LAotLSAKMS45LjEKCg== --_013_BN1PR06MB0702F0782A3A6B975EDA156D16D0BN1PR06MB070namprd_-- -- 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/