From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.phytec.de ([217.6.246.34] helo=root.phytec.de) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XYvPb-0001UD-Fc for barebox@lists.infradead.org; Tue, 30 Sep 2014 11:16:09 +0000 Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id 6C59CA00428 for ; Tue, 30 Sep 2014 13:15:52 +0200 (CEST) From: =?UTF-8?q?Teresa=20G=C3=A1mez?= Date: Tue, 30 Sep 2014 13:15:30 +0200 Message-Id: <1412075730-5946-5-git-send-email-t.gamez@phytec.de> In-Reply-To: <1412075730-5946-1-git-send-email-t.gamez@phytec.de> References: <1412075730-5946-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: [PATCHv3 5/5] commands: add of_display_timings To: barebox@lists.infradead.org QSBsb3Qgb2YgYm9hcmRzIHVzZSBkaXNwbGF5LXRpbWluZ3Mgbm9kZXMgdG8gZGVmaW5lIHRoZSB0 aW1pbmdzIG9mIG9uZSBvciBtb3JlCmRpc3BsYXlzLiBUaGlzIGNvbW1hbmQgbWFrZXMgaXQgcG9z c2libGUgdG8gbGlzdCBhbmQgc2VsZWN0IGRpc3BsYXlzIHdoaWNoIGFyZQpkZWZpbmVkIGluIGEg ZGV2aWNlIHRyZWUuCgpTaWduZWQtb2ZmLWJ5OiBUZXJlc2EgR8OhbWV6IDx0LmdhbWV6QHBoeXRl Yy5kZT4KLS0tCkNoYW5nZXMgdjM6Ci0gcmVtb3ZlZCBvdmVyd3JpdGluZyBvZiByb290IG5vZGUK LSB1c2luZyBub3cgZm9yX2VhY2hfbm9kZV9ieV9uYW1lX2Zyb20gYW5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