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: 1518491 Return-Path: X-Original-To: patchwork-linux-omap@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 4C02B3FE80 for ; Fri, 28 Sep 2012 10:35:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756923Ab2I1Kf4 (ORCPT ); Fri, 28 Sep 2012 06:35:56 -0400 Received: from na3sys009aog123.obsmtp.com ([74.125.149.149]:48220 "EHLO na3sys009aog123.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753250Ab2I1Kfz (ORCPT ); Fri, 28 Sep 2012 06:35:55 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]) (using TLSv1) by na3sys009aob123.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 jk13so3146773bkc.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=g9abHNg0ZEHg5TI3UwFk0wuF1ruWeyareF09rqla4aAxmW2AkZTp8oyI57156Ro1Vd 57aL8DiqJNJNedbNa1X0WaBZP7zgXsaJJ9vOBF7a/2m7lhOzJ/rU1iRNl+PhsserlKEa +NcIdeXnN5oQQkSYy3jwlpGHwworwidijHvxh/N1G6WBGYx+WPWGb9Kw69abGM8U/ONH eRJmtI7g5W7V6YLhjgsgeLiGUC17iYdj7biTyGsYicmLKJTHr2bSziBT6kovkc2L5tC+ GW50Xw8ZMGYJRMAqMCpOCYK45Im5wUS6NysffI6BUUuqfxdHNzlEOIrkY+upt61P03Hg J4sg== 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: ALoCoQnL3z4oCfKOsXnLvmSzZh7fFQnkeUcpaNDRWUJ9GaQcuXiGZyRqFK2t4L8j1l28hCH2+r2N Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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;