From patchwork Fri Sep 28 10:35:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1518511 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 668683FE80 for ; Fri, 28 Sep 2012 10:36:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757063Ab2I1Kf6 (ORCPT ); Fri, 28 Sep 2012 06:35:58 -0400 Received: from na3sys009aog124.obsmtp.com ([74.125.149.151]:50798 "EHLO na3sys009aog124.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754505Ab2I1Kf5 (ORCPT ); Fri, 28 Sep 2012 06:35:57 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]) (using TLSv1) by na3sys009aob124.postini.com ([74.125.148.12]) with SMTP ID DSNKUGV9jMnzhlBHIcOlisagzQt64MQ1OG8C@postini.com; Fri, 28 Sep 2012 03:35:56 PDT Received: by bkcjk13 with SMTP id jk13so3146803bkc.19 for ; Fri, 28 Sep 2012 03:35:54 -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=hnom/mg29Hpc+jcKKSqNTrAlvAeIAVhIIpMvq1Srk5I=; b=Gvm2LfWe2qyTj0kTL7hVLbL9MkS7rpxRjEUG2yu43yhB7TlHjLikEwwYpzPiFE1583 kVkyFYo0MFK2PQITLvrlC/ppd335gmXMta9Il1hEbBO8D9sPphZEfmOn87qH43JlXaB8 C5KNXwKnPFduOnWcj3P5fLuaDDgTkUClbUV5pKhQD1dHvKs+oVtADQMfjdlFF7DMEkoI F4nqvjArsEZxbPdYZMHkAIuL5n3wkPS0D2H4EIyP/M7cCNq8z5gTYcZH2EL5EoBW+swS 1KHXs/6uQ/GPvWhrhrqr3J9oe2mU1USA5mohXwUpU8W90Z9NtpxCF9bPua09W+ze1GbR LO6A== Received: by 10.112.87.161 with SMTP id az1mr2479330lbb.99.1348828554786; Fri, 28 Sep 2012 03:35:54 -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.53 (version=SSLv3 cipher=OTHER); Fri, 28 Sep 2012 03:35:53 -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 4/6] OMAPDSS: DSS: use omapdss_version Date: Fri, 28 Sep 2012 13:35:25 +0300 Message-Id: <1348828527-13309-5-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: ALoCoQlS5XYZcE2vfAlVT/dTAhg+xMMoHUMRjmoqj1ZaALyL1vPp1qk0Iuz/+V8MmJ4BzjiTRgNE Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Use omapdss_version in dss.c to select the proper dss features. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dss.c | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c index 2ab1c3e..2e74eef 100644 --- a/drivers/video/omap2/dss/dss.c +++ b/drivers/video/omap2/dss/dss.c @@ -792,29 +792,46 @@ static const struct dss_features omap54xx_dss_feats __initconst = { .dpi_select_source = &dss_dpi_select_source_omap5, }; -static int __init dss_init_features(struct device *dev) +static int __init dss_init_features(struct platform_device *pdev) { + struct omap_dss_board_info *pdata = pdev->dev.platform_data; const struct dss_features *src; struct dss_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 local DSS Features\n"); + dev_err(&pdev->dev, "Failed to allocate local DSS Features\n"); return -ENOMEM; } - if (cpu_is_omap24xx()) + switch (pdata->version) { + case OMAPDSS_VER_OMAP24xx: src = &omap24xx_dss_feats; - else if (cpu_is_omap34xx()) + break; + + case OMAPDSS_VER_OMAP34xx_ES1: + case OMAPDSS_VER_OMAP34xx_ES3: + case OMAPDSS_VER_AM35xx: src = &omap34xx_dss_feats; - else if (cpu_is_omap3630()) + break; + + case OMAPDSS_VER_OMAP3630: src = &omap3630_dss_feats; - else if (cpu_is_omap44xx()) + break; + + case OMAPDSS_VER_OMAP4430_ES1: + case OMAPDSS_VER_OMAP4430_ES2: + case OMAPDSS_VER_OMAP4: src = &omap44xx_dss_feats; - else if (soc_is_omap54xx()) + break; + + case OMAPDSS_VER_OMAP5: src = &omap54xx_dss_feats; - else + break; + + default: return -ENODEV; + } memcpy(dst, src, sizeof(*dst)); dss.feat = dst; @@ -831,7 +848,7 @@ static int __init omap_dsshw_probe(struct platform_device *pdev) dss.pdev = pdev; - r = dss_init_features(&dss.pdev->dev); + r = dss_init_features(dss.pdev); if (r) return r;