From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.phycard.de ([217.6.246.34] helo=root.phytec.de) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UpeKH-0005pw-M6 for barebox@lists.infradead.org; Thu, 20 Jun 2013 12:51:00 +0000 Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id 6A49EBF0E8 for ; Thu, 20 Jun 2013 14:45:42 +0200 (CEST) From: =?UTF-8?q?Teresa=20G=C3=A1mez?= Date: Thu, 20 Jun 2013 14:50:29 +0200 Message-Id: <1371732630-27966-3-git-send-email-t.gamez@phytec.de> In-Reply-To: <1371732630-27966-1-git-send-email-t.gamez@phytec.de> References: <1371732630-27966-1-git-send-email-t.gamez@phytec.de> 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 2/3] ARM: AM33xx: Add i2c support for AM33xx To: barebox@lists.infradead.org QWRkZWQgZGV2aWNlIHJlZ2lzdGVyIGZ1bmN0aW9ucyBhbmQgY3B1X2lzX2FtMzN4eCgpCmZ1bmN0 aW9uLgpBZGFwdGVkIHRoZSBpMmMtb21hcCBkcml2ZXIuIEFNMzM1eCBoYXMgYSBsb3dlcgpjbG9j ayByYXRlIGFuZCB0aGUgdGltZW91dCBvZiBwb2xsaW5nIHRoZSBpc3IgZnVuY3Rpb24KaGFkIHRv IGJlIGluY3JlYXNlZC4KCkJhc2VkIG9uIGEgcGF0Y2ggZnJvbSBTaHJhdmFuIEt1bWFyIDxzaHJh dmFuLmtAcGh5dGVjLmluPi4KClNpZ25lZC1vZmYtYnk6IFRlcmVzYSBHw6FtZXogPHQuZ2FtZXpA cGh5dGVjLmRlPgotLS0KIGFyY2gvYXJtL21hY2gtb21hcC9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