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: 1518501 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 3F02D3FE80 for ; Fri, 28 Sep 2012 10:35:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756255Ab2I1Kf6 (ORCPT ); Fri, 28 Sep 2012 06:35:58 -0400 Received: from na3sys009aog125.obsmtp.com ([74.125.149.153]:40373 "EHLO na3sys009aog125.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754680Ab2I1Kf5 (ORCPT ); Fri, 28 Sep 2012 06:35:57 -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 DSNKUGV9jMnzhlBHIcOlisagzQt64MQ1OG8C@postini.com; Fri, 28 Sep 2012 03:35:56 PDT Received: by bkcjk13 with SMTP id jk13so3146802bkc.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=eGyuU3uiERQpUpzQrHS+kMUc8Aiy8xyAdILmwG0pM3T/cxOgKkQUsX43cATUGLxE8x jJ/M9fuquoaBb3Kb6Sp/S8JLP6r3iM92IEmOYxcWrWlb19SlAu1ofG5aTqqcjP5Ju+rf 0XmwTpNIQZD9xsHmOuOQLu2xKoUWkkks/cJsht3y2L/7E9OUdXNfY8eeWiyWltbv6Lsu Pzn5qzc97N5Pqe3n0rMQ0nOe8N+peO24FtICJrgSp7VzcnTcu2zdInyJTNi5ryPmyE30 hk+NNM3vaqrHcHeCZupgxZ/C2Tb/rZOTfamkNNOERBRV+kal2eZFV5HD8xux7EsKTwWW 0zNQ== 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: ALoCoQl5gu2YsGLuKGrT9BQ8fRKKAYD7K+SjICrNVEhuputAuHk3mEigvGZNweoHEdUcLYR4WQYq Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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;