From patchwork Fri Sep 28 10:35:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1518481 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 5FE453FE80 for ; Fri, 28 Sep 2012 10:35:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756909Ab2I1Kf4 (ORCPT ); Fri, 28 Sep 2012 06:35:56 -0400 Received: from na3sys009aog125.obsmtp.com ([74.125.149.153]:44990 "EHLO na3sys009aog125.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756255Ab2I1Kfz (ORCPT ); Fri, 28 Sep 2012 06:35:55 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]) (using TLSv1) by na3sys009aob125.postini.com ([74.125.148.12]) with SMTP ID DSNKUGV9ikggJVD3tM5WLtvORROSLjPdok3E@postini.com; Fri, 28 Sep 2012 03:35:55 PDT Received: by bkcjk13 with SMTP id jk13so3146775bkc.19 for ; Fri, 28 Sep 2012 03:35:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=3li7TpeqxgWnatU+rIPDWfR0QNxcTaNfoMuumFJ39k0=; b=df7pLwReJA+V0ZFFnBCNSCwAAlZnXBNJkzIXwxRT1VnFJ1+/kpnKjGWg7bUvM2eOfR S8O6hWWy3Afkxgv3aJxFvRJhwpUZ6ljDTwanO7kruVQ9KpIaJKaAnM/xtWrF95OQz2bv KdZKrjZ0UpGDeDISi/M5ROTRyqgJN+yLlDV+8r27kygXIowxfUr0Baw1aip7aVAj6lpT E9rzU1tiYExRYzd8ny6xDQeUKveIN/mx/F6MXMfgBlTMlm1k/WVpQf4DXYrUXs7v+bTd /s70x2Sy3T7T/HE/WmaKs9P7zJYaIeqyC7B5JPkwwhyMO+/LNdtRHpnVEs4cGc83mi2B 4p3Q== Received: by 10.112.8.228 with SMTP id u4mr2618612lba.38.1348828552992; Fri, 28 Sep 2012 03:35:52 -0700 (PDT) Received: from localhost.localdomain (a91-156-160-115.elisa-laajakaista.fi. [91.156.160.115]) by mx.google.com with ESMTPS id pi16sm2394521lab.7.2012.09.28.03.35.50 (version=SSLv3 cipher=OTHER); Fri, 28 Sep 2012 03:35:51 -0700 (PDT) From: Tomi Valkeinen To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: Archit Taneja , Chandrabhanu Mahapatra , =?UTF-8?q?Rapha=C3=ABl=20Ass=C3=A9nat?= , Tony Lindgren , Tomi Valkeinen Subject: [PATCH 3/6] OMAPDSS: DISPC: use omapdss_version Date: Fri, 28 Sep 2012 13:35:24 +0300 Message-Id: <1348828527-13309-4-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1348828527-13309-1-git-send-email-tomi.valkeinen@ti.com> References: <1348828527-13309-1-git-send-email-tomi.valkeinen@ti.com> X-Gm-Message-State: ALoCoQl+/YbLI/b3njTUKMBGylDKJZHY7ex4bbPYC0xbcBmYZ5ISNJIjE1vLGf1rKedNUR//m40e Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Use omapdss_version in dispc.c to select the proper dispc features. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dispc.c | 41 ++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index a173a94..a5ab354 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c @@ -4040,29 +4040,44 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = { .gfx_fifo_workaround = true, }; -static int __init dispc_init_features(struct device *dev) +static int __init dispc_init_features(struct platform_device *pdev) { + struct omap_dss_board_info *pdata = pdev->dev.platform_data; const struct dispc_features *src; struct dispc_features *dst; - dst = devm_kzalloc(dev, sizeof(*dst), GFP_KERNEL); + dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL); if (!dst) { - dev_err(dev, "Failed to allocate DISPC Features\n"); + dev_err(&pdev->dev, "Failed to allocate DISPC Features\n"); return -ENOMEM; } - if (cpu_is_omap24xx()) { + switch (pdata->version) { + case OMAPDSS_VER_OMAP24xx: src = &omap24xx_dispc_feats; - } else if (cpu_is_omap34xx()) { - if (omap_rev() < OMAP3430_REV_ES3_0) - src = &omap34xx_rev1_0_dispc_feats; - else - src = &omap34xx_rev3_0_dispc_feats; - } else if (cpu_is_omap44xx()) { + break; + + case OMAPDSS_VER_OMAP34xx_ES1: + src = &omap34xx_rev1_0_dispc_feats; + break; + + case OMAPDSS_VER_OMAP34xx_ES3: + case OMAPDSS_VER_OMAP3630: + case OMAPDSS_VER_AM35xx: + src = &omap34xx_rev3_0_dispc_feats; + break; + + case OMAPDSS_VER_OMAP4430_ES1: + case OMAPDSS_VER_OMAP4430_ES2: + case OMAPDSS_VER_OMAP4: src = &omap44xx_dispc_feats; - } else if (soc_is_omap54xx()) { + break; + + case OMAPDSS_VER_OMAP5: src = &omap44xx_dispc_feats; - } else { + break; + + default: return -ENODEV; } @@ -4082,7 +4097,7 @@ static int __init omap_dispchw_probe(struct platform_device *pdev) dispc.pdev = pdev; - r = dispc_init_features(&dispc.pdev->dev); + r = dispc_init_features(dispc.pdev); if (r) return r;