From patchwork Wed Dec 4 12:28:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 3282471 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 58686C0D4A for ; Wed, 4 Dec 2013 12:32:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 372E520240 for ; Wed, 4 Dec 2013 12:31:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7C15F201FB for ; Wed, 4 Dec 2013 12:31:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932224Ab3LDMbK (ORCPT ); Wed, 4 Dec 2013 07:31:10 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:52204 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932220Ab3LDMaK (ORCPT ); Wed, 4 Dec 2013 07:30:10 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id rB4CU9fr016861; Wed, 4 Dec 2013 06:30:09 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id rB4CU9DS021889; Wed, 4 Dec 2013 06:30:09 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Wed, 4 Dec 2013 06:30:08 -0600 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id rB4CTkku015425; Wed, 4 Dec 2013 06:30:07 -0600 From: Tomi Valkeinen To: , , CC: Archit Taneja , Darren Etheridge , Tony Lindgren , Tomi Valkeinen Subject: [PATCH 09/26] OMAPFB: search for default display with DT alias Date: Wed, 4 Dec 2013 14:28:36 +0200 Message-ID: <1386160133-24026-10-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1386160133-24026-1-git-send-email-tomi.valkeinen@ti.com> References: <1386160133-24026-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Improve the search for the default display in two ways: * compare the given display name to the display's alias * if no display name is given, look for "display0" DT alias Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/omapfb/omapfb-main.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index 8bfe973e55ec..961c5c251f63 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c @@ -2413,7 +2413,10 @@ omapfb_find_default_display(struct omapfb2_device *fbdev) const char *def_name; int i; - /* search with the display name from the user or the board file */ + /* + * Search with the display name from the user or the board file, + * comparing to display names and aliases + */ def_name = omapdss_get_default_display_name(); @@ -2425,12 +2428,30 @@ omapfb_find_default_display(struct omapfb2_device *fbdev) if (dssdev->name && strcmp(def_name, dssdev->name) == 0) return dssdev; + + if (strcmp(def_name, dssdev->alias) == 0) + return dssdev; } /* def_name given but not found */ return NULL; } + /* then look for DT alias display0 */ + for (i = 0; i < fbdev->num_displays; ++i) { + struct omap_dss_device *dssdev; + int id; + + dssdev = fbdev->displays[i].dssdev; + + if (dssdev->dev->of_node == NULL) + continue; + + id = of_alias_get_id(dssdev->dev->of_node, "display"); + if (id == 0) + return dssdev; + } + /* return the first display we have in the list */ return fbdev->displays[0].dssdev; }