From patchwork Tue Feb 23 10:01:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 8389971 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 72E5BC0553 for ; Tue, 23 Feb 2016 10:02:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6FB5D20304 for ; Tue, 23 Feb 2016 10:02:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B1AA420384 for ; Tue, 23 Feb 2016 10:02:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751143AbcBWKCG (ORCPT ); Tue, 23 Feb 2016 05:02:06 -0500 Received: from mail-lb0-f169.google.com ([209.85.217.169]:32844 "EHLO mail-lb0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751077AbcBWKCE (ORCPT ); Tue, 23 Feb 2016 05:02:04 -0500 Received: by mail-lb0-f169.google.com with SMTP id x4so98598093lbm.0 for ; Tue, 23 Feb 2016 02:02:03 -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:in-reply-to:references; bh=2bLzAXNSy9gUz+J1BZ+w2qFsNxuFRyLuhRtc0yR+6u4=; b=g17LTtBzd9fHv8bqD/En1zVfe9M8WMm6w3hQBWZUDPl1B+jJXZsz8AoVBxPBEGp3Ij Ft8lWOaFETrVMVGnCGzhg4epdJylngV+Im2vpdw+Q7UC1YNJzNoiYH4K1/uW6SVWaZW5 HeGWfrX65Y8rG/o1u29xzsEVCZ1XfB2FiByMQ= 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:in-reply-to :references; bh=2bLzAXNSy9gUz+J1BZ+w2qFsNxuFRyLuhRtc0yR+6u4=; b=kZ4mirhPb3b2NG0Gik7liG+Lcv/JtUZDpgfJd1WuYY2VIHkHZXZPbj2eu8RG945gyC 60ZaUTIUn/D8wmypRqkFp0wfcjw1IQf6iVYFPJgHLBPrQduUaONljEyi7pRZ2gH+6Oeu HJHuh4cBU/NfzmH8Btx5BUe34L0edYWf8SHCXzyrIUIb7vi/Znnyz/XVnT15y9Wvzp3N kQdg4jM8WLLwAEvnF2sR61cO6EZCFKFItrjZjGc7/qMkydf618+vVwq24VaeVKnSe7l7 mLWAulx8D+6v24EtrRM8TxbEcinM1RxIR8byBN2gRqiQaqbfHgBKNgBvPvjUc8KxWEa4 VTYA== X-Gm-Message-State: AG10YORlPXLznGYrU2u35llcnDfyo+3FmbtfC24qEo6SyUPE57jwbQFGfCIKiZxSWN76QyXy X-Received: by 10.112.166.2 with SMTP id zc2mr11790803lbb.34.1456221722417; Tue, 23 Feb 2016 02:02:02 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id k70sm3926525lfg.5.2016.02.23.02.02.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Feb 2016 02:02:01 -0800 (PST) From: Linus Walleij To: linux-fbdev@vger.kernel.org, Tomi Valkeinen , Jean-Christophe Plagniol-Villard , Pawel Moll , Rob Herring , Russell King Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Ray Jui , Linus Walleij , stable@vger.kernel.org Subject: [PATCH 1/7 RESEND] video: ARM CLCD: runtime check for Versatile Date: Tue, 23 Feb 2016 11:01:38 +0100 Message-Id: <1456221704-5792-2-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1456221704-5792-1-git-send-email-linus.walleij@linaro.org> References: <1456221704-5792-1-git-send-email-linus.walleij@linaro.org> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.8 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);