From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XEDfs-0004vT-LY for barebox@lists.infradead.org; Mon, 04 Aug 2014 08:31:25 +0000 Received: by mail-wi0-f180.google.com with SMTP id n3so4524390wiv.1 for ; Mon, 04 Aug 2014 01:30:54 -0700 (PDT) From: =?UTF-8?q?Rapha=C3=ABl=20Poggi?= Date: Mon, 4 Aug 2014 10:31:51 +0200 Message-Id: <1407141112-3868-2-git-send-email-poggi.raph@gmail.com> In-Reply-To: <1407141112-3868-1-git-send-email-poggi.raph@gmail.com> References: <1407141112-3868-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 V2 1/2] i2c: at91: add support of device tree To: barebox@lists.infradead.org Cc: =?UTF-8?q?Rapha=C3=ABl=20Poggi?= U2lnbmVkLW9mZi1ieTogUmFwaGHDq2wgUG9nZ2kgPHBvZ2dpLnJhcGhAZ21haWwuY29tPgotLS0K IGRyaXZlcnMvaTJjL2J1c3Nlcy9pMmMtYXQ5MS5jIHwgICA2NiArKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKystLS0tLQogMSBmaWxlIGNoYW5nZWQsIDU4IGluc2VydGlvbnMoKyks IDggZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvZHJpdmVycy9pMmMvYnVzc2VzL2kyYy1hdDkx LmMgYi9kcml2ZXJzL2kyYy9idXNzZXMvaTJjLWF0OTEuYwppbmRleCAzOTlmNmE5Li45NDRhOGIz IDEwMDY0NAotLS0gYS9kcml2ZXJzL2kyYy9idXNzZXMvaTJjLWF0OTEuYworKysgYi9kc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