From patchwork Fri Sep 28 10:35:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1518461 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 A081C3FE80 for ; Fri, 28 Sep 2012 10:35:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756334Ab2I1Kfz (ORCPT ); Fri, 28 Sep 2012 06:35:55 -0400 Received: from na3sys009aog110.obsmtp.com ([74.125.149.203]:57204 "EHLO na3sys009aog110.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753736Ab2I1Kfx (ORCPT ); Fri, 28 Sep 2012 06:35:53 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]) (using TLSv1) by na3sys009aob110.postini.com ([74.125.148.12]) with SMTP ID DSNKUGV9h0Vf80DuP6WPgrdnFeON96a0nTH6@postini.com; Fri, 28 Sep 2012 03:35:53 PDT Received: by bkcjk13 with SMTP id jk13so3146712bkc.19 for ; Fri, 28 Sep 2012 03:35:50 -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=Af5Oz/klFyEdIDptuNX4C1Cr18x6dm8FYDsBkdNEDOE=; b=lXrwmBxFKG4LAiRvDiKy6yz4KCwqBVzxf+bSdHfWlWKZepxfnEDfOPckyXdUm/rmca 8HpEwLLSzGYB0xSMLLKv4H0K3g7/lWRlK36/NYWCnuSph7Qfq4Y25KDPt1jv6fRVErW3 KUmYIjFJWUbFvXIgfvAt27TspRkc/OEaMS0JhT5oRJ9kLQwbswFzNDkyUeAsQ8FF3OuG 4brjs+PqV+dhelxlRNCxasiA295CJXdddp3L410ceDqZMunibR9+o+s0fZNJHIg4RN1g SEuomV4vaIvBjeofHSSTnAv/nQ+2wGH5mfCrw1/ZT7DLX5SY6eL1/IBulnHVWLprH/2I 6rug== Received: by 10.112.98.70 with SMTP id eg6mr2447925lbb.121.1348828550443; Fri, 28 Sep 2012 03:35:50 -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.49 (version=SSLv3 cipher=OTHER); Fri, 28 Sep 2012 03:35:49 -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 2/6] OMAPDSS: use omapdss_version in dss_features.c Date: Fri, 28 Sep 2012 13:35:23 +0300 Message-Id: <1348828527-13309-3-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: ALoCoQlCGyAGluamF6OpUpQ63RkfTvpgdYG1nNFNWIMhpP/IzaMOWnFuli+Bl4/7vnssRMuZDEs8 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Pass the omapdss_version to dss_features.c and use it to select the proper dss features. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/core.c | 2 +- drivers/video/omap2/dss/dss_features.c | 49 +++++++++++++++++++++----------- drivers/video/omap2/dss/dss_features.h | 2 +- 3 files changed, 34 insertions(+), 19 deletions(-) diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index b2af72d..d94ef9e 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -237,7 +237,7 @@ static int __init omap_dss_probe(struct platform_device *pdev) core.pdev = pdev; - dss_features_init(); + dss_features_init(pdata->version); dss_apply_init(); diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c index acbc1e1..5936ba7 100644 --- a/drivers/video/omap2/dss/dss_features.c +++ b/drivers/video/omap2/dss/dss_features.c @@ -929,29 +929,44 @@ bool dss_feat_rotation_type_supported(enum omap_dss_rotation_type rot_type) return omap_current_dss_features->supported_rotation_types & rot_type; } -void dss_features_init(void) +void dss_features_init(enum omapdss_version version) { - if (cpu_is_omap24xx()) + switch (version) { + case OMAPDSS_VER_OMAP24xx: omap_current_dss_features = &omap2_dss_features; - else if (cpu_is_omap3630()) + break; + + case OMAPDSS_VER_OMAP34xx_ES1: + case OMAPDSS_VER_OMAP34xx_ES3: + omap_current_dss_features = &omap3430_dss_features; + break; + + case OMAPDSS_VER_OMAP3630: omap_current_dss_features = &omap3630_dss_features; - else if (cpu_is_omap34xx()) { - if (soc_is_am35xx()) { - omap_current_dss_features = &am35xx_dss_features; - } else { - omap_current_dss_features = &omap3430_dss_features; - } - } - else if (omap_rev() == OMAP4430_REV_ES1_0) + break; + + case OMAPDSS_VER_OMAP4430_ES1: omap_current_dss_features = &omap4430_es1_0_dss_features; - else if (omap_rev() == OMAP4430_REV_ES2_0 || - omap_rev() == OMAP4430_REV_ES2_1 || - omap_rev() == OMAP4430_REV_ES2_2) + break; + + case OMAPDSS_VER_OMAP4430_ES2: omap_current_dss_features = &omap4430_es2_0_1_2_dss_features; - else if (cpu_is_omap44xx()) + break; + + case OMAPDSS_VER_OMAP4: omap_current_dss_features = &omap4_dss_features; - else if (soc_is_omap54xx()) + break; + + case OMAPDSS_VER_OMAP5: omap_current_dss_features = &omap5_dss_features; - else + break; + + case OMAPDSS_VER_AM35xx: + omap_current_dss_features = &am35xx_dss_features; + break; + + default: DSSWARN("Unsupported OMAP version"); + break; + } } diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h index 9218113..14a412e 100644 --- a/drivers/video/omap2/dss/dss_features.h +++ b/drivers/video/omap2/dss/dss_features.h @@ -123,7 +123,7 @@ bool dss_feat_rotation_type_supported(enum omap_dss_rotation_type rot_type); bool dss_has_feature(enum dss_feat_id id); void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end); -void dss_features_init(void); +void dss_features_init(enum omapdss_version version); #if defined(CONFIG_OMAP4_DSS_HDMI) void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data); #endif