From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from 9.mo4.mail-out.ovh.net ([46.105.40.176] helo=mo4.mail-out.ovh.net) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TUDiS-00020R-Fm for barebox@lists.infradead.org; Fri, 02 Nov 2012 09:39:08 +0000 Received: from mail247.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo4.mail-out.ovh.net (Postfix) with SMTP id 38B9B104ECF2 for ; Fri, 2 Nov 2012 10:46:13 +0100 (CET) From: Jean-Christophe PLAGNIOL-VILLARD Date: Fri, 2 Nov 2012 10:36:50 +0100 Message-Id: <1351849012-26236-2-git-send-email-plagnioj@jcrosoft.com> In-Reply-To: <1351849012-26236-1-git-send-email-plagnioj@jcrosoft.com> References: <20121102092718.GO29599@game.jcrosoft.org> <1351849012-26236-1-git-send-email-plagnioj@jcrosoft.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-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: =?UTF-8?q?=5BPATCH=202/4=5D=20i2c=3A=20add=20i2c=20algo=20bit=20support?= To: barebox@lists.infradead.org VGhpcyBpcyBuZWVkZWQgZm9yIGkyYy1ncGlvIHN1cHBvcnQKCkJhc2VkIG9uIGxpbnV4IDMuNy1y YzIKClNpZ25lZC1vZmYtYnk6IEplYW4tQ2hyaXN0b3BoZSBQTEFHTklPTC1WSUxMQVJEIDxwbGFn bmlvakBqY3Jvc29mdC5jb20+Ci0tLQogZHJpdmVycy9pMmMvS2NvbmZpZyAgICAgICAgICAgICAg fCAgICAxICsKIGRyaXZlcnMvaTJjL01ha2VmaWxlICAgICAgICAgICAgIHwgICAgMiArLQogZHJp dmVycy9pMmMvYWxnb3MvS2NvbmZpZyAgICAgICAgfCAgICA2ICsKIGRyaXZlcn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