From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XhR9K-0005k1-E4 for barebox@lists.infradead.org; Thu, 23 Oct 2014 22:46:31 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Fri, 24 Oct 2014 00:46:01 +0200 Message-Id: <1414104361-15956-4-git-send-email-u.kleine-koenig@pengutronix.de> In-Reply-To: <1414104361-15956-1-git-send-email-u.kleine-koenig@pengutronix.de> References: <1414104361-15956-1-git-send-email-u.kleine-koenig@pengutronix.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 3/3] mxs: iomux-imx23/imx28: add additional checks on mode To: barebox@lists.infradead.org VGhpcyBjYXRjaGVzIHdyb25nIG1vZGVzOgogLSByZXF1ZXN0IHRvIGVuYWJsZSB0aGUgcHVsbCB1 cCBvbiBhIHBpbiB0aGF0IGRvZXNuJ3QgaGF2ZSBvbmUuCiAtIGRpdHRvIGZvciBiaXQga2VlcGVy cywgZHJpdmUgc3RyZW5ndGggYW5kIHZvbHRhZ2UKCkFkZGl0aW9uYWxseSBvbmx5IHdyaXRlIHZh bHVlcyBmb3IgYSBnaXZlbiBwaW4gaWYgdGhlIG1vZGUgaGFzIHRoZQpjb3JyZXNwb25kaW5nIHZh bHVlIHNldC4KClNpZ25lZC1vZmYtYnk6IFV3ZSBLbGVpbmUtS8O2bmlnIDx1LmtsZWluZS1rb2Vu aWdAcGVuZ3V0cm9uaXguZGU+Ci0tLQogYXJjaC9hcm0vbWFjaC1teHMvaW9tdXgtaW14LmMgfCAy MyArKysrKysrKysrKysrKysrKysrLS0tLQogMS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