From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.visioncatalog.de ([217.6.246.34] helo=root.phytec.de) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XXTc2-0003ht-DW for barebox@lists.infradead.org; Fri, 26 Sep 2014 11:22:59 +0000 Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id 194D3A00083 for ; Fri, 26 Sep 2014 13:22:38 +0200 (CEST) From: =?UTF-8?q?Teresa=20G=C3=A1mez?= Date: Fri, 26 Sep 2014 13:22:31 +0200 Message-Id: <1411730551-26605-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: [PATCHv2] commands: add of_display_timings To: barebox@lists.infradead.org QSBsb3Qgb2YgYm9hcmRzIHVzZSBkaXNwbGF5LXRpbWluZ3Mgbm9kZXMgdG8gZGVmaW5lIHRoZSB0 aW1pbmdzIG9mIG9uZSBvciBtb3JlCmRpc3BsYXlzLiBUaGlzIGNvbW1hbmQgbWFrZXMgaXQgcG9z c2libGUgdG8gbGlzdCBhbmQgc2VsZWN0IGRpc3BsYXlzIHdoaWNoIGFyZQpkZWZpbmVkIGluIGEg ZGV2aWNlIHRyZWUuCgpTaWduZWQtb2ZmLWJ5OiBUZXJlc2EgR8OhbWV6IDx0LmdhbWV6QHBoeXRl Yy5kZT4KLS0tCkNoYW5nZXMgdjI6Ci0gcmVtb3ZlZCBjYXN0Ci0gYWRkZWQgZnJlZShmdGQpCi0g ZnJlZWQgcm9vdAoKIGNvbW1hbmRzL0tjb25maWcgICAgICAgICAgICAgIHwgICAxNSArKysrCiBj b21tYW5kcy9NYWtlZmlsZSAgICAgICAgICAgICB8ICAgIDEgKwogY29tbWF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