From patchwork Mon Dec 16 14:56:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 3354421 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8548F9F386 for ; Mon, 16 Dec 2013 14:58:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C8DD320218 for ; Mon, 16 Dec 2013 14:58:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 15AA120213 for ; Mon, 16 Dec 2013 14:58:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754384Ab3LPO6L (ORCPT ); Mon, 16 Dec 2013 09:58:11 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:33044 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754248Ab3LPO6J (ORCPT ); Mon, 16 Dec 2013 09:58:09 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id rBGEw9E7002682; Mon, 16 Dec 2013 08:58:09 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id rBGEw9hG003597; Mon, 16 Dec 2013 08:58:09 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Mon, 16 Dec 2013 08:58:08 -0600 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id rBGEvr19024216; Mon, 16 Dec 2013 08:58:07 -0600 From: Tomi Valkeinen To: , , CC: Tomi Valkeinen Subject: [PATCHv2 07/27] OMAPFB: search for default display with DT alias Date: Mon, 16 Dec 2013 16:56:14 +0200 Message-ID: <1387205794-32246-8-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1387205794-32246-1-git-send-email-tomi.valkeinen@ti.com> References: <1387205794-32246-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=-7.4 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; }