From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.rapiddevelopmentkit.de ([217.6.246.34] helo=root.phytec.de) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XWix6-0002xK-0A for barebox@lists.infradead.org; Wed, 24 Sep 2014 09:33:37 +0000 Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id 05EF2A001F6 for ; Wed, 24 Sep 2014 11:33:18 +0200 (CEST) From: =?UTF-8?q?Teresa=20G=C3=A1mez?= Date: Wed, 24 Sep 2014 11:33:11 +0200 Message-Id: <1411551191-27938-2-git-send-email-t.gamez@phytec.de> In-Reply-To: <1411551191-27938-1-git-send-email-t.gamez@phytec.de> References: <1411551191-27938-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: [PATCH 2/2] commands: add of_display_timings To: barebox@lists.infradead.org QSBsb3Qgb2YgYm9hcmRzIHVzZSBkaXNwbGF5LXRpbWluZ3Mgbm9kZXMgdG8gZGVmaW5lIHRoZSB0 aW1pbmdzIG9mIG9uZSBvciBtb3JlCmRpc3BsYXlzLiBUaGlzIGNvbW1hbmQgbWFrZXMgaXQgcG9z c2libGUgdG8gbGlzdCBhbmQgc2VsZWN0IGRpc3BsYXlzIHdoaWNoIGFyZQpkZWZpbmVkIGluIGEg ZGV2aWNlIHRyZWUuCgpTaWduZWQtb2ZmLWJ5OiBUZXJlc2EgR8OhbWV6IDx0LmdhbWV6QHBoeXRl Yy5kZT4KLS0tCiBjb21tYW5kcy9LY29uZmlnICAgICAgICAgICAgICB8ICAgMTUgKysrKwogY29t bWFuZHMvTWFrZWZpbGUgICAgICAgICAgICAgfCAgICAxICsKIGNvbW1hbmRzL29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