From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XDCoM-0004uM-9A for barebox@lists.infradead.org; Fri, 01 Aug 2014 13:23:56 +0000 Received: by mail-wi0-f170.google.com with SMTP id f8so2852854wiw.5 for ; Fri, 01 Aug 2014 06:23:31 -0700 (PDT) From: =?UTF-8?q?Rapha=C3=ABl=20Poggi?= Date: Fri, 1 Aug 2014 15:24:23 +0200 Message-Id: <1406899464-29144-2-git-send-email-poggi.raph@gmail.com> In-Reply-To: <1406899464-29144-1-git-send-email-poggi.raph@gmail.com> References: <1406899464-29144-1-git-send-email-poggi.raph@gmail.com> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 1/2] pinctrl: at91: add pinctrl driver To: barebox@lists.infradead.org Cc: =?UTF-8?q?Rapha=C3=ABl=20Poggi?= VGhpcyBkcml2ZXIgaXMgYmFzZWQgb24gbWFjaC1hdDkxL2dwaW8uYyBhbmQgbGludXggcGluY3Ry bCBkcml2ZXIuClRoZSBkcml2ZXIgY29udGFpbnMgdGhlIGdwaW8gYW5kIHBpbmN0cmwgcGFydHMg KGxpa2UgaW4gbGludXgpIGJlY2F1c2UgdGhlIHR3byBwYXJ0cwpzaGFyZSBzb21lIHN0cnVjdHVy ZXMgYW5kIGxvZ2ljcy4KClNpZ25lZC1vZmYtYnk6IFJhcGhhw6tsIFBvZ2dpIDxwb2dnaS5yYXBo QGdtYWlsLmNvbT4KLS0tCiBkcml2ZXJzL3BpbmN0cmwvS2NvbmZpZyAgICAgICAgfCAgICA2ICsK IGRyaXZlcnMvcGluY3RybC9NYWtlZmlsZSAgICAgICB8ICAgIDE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hOworfQorCitzdGF0aWMg aW50IGF0OTFfcGluY3RybF9zZXRfY29uZihzdHJ1Y3QgYXQ5MV9waW5jdHJsICppbmZvLCB1bnNp Z25lZCBpbnQgcGluX251bSwgdW5zaWduZWQgaW50IG11eCwgdW5zaWduZWQgaW50IGNvbmYpCit7 CisJdW5zaWduZWQgaW50IG1hc2s7CisJdm9pZCBfX2lvbWVtICpwaW87CisKKwlwaW8gPSBwaW5f dG9fY29udHJvbGxlcihpbmZvLCBwaW5fbnVtKTsKKwltYXNrID0gcGluX3RvX21hc2socGluX251 bSk7CisKKwlpZiAoY29uZiAmIFBVTExfVVAgJiYgY29uZiAmIFBVTExfRE9XTikKKwkJcmV0dXJu IC1FSU5WQUw7CisKKwlhdDkxX211eF9zZXRfcHVsbHVwKHBpbywgbWFzaywgY29uZiAmIFBVTExf VVApOworCWF0OTFfbXV4X3NldF9tdWx0aWRyaXZlKHBpbywgbWFzaywgY29uZiAmIE1VTFRJX0RS SVZFKTsKKwlpZiAoaW5mby0+b3BzLT5zZXRfZGVnbGl0Y2gpCisJCWluZm8tPm9wcy0+c2V0X2Rl Z2xpdGNoKHBpbywgbWFzaywgY29uZiAmIERFR0xJVENIKTsKKwlpZiAoaW5mby0+b3BzLT5zZXRf ZGVib3VuY2UpCisJCWluZm8tPm9wcy0+c2V0X2RlYm91bmNlKHBpbywgbWFzaywgY29uZiAmIERF Qk9VTkNFLAorCQkJKGNvbmYgJiBERUJPVU5DRV9WQUwpID4+IERFQk9VTkNFX1ZBTF9TSElGVCk7 CisJaWYgKGluZm8tPm9wcy0+c2V0X3B1bGxkb3duKQorCQlpbmZvLT5vcHMtPnNldF9wdWxsZG93 bihwaW8sIG1hc2ssIGNvbmYgJiBQVUxMX0RPV04pOworCWlmIChpbmZvLT5vcHMtPmRpc2FibGVf c2NobWl0dF90cmlnICYmIGNvbmYgJiBESVNfU0NITUlUKQorCQlpbmZvLT5vcHMtPmRpc2FibGVf c2NobWl0dF90cmlnKHBpbywgbWFzayk7CisKKwlyZXR1cm4gMDsKK30KKworc3RhdGljIGludCBh dDkxX3BpbmN0cmxfc2V0X3N0YXRlKHN0cnVjdCBwaW5jdHJsX2RldmljZSAqcGRldiwgc3RydWN0 IGRldmljZV9ub2RlICpucCkKK3sKKwlzdHJ1Y3QgYXQ5MV9waW5jdHJsICppbmZvOworCWNvbnN0 IF9fYmUzMiAqbGlzdDsKKwlpbnQgaSwgc2l6ZTsKKwlpbnQgcmV0ID0gMDsKKwlpbnQgYmFua19u dW0sIHBpbl9udW0sIG11eCwgY29uZjsKKworCWluZm8gPSB0b19hdDkxX3BpbmN0cmwocGRldik7 CisKKwlsaXN0ID0gb2ZfZ2V0X3Byb3BlcnR5KG5wLCAiYXRtZWwscGlucyIsICZzaXplKTsKKwlz aXplIC89IHNpemVvZigqbGlzdCk7CisKKwlpZiAoIXNpemUgfHwgc2l6ZSAlIDQpIHsKKwkJZGV2 X2VycihwZGV2LT5kZXYsICJ3cm9uZyBwaW5zIG51bWJlciBvciBwaW5zIGFuZCBjb25maWdzIHNo b3VsZCBiZSBieSA0XG4iKTsKKwkJcmV0dXJuIC1FSU5WQUw7CisJfQorCisJZm9yIChpID0gMDsg aSA8IHNpemU7IGkgKz0gNCkgeworCQliYW5rX251bSA9IGJlMzJfdG9fY3B1KCpsaXN0KyspOwor CQlwaW5fbnVtID0gYmUzMl90b19jcHUoKmxpc3QrKyk7CisJCW11eCA9IGJlMzJfdG9fY3B1KCps aXN0KyspOworCQljb25mID0gYmUzMl90b19jcHUoKmxpc3QrKyk7CisKKwkJcmV0ID0gYXQ5MV9t dXhfcGluKGluZm8sIHBpbl9udW0sIG11eCwgY29uZiAmIFBVTExfVVApOworCQlpZiAocmV0KSB7 CisJCQlkZXZfZXJyKHBkZXYtPmRldiwgImZhaWxlZCB0byBtdXggcGluICVkXG4iLCBwaW5fbnVt KTsKKwkJCXJldHVybiByZXQ7CisJCX0KKworCQlyZXQgPSBhdDkxX3BpbmN0cmxfc2V0X2NvbmYo aW5mbywgcGluX251bSwgbXV4LCBjb25mKTsKKwkJaWYgKHJldCkgeworCQkJZGV2X2VycihwZGV2 LT5kZXYsICJmYWlsZWQgdG8gc2V0IGNvbmYgb24gcGluICVkXG4iLCBwaW5fbnVtKTsKKwkJCXJl dHVybiByZXQ7CisJCX0KKwl9CisKKwlyZXR1cm4gcmV0OworfQorCitzdGF0aWMgc3RydWN0IHBp bmN0cmxfb3BzIGF0OTFfcGluY3RybF9vcHMgPSB7CisJLnNldF9zdGF0ZSA9IGF0OTFfcGluY3Ry bF9zZXRfc3RhdGUsCit9OworCitzdGF0aWMgaW50IGF0OTFfcGluY3RybF9wcm9iZShzdHJ1Y3Qg ZGV2aWNlX2QgKmRldikKK3sKKwlzdHJ1Y3QgYXQ5MV9waW5jdHJsICppbmZvOworCWludCByZXQ7 CisKKwlpbmZvID0geHphbGxvYyhzaXplb2Yoc3RydWN0IGF0OTFfcGluY3RybCkpOworCisJaW5m by0+b3BzID0gYXQ5MV9waW5jdHJsX2dldF9kcml2ZXJfZGF0YShkZXYpOworCWlmICghaW5mby0+ b3BzKSB7CisJCWRldl9lcnIoZGV2LCAiZmFpbGVkIHRvIHJldHJpZXZlIGRyaXZlciBkYXRhXG4i KTsKKwkJcmV0dXJuIC1FTk9ERVY7CisJfQorCisJaW5mby0+cGN0bC5kZXYgPSBkZXY7CisJaW5m by0+cGN0bC5vcHMgPSAmYXQ5MV9waW5jdHJsX29wczsKKworCXJldCA9IHBpbmN0cmxfcmVnaXN0 ZXIoJmluZm8tPnBjdGwpOworCWlmIChyZXQpCisJCXJldHVybiByZXQ7CisKKwlkZXZfaW5mbyhk ZXYsICJBVDkxIHBpbmN0cmwgcmVnaXN0cmVkXG4iKTsKKworCXJldHVybiAwOworfQorCitzdGF0 aWMgc3RydWN0IHBsYXRmb3JtX2RldmljZV9pZCBhdDkxX3BpbmN0cmxfaWRzW10gPSB7CisJewor CQkubmFtZSA9ICJhdDkxcm05MjAwLXBpbmN0cmwiLAorCQkuZHJp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bl90b19iYW5rX29mZnNldChwaW4pOworfQorCitzdGF0aWMgaW5saW5lIHZvaWQgYXQ5MV9t dXhfZGlzYWJsZV9pbnRlcnJ1cHQodm9pZCBfX2lvbWVtICpwaW8sIHVuc2lnbmVkIG1hc2spCit7 CisJX19yYXdfd3JpdGVsKG1hc2ssIHBpbyArIFBJT19JRFIpOworfQorCitzdGF0aWMgaW5saW5l IHZvaWQgYXQ5MV9tdXhfc2V0X3B1bGx1cCh2b2lkIF9faW9tZW0gKnBpbywgdW5zaWduZWQgbWFz aywgYm9vbCBvbikKK3sKKwlfX3Jhd193cml0ZWwobWFzaywgcGlvICsgKG9uID8gUElPX1BVRVIg OiBQSU9fUFVEUikpOworfQorCitzdGF0aWMgaW5saW5lIHZvaWQgYXQ5MV9tdXhfc2V0X211bHRp ZHJpdmUodm9pZCBfX2lvbWVtICpwaW8sIHVuc2lnbmVkIG1hc2ssIGJvb2wgb24pCit7CisJX19y YXdfd3JpdGVsKG1hc2ssIHBpbyArIChvbiA/IFBJT19NREVSIDogUElPX01ERFIpKTsKK30KKwor c3RhdGljIGlubGluZSB2b2lkIGF0OTFfbXV4X3NldF9BX3BlcmlwaCh2b2lkIF9faW9tZW0gKnBp bywgdW5zaWduZWQgbWFzaykKK3sKKwlfX3Jhd193cml0ZWwobWFzaywgcGlvICsgUElPX0FTUik7 Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZCBhdDkxX211eF9zZXRfQl9wZXJpcGgodm9pZCBfX2lv bWVtICpwaW8sIHVuc2lnbmVkIG1hc2spCit7CisJX19yYXdfd3JpdGVsKG1hc2ssIHBpbyArIFBJ T19CU1IpOworfQorCitzdGF0aWMgaW5saW5lIHZvaWQgYXQ5MV9tdXhfcGlvM19zZXRfQV9wZXJp cGgodm9pZCBfX2lvbWVtICpwaW8sIHVuc2lnbmVkIG1hc2spCit7CisKKwlfX3Jhd193cml0ZWwo X19yYXdfcmVhZGwocGlvICsgUElPX0FCQ0RTUjEpICYgfm1hc2ssC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Ag IHUzMiBwZHNyOworCisgICAgICAgcGRzciA9IF9fcmF3X3JlYWRsKHBpbyArIFBJT19QRFNSKTsK KyAgICAgICByZXR1cm4gKHBkc3IgJiBtYXNrKSAhPSAwOworfQorCisjZW5kaWYgLyogX19BVDkx X0dQSU9fSF9fICovCi0tIAoxLjcuOS41CgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX18KYmFyZWJveCBtYWlsaW5nIGxpc3QKYmFyZWJveEBsaXN0cy5pbmZy YWRlYWQub3JnCmh0dHA6Ly9saXN0cy5pbmZyYWRlYWQub3JnL21haWxtYW4vbGlzdGluZm8vYmFy ZWJveAo=