From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wg0-x22f.google.com ([2a00:1450:400c:c00::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XWm7z-00070q-P3 for barebox@lists.infradead.org; Wed, 24 Sep 2014 12:57:04 +0000 Received: by mail-wg0-f47.google.com with SMTP id y10so6341152wgg.6 for ; Wed, 24 Sep 2014 05:56:40 -0700 (PDT) From: =?UTF-8?q?Rapha=C3=ABl=20Poggi?= Date: Wed, 24 Sep 2014 14:57:04 +0200 Message-Id: <1411563425-28463-3-git-send-email-poggi.raph@gmail.com> In-Reply-To: <1411563425-28463-1-git-send-email-poggi.raph@gmail.com> References: <1411563425-28463-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] i2c: at91: add support of device tree To: barebox@lists.infradead.org Cc: =?UTF-8?q?Rapha=C3=ABl=20Poggi?= U2lnbmVkLW9mZi1ieTogUmFwaGHDq2wgUG9nZ2kgPHBvZ2dpLnJhcGhAZ21haWwuY29tPgotLS0K IGRyaXZlcnMvaTJjL2J1c3Nlcy9pMmMtYXQ5MS5jIHwgNDEgKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKy0tLS0tLS0KIDEgZmlsZSBjaGFuZ2VkLCAzNCBpbnNlcnRpb25zKCspLCA3 IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2RyaXZlcnMvaTJjL2J1c3Nlcy9pMmMtYXQ5MS5j IGIvZHJpdmVycy9pMmMvYnVzc2VzL2kyYy1hdDkxLmMKaW5kZXggOTQ5MDgyMi4uYTIyMzZlZCAx MDA2NDQKLS0tIGEvZHJpdmVycy9pMmMvYnVzc2VzL2kyYy1hdDkxLmM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