From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp2-g21.free.fr ([2a01:e0c:1:1599::11]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1RiMGQ-0004MW-4S for barebox@lists.infradead.org; Wed, 04 Jan 2012 08:32:04 +0000 Received: from localhost.localdomain (unknown [82.240.38.71]) by smtp2-g21.free.fr (Postfix) with ESMTP id 9BADE4B0211 for ; Wed, 4 Jan 2012 09:31:55 +0100 (CET) From: =?UTF-8?q?Eric=20B=C3=A9nard?= Date: Wed, 4 Jan 2012 09:31:54 +0100 Message-Id: <1325665914-19238-1-git-send-email-eric@eukrea.com> In-Reply-To: <20120104081755.GM945@game.jcrosoft.org> References: <20120104081755.GM945@game.jcrosoft.org> 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: [PATCH v3 3/4] serial gadget: enable/disable on request To: barebox@lists.infradead.org LSBhZGQgYSB1c2JzZXJpYWwgY29tbWFuZCB0byBlbmFibGUvZGlzYWJsZSB0aGUgc2VyaWFsIGdh ZGdldAotIGFsbG93IGRmdSBhbmQgdXNic2VyaWFsIHRvIGNvaGV4aXN0IGluIHRoZSBzYW1lIGJh cmVib3gKLSBhZGQgYSB0aW1lb3V0IGluIHVfc2VyaWFsIHNvIHRoYXQgd2UgZG9uJ3QgZ2V0IGxv Y2tlZCBpZiB0aGUgdXNlcgplbmFibGUgdXNic2VyaWFsIGZyb20gYSBVQVJUIGNvbnNvbGUgYnV0 IGRvZXNuJ3QgY29uc3VtZSB0aGUgZGF0YQpvbiB0aGUgdXNic2VyaWFsIHBvcnQgY3JlYXRlZCBv biB0aGUgUEMKLSByZW1vdmUgZGVidWcgb3IgdmVyYm9zZSBwcmludGYKLSB0ZXN0ZWQgb24gaS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