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 1Ri7iA-0000rB-91 for barebox@lists.infradead.org; Tue, 03 Jan 2012 16:59:44 +0000 Received: from localhost.localdomain (unknown [82.240.38.71]) by smtp2-g21.free.fr (Postfix) with ESMTP id DFB1C4B0286 for ; Tue, 3 Jan 2012 17:59:36 +0100 (CET) From: =?UTF-8?q?Eric=20B=C3=A9nard?= Date: Tue, 3 Jan 2012 17:59:28 +0100 Message-Id: <1325609969-21471-3-git-send-email-eric@eukrea.com> In-Reply-To: <1325609969-21471-1-git-send-email-eric@eukrea.com> References: <1325609969-21471-1-git-send-email-eric@eukrea.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: [PATCH 3/4] serial gadget: enable/disable on request To: barebox@lists.infradead.org LSBhZGQgYSB1c2JzZXJpYWwgY29tbWFuZCB0byBlbmFibGUvZGlzYWJsZSB0aGUgc2VyaWFsIGdh ZGdldAotIGFsbG93IGRmdSBhbmQgdXNic2VyaWFsIHRvIGNvaGV4aXN0IGluIHRoZSBzYW1lIGJh cmVib3gKLSBhZGQgYSB0aW1lb3V0IGluIHVfc2VyaWFsIHNvIHRoYXQgd2UgZG9uJ3QgZ2V0IGxv Y2tlZCBpZiB0aGUgdXNlcgplbmFibGUgdXNic2VyaWFsIGZyb20gYSBVQVJUIGNvbnNvbGUgYnV0 IGRvZXNuJ3QgY29uc3VtZSB0aGUgZGF0YQpvbiB0aGUgdXNic2VyaWFsIHBvcnQgY3JlYXRlZCBv biB0aGUgUEMKLSByZW1vdmUgZGVidWcgb3IgdmVyYm9zZSBwcmludGYKLSB0ZXN0Z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