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 1RiNHK-0007hp-6f for barebox@lists.infradead.org; Wed, 04 Jan 2012 09:37:04 +0000 Received: from localhost.localdomain (unknown [82.240.38.71]) by smtp2-g21.free.fr (Postfix) with ESMTP id DEF434B0200 for ; Wed, 4 Jan 2012 10:36:56 +0100 (CET) From: =?UTF-8?q?Eric=20B=C3=A9nard?= Date: Wed, 4 Jan 2012 10:36:47 +0100 Message-Id: <1325669809-32637-3-git-send-email-eric@eukrea.com> In-Reply-To: <1325669809-32637-1-git-send-email-eric@eukrea.com> References: <1325669809-32637-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 v4 3/5] serial gadget: enable/disable on request To: barebox@lists.infradead.org LSBhZGQgYSB1c2JzZXJpYWwgY29tbWFuZCB0byBlbmFibGUvZGlzYWJsZSB0aGUgc2VyaWFsIGdh ZGdldAotIGFsbG93IGRmdSBhbmQgdXNic2VyaWFsIHRvIGNvaGV4aXN0IGluIHRoZSBzYW1lIGJh cmVib3gKLSBhZGQgYSB0aW1lb3V0IGluIHVfc2VyaWFsIHNvIHRoYXQgd2UgZG9uJ3QgZ2V0IGxv Y2tlZCBpZiB0aGUgdXNlcgplbmFibGUgdXNic2VyaWFsIGZyb20gYSBVQVJUIGNvbnNvbGUgYnV0 IGRvZXNuJ3QgY29uc3VtZSB0aGUgZGF0YQpvbiB0aGUgdXNic2VyaWFsIHBvcnQgY3JlYXRlZCBv biB0aGUgUEMKLSByZW1vdmUgZGVidWcgb3IgdmVyYm9zZSBwcmludGYKLSB0ZXN0ZW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