From patchwork Tue Feb 2 20:47:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 61042 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp973248lbb; Tue, 2 Feb 2016 12:47:56 -0800 (PST) X-Received: by 10.98.14.68 with SMTP id w65mr51232906pfi.146.1454446076144; Tue, 02 Feb 2016 12:47:56 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h6si3971373pfd.5.2016.02.02.12.47.55; Tue, 02 Feb 2016 12:47:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-fbdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-fbdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-fbdev-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934231AbcBBUrz (ORCPT + 2 others); Tue, 2 Feb 2016 15:47:55 -0500 Received: from mail-lf0-f54.google.com ([209.85.215.54]:34792 "EHLO mail-lf0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933907AbcBBUrx (ORCPT ); Tue, 2 Feb 2016 15:47:53 -0500 Received: by mail-lf0-f54.google.com with SMTP id j78so292852lfb.1 for ; Tue, 02 Feb 2016 12:47:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=2bLzAXNSy9gUz+J1BZ+w2qFsNxuFRyLuhRtc0yR+6u4=; b=Mb8LTv0i5iKo4mUMzMhueph/JHZg0wV9a78ZI241BdHRHujvTiiVMEU/O+bWiKLHui CQk3sTDdX1vmQqLiWBFcPV9rxqfx+bNTQ+mpAGki5sFwxFuS+P+cYhPCI9wWMxNOw5lq mWg9O0khfhyfEjgVBEoMFQYqA0XibB/f5/dpk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2bLzAXNSy9gUz+J1BZ+w2qFsNxuFRyLuhRtc0yR+6u4=; b=kIIjSbrEUMhe1r/x5Mw4vnW3BKYkJ7Yh/G4unGtRS34xliHNYNw2SkNtUWrMO5fXs5 JqxsONR6CX/0T/lMuwtvTjxMzvPd1eXqvC7UC+DbQN9Dig23wyozXOb+LNmDCr20ULpW dAw1CwND/+TPw8S3cD9CZfWeuEcmTCGUUEe5YrESrelIK78hvg8dg6S9WMJvoXwCYGBr wDeQXa95H7TVJ/WjC1nE9PJUyNl/aIF8DYotbvCap0uvfxw3MTwzfposxRPJTfuIhSej yBXLGi/AIpSYPBS0ccauar4RLXmW+4tqAhNU43wemwrTLTc5eOSw0rdMjwxbF+G8UODY RoLA== X-Gm-Message-State: AG10YOSvlUTawqU7gwgOLpnjin9dpSBMTmGw9OwhTnb2uGpa4vtdJ5uGE6yFpXjwyR1htBt5 X-Received: by 10.25.65.5 with SMTP id o5mr11145795lfa.38.1454446072334; Tue, 02 Feb 2016 12:47:52 -0800 (PST) Received: from localhost.localdomain.localdomain (c-3d95db54.01-192-6c756e10.cust.bredbandsbolaget.se. [84.219.149.61]) by smtp.gmail.com with ESMTPSA id l204sm443317lfg.49.2016.02.02.12.47.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Feb 2016 12:47:51 -0800 (PST) From: Linus Walleij To: linux-fbdev@vger.kernel.org, Tomi Valkeinen , Jean-Christophe Plagniol-Villard , Russell King Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij , stable@vger.kernel.org, Rob Herring Subject: [PATCH] video: ARM CLCD: runtime check for Versatile Date: Tue, 2 Feb 2016 21:47:39 +0100 Message-Id: <1454446059-30526-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org The current compile-time check for inversed IENB/CNTL does not work in multiplatform boots: as soon as versatile is included in the build, the IENB/CNTL is switched and breaks graphics. Convert this to a runtime switch. Cc: stable@vger.kernel.org Cc: Rob Herring Cc: Russell King Fixes: a29da136de34 ("ARM: versatile: convert to multi-platform") Signed-off-by: Linus Walleij --- drivers/video/fbdev/amba-clcd.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c index 9362424c2340..f9ef06d0cd48 100644 --- a/drivers/video/fbdev/amba-clcd.c +++ b/drivers/video/fbdev/amba-clcd.c @@ -440,13 +440,14 @@ static int clcdfb_register(struct clcd_fb *fb) fb->off_ienb = CLCD_PL111_IENB; fb->off_cntl = CLCD_PL111_CNTL; } else { -#ifdef CONFIG_ARCH_VERSATILE - fb->off_ienb = CLCD_PL111_IENB; - fb->off_cntl = CLCD_PL111_CNTL; -#else - fb->off_ienb = CLCD_PL110_IENB; - fb->off_cntl = CLCD_PL110_CNTL; -#endif + if (of_machine_is_compatible("arm,versatile-ab") || + of_machine_is_compatible("arm,versatile-pb")) { + fb->off_ienb = CLCD_PL111_IENB; + fb->off_cntl = CLCD_PL111_CNTL; + } else { + fb->off_ienb = CLCD_PL110_IENB; + fb->off_cntl = CLCD_PL110_CNTL; + } } fb->clk = clk_get(&fb->dev->dev, NULL);