From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-we0-x236.google.com ([2a00:1450:400c:c03::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XAHiB-00073n-SN for barebox@lists.infradead.org; Thu, 24 Jul 2014 12:01:29 +0000 Received: by mail-we0-f182.google.com with SMTP id k48so2642158wev.41 for ; Thu, 24 Jul 2014 05:01:01 -0700 (PDT) From: =?UTF-8?q?Rapha=C3=ABl=20Poggi?= Date: Thu, 24 Jul 2014 14:01:43 +0200 Message-Id: <1406203303-13015-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] i2c: add Atmel AT91 driver To: barebox@lists.infradead.org Cc: =?UTF-8?q?Rapha=C3=ABl=20Poggi?= U2lnbmVkLW9mZi1ieTogUmFwaGHDq2wgUG9nZ2kgPHBvZ2dpLnJhcGhAZ21haWwuY29tPgotLS0K IGRyaXZlcnMvaTJjL2J1c3Nlcy9LY29uZmlnICAgIHwgICAgNCArCiBkcml2ZXJzL2kyYy9idXNz ZXMvTWFrZWZpbGUgICB8ICAgIDEgKwogZHJpdmVycy9pMmMvYnVzc2VzL2kyYy1hdDkxLmMgfCAg NDM3ICsrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrCiAzIGZpbGVzIGNo YW5nZWQsIDQ0MiBpbnNlcnRpb25zKCspCiBjcmVhdGUgbW9kZSAxMDA2NDQgZHJpdmVycy9pMmMv YnVzc2VzL2kyYy1hdDkxLmMKCmRpZmYgLS1naXQgYS9kcml2ZXJzL2kyYy9idXNzZXMvS2NvbmZp ZyBiL2RyaXZlcnMvaTJjL2J1c3Nlcy9LY29uZmlnCmluZGV4IDM3MGFiYjAuLjViN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