From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-we0-x22f.google.com ([2a00:1450:400c:c03::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XEyHN-0008I9-UT for barebox@lists.infradead.org; Wed, 06 Aug 2014 10:17:10 +0000 Received: by mail-we0-f175.google.com with SMTP id t60so2414482wes.34 for ; Wed, 06 Aug 2014 03:16:47 -0700 (PDT) From: =?UTF-8?q?Rapha=C3=ABl=20Poggi?= Date: Wed, 6 Aug 2014 12:17:47 +0200 Message-Id: <1407320269-32368-2-git-send-email-poggi.raph@gmail.com> In-Reply-To: <1407320269-32368-1-git-send-email-poggi.raph@gmail.com> References: <1407320269-32368-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 v3 1/3] i2c: at91: add support of device tree To: barebox@lists.infradead.org Cc: =?UTF-8?q?Rapha=C3=ABl=20Poggi?= U2lnbmVkLW9mZi1ieTogUmFwaGHDq2wgUG9nZ2kgPHBvZ2dpLnJhcGhAZ21haWwuY29tPgotLS0K IGRyaXZlcnMvaTJjL2J1c3Nlcy9pMmMtYXQ5MS5jIHwgICA5MiArKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKy0tLS0tLS0tLQogMSBmaWxlIGNoYW5nZWQsIDczIGluc2VydGlvbnMoKyks IDE5IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2RyaXZlcnMvaTJjL2J1c3Nlcy9pMmMtYXQ5 MS5jIGIvZHJpdmVycy9pMmMvYnVzc2VzL2kyYy1hdDkxLmMKaW5kZXggMzk5ZjZhOS4uNjUxY2Zj NyAxMDA2NDQKLS0tIGEvZHJpdmVycy9pMmMvYnVzc2VzL2kyYy1hdDkx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