From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wg0-x22d.google.com ([2a00:1450:400c:c00::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XDCmT-0004M2-MR for barebox@lists.infradead.org; Fri, 01 Aug 2014 13:21:58 +0000 Received: by mail-wg0-f45.google.com with SMTP id x12so4287123wgg.28 for ; Fri, 01 Aug 2014 06:21:35 -0700 (PDT) From: =?UTF-8?q?Rapha=C3=ABl=20Poggi?= Date: Fri, 1 Aug 2014 15:22:30 +0200 Message-Id: <1406899351-29047-2-git-send-email-poggi.raph@gmail.com> In-Reply-To: <1406899351-29047-1-git-send-email-poggi.raph@gmail.com> References: <1406899351-29047-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] i2c: at91: add support of device tree To: barebox@lists.infradead.org Cc: =?UTF-8?q?Rapha=C3=ABl=20Poggi?= U2lnbmVkLW9mZi1ieTogUmFwaGHDq2wgUG9nZ2kgPHBvZ2dpLnJhcGhAZ21haWwuY29tPgotLS0K IGRyaXZlcnMvaTJjL2J1c3Nlcy9pMmMtYXQ5MS5jIHwgICA2MCArKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKy0tLS0tLQogMSBmaWxlIGNoYW5nZWQsIDUyIGluc2VydGlvbnMoKyks IDggZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvZHJpdmVycy9pMmMvYnVzc2VzL2kyYy1hdDkx LmMgYi9kcml2ZXJzL2kyYy9idXNzZXMvaTJjLWF0OTEuYwppbmRleCA0YWE0ZTRlLi45NDRhOGIz IDEwMDY0NAotLS0gYS9kcml2ZXJzL2kyYy9idXNzZXMvaTJjLWF0OTEuYworKysgYi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