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: 8195571 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B8719BEEE5 for ; Tue, 2 Feb 2016 20:47:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B19F820266 for ; Tue, 2 Feb 2016 20:47:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D93EC202BE for ; Tue, 2 Feb 2016 20:47:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934231AbcBBUrz (ORCPT ); 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 X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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);